Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/quick-shoes-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
51 changes: 9 additions & 42 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,22 @@
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${relativeFile}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"type": "node",
"request": "launch",
"name": "Jest Current File (Fuzzy)",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["${fileBaseName}"],
"name": "Vitest All",
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "--project=jsdom", "--project=node"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand", "--watchAll=false"],
"name": "Vitest Current File",
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
"internalConsoleOptions": "neverOpen"
}
]
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@
"source.fixAll.eslint": "explicit"
},
"storyExplorer.storiesGlobs": "packages/styleguide/stories/**/*.stories.mdx",
"jest.jestCommandLine": "node_modules/.bin/jest",
"nxConsole.generateAiAgentRules": true
}
7 changes: 0 additions & 7 deletions babel.config.js

This file was deleted.

40 changes: 0 additions & 40 deletions babel.defaults.js

This file was deleted.

45 changes: 0 additions & 45 deletions jest.config.base.ts

This file was deleted.

5 changes: 0 additions & 5 deletions jest.config.ts

This file was deleted.

3 changes: 0 additions & 3 deletions jest.preset.js

This file was deleted.

14 changes: 1 addition & 13 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"libsDir": "packages"
},
"namedInputs": {
"babelConfig": ["{workspaceRoot}/babel.defaults.js"],
"default": ["{projectRoot}/**/*"],
"production": [
"default",
Expand All @@ -21,7 +20,7 @@
"build": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production", "babelConfig", { "env": "CI" }]
"inputs": ["production", "^production", { "env": "CI" }]
},
"lint": {
"cache": true,
Expand Down Expand Up @@ -49,17 +48,6 @@
"verify": {
"cache": true,
"dependsOn": ["^build"]
},
"@nx/jest:jest": {
"cache": true,
"dependsOn": ["^build"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.config.base.ts",
"{workspaceRoot}/jest.preset.js",
"babelConfig"
]
}
},
"generators": {
Expand Down
15 changes: 2 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@
"devDependencies": {
"@arethetypeswrong/cli": "0.18.5",
"@babel/core": "7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/plugin-syntax-jsx": "^7.27.1",
"@changesets/changelog-github": "1.0.1",
"@changesets/cli": "3.0.3",
"@codecademy/eslint-config": "8.2.0",
"@codecademy/prettier-config": "^0.2.0",
"@codecademy/tsconfig": "^0.3.0",
"@commander-js/extra-typings": "^14.0.0",
"@emotion/babel-plugin": "11.13.5",
"@emotion/jest": "^11.11.0",
"@nx/jest": "22.6.0",
"@nx/js": "22.6.0",
"@nx/react": "22.6.0",
"@nx/storybook": "22.6.0",
Expand All @@ -51,7 +47,6 @@
"@testing-library/user-event": "^14.5.2",
"@types/classnames": "2.2.10",
"@types/invariant": "2.2.29",
"@types/jest": "^30.0.0",
"@types/konami-code-js": "^0.8.0",
"@types/lodash": "4.17.23",
"@types/react": "^18.2.0",
Expand All @@ -62,7 +57,6 @@
"@vitejs/plugin-react-swc": "4.3.0",
"@vitest/browser": "^3.2.4",
"@vitest/coverage-v8": "3.2.7",
"babel-jest": "30.4.1",
"commander": "^14.0.3",
"component-test-setup": "^0.3.1",
"cpy-cli": "^4.1.0",
Expand All @@ -71,10 +65,7 @@
"eslint-plugin-lodash": "^7.4.0",
"gh-pages": "^5.0.0",
"husky": "^9.1.7",
"identity-obj-proxy": "3.0.0",
"jest": "30.4.2",
"jest-environment-jsdom": "30.4.1",
"jest-junit": "^16.0.0",
"jsdom": "^26.1.0",
"lint-staged": "^16.4.0",
"nx": "22.6.0",
"nx-cloud": "19.1.0",
Expand All @@ -87,8 +78,6 @@
"storybook-addon-deep-controls": "^0.10.0",
"svgo": "^1.3.2",
"syncpack": "^10.9.3",
"ts-jest": "^29.4.12",
"ts-node": "10.9.1",
"tsdown": "0.23.0",
"tslib": "2.4.0",
"typescript": "5.9.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ Gamut ships modern JavaScript from `node_modules`, and Jest skips transpiling `n
transformIgnorePatterns: ['node_modules/(?!(@vidstack/react|@formatjs)/)'],
```

Add more scopes inside the non-capturing group if your dependency tree pulls in other untranspiled ESM packages. If tests only start failing after upgrading Gamut or a transitive dependency, compare your Jest/Babel config against Gamut's own and adjust `transformIgnorePatterns` and Babel plugins to match.
Add more scopes inside the non-capturing group if your dependency tree pulls in other untranspiled ESM packages. If tests only start failing after upgrading Gamut or a transitive dependency, check `transformIgnorePatterns` and your Babel plugins first.
3 changes: 0 additions & 3 deletions packages/gamut-icons/babel.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/gamut-illustrations/babel.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/gamut-patterns/babel.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/gamut-styles/babel.config.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/gamut-tests/babel.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/gamut-tests/jest.config.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/gamut-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
"outDir": "./dist",
"rootDir": "./src",
"types": []
},
"exclude": ["jest.config.ts"]
}
}
13 changes: 0 additions & 13 deletions packages/gamut/babel.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/styleguide/src/lib/Meta/Installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ this correctly on their own. You only need to think about it explicitly in a few

Gamut depends on packages that ship modern JavaScript from `node_modules`. Jest often skips transpiling `node_modules`, so importing Gamut in tests can surface parse or syntax errors unless your repo opts those dependencies into your test transform.

If tests only fail after upgrading Gamut or a transitive dependency, compare your Jest and Babel setup with Gamut's and adjust `transformIgnorePatterns` and plugins accordingly.
If tests only fail after upgrading Gamut or a transitive dependency, check `transformIgnorePatterns` and your Babel plugins first.

Jest's default module resolution is CommonJS-based, so a plain `require('@skillsoft/gamut')` inside a test resolves through the `require` condition above and gets the already-built CJS `dist/index.js` — no transform needed for Gamut itself. This only changes if your Jest config is set up for native ESM (`extensionsToTreatAsEsm`, `--experimental-vm-modules`); in that mode Jest resolves the `import` condition instead and gets `dist/index.mjs`.

### `transformIgnorePatterns`

Allow your test transformer (for example `babel-jest`) to run on specific packages. Gamut's own Jest setup uses a negative lookahead so `@vidstack/react`, `react-player`, and `@formatjs` are not ignored:
Allow your test transformer (for example `babel-jest`) to run on specific packages. Use a negative lookahead so packages like `@vidstack/react` and `@formatjs` are not ignored:

```js
// jest.config.js (or equivalent)
Expand Down
1 change: 0 additions & 1 deletion packages/styleguide/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
Expand Down
13 changes: 0 additions & 13 deletions packages/variance/babel.config.js

This file was deleted.

Loading
Loading