Skip to content

Commit

Permalink
get vitest DevX working in monorepo (#643)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Jiang <[email protected]>
  • Loading branch information
mscolnick and abvthecity authored Apr 12, 2024
1 parent f531e7d commit b02617a
Show file tree
Hide file tree
Showing 24 changed files with 356 additions and 201 deletions.
23 changes: 17 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@
{
"type": "node",
"request": "launch",
"name": "Debug current test file",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "test", "--", "--debug", "${file}"],
"port": 9229,
"cwd": "${workspaceFolder}",
"timeout": 10000,
"name": "Debug Current Test File",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"smartStep": true,
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "Debug Current Test",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}", "--testName", "${input:TestName}"],
"smartStep": true,
"console": "integratedTerminal"
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"husky": "^8.0.1",
"immer": "^9.0.15",
"is-ci": "^3.0.1",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"jsonc-parser": "~2.2.1",
"lint-staged": "^13.0.3",
"lodash-es": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/ua-parser-js": "^0.7.39",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/fdr-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/node": "^18.7.18",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"next-mdx-remote": "^4.4.1",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
Expand Down
7 changes: 7 additions & 0 deletions packages/commons/fdr-utils/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
globals: true,
},
});
2 changes: 1 addition & 1 deletion packages/commons/loadable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/node": "^18.7.18",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/react/common-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/react": "^18.0.20",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/react/fonts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/react": "^18.0.20",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/react/react-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@types/react": "^18.0.20",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commons/react/react-query-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/react": "^18.0.20",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
"stylelint": "^16.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/fdr-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@types/url-join": "4.0.1",
"eslint": "^8.56.0",
"eslint-config-custom": "*",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"prettier": "^3.2.4",
"tsconfig": "*",
"typescript": "5.4.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/yargs": "^17.0.32",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
"typescript": "5.4.3"
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,23 @@
"@types/react-test-renderer": "^18.0.7",
"@types/tinycolor2": "^1.4.6",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"chromatic": "^11.3.0",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"eslint-plugin-storybook": "^0.8.0",
"jsdom": "^24.0.0",
"next-router-mock": "^0.9.13",
"organize-imports-cli": "^0.10.0",
"postcss-import": "^16.0.1",
"prettier": "^3.2.4",
"react-test-renderer": "^18.2.0",
"sass": "^1.74.1",
"storybook": "8.1.0-alpha.6",
"stylelint": "^16.1.0",
"typescript": "5.4.3",
"vite": "^5.2.6",
"vitest": "^1.4.0"
"vitest": "^1.5.0"
},
"eslintConfig": {
"extends": [
Expand Down
11 changes: 10 additions & 1 deletion packages/ui/app/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
module.exports = require("../postcss.config.js");
module.exports = {
// This is duplicated, make sure to keep it in sync with others
plugins: {
"postcss-import": {},
"tailwindcss/nesting": {},
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {})
}
};
2 changes: 1 addition & 1 deletion packages/ui/docs-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@
"stylelint": "^16.1.0",
"tailwindcss": "^3.4.1",
"typescript": "5.4.3",
"vitest": "^1.4.0"
"vitest": "^1.5.0"
}
}
11 changes: 10 additions & 1 deletion packages/ui/docs-bundle/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
module.exports = require("../postcss.config.js");
module.exports = {
// This is duplicated, make sure to keep it in sync with others
plugins: {
"postcss-import": {},
"tailwindcss/nesting": {},
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {}),
},
};
2 changes: 1 addition & 1 deletion packages/ui/fontawesome-cdn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@types/react": "^18.0.20",
"depcheck": "^1.4.3",
"eslint": "^8.56.0",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"next": "^14.1.1",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/local-preview-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"stylelint": "^16.1.0",
"tailwindcss": "^3.4.1",
"typescript": "5.4.3",
"vitest": "^1.4.0",
"vitest": "^1.5.0",
"ws": "^8.16.0"
}
}
11 changes: 10 additions & 1 deletion packages/ui/local-preview-bundle/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
module.exports = require("../postcss.config.js");
module.exports = {
// This is duplicated, make sure to keep it in sync with others
plugins: {
"postcss-import": {},
"tailwindcss/nesting": {},
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {}),
},
};
9 changes: 0 additions & 9 deletions packages/ui/postcss.config.js

This file was deleted.

Loading

0 comments on commit b02617a

Please sign in to comment.