@nx/remix 22.1.0 → 22.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/src/generators/application/__snapshots__/application.impl.spec.ts.snap +7 -3
- package/src/generators/application/application.impl.d.ts.map +1 -1
- package/src/generators/application/application.impl.js +1 -0
- package/src/generators/application/files/common/{vite.config.ts__tmpl__ → vite.config.mts__tmpl__} +1 -1
- package/src/generators/application/lib/update-unit-test-config.d.ts.map +1 -1
- package/src/generators/application/lib/update-unit-test-config.js +3 -1
- package/src/generators/library/__snapshots__/library.impl.spec.ts.snap +1 -30
- package/src/generators/library/lib/add-unit-testing.js +1 -1
- package/src/generators/storybook-configuration/__snapshots__/storybook-configuration.impl.spec.ts.snap +2 -31
- package/src/generators/storybook-configuration/storybook-configuration.impl.d.ts.map +1 -1
- package/src/generators/storybook-configuration/storybook-configuration.impl.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/remix",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.1",
|
|
4
4
|
"description": "The Remix plugin for Nx contains executors and generators for managing Remix applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Jest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, routes, loaders, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"migrations": "./migrations.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nx/devkit": "22.1.
|
|
33
|
-
"@nx/js": "22.1.
|
|
34
|
-
"@nx/react": "22.1.
|
|
35
|
-
"@nx/workspace": "22.1.
|
|
32
|
+
"@nx/devkit": "22.1.1",
|
|
33
|
+
"@nx/js": "22.1.1",
|
|
34
|
+
"@nx/react": "22.1.1",
|
|
35
|
+
"@nx/workspace": "22.1.1",
|
|
36
36
|
"tslib": "^2.3.0",
|
|
37
37
|
"@phenomnomnominal/tsquery": "~5.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"nx": "22.1.
|
|
41
|
-
"@nx/vitest": "22.1.
|
|
40
|
+
"nx": "22.1.1",
|
|
41
|
+
"@nx/vitest": "22.1.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@remix-run/dev": "^2.14.0"
|
|
@@ -253,7 +253,7 @@ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
|
253
253
|
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
254
254
|
|
|
255
255
|
export default defineConfig(() => ({
|
|
256
|
-
root:
|
|
256
|
+
root: import.meta.dirname,
|
|
257
257
|
cacheDir: '../node_modules/.vite/test',
|
|
258
258
|
plugins: [react(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])],
|
|
259
259
|
// Uncomment this if you are using workers.
|
|
@@ -299,7 +299,9 @@ exports[`Remix Application Integrated Repo --unitTestRunner should generate the
|
|
|
299
299
|
},
|
|
300
300
|
"include": [
|
|
301
301
|
"vite.config.ts",
|
|
302
|
+
"vite.config.mts",
|
|
302
303
|
"vitest.config.ts",
|
|
304
|
+
"vitest.config.mts",
|
|
303
305
|
"app/**/*.ts",
|
|
304
306
|
"app/**/*.tsx",
|
|
305
307
|
"app/**/*.js",
|
|
@@ -457,7 +459,7 @@ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
|
457
459
|
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
458
460
|
|
|
459
461
|
export default defineConfig(() => ({
|
|
460
|
-
root:
|
|
462
|
+
root: import.meta.dirname,
|
|
461
463
|
cacheDir: './node_modules/.vite/test',
|
|
462
464
|
plugins: [react(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])],
|
|
463
465
|
// Uncomment this if you are using workers.
|
|
@@ -517,7 +519,9 @@ exports[`Remix Application Standalone Project Repo --unitTestRunner should gener
|
|
|
517
519
|
},
|
|
518
520
|
"include": [
|
|
519
521
|
"vite.config.ts",
|
|
522
|
+
"vite.config.mts",
|
|
520
523
|
"vitest.config.ts",
|
|
524
|
+
"vitest.config.mts",
|
|
521
525
|
"app/**/*.ts",
|
|
522
526
|
"app/**/*.tsx",
|
|
523
527
|
"app/**/*.js",
|
|
@@ -641,7 +645,7 @@ declare module '@remix-run/node' {
|
|
|
641
645
|
}
|
|
642
646
|
|
|
643
647
|
export default defineConfig({
|
|
644
|
-
root:
|
|
648
|
+
root: import.meta.dirname,
|
|
645
649
|
plugins: [
|
|
646
650
|
remix({
|
|
647
651
|
future: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EAMjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA6BpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAQlD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,8BAOhC;AAED,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"application.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EAMjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA6BpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAQlD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,8BAOhC;AAED,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,sBAAsB,8BA+SjC;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -119,6 +119,7 @@ async function remixApplicationGeneratorInternal(tree, _options) {
|
|
|
119
119
|
testEnvironment: 'jsdom',
|
|
120
120
|
imports: [`import react from '@vitejs/plugin-react';`],
|
|
121
121
|
plugins: [`react()`],
|
|
122
|
+
useEsmExtension: true,
|
|
122
123
|
}, true, undefined, true);
|
|
123
124
|
tasks.push(vitestTask);
|
|
124
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-unit-test-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/application/lib/update-unit-test-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;AAcpB,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,QAAQ,GAAG,MAAM,EACjC,WAAW,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"update-unit-test-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/application/lib/update-unit-test-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;AAcpB,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,QAAQ,GAAG,MAAM,EACjC,WAAW,EAAE,OAAO,0CA4ErB"}
|
|
@@ -11,7 +11,7 @@ function updateUnitTestConfig(tree, pathToRoot, unitTestRunner, rootProject) {
|
|
|
11
11
|
import '@testing-library/jest-dom/matchers';
|
|
12
12
|
installGlobals();`);
|
|
13
13
|
if (unitTestRunner === 'vitest') {
|
|
14
|
-
const pathToViteConfig = (0, devkit_1.joinPathFragments)(pathToRoot, 'vitest.config.
|
|
14
|
+
const pathToViteConfig = (0, devkit_1.joinPathFragments)(pathToRoot, 'vitest.config.mts');
|
|
15
15
|
(0, testing_config_utils_1.updateVitestTestIncludes)(tree, pathToViteConfig, './app/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}');
|
|
16
16
|
(0, testing_config_utils_1.updateVitestTestIncludes)(tree, pathToViteConfig, './tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}');
|
|
17
17
|
(0, testing_config_utils_1.updateVitestTestSetup)(tree, pathToViteConfig, 'test-setup.ts');
|
|
@@ -28,7 +28,9 @@ function updateUnitTestConfig(tree, pathToRoot, unitTestRunner, rootProject) {
|
|
|
28
28
|
(0, devkit_1.updateJson)(tree, pathToTsConfigSpec, (json) => {
|
|
29
29
|
json.include = [
|
|
30
30
|
'vite.config.ts',
|
|
31
|
+
'vite.config.mts',
|
|
31
32
|
'vitest.config.ts',
|
|
33
|
+
'vitest.config.mts',
|
|
32
34
|
'app/**/*.ts',
|
|
33
35
|
'app/**/*.tsx',
|
|
34
36
|
'app/**/*.js',
|
|
@@ -22,36 +22,7 @@ installGlobals();
|
|
|
22
22
|
"
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
-
exports[`Remix Library Generator --unitTestRunner should create the correct config files for testing with vitest 1`] = `
|
|
26
|
-
"import { defineConfig } from 'vite';
|
|
27
|
-
import react from '@vitejs/plugin-react';
|
|
28
|
-
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
29
|
-
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
30
|
-
|
|
31
|
-
export default defineConfig(() => ({
|
|
32
|
-
root: __dirname,
|
|
33
|
-
cacheDir: '../node_modules/.vite/test',
|
|
34
|
-
plugins: [react(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])],
|
|
35
|
-
// Uncomment this if you are using workers.
|
|
36
|
-
// worker: {
|
|
37
|
-
// plugins: [ nxViteTsPaths() ],
|
|
38
|
-
// },
|
|
39
|
-
test: {
|
|
40
|
-
setupFiles: ['./src/test-setup.ts'],
|
|
41
|
-
name: 'test',
|
|
42
|
-
watch: false,
|
|
43
|
-
globals: true,
|
|
44
|
-
environment: 'jsdom',
|
|
45
|
-
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
46
|
-
reporters: ['default'],
|
|
47
|
-
coverage: {
|
|
48
|
-
reportsDirectory: '../coverage/test',
|
|
49
|
-
provider: 'v8' as const,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
}));
|
|
53
|
-
"
|
|
54
|
-
`;
|
|
25
|
+
exports[`Remix Library Generator --unitTestRunner should create the correct config files for testing with vitest 1`] = `null`;
|
|
55
26
|
|
|
56
27
|
exports[`Remix Library Generator --unitTestRunner should create the correct config files for testing with vitest 2`] = `
|
|
57
28
|
"import { installGlobals } from '@remix-run/node';
|
|
@@ -15,7 +15,7 @@ function addUnitTestingSetup(tree, options) {
|
|
|
15
15
|
import "@testing-library/jest-dom/matchers";
|
|
16
16
|
installGlobals();`);
|
|
17
17
|
if (options.unitTestRunner === 'vitest') {
|
|
18
|
-
const pathToVitestConfig = (0, devkit_1.joinPathFragments)(options.projectRoot, `vite.config.
|
|
18
|
+
const pathToVitestConfig = (0, devkit_1.joinPathFragments)(options.projectRoot, `vite.config.mts`);
|
|
19
19
|
(0, testing_config_utils_1.updateVitestTestSetup)(tree, pathToVitestConfig, './src/test-setup.ts');
|
|
20
20
|
}
|
|
21
21
|
else if (options.unitTestRunner === 'jest') {
|
|
@@ -86,36 +86,7 @@ export default config;
|
|
|
86
86
|
"
|
|
87
87
|
`;
|
|
88
88
|
|
|
89
|
-
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework vitest 1`] = `
|
|
90
|
-
"import { defineConfig } from 'vite';
|
|
91
|
-
import react from '@vitejs/plugin-react';
|
|
92
|
-
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
93
|
-
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
|
94
|
-
|
|
95
|
-
export default defineConfig(() => ({
|
|
96
|
-
root: __dirname,
|
|
97
|
-
cacheDir: '../../node_modules/.vite/libs/storybook-test',
|
|
98
|
-
plugins: [react(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])],
|
|
99
|
-
// Uncomment this if you are using workers.
|
|
100
|
-
// worker: {
|
|
101
|
-
// plugins: [ nxViteTsPaths() ],
|
|
102
|
-
// },
|
|
103
|
-
test: {
|
|
104
|
-
setupFiles: ['./src/test-setup.ts'],
|
|
105
|
-
name: 'storybook-test',
|
|
106
|
-
watch: false,
|
|
107
|
-
globals: true,
|
|
108
|
-
environment: 'jsdom',
|
|
109
|
-
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
110
|
-
reporters: ['default'],
|
|
111
|
-
coverage: {
|
|
112
|
-
reportsDirectory: '../../coverage/libs/storybook-test',
|
|
113
|
-
provider: 'v8' as const,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
}));
|
|
117
|
-
"
|
|
118
|
-
`;
|
|
89
|
+
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework vitest 1`] = `null`;
|
|
119
90
|
|
|
120
91
|
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework vitest 2`] = `
|
|
121
92
|
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
@@ -127,7 +98,7 @@ const config: StorybookConfig = {
|
|
|
127
98
|
name: '@storybook/react-vite',
|
|
128
99
|
options: {
|
|
129
100
|
builder: {
|
|
130
|
-
viteConfigPath: 'vite.config.
|
|
101
|
+
viteConfigPath: 'vite.config.mts',
|
|
131
102
|
},
|
|
132
103
|
},
|
|
133
104
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook-configuration.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/storybook-configuration/storybook-configuration.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAG7D,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,4BAA4B,mDAMrC;AAQD,wBAA8B,mCAAmC,CAC/D,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"storybook-configuration.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/storybook-configuration/storybook-configuration.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAG7D,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,4BAA4B,mDAMrC;AAQD,wBAA8B,mCAAmC,CAC/D,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,4BAA4B,mDA0BrC"}
|
|
@@ -21,7 +21,8 @@ async function remixStorybookConfigurationInternal(tree, schema) {
|
|
|
21
21
|
nxJson.useInferencePlugins !== false;
|
|
22
22
|
schema.addPlugin ??= addPluginDefault;
|
|
23
23
|
const { root } = (0, devkit_1.readProjectConfiguration)(tree, schema.project);
|
|
24
|
-
if (!tree.exists((0, devkit_1.joinPathFragments)(root, 'vite.config.
|
|
24
|
+
if (!tree.exists((0, devkit_1.joinPathFragments)(root, 'vite.config.mts')) &&
|
|
25
|
+
!tree.exists((0, devkit_1.joinPathFragments)(root, 'vite.config.ts'))) {
|
|
25
26
|
const cacheDir = normalizedJoinPaths((0, devkit_1.offsetFromRoot)(root), 'node_modules', '.vite', 'storybook', root === '.' ? schema.project : root);
|
|
26
27
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), root, { cacheDir, tpl: '' });
|
|
27
28
|
}
|