@nx/remix 20.3.2 → 20.4.0-beta.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 +4 -4
- package/src/generators/application/__snapshots__/application.impl.spec.ts.snap +0 -2
- package/src/generators/application/application.impl.js +3 -0
- package/src/generators/init/init.js +12 -2
- package/src/generators/library/library.impl.js +2 -0
- package/src/plugins/__snapshots__/plugin.spec.ts.snap +123 -0
- package/src/plugins/plugin.d.ts +2 -0
- package/src/plugins/plugin.js +3 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/remix",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.4.0-beta.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,9 +29,9 @@
|
|
|
29
29
|
"migrations": "./migrations.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nx/devkit": "20.
|
|
33
|
-
"@nx/js": "20.
|
|
34
|
-
"@nx/react": "20.
|
|
32
|
+
"@nx/devkit": "20.4.0-beta.1",
|
|
33
|
+
"@nx/js": "20.4.0-beta.1",
|
|
34
|
+
"@nx/react": "20.4.0-beta.1",
|
|
35
35
|
"tslib": "^2.3.1",
|
|
36
36
|
"@phenomnomnominal/tsquery": "~5.0.1"
|
|
37
37
|
},
|
|
@@ -156,7 +156,6 @@ export default defineConfig({
|
|
|
156
156
|
exports[`Remix Application Integrated Repo --e2eTestRunner should generate a playwright e2e application for the app 1`] = `
|
|
157
157
|
"import { defineConfig, devices } from '@playwright/test';
|
|
158
158
|
import { nxE2EPreset } from '@nx/playwright/preset';
|
|
159
|
-
|
|
160
159
|
import { workspaceRoot } from '@nx/devkit';
|
|
161
160
|
|
|
162
161
|
// For CI, you may want to set BASE_URL to the deployed application.
|
|
@@ -678,7 +677,6 @@ exports[`Remix Application Standalone Project Repo should create the application
|
|
|
678
677
|
exports[`Remix Application Standalone Project Repo should generate a playwright e2e application for the app 1`] = `
|
|
679
678
|
"import { defineConfig, devices } from '@playwright/test';
|
|
680
679
|
import { nxE2EPreset } from '@nx/playwright/preset';
|
|
681
|
-
|
|
682
680
|
import { workspaceRoot } from '@nx/devkit';
|
|
683
681
|
|
|
684
682
|
// For CI, you may want to set BASE_URL to the deployed application.
|
|
@@ -13,6 +13,7 @@ const init_1 = require("../init/init");
|
|
|
13
13
|
const update_dependencies_1 = require("../utils/update-dependencies");
|
|
14
14
|
const lib_1 = require("./lib");
|
|
15
15
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
16
|
+
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
16
17
|
function remixApplicationGenerator(tree, options) {
|
|
17
18
|
return remixApplicationGeneratorInternal(tree, {
|
|
18
19
|
addPlugin: true,
|
|
@@ -29,6 +30,7 @@ async function remixApplicationGeneratorInternal(tree, _options) {
|
|
|
29
30
|
skipFormat: true,
|
|
30
31
|
addTsPlugin: _options.useTsSolution,
|
|
31
32
|
formatter: _options.formatter,
|
|
33
|
+
platform: 'web',
|
|
32
34
|
}),
|
|
33
35
|
];
|
|
34
36
|
const options = await (0, lib_1.normalizeOptions)(tree, _options);
|
|
@@ -200,6 +202,7 @@ export default {...nxPreset};
|
|
|
200
202
|
if (options.useTsSolution) {
|
|
201
203
|
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
|
|
202
204
|
}
|
|
205
|
+
(0, sort_fields_1.sortPackageJsonFields)(tree, options.projectRoot);
|
|
203
206
|
if (!options.skipFormat) {
|
|
204
207
|
await (0, devkit_1.formatFiles)(tree);
|
|
205
208
|
}
|
|
@@ -36,8 +36,18 @@ async function remixInitGeneratorInternal(tree, options) {
|
|
|
36
36
|
],
|
|
37
37
|
serveStaticTargetName: [
|
|
38
38
|
'serve-static',
|
|
39
|
-
'
|
|
40
|
-
'
|
|
39
|
+
'remix:serve-static',
|
|
40
|
+
'remix-serve-static',
|
|
41
|
+
],
|
|
42
|
+
buildDepsTargetName: [
|
|
43
|
+
'build-deps',
|
|
44
|
+
'remix:build-deps',
|
|
45
|
+
'remix-build-deps',
|
|
46
|
+
],
|
|
47
|
+
watchDepsTargetName: [
|
|
48
|
+
'watch-deps',
|
|
49
|
+
'remix:watch-deps',
|
|
50
|
+
'remix-watch-deps',
|
|
41
51
|
],
|
|
42
52
|
}, options.updatePackageScripts);
|
|
43
53
|
}
|
|
@@ -7,6 +7,7 @@ const js_1 = require("@nx/js");
|
|
|
7
7
|
const react_1 = require("@nx/react");
|
|
8
8
|
const lib_1 = require("./lib");
|
|
9
9
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
10
|
+
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
10
11
|
async function remixLibraryGenerator(tree, schema) {
|
|
11
12
|
return remixLibraryGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
12
13
|
}
|
|
@@ -52,6 +53,7 @@ async function remixLibraryGeneratorInternal(tree, schema) {
|
|
|
52
53
|
if (options.isUsingTsSolutionConfig) {
|
|
53
54
|
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
|
|
54
55
|
}
|
|
56
|
+
(0, sort_fields_1.sortPackageJsonFields)(tree, options.projectRoot);
|
|
55
57
|
if (!options.skipFormat) {
|
|
56
58
|
await (0, devkit_1.formatFiles)(tree);
|
|
57
59
|
}
|
|
@@ -33,6 +33,112 @@ exports[`@nx/remix/plugin Remix Classic Compiler non-root project should create
|
|
|
33
33
|
"{workspaceRoot}/my-app/public/build",
|
|
34
34
|
],
|
|
35
35
|
},
|
|
36
|
+
"build-deps": {
|
|
37
|
+
"dependsOn": [
|
|
38
|
+
"^build",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
"dev": {
|
|
42
|
+
"command": "remix dev --manual",
|
|
43
|
+
"options": {
|
|
44
|
+
"cwd": "my-app",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
"serve-static": {
|
|
48
|
+
"command": "remix-serve build/index.js",
|
|
49
|
+
"dependsOn": [
|
|
50
|
+
"build",
|
|
51
|
+
],
|
|
52
|
+
"options": {
|
|
53
|
+
"cwd": "my-app",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
"start": {
|
|
57
|
+
"command": "remix-serve build/index.js",
|
|
58
|
+
"dependsOn": [
|
|
59
|
+
"build",
|
|
60
|
+
],
|
|
61
|
+
"options": {
|
|
62
|
+
"cwd": "my-app",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
"static-serve": {
|
|
66
|
+
"command": "remix-serve build/index.js",
|
|
67
|
+
"dependsOn": [
|
|
68
|
+
"build",
|
|
69
|
+
],
|
|
70
|
+
"options": {
|
|
71
|
+
"cwd": "my-app",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
"tsc": {
|
|
75
|
+
"cache": true,
|
|
76
|
+
"command": "tsc",
|
|
77
|
+
"inputs": [
|
|
78
|
+
"production",
|
|
79
|
+
"^production",
|
|
80
|
+
{
|
|
81
|
+
"externalDependencies": [
|
|
82
|
+
"typescript",
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
"options": {
|
|
87
|
+
"cwd": "my-app",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
"watch-deps": {
|
|
91
|
+
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
|
|
92
|
+
"dependsOn": [
|
|
93
|
+
"build-deps",
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
]
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
exports[`@nx/remix/plugin Remix Classic Compiler non-root project should infer watch-deps target 1`] = `
|
|
105
|
+
[
|
|
106
|
+
[
|
|
107
|
+
"my-app/remix.config.cjs",
|
|
108
|
+
{
|
|
109
|
+
"projects": {
|
|
110
|
+
"my-app": {
|
|
111
|
+
"metadata": {},
|
|
112
|
+
"root": "my-app",
|
|
113
|
+
"targets": {
|
|
114
|
+
"build": {
|
|
115
|
+
"cache": true,
|
|
116
|
+
"command": "remix build",
|
|
117
|
+
"dependsOn": [
|
|
118
|
+
"^build",
|
|
119
|
+
],
|
|
120
|
+
"inputs": [
|
|
121
|
+
"production",
|
|
122
|
+
"^production",
|
|
123
|
+
{
|
|
124
|
+
"externalDependencies": [
|
|
125
|
+
"@remix-run/dev",
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
"options": {
|
|
130
|
+
"cwd": "my-app",
|
|
131
|
+
},
|
|
132
|
+
"outputs": [
|
|
133
|
+
"{workspaceRoot}/my-app/build",
|
|
134
|
+
"{workspaceRoot}/my-app/public/build",
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
"build-deps": {
|
|
138
|
+
"dependsOn": [
|
|
139
|
+
"^build",
|
|
140
|
+
],
|
|
141
|
+
},
|
|
36
142
|
"dev": {
|
|
37
143
|
"command": "remix dev --manual",
|
|
38
144
|
"options": {
|
|
@@ -82,6 +188,12 @@ exports[`@nx/remix/plugin Remix Classic Compiler non-root project should create
|
|
|
82
188
|
"cwd": "my-app",
|
|
83
189
|
},
|
|
84
190
|
},
|
|
191
|
+
"watch-deps": {
|
|
192
|
+
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
|
|
193
|
+
"dependsOn": [
|
|
194
|
+
"build-deps",
|
|
195
|
+
],
|
|
196
|
+
},
|
|
85
197
|
},
|
|
86
198
|
},
|
|
87
199
|
},
|
|
@@ -212,6 +324,11 @@ exports[`@nx/remix/plugin Remix Vite Compiler non-root project should create nod
|
|
|
212
324
|
"{workspaceRoot}/my-app/build",
|
|
213
325
|
],
|
|
214
326
|
},
|
|
327
|
+
"build-deps": {
|
|
328
|
+
"dependsOn": [
|
|
329
|
+
"^build",
|
|
330
|
+
],
|
|
331
|
+
},
|
|
215
332
|
"dev": {
|
|
216
333
|
"command": "remix vite:dev",
|
|
217
334
|
"options": {
|
|
@@ -261,6 +378,12 @@ exports[`@nx/remix/plugin Remix Vite Compiler non-root project should create nod
|
|
|
261
378
|
"cwd": "my-app",
|
|
262
379
|
},
|
|
263
380
|
},
|
|
381
|
+
"watch-deps": {
|
|
382
|
+
"command": "npx nx watch --projects my-app --includeDependentProjects -- npx nx build-deps my-app",
|
|
383
|
+
"dependsOn": [
|
|
384
|
+
"build-deps",
|
|
385
|
+
],
|
|
386
|
+
},
|
|
264
387
|
},
|
|
265
388
|
},
|
|
266
389
|
},
|
package/src/plugins/plugin.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export interface RemixPluginOptions {
|
|
|
4
4
|
devTargetName?: string;
|
|
5
5
|
startTargetName?: string;
|
|
6
6
|
typecheckTargetName?: string;
|
|
7
|
+
buildDepsTargetName?: string;
|
|
8
|
+
watchDepsTargetName?: string;
|
|
7
9
|
/**
|
|
8
10
|
* @deprecated Use serveStaticTargetName instead. This option will be removed in Nx 21.
|
|
9
11
|
*/
|
package/src/plugins/plugin.js
CHANGED
|
@@ -11,6 +11,8 @@ const js_1 = require("@nx/js");
|
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const fs_1 = require("fs");
|
|
13
13
|
const executor_utils_1 = require("../utils/executor-utils");
|
|
14
|
+
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
15
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
14
16
|
function readTargetsCache(cachePath) {
|
|
15
17
|
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
16
18
|
}
|
|
@@ -87,6 +89,7 @@ async function buildRemixTargets(configFilePath, projectRoot, options, context,
|
|
|
87
89
|
targets[options.staticServeTargetName] = startTarget(projectRoot, serverBuildPath, options.buildTargetName, remixCompiler);
|
|
88
90
|
targets[options.serveStaticTargetName] = startTarget(projectRoot, serverBuildPath, options.buildTargetName, remixCompiler);
|
|
89
91
|
targets[options.typecheckTargetName] = typecheckTarget(projectRoot, namedInputs, siblingFiles);
|
|
92
|
+
(0, util_1.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
|
|
90
93
|
return { targets, metadata: {} };
|
|
91
94
|
}
|
|
92
95
|
function buildTarget(buildTargetName, projectRoot, buildDirectory, assetsBuildDirectory, namedInputs, remixCompiler) {
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const reactDomVersion = "^18.2.0";
|
|
|
7
7
|
export declare const typesReactVersion = "^18.2.0";
|
|
8
8
|
export declare const typesReactDomVersion = "^18.2.0";
|
|
9
9
|
export declare const eslintVersion = "^8.56.0";
|
|
10
|
-
export declare const typescriptVersion = "~5.
|
|
10
|
+
export declare const typescriptVersion = "~5.7.2";
|
|
11
11
|
export declare const tailwindVersion = "^3.3.0";
|
|
12
12
|
export declare const postcssVersion = "^8.4.38";
|
|
13
13
|
export declare const autoprefixerVersion = "^10.4.19";
|
package/src/utils/versions.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.reactDomVersion = '^18.2.0';
|
|
|
12
12
|
exports.typesReactVersion = '^18.2.0';
|
|
13
13
|
exports.typesReactDomVersion = '^18.2.0';
|
|
14
14
|
exports.eslintVersion = '^8.56.0';
|
|
15
|
-
exports.typescriptVersion = '~5.
|
|
15
|
+
exports.typescriptVersion = '~5.7.2';
|
|
16
16
|
exports.tailwindVersion = '^3.3.0';
|
|
17
17
|
exports.postcssVersion = '^8.4.38';
|
|
18
18
|
exports.autoprefixerVersion = '^10.4.19';
|