Skip to content

Commit

Permalink
Fix CommonJS build and add Jest setup to test app (#6410)
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett authored May 20, 2024
1 parent b2f561a commit 8ad383b
Show file tree
Hide file tree
Showing 23 changed files with 570 additions and 523 deletions.
2 changes: 1 addition & 1 deletion examples/rac-spectrum-tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@adobe/react-spectrum": "^3.28.0",
"@spectrum-icons/illustrations": "^3.6.3",
"@spectrum-icons/workflow": "^4.2.2",
"parcel": "2.0.0-canary.1563",
"parcel": "2.0.0-dev.1599",
"postcss": "^8.2.1",
"react": "^18.2.0",
"react-aria-components": "^1.0.0-alpha.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/rac-tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@heroicons/react": "^2.0.16",
"@react-aria/parcel-resolver-optimize-locales": "^1.0.0",
"framer-motion": "^10.12.16",
"parcel": "2.0.0-canary.1563",
"parcel": "2.0.0-dev.1599",
"postcss": "^8.4.21",
"react": "^18.2.0",
"react-aria-components": "^1.0.0-alpha.4",
Expand Down
26 changes: 26 additions & 0 deletions examples/rsp-next-ts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
transform: {
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
jsc: {
parser: {
syntax: 'typescript',
tsx: true
},

transform: {
react: {
runtime: 'automatic'
}
}
}
}
]
},
moduleNameMapper: {
'\\.(css|styl)$': 'identity-obj-proxy'
},
};
13 changes: 11 additions & 2 deletions examples/rsp-next-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build": "next build",
"export": "next export",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"test": "jest"
},
"type": "module",
"dependencies": {
"@adobe/react-spectrum": "^3.26.0",
"@react-aria/optimize-locales-plugin": "^1.0.0",
Expand All @@ -25,10 +25,19 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@swc/jest": "^0.2.36",
"@testing-library/react": "^15.0.7",
"@types/node": "^18.8.2",
"@types/react": "^18.0.21",
"eslint": "^8.24.0",
"eslint-config-next": "^13.4.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"typescript": "^5.1.3"
},
"resolutions": {
"string-width": "4.2.3",
"strip-ansi": "6.0.1",
"wrap-ansi": "7.0.0"
}
}
1 change: 1 addition & 0 deletions examples/rsp-next-ts/setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom';
9 changes: 9 additions & 0 deletions examples/rsp-next-ts/test/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Home from '../pages/index';
import {Provider, defaultTheme} from '@adobe/react-spectrum';
import {render} from '@testing-library/react';

describe('smoke test', () => {
it('should render', () => {
render(<Provider theme={defaultTheme}><Home /></Provider>);
});
});
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@
"@babel/preset-typescript": "^7.24.1",
"@babel/register": "^7.23.7",
"@octokit/rest": "*",
"@parcel/bundler-library": "2.11.1-canary.3188",
"@parcel/optimizer-data-url": "2.0.0-canary.1565",
"@parcel/optimizer-terser": "2.0.0-canary.1565",
"@parcel/packager-ts": "2.0.0-canary.1565",
"@parcel/reporter-cli": "2.0.0-canary.1565",
"@parcel/resolver-glob": "2.12.1-canary.3188",
"@parcel/transformer-inline": "2.0.0-canary.1565",
"@parcel/transformer-inline-string": "2.0.0-canary.1565",
"@parcel/transformer-svg-react": "2.12.1-canary.3188",
"@parcel/transformer-typescript-types": "2.0.0-canary.1565",
"@parcel/bundler-library": "2.11.1-dev.3224",
"@parcel/optimizer-data-url": "2.0.0-dev.1601",
"@parcel/optimizer-terser": "2.0.0-dev.1601",
"@parcel/packager-ts": "2.0.0-dev.1601",
"@parcel/reporter-cli": "2.0.0-dev.1601",
"@parcel/resolver-glob": "2.12.1-dev.3224",
"@parcel/transformer-inline": "2.0.0-dev.1601",
"@parcel/transformer-inline-string": "2.0.0-dev.1601",
"@parcel/transformer-svg-react": "2.12.1-dev.3224",
"@parcel/transformer-typescript-types": "2.0.0-dev.1601",
"@spectrum-css/component-builder": "^1.0.0",
"@spectrum-css/vars": "^2.3.0",
"@storybook/addon-a11y": "^7.6.19",
Expand Down Expand Up @@ -155,7 +155,7 @@
"npm-cli-login": "^1.0.0",
"nyc": "^10.2.0",
"p-queue": "^6.2.1",
"parcel": "2.0.0-canary.1563",
"parcel": "2.0.0-dev.1599",
"parcel-resolver-storybook": "https://gitpkg.now.sh/mischnic/storybook-parcel/packages/parcel-resolver-storybook?master",
"patch-package": "^6.2.0",
"plop": "^2.4.0",
Expand Down Expand Up @@ -206,21 +206,21 @@
"caniuse-lite": "1.0.30001563",
"@storybook/core-common": "7.6.19",
"storybook-builder-parcel/@storybook/core-common": "7.6.19",
"@parcel/cache": "2.0.0-canary.1565",
"@parcel/codeframe": "2.0.0-canary.1565",
"@parcel/diagnostic": "2.0.0-canary.1565",
"@parcel/events": "2.0.0-canary.1565",
"@parcel/fs": "2.0.0-canary.1565",
"@parcel/logger": "2.0.0-canary.1565",
"@parcel/markdown-ansi": "2.0.0-canary.1565",
"@parcel/node-resolver-core": "3.3.1-canary.3188",
"@parcel/package-manager": "2.0.0-canary.1565",
"@parcel/plugin": "2.0.0-canary.1565",
"@parcel/profiler": "2.12.1-canary.3188",
"@parcel/rust": "2.12.1-canary.3188",
"@parcel/types": "2.0.0-canary.1565",
"@parcel/utils": "2.0.0-canary.1565",
"@parcel/workers": "2.0.0-canary.1565"
"@parcel/cache": "2.0.0-dev.1601",
"@parcel/codeframe": "2.0.0-dev.1601",
"@parcel/diagnostic": "2.0.0-dev.1601",
"@parcel/events": "2.0.0-dev.1601",
"@parcel/fs": "2.0.0-dev.1601",
"@parcel/logger": "2.0.0-dev.1601",
"@parcel/markdown-ansi": "2.0.0-dev.1601",
"@parcel/node-resolver-core": "3.3.1-dev.3224",
"@parcel/package-manager": "2.0.0-dev.1601",
"@parcel/plugin": "2.0.0-dev.1601",
"@parcel/profiler": "2.12.1-dev.3224",
"@parcel/rust": "2.12.1-dev.3224",
"@parcel/types": "2.0.0-dev.1601",
"@parcel/utils": "2.0.0-dev.1601",
"@parcel/workers": "2.0.0-dev.1601"
},
"@parcel/transformer-css": {
"cssModules": {
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/parcel-namer-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"private": true,
"main": "DocsNamer.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565"
"@parcel/plugin": "2.0.0-dev.1601"
}
}
4 changes: 2 additions & 2 deletions packages/dev/parcel-namer-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"private": true,
"main": "IntlNamer.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565"
"@parcel/plugin": "2.0.0-dev.1601"
}
}
4 changes: 2 additions & 2 deletions packages/dev/parcel-packager-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"private": true,
"main": "DocsPackager.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565"
"@parcel/plugin": "2.0.0-dev.1601"
}
}
6 changes: 3 additions & 3 deletions packages/dev/parcel-packager-ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"main": "SSGPackager.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565",
"@parcel/utils": "2.0.0-canary.1565",
"@parcel/plugin": "2.0.0-dev.1601",
"@parcel/utils": "2.0.0-dev.1601",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/dev/parcel-resolver-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"main": "BuildResolver.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565",
"@parcel/node-resolver-core": "3.3.1-canary.3188"
"@parcel/plugin": "2.0.0-dev.1601",
"@parcel/node-resolver-core": "3.3.1-dev.3224"
}
}
6 changes: 3 additions & 3 deletions packages/dev/parcel-resolver-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"main": "DocsResolver.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565",
"@parcel/node-resolver-core": "3.3.1-canary.3188"
"@parcel/plugin": "2.0.0-dev.1601",
"@parcel/node-resolver-core": "3.3.1-dev.3224"
}
}
4 changes: 2 additions & 2 deletions packages/dev/parcel-transformer-css-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"private": true,
"main": "CSSEnvTransformer.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565"
"@parcel/plugin": "2.0.0-dev.1601"
}
}
8 changes: 4 additions & 4 deletions packages/dev/parcel-transformer-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"private": true,
"main": "DocsTransformer.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@babel/parser": "^7.24.0",
"@babel/traverse": "^7.24.0",
"@babel/types": "^7.24.0",
"@parcel/plugin": "2.0.0-canary.1565",
"@parcel/plugin": "2.0.0-dev.1601",
"doctrine": "^3.0.0"
},
"devDependencies": {
"@parcel/fs": "2.0.0-canary.1565",
"@parcel/core": "2.0.0-canary.1563"
"@parcel/fs": "2.0.0-dev.1601",
"@parcel/core": "2.0.0-dev.1599"
}
}
4 changes: 2 additions & 2 deletions packages/dev/parcel-transformer-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"main": "IntlTransformer.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565",
"@parcel/plugin": "2.0.0-dev.1601",
"@internationalized/string-compiler": "^3.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/dev/parcel-transformer-mdx-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"private": true,
"main": "MDXTransformer.js",
"engines": {
"parcel": "2.0.0-canary.1563"
"parcel": "2.0.0-dev.1599"
},
"dependencies": {
"@mdx-js/mdx": "next",
"@mdx-js/react": "next",
"@parcel/plugin": "2.0.0-canary.1565",
"@parcel/plugin": "2.0.0-dev.1601",
"dprint-node": "^1.0.7",
"js-yaml": "^3.13.1",
"mdast-util-toc": "^6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/parcel-transformer-mdx-extract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"parcel": "^2.12.0"
},
"dependencies": {
"@parcel/plugin": "2.0.0-canary.1565"
"@parcel/plugin": "2.0.0-dev.1601"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/@parcel/transformer-css/lib/CSSTransformer.js b/node_modules/@parcel/transformer-css/lib/CSSTransformer.js
index b8dd9f2..fd3c753 100644
index b8dd9f2..0bad8ab 100644
--- a/node_modules/@parcel/transformer-css/lib/CSSTransformer.js
+++ b/node_modules/@parcel/transformer-css/lib/CSSTransformer.js
@@ -88,6 +88,9 @@ var _default = exports.default = new (_plugin().Transformer)({
Expand Down
1 change: 1 addition & 0 deletions scripts/verdaccio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ then
# install packages in NextJS test app
cd ../../examples/rsp-next-ts
yarn install
yarn test

# Build NextJS test app and move to dist folder. Store the size of the build in a text file.
VERDACCIO=true yarn build | tee next-build-stats.txt
Expand Down
Loading

1 comment on commit 8ad383b

@rspbot
Copy link

@rspbot rspbot commented on 8ad383b May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.