@nx/remix 19.0.2 → 19.0.4
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 +5 -5
- package/src/generators/application/__snapshots__/application.impl.spec.ts.snap +4 -4
- package/src/generators/library/__snapshots__/library.impl.spec.ts.snap +2 -2
- package/src/generators/storybook-configuration/__snapshots__/storybook-configuration.impl.spec.ts.snap +70 -0
- package/src/generators/storybook-configuration/files/vite.config.ts__tpl__ +1 -1
- package/src/generators/storybook-configuration/storybook-configuration.impl.js +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/remix",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.4",
|
|
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",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"migrations": "./migrations.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nx/devkit": "19.0.
|
|
32
|
-
"@nx/js": "19.0.
|
|
33
|
-
"@nx/react": "19.0.
|
|
31
|
+
"@nx/devkit": "19.0.4",
|
|
32
|
+
"@nx/js": "19.0.4",
|
|
33
|
+
"@nx/react": "19.0.4",
|
|
34
34
|
"tslib": "^2.3.1",
|
|
35
35
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
36
|
-
"@nrwl/remix": "19.0.
|
|
36
|
+
"@nrwl/remix": "19.0.4"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {},
|
|
39
39
|
"publishConfig": {
|
|
@@ -386,7 +386,7 @@ export default defineConfig({
|
|
|
386
386
|
setupFiles: ['test-setup.ts'],
|
|
387
387
|
globals: true,
|
|
388
388
|
cache: {
|
|
389
|
-
dir: '../node_modules/.vitest',
|
|
389
|
+
dir: '../node_modules/.vitest/test',
|
|
390
390
|
},
|
|
391
391
|
environment: 'jsdom',
|
|
392
392
|
include: ['./tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
@@ -899,7 +899,7 @@ export default defineConfig({
|
|
|
899
899
|
setupFiles: ['test-setup.ts'],
|
|
900
900
|
globals: true,
|
|
901
901
|
cache: {
|
|
902
|
-
dir: '../../node_modules/.vitest',
|
|
902
|
+
dir: '../../node_modules/.vitest/apps/test',
|
|
903
903
|
},
|
|
904
904
|
environment: 'jsdom',
|
|
905
905
|
include: ['./tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
@@ -1206,7 +1206,7 @@ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
|
1206
1206
|
|
|
1207
1207
|
export default defineConfig({
|
|
1208
1208
|
root: __dirname,
|
|
1209
|
-
cacheDir: './node_modules/.vite
|
|
1209
|
+
cacheDir: './node_modules/.vite/test',
|
|
1210
1210
|
|
|
1211
1211
|
plugins: [react(), nxViteTsPaths()],
|
|
1212
1212
|
|
|
@@ -1219,7 +1219,7 @@ export default defineConfig({
|
|
|
1219
1219
|
setupFiles: ['test-setup.ts'],
|
|
1220
1220
|
globals: true,
|
|
1221
1221
|
cache: {
|
|
1222
|
-
dir: './node_modules/.vitest',
|
|
1222
|
+
dir: './node_modules/.vitest/test',
|
|
1223
1223
|
},
|
|
1224
1224
|
environment: 'jsdom',
|
|
1225
1225
|
include: ['./tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
@@ -42,7 +42,7 @@ export default defineConfig({
|
|
|
42
42
|
test: {
|
|
43
43
|
setupFiles: ['./src/test-setup.ts'],
|
|
44
44
|
globals: true,
|
|
45
|
-
cache: { dir: '../node_modules/.vitest' },
|
|
45
|
+
cache: { dir: '../node_modules/.vitest/test' },
|
|
46
46
|
environment: 'jsdom',
|
|
47
47
|
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
48
48
|
reporters: ['default'],
|
|
@@ -120,7 +120,7 @@ export default defineConfig({
|
|
|
120
120
|
test: {
|
|
121
121
|
setupFiles: ['./src/test-setup.ts'],
|
|
122
122
|
globals: true,
|
|
123
|
-
cache: { dir: '../../node_modules/.vitest' },
|
|
123
|
+
cache: { dir: '../../node_modules/.vitest/libs/test' },
|
|
124
124
|
environment: 'jsdom',
|
|
125
125
|
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
126
126
|
reporters: ['default'],
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework jest 1`] = `
|
|
4
|
+
"/// <reference types="vitest" />
|
|
5
|
+
import { defineConfig } from 'vite';
|
|
6
|
+
import react from '@vitejs/plugin-react';
|
|
7
|
+
import viteTsConfigPaths from 'vite-tsconfig-paths';
|
|
8
|
+
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
cacheDir: '../../node_modules/.vite/storybook/libs/storybook-test',
|
|
11
|
+
|
|
12
|
+
plugins: [
|
|
13
|
+
react(),
|
|
14
|
+
viteTsConfigPaths({
|
|
15
|
+
root: '../../../',
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
"
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework jest 2`] = `
|
|
4
23
|
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
5
24
|
|
|
6
25
|
const config: StorybookConfig = {
|
|
@@ -25,6 +44,25 @@ export default config;
|
|
|
25
44
|
`;
|
|
26
45
|
|
|
27
46
|
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework none 1`] = `
|
|
47
|
+
"/// <reference types="vitest" />
|
|
48
|
+
import { defineConfig } from 'vite';
|
|
49
|
+
import react from '@vitejs/plugin-react';
|
|
50
|
+
import viteTsConfigPaths from 'vite-tsconfig-paths';
|
|
51
|
+
|
|
52
|
+
export default defineConfig({
|
|
53
|
+
cacheDir: '../../node_modules/.vite/storybook/libs/storybook-test',
|
|
54
|
+
|
|
55
|
+
plugins: [
|
|
56
|
+
react(),
|
|
57
|
+
viteTsConfigPaths({
|
|
58
|
+
root: '../../../',
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
"
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework none 2`] = `
|
|
28
66
|
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
29
67
|
|
|
30
68
|
const config: StorybookConfig = {
|
|
@@ -49,6 +87,38 @@ export default config;
|
|
|
49
87
|
`;
|
|
50
88
|
|
|
51
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
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
root: __dirname,
|
|
96
|
+
cacheDir: '../../node_modules/.vite/libs/storybook-test',
|
|
97
|
+
|
|
98
|
+
plugins: [react(), nxViteTsPaths()],
|
|
99
|
+
|
|
100
|
+
// Uncomment this if you are using workers.
|
|
101
|
+
// worker: {
|
|
102
|
+
// plugins: [ nxViteTsPaths() ],
|
|
103
|
+
// },
|
|
104
|
+
|
|
105
|
+
test: {
|
|
106
|
+
setupFiles: ['./src/test-setup.ts'],
|
|
107
|
+
globals: true,
|
|
108
|
+
cache: { dir: '../../node_modules/.vitest/libs/storybook-test' },
|
|
109
|
+
environment: 'jsdom',
|
|
110
|
+
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
111
|
+
reporters: ['default'],
|
|
112
|
+
coverage: {
|
|
113
|
+
reportsDirectory: '../../coverage/libs/storybook-test',
|
|
114
|
+
provider: 'v8',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
"
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework vitest 2`] = `
|
|
52
122
|
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
53
123
|
|
|
54
124
|
const config: StorybookConfig = {
|
|
@@ -11,6 +11,10 @@ function remixStorybookConfiguration(tree, schema) {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
exports.remixStorybookConfiguration = remixStorybookConfiguration;
|
|
14
|
+
function normalizedJoinPaths(...paths) {
|
|
15
|
+
const path = (0, devkit_1.joinPathFragments)(...paths);
|
|
16
|
+
return path.startsWith('.') ? path : `./${path}`;
|
|
17
|
+
}
|
|
14
18
|
async function remixStorybookConfigurationInternal(tree, schema) {
|
|
15
19
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
16
20
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
@@ -18,7 +22,8 @@ async function remixStorybookConfigurationInternal(tree, schema) {
|
|
|
18
22
|
schema.addPlugin ??= addPluginDefault;
|
|
19
23
|
const { root } = (0, devkit_1.readProjectConfiguration)(tree, schema.project);
|
|
20
24
|
if (!tree.exists((0, devkit_1.joinPathFragments)(root, 'vite.config.ts'))) {
|
|
21
|
-
(0, devkit_1.
|
|
25
|
+
const cacheDir = normalizedJoinPaths((0, devkit_1.offsetFromRoot)(root), 'node_modules', '.vite', 'storybook', root === '.' ? schema.project : root);
|
|
26
|
+
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), root, { cacheDir, tpl: '' });
|
|
22
27
|
}
|
|
23
28
|
const task = await (0, react_1.storybookConfigurationGenerator)(tree, schema);
|
|
24
29
|
return task;
|