Skip to content

Commit

Permalink
chore: bump Nx to 19.3.2 (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored Jul 4, 2024
1 parent c205603 commit daf28f1
Show file tree
Hide file tree
Showing 14 changed files with 914 additions and 927 deletions.
19 changes: 15 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
"prefer": "type-imports"
}
],
"import/no-extraneous-dependencies": ["error", { "devDependencies": false }],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": false
}
],
"jest/no-focused-tests": "error"
},
"overrides": [
Expand Down Expand Up @@ -49,13 +54,18 @@
"rules": {
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "error"
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
"rules": {
"@typescript-eslint/no-extra-semi": "error",
"no-extra-semi": "off"
}
},
{
"files": [
Expand All @@ -64,7 +74,8 @@
"**/*.stories.tsx",
"**/*.test.ts",
"**/*.test.tsx",
"**/jest.setup.js"
"**/jest.setup.js",
"**/jest.setup.ts"
],
"rules": {
"import/no-extraneous-dependencies": "off"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ testem.log
.DS_Store
Thumbs.db

.nx/cache
.nx/cache
.nx/workspace-data
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/dist
/coverage

/.nx/cache
/.nx/cache
/.nx/workspace-data
50 changes: 0 additions & 50 deletions apps/benchmark/build.js

This file was deleted.

66 changes: 66 additions & 0 deletions apps/benchmark/build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import esbuild from 'esbuild';
import ImportGlobPlugin from 'esbuild-plugin-import-glob';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import yargs from 'yargs';

const CURRENT_DIR = path.dirname(fileURLToPath(import.meta.url));
const OUT_DIR = path.resolve(CURRENT_DIR, '../../dist/apps/benchmark/');

const argv = yargs(process.argv)
.options({
watch: { type: 'boolean', default: false },
})
.parseSync();

/** @type {esbuild.Plugin} */
const WatchRebuildPlugin = {
name: 'watch-rebuild',
setup(build) {
build.onEnd(result => {
if (result.errors.length === 0) {
console.log('Rebuild was successful, watching for changes...');
}

console.log(`Rebuild ended with ${result.errors.length} errors`);
console.log(
[result.errors, result.warnings]
.flat()
.map(e => e.text)
.join('\n'),
);
});
},
};

/** @type {esbuild.BuildOptions} */
const esbuildConfig = {
entryPoints: ['./src/index.tsx'],
outfile: path.join(OUT_DIR, 'bundle.js'),
minify: true,
bundle: true,

plugins: /** @type {esbuild.Plugin[]} */ (
[argv.watch && WatchRebuildPlugin, ImportGlobPlugin.default()].filter(Boolean)
),
};

async function copyIndexHtml() {
await fs.promises.copyFile(path.resolve(CURRENT_DIR, './index.html'), path.join(OUT_DIR, 'index.html'));
}

if (argv.watch) {
const context = await esbuild.context(esbuildConfig);

await copyIndexHtml();
await context.watch();
} else {
try {
await esbuild.build(esbuildConfig);
await copyIndexHtml();
} catch (e) {
console.error(e);
process.exit(1);
}
}
4 changes: 2 additions & 2 deletions apps/benchmark/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"executor": "nx:run-commands",
"options": {
"cwd": "apps/benchmark",
"commands": [{ "command": "node ./build.js" }]
"commands": [{ "command": "node ./build.mjs" }]
},
"outputs": ["{workspaceRoot}/dist/apps/benchmark"]
},
"watch": {
"executor": "nx:run-commands",
"options": {
"cwd": "apps/benchmark",
"commands": [{ "command": "node ./build.js --watch" }],
"commands": [{ "command": "node ./build.mjs --watch" }],
"outputPath": ["dist/apps/benchmark"]
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: bump Nx to 19.3.2",
"packageName": "@griffel/jest-serializer",
"email": "[email protected]",
"dependentChangeType": "none"
}
45 changes: 22 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@
"@docusaurus/preset-classic": "^3.4.0",
"@docusaurus/theme-mermaid": "^3.4.0",
"@emotion/css": "^11.9.0",
"@nx/eslint": "18.3.5",
"@nx/eslint-plugin": "18.3.5",
"@nx/jest": "18.3.5",
"@nx/js": "18.3.5",
"@nx/node": "18.3.5",
"@nx/react": "18.3.5",
"@nx/rollup": "18.3.5",
"@nx/storybook": "18.3.5",
"@nx/web": "18.3.5",
"@nx/webpack": "18.3.5",
"@nx/workspace": "18.3.5",
"@nx/eslint": "19.3.2",
"@nx/eslint-plugin": "19.3.2",
"@nx/jest": "19.3.2",
"@nx/js": "19.3.2",
"@nx/node": "19.3.2",
"@nx/react": "19.3.2",
"@nx/rollup": "19.3.2",
"@nx/storybook": "19.3.2",
"@nx/web": "19.3.2",
"@nx/webpack": "19.3.2",
"@nx/workspace": "19.3.2",
"@rspack/cli": "0.7.5",
"@rspack/core": "0.7.5",
"@storybook/addon-essentials": "7.6.8",
"@storybook/core-server": "7.6.8",
"@storybook/react-webpack5": "7.6.8",
"@swc/core": "1.3.102",
"@testing-library/jest-dom": "5.16.1",
"@testing-library/react": "13.4.0",
"@swc/core": "1.5.29",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "15.0.6",
"@types/babel__helper-module-imports": "7.18.0",
"@types/babel__helper-plugin-utils": "7.10.0",
"@types/chrome": "0.0.180",
Expand All @@ -66,8 +66,8 @@
"@types/mini-css-extract-plugin": "2.5.1",
"@types/node": "18.19.9",
"@types/prettier": "2.7.3",
"@types/react": "18.2.24",
"@types/react-dom": "18.2.9",
"@types/react": "18.3.1",
"@types/react-dom": "18.3.0",
"@types/styled-components": "5.1.26",
"@types/stylis": "4.2.0",
"@types/tmp": "0.2.3",
Expand All @@ -77,7 +77,6 @@
"@typescript-eslint/parser": "7.14.1",
"@uifabric/merge-styles": "7.19.1",
"babel-jest": "29.4.3",
"babel-loader": "8.1.0",
"babel-plugin-annotate-pure-calls": "0.4.0",
"babel-plugin-tester": "11.0.0",
"beachball": "2.31.5",
Expand All @@ -86,7 +85,7 @@
"css-loader": "^6.4.0",
"d3-scale-chromatic": "^3.0.0",
"doctoc": "2.2.1",
"esbuild": "0.19.11",
"esbuild": "0.21.5",
"esbuild-plugin-alias": "0.2.1",
"esbuild-plugin-import-glob": "0.1.1",
"eslint": "8.57.0",
Expand Down Expand Up @@ -117,13 +116,13 @@
"monosize-storage-upstash": "0.0.8",
"nano-staged": "0.5.0",
"next": "14.1.1",
"nx": "18.3.5",
"postcss": "^8.4.31",
"nx": "19.3.2",
"postcss": "8.4.38",
"prettier": "2.8.2",
"prism-react-renderer": "2.3.1",
"raw-loader": "4.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-fela": "12.2.0",
"react-refresh": "^0.10.0",
"react-shadow": "^20.2.0",
Expand All @@ -137,7 +136,7 @@
"ts-node": "10.9.1",
"tsconfig-paths": "4.1.1",
"typescript": "5.4.5",
"vite": "^4.5.3",
"vite": "^5.3.2",
"webpack": "5.89.0",
"webpack-merge": "5.10.0",
"yargs": "^17.5.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-serializer/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/packages/jest-serializer',
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
};
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/jest-serializer/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"declaration": true,
"types": ["node", "environment"]
},
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"],
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts", "jest.setup.ts"],
"include": ["**/*.ts"]
}
5 changes: 3 additions & 2 deletions packages/jest-serializer/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"jsx": "react",
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node", "environment", "@testing-library/jest-dom"]
"types": ["jest", "node", "environment"]
},
"include": [
"**/*.test.ts",
Expand All @@ -16,6 +16,7 @@
"**/*.test.jsx",
"**/*.spec.jsx",
"**/*.d.ts",
"jest.config.ts"
"jest.config.ts",
"jest.setup.ts"
]
}
2 changes: 2 additions & 0 deletions tools/getRollupOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ function getRollupOptions(/** @type {import('rollup').RollupOptions} */ options)
preserveModulesRoot: 'src',
// Enables sourcemaps
sourcemap: true,
// Add interop for CJS
...(output.format === 'cjs' && { interop: 'compat' }),
}));

return options;
Expand Down
Loading

0 comments on commit daf28f1

Please sign in to comment.