@nx/remix 16.4.0 → 16.7.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/executors.json +26 -0
- package/package.json +9 -7
- package/src/executors/build/build.impl.d.ts +5 -0
- package/src/executors/build/build.impl.js +84 -0
- package/src/executors/build/build.impl.js.map +1 -0
- package/src/executors/build/compat.d.ts +2 -0
- package/src/executors/build/compat.js +6 -0
- package/src/executors/build/compat.js.map +1 -0
- package/src/executors/build/schema.d.ts +5 -0
- package/src/executors/build/schema.json +31 -0
- package/src/executors/serve/compat.d.ts +2 -0
- package/src/executors/serve/compat.js +6 -0
- package/src/executors/serve/compat.js.map +1 -0
- package/src/executors/serve/schema.d.ts +9 -0
- package/src/executors/serve/schema.json +41 -0
- package/src/executors/serve/serve.impl.d.ts +6 -0
- package/src/executors/serve/serve.impl.js +77 -0
- package/src/executors/serve/serve.impl.js.map +1 -0
- package/src/generators/application/__snapshots__/application.impl.spec.ts.snap +6 -24
- package/src/generators/application/application.impl.js +5 -4
- package/src/generators/application/application.impl.js.map +1 -1
- package/src/generators/cypress/cypress.impl.d.ts +3 -2
- package/src/generators/cypress/cypress.impl.js +26 -4
- package/src/generators/cypress/cypress.impl.js.map +1 -1
- package/src/generators/cypress/schema.d.ts +10 -0
- package/src/generators/preset/lib/normalize-options.d.ts +3 -0
- package/src/generators/preset/lib/normalize-options.js.map +1 -1
- package/src/generators/preset/preset.impl.js +4 -0
- package/src/generators/preset/preset.impl.js.map +1 -1
- package/src/generators/storybook-configuration/__snapshots__/storybook-configuration.impl.spec.ts.snap +12 -6
package/executors.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executors": {
|
|
3
|
+
"serve": {
|
|
4
|
+
"implementation": "./src/executors/serve/serve.impl",
|
|
5
|
+
"schema": "./src/executors/serve/schema.json",
|
|
6
|
+
"description": "Serve a Remix application."
|
|
7
|
+
},
|
|
8
|
+
"build": {
|
|
9
|
+
"implementation": "./src/executors/build/build.impl",
|
|
10
|
+
"schema": "./src/executors/build/schema.json",
|
|
11
|
+
"description": "Build a Remix application."
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"builders": {
|
|
15
|
+
"serve": {
|
|
16
|
+
"implementation": "./src/executors/serve/compat",
|
|
17
|
+
"schema": "./src/executors/serve/schema.json",
|
|
18
|
+
"description": "Serve a Remix application."
|
|
19
|
+
},
|
|
20
|
+
"build": {
|
|
21
|
+
"implementation": "./src/executors/build/build.impl",
|
|
22
|
+
"schema": "./src/executors/build/schema.json",
|
|
23
|
+
"description": "Build a Remix application."
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/remix",
|
|
3
|
-
"version": "16.
|
|
4
|
-
"main": "src/index.js",
|
|
3
|
+
"version": "16.7.0-beta.1",
|
|
4
|
+
"main": "./src/index.js",
|
|
5
5
|
"generators": "./generators.json",
|
|
6
|
+
"executors": "./executors.json",
|
|
6
7
|
"dependencies": {
|
|
7
|
-
"@nx/devkit": "^16.0.
|
|
8
|
-
"@nx/js": "^16.0.
|
|
9
|
-
"@nx/react": "^16.0.
|
|
8
|
+
"@nx/devkit": "^16.7.0-rc.1",
|
|
9
|
+
"@nx/js": "^16.7.0-rc.1",
|
|
10
|
+
"@nx/react": "^16.7.0-rc.1",
|
|
11
|
+
"@nx/web": "16.7.1",
|
|
10
12
|
"@phenomnomnominal/tsquery": "^5.0.1",
|
|
11
13
|
"tslib": "^2.3.1",
|
|
12
14
|
"vite": "4.3.9",
|
|
13
|
-
"@nrwl/remix": "16.
|
|
15
|
+
"@nrwl/remix": "16.7.0-beta.1"
|
|
14
16
|
},
|
|
15
17
|
"ng-update": {
|
|
16
18
|
"requirements": {},
|
|
17
19
|
"migrations": "./migrations.json"
|
|
18
20
|
},
|
|
19
|
-
"
|
|
21
|
+
"type": "commonjs"
|
|
20
22
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const js_1 = require("@nx/js");
|
|
6
|
+
const fileutils_1 = require("@nx/workspace/src/utilities/fileutils");
|
|
7
|
+
const dev_1 = require("@remix-run/dev");
|
|
8
|
+
const fs_extra_1 = require("fs-extra");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
function buildExecutor(options, context) {
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const projectRoot = context.projectGraph.nodes[context.projectName].data.root;
|
|
13
|
+
try {
|
|
14
|
+
yield dev_1.cli.run(['build', projectRoot]);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
devkit_1.logger.error(`Error occurred while trying to build application.`);
|
|
18
|
+
devkit_1.logger.error(error.toString());
|
|
19
|
+
return { success: false };
|
|
20
|
+
}
|
|
21
|
+
if (!(0, fileutils_1.directoryExists)(options.outputPath)) {
|
|
22
|
+
(0, fs_extra_1.mkdir)(options.outputPath);
|
|
23
|
+
}
|
|
24
|
+
const builtPackageJson = (0, js_1.createPackageJson)(context.projectName, context.projectGraph, {
|
|
25
|
+
target: context.targetName,
|
|
26
|
+
root: context.root,
|
|
27
|
+
isProduction: !options.includeDevDependenciesInPackageJson, // By default we remove devDependencies since this is a production build.
|
|
28
|
+
});
|
|
29
|
+
// Update `package.json` to reflect how users should run the build artifacts
|
|
30
|
+
builtPackageJson.scripts = {
|
|
31
|
+
start: 'remix-serve build',
|
|
32
|
+
};
|
|
33
|
+
updatePackageJson(builtPackageJson, context);
|
|
34
|
+
(0, devkit_1.writeJsonFile)(`${options.outputPath}/package.json`, builtPackageJson);
|
|
35
|
+
if (options.generateLockfile) {
|
|
36
|
+
const lockFile = (0, js_1.createLockFile)(builtPackageJson);
|
|
37
|
+
(0, fs_extra_1.writeFileSync)(`${options.outputPath}/${(0, js_1.getLockFileName)()}`, lockFile, {
|
|
38
|
+
encoding: 'utf-8',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// If output path is different from source path, then copy over the config and public files.
|
|
42
|
+
// This is the default behavior when running `nx build <app>`.
|
|
43
|
+
if (options.outputPath.replace(/\/$/, '') !== projectRoot) {
|
|
44
|
+
(0, fs_extra_1.copySync)((0, path_1.join)(projectRoot, 'public'), (0, path_1.join)(options.outputPath, 'public'), {
|
|
45
|
+
dereference: true,
|
|
46
|
+
});
|
|
47
|
+
(0, fs_extra_1.copySync)((0, path_1.join)(projectRoot, 'build'), (0, path_1.join)(options.outputPath, 'build'), {
|
|
48
|
+
dereference: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return { success: true };
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
exports.default = buildExecutor;
|
|
55
|
+
function updatePackageJson(packageJson, context) {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
var _c;
|
|
58
|
+
if (!packageJson.scripts) {
|
|
59
|
+
packageJson.scripts = {};
|
|
60
|
+
}
|
|
61
|
+
if (!packageJson.scripts.start) {
|
|
62
|
+
packageJson.scripts.start = 'remix-serve build';
|
|
63
|
+
}
|
|
64
|
+
(_a = packageJson.dependencies) !== null && _a !== void 0 ? _a : (packageJson.dependencies = {});
|
|
65
|
+
// These are always required for a production Remix app to run.
|
|
66
|
+
const requiredPackages = [
|
|
67
|
+
'react',
|
|
68
|
+
'react-dom',
|
|
69
|
+
'isbot',
|
|
70
|
+
'typescript',
|
|
71
|
+
'@remix-run/css-bundle',
|
|
72
|
+
'@remix-run/node',
|
|
73
|
+
'@remix-run/react',
|
|
74
|
+
'@remix-run/serve',
|
|
75
|
+
'@remix-run/dev',
|
|
76
|
+
];
|
|
77
|
+
for (const pkg of requiredPackages) {
|
|
78
|
+
const externalNode = context.projectGraph.externalNodes[`npm:${pkg}`];
|
|
79
|
+
if (externalNode) {
|
|
80
|
+
(_b = (_c = packageJson.dependencies)[pkg]) !== null && _b !== void 0 ? _b : (_c[pkg] = externalNode.data.version);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=build.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,uCAAyE;AACzE,+BAA4E;AAC5E,qEAAwE;AACxE,wCAAiD;AACjD,uCAA0D;AAE1D,+BAA4B;AAG5B,SAA8B,aAAa,CACzC,OAAyB,EACzB,OAAwB;;QAExB,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAE9E,IAAI;YACF,MAAM,SAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;SAC5C;QAAC,OAAO,KAAK,EAAE;YACd,eAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YAClE,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;SAC3B;QAED,IAAI,CAAC,IAAA,2BAAe,EAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACxC,IAAA,gBAAK,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC3B;QAED,MAAM,gBAAgB,GAAG,IAAA,sBAAiB,EACxC,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,YAAY,EACpB;YACE,MAAM,EAAE,OAAO,CAAC,UAAU;YAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,YAAY,EAAE,CAAC,OAAO,CAAC,mCAAmC,EAAE,yEAAyE;SACtI,CACF,CA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AAK,EAAE;QAC9B,WAAW,CAAC,OAAO,CAAC,KAAK,GAAG,mBAAmB,CAAC;KACjD;IAED,MAAA,WAAW,CAAC,YAAY,oCAAxB,WAAW,CAAC,YAAY,GAAK,EAAE,EAAC;IAEhC,+DAA+D;IAC/D,MAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,WAAW;QACX,OAAO;QACP,YAAY;QACZ,uBAAuB;QACvB,iBAAiB;QACjB,kBAAkB;QAClB,kBAAkB;QAClB,gBAAgB;KACjB,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE;QAClC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QACtE,IAAI,YAAY,EAAE;YAChB,YAAA,WAAW,CAAC,YAAY,EAAC,GAAG,wCAAH,GAAG,IAAM,YAAY,CAAC,IAAI,CAAC,OAAO,EAAC;SAC7D;KACF;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const build_impl_1 = require("./build.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(build_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/executors/build/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,6CAAyC;AAEzC,kBAAe,IAAA,0BAAiB,EAAC,oBAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "pipe",
|
|
4
|
+
"$schema": "http://json-schema.org/schema",
|
|
5
|
+
"cli": "nx",
|
|
6
|
+
"title": "Remix Build",
|
|
7
|
+
"description": "Build a Remix app.",
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"outputPath": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "The output path of the generated files.",
|
|
13
|
+
"x-completion-type": "directory",
|
|
14
|
+
"x-priority": "important"
|
|
15
|
+
},
|
|
16
|
+
"includeDevDependenciesInPackageJson": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"description": "Include `devDependencies` in the generated package.json file. By default only production `dependencies` are included.",
|
|
19
|
+
"default": false
|
|
20
|
+
},
|
|
21
|
+
"generateLockfile": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Generate a lockfile (e.g. package-lock.json) that matches the workspace lockfile to ensure package versions match.",
|
|
24
|
+
"default": false,
|
|
25
|
+
"x-priority": "internal"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"outputPath"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const serve_impl_1 = require("./serve.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(serve_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/executors/serve/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,6CAAyC;AAEzC,kBAAe,IAAA,0BAAiB,EAAC,oBAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "pipe",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Remix Serve",
|
|
6
|
+
"description": "Serve a Remix app.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"port": {
|
|
10
|
+
"type": "number",
|
|
11
|
+
"description": "Set PORT environment variable that can be used to serve the Remix application.",
|
|
12
|
+
"default": 4200
|
|
13
|
+
},
|
|
14
|
+
"devServerPort": {
|
|
15
|
+
"type": "number",
|
|
16
|
+
"description": "Port to start the dev server on."
|
|
17
|
+
},
|
|
18
|
+
"debug": {
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"description": "Attach a Node.js inspector.",
|
|
21
|
+
"default": false
|
|
22
|
+
},
|
|
23
|
+
"command": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Command used to run your app server."
|
|
26
|
+
},
|
|
27
|
+
"manual": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"description": "Enable manual mode",
|
|
30
|
+
"default": false
|
|
31
|
+
},
|
|
32
|
+
"tlsKey": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Path to TLS key (key.pem)."
|
|
35
|
+
},
|
|
36
|
+
"tlsCert": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Path to TLS certificate (cert.pem)."
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { type RemixServeSchema } from './schema';
|
|
3
|
+
export default function serveExecutor(schema: RemixServeSchema, context: ExecutorContext): AsyncGenerator<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
}, void, undefined>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
6
|
+
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
function normalizeOptions(schema) {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
return Object.assign(Object.assign({}, schema), { port: (_a = schema.port) !== null && _a !== void 0 ? _a : 4200, debug: (_b = schema.debug) !== null && _b !== void 0 ? _b : false, manual: (_c = schema.manual) !== null && _c !== void 0 ? _c : false });
|
|
12
|
+
}
|
|
13
|
+
function buildRemixDevArgs(options) {
|
|
14
|
+
const args = [];
|
|
15
|
+
if (options.command) {
|
|
16
|
+
args.push(`--command=${options.command}`);
|
|
17
|
+
}
|
|
18
|
+
if (options.devServerPort) {
|
|
19
|
+
args.push(`--port=${options.devServerPort}`);
|
|
20
|
+
}
|
|
21
|
+
if (options.debug) {
|
|
22
|
+
args.push(`--debug`);
|
|
23
|
+
}
|
|
24
|
+
if (options.manual) {
|
|
25
|
+
args.push(`--manual`);
|
|
26
|
+
}
|
|
27
|
+
if (options.tlsKey) {
|
|
28
|
+
args.push(`--tls-key=${options.tlsKey}`);
|
|
29
|
+
}
|
|
30
|
+
if (options.tlsCert) {
|
|
31
|
+
args.push(`--tls-cert=${options.tlsCert}`);
|
|
32
|
+
}
|
|
33
|
+
return args;
|
|
34
|
+
}
|
|
35
|
+
function serveExecutor(schema, context) {
|
|
36
|
+
return tslib_1.__asyncGenerator(this, arguments, function* serveExecutor_1() {
|
|
37
|
+
const options = normalizeOptions(schema);
|
|
38
|
+
const projectRoot = context.workspace.projects[context.projectName].root;
|
|
39
|
+
const remixBin = require.resolve('@remix-run/dev/dist/cli');
|
|
40
|
+
const args = buildRemixDevArgs(options);
|
|
41
|
+
// Cast to any to overwrite NODE_ENV
|
|
42
|
+
process.env.NODE_ENV = process.env.NODE_ENV
|
|
43
|
+
? process.env.NODE_ENV
|
|
44
|
+
: 'development';
|
|
45
|
+
process.env.PORT = `${options.port}`;
|
|
46
|
+
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, async_iterable_1.createAsyncIterable)(({ done, next, error }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const server = (0, node_child_process_1.fork)(remixBin, ['dev', ...args], {
|
|
48
|
+
cwd: (0, node_path_1.join)(devkit_1.workspaceRoot, projectRoot),
|
|
49
|
+
stdio: 'inherit',
|
|
50
|
+
});
|
|
51
|
+
server.once('exit', (code) => {
|
|
52
|
+
if (code === 0) {
|
|
53
|
+
done();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
error(new Error(`Remix app exited with code ${code}`));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const killServer = () => {
|
|
60
|
+
if (server.connected) {
|
|
61
|
+
server.kill('SIGTERM');
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
process.on('exit', () => killServer());
|
|
65
|
+
process.on('SIGINT', () => killServer());
|
|
66
|
+
process.on('SIGTERM', () => killServer());
|
|
67
|
+
process.on('SIGHUP', () => killServer());
|
|
68
|
+
yield (0, wait_for_port_open_1.waitForPortOpen)(options.port);
|
|
69
|
+
next({
|
|
70
|
+
success: true,
|
|
71
|
+
baseUrl: `http://localhost:${options.port}`,
|
|
72
|
+
});
|
|
73
|
+
})))));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
exports.default = serveExecutor;
|
|
77
|
+
//# sourceMappingURL=serve.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/executors/serve/serve.impl.ts"],"names":[],"mappings":";;;AAAA,uCAAiE;AACjE,wEAA0E;AAC1E,6EAAuE;AACvE,2DAA0C;AAC1C,yCAAiC;AAGjC,SAAS,gBAAgB,CAAC,MAAwB;;IAChD,OAAO,gCACF,MAAM,KACT,IAAI,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,IAAI,EACzB,KAAK,EAAE,MAAA,MAAM,CAAC,KAAK,mCAAI,K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AC,CAAC;YAEzC,MAAM,IAAA,oCAAe,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEpC,IAAI,CAAC;gBACH,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;aAC5C,CAAC,CAAC;QACL,CAAC,CAAA,CACF,CAAA,CAAA,CAAA,CAAC;IACJ,CAAC;CAAA;AAhDD,gCAgDC"}
|
|
@@ -305,27 +305,18 @@ module.exports = {
|
|
|
305
305
|
|
|
306
306
|
exports[`Remix Application Integrated Repo --unitTestRunner should generate the correct files for testing using vitest 2`] = `
|
|
307
307
|
"/// <reference types=\\"vitest\\" />
|
|
308
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
308
309
|
import react from '@vitejs/plugin-react';
|
|
309
310
|
import { defineConfig } from 'vite';
|
|
310
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths';
|
|
311
311
|
|
|
312
312
|
export default defineConfig({
|
|
313
313
|
cacheDir: '../../node_modules/.vite/test',
|
|
314
314
|
|
|
315
|
-
plugins: [
|
|
316
|
-
react(),
|
|
317
|
-
viteTsConfigPaths({
|
|
318
|
-
root: '../../',
|
|
319
|
-
}),
|
|
320
|
-
],
|
|
315
|
+
plugins: [react(), nxViteTsPaths()],
|
|
321
316
|
|
|
322
317
|
// Uncomment this if you are using workers.
|
|
323
318
|
// worker: {
|
|
324
|
-
// plugins: [
|
|
325
|
-
// viteTsConfigPaths({
|
|
326
|
-
// root: '../../',
|
|
327
|
-
// }),
|
|
328
|
-
// ],
|
|
319
|
+
// plugins: [ nxViteTsPaths() ],
|
|
329
320
|
// },
|
|
330
321
|
|
|
331
322
|
test: {
|
|
@@ -563,27 +554,18 @@ module.exports = {
|
|
|
563
554
|
|
|
564
555
|
exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using vitest 2`] = `
|
|
565
556
|
"/// <reference types=\\"vitest\\" />
|
|
557
|
+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
566
558
|
import react from '@vitejs/plugin-react';
|
|
567
559
|
import { defineConfig } from 'vite';
|
|
568
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths';
|
|
569
560
|
|
|
570
561
|
export default defineConfig({
|
|
571
562
|
cacheDir: './node_modules/.vite/test',
|
|
572
563
|
|
|
573
|
-
plugins: [
|
|
574
|
-
react(),
|
|
575
|
-
viteTsConfigPaths({
|
|
576
|
-
root: './',
|
|
577
|
-
}),
|
|
578
|
-
],
|
|
564
|
+
plugins: [react(), nxViteTsPaths()],
|
|
579
565
|
|
|
580
566
|
// Uncomment this if you are using workers.
|
|
581
567
|
// worker: {
|
|
582
|
-
// plugins: [
|
|
583
|
-
// viteTsConfigPaths({
|
|
584
|
-
// root: './',
|
|
585
|
-
// }),
|
|
586
|
-
// ],
|
|
568
|
+
// plugins: [ nxViteTsPaths() ],
|
|
587
569
|
// },
|
|
588
570
|
|
|
589
571
|
test: {
|
|
@@ -17,15 +17,16 @@ function default_1(tree, _options) {
|
|
|
17
17
|
tags: options.parsedTags,
|
|
18
18
|
targets: {
|
|
19
19
|
build: {
|
|
20
|
-
|
|
20
|
+
executor: '@nx/remix:build',
|
|
21
|
+
outputs: ['{options.outputPath}'],
|
|
21
22
|
options: {
|
|
22
|
-
|
|
23
|
+
outputPath: (0, devkit_1.joinPathFragments)('dist', options.projectRoot),
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
serve: {
|
|
26
|
-
|
|
27
|
+
executor: `@nx/remix:serve`,
|
|
27
28
|
options: {
|
|
28
|
-
|
|
29
|
+
port: 4200,
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
start: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":";;;AAAA,uCAcoB;AACpB,mFAAmF;AACnF,mDAU8B;AAC9B,0DAAuD;AACvD,+BAA+D;AAG/D,mBAA+B,IAAU,EAAE,QAAgC;;QACzE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,IAAA,gCAAuB,EAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE;YACjD,IAAI,EAAE,OAAO,CAAC,WAAW;YACzB,UAAU,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE;YACpC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,OAAO,CAAC,UAAU;YACxB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"application.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":";;;AAAA,uCAcoB;AACpB,mFAAmF;AACnF,mDAU8B;AAC9B,0DAAuD;AACvD,+BAA+D;AAG/D,mBAA+B,IAAU,EAAE,QAAgC;;QACzE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,IAAA,gCAAuB,EAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE;YACjD,IAAI,EAAE,OAAO,CAAC,WAAW;YACzB,UAAU,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE;YACpC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,OAAO,CAAC,UAAU;YACxB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,QAAQ,EAAE,iBAAiB;oBAC3B,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,OAAO,EAAE;wBACP,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC;qBAC3D;iBACF;gBACD,KAAK,EAAE;oBACL,QAAQ,EAAE,iBAAiB;o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AAC,IAAI,CAAC,CAAC;SAC3B;QAED,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,EAAE;YACvC,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAgB,EAAC,IAAI,EAAE;gBAChD,OAAO,EAAE,OAAO,CAAC,WAAW;gBAC5B,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,MAAM;aACjE,CAAC,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SAC1B;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAvLD,4BAuLC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
import { CypressGeneratorSchema } from './schema';
|
|
3
|
+
export default function (tree: Tree, options: CypressGeneratorSchema): Promise<GeneratorCallback>;
|
|
@@ -4,20 +4,22 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const package_json_1 = require("nx/package.json");
|
|
6
6
|
function default_1(tree, options) {
|
|
7
|
+
var _a, _b, _c, _d;
|
|
7
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
(_a = options.baseUrl) !== null && _a !== void 0 ? _a : (options.baseUrl = 'http://localhost:3000');
|
|
8
10
|
const { cypressInitGenerator, cypressProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', package_json_1.version);
|
|
9
11
|
const initSideEffects = yield cypressInitGenerator(tree, {});
|
|
10
12
|
const projSideEffects = yield cypressProjectGenerator(tree, Object.assign(Object.assign({}, options), { standaloneConfig: true }));
|
|
11
|
-
const
|
|
12
|
-
tree.delete((0, devkit_1.joinPathFragments)(
|
|
13
|
-
tree.write((0, devkit_1.joinPathFragments)(
|
|
13
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.name);
|
|
14
|
+
tree.delete((0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'support', 'app.po.ts'));
|
|
15
|
+
tree.write((0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'e2e', 'app.cy.ts'), `describe('webapp', () => {
|
|
14
16
|
beforeEach(() => cy.visit('/'));
|
|
15
17
|
|
|
16
18
|
it('should display welcome message', () => {
|
|
17
19
|
cy.get('h1').contains('Welcome to Remix');
|
|
18
20
|
});
|
|
19
21
|
});`);
|
|
20
|
-
const supportFilePath = (0, devkit_1.joinPathFragments)(
|
|
22
|
+
const supportFilePath = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'support', 'e2e.ts');
|
|
21
23
|
const supportContent = tree.read(supportFilePath, 'utf-8');
|
|
22
24
|
tree.write(supportFilePath, `${supportContent}
|
|
23
25
|
|
|
@@ -34,6 +36,26 @@ Cypress.on("uncaught:exception", (err) => {
|
|
|
34
36
|
return false;
|
|
35
37
|
}
|
|
36
38
|
});`);
|
|
39
|
+
// run-commands won't emit { success: true, baseUrl: '...' } to Cypress executor.
|
|
40
|
+
// We'll wire it up manually and skip serve from Cypress.
|
|
41
|
+
projectConfig.targets.e2e.options.skipServe = true;
|
|
42
|
+
projectConfig.targets.e2e.options.baseUrl =
|
|
43
|
+
(_b = options.baseUrl) !== null && _b !== void 0 ? _b : 'http://localhost:3000';
|
|
44
|
+
projectConfig.targets.e2e.dependsOn = ['dev-server'];
|
|
45
|
+
delete projectConfig.targets.e2e.options.devServerTarget;
|
|
46
|
+
(_d = (_c = projectConfig.targets.e2e) === null || _c === void 0 ? void 0 : _c.configurations) === null || _d === void 0 ? true : delete _d.production.devServerTarget;
|
|
47
|
+
projectConfig.targets['dev-server'] = {
|
|
48
|
+
command: `nx serve ${options.project}`,
|
|
49
|
+
options: {
|
|
50
|
+
readyWhen: 'Server started',
|
|
51
|
+
},
|
|
52
|
+
configurations: {
|
|
53
|
+
production: {
|
|
54
|
+
command: `nx serve ${options.project} --configuration=production`,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.name, projectConfig);
|
|
37
59
|
// returning this in case the cypress generator has any side effects
|
|
38
60
|
return () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
61
|
yield initSideEffects();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/cypress/cypress.impl.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"cypress.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/cypress/cypress.impl.ts"],"names":[],"mappings":";;;AAAA,uCAOoB;AAEpB,kDAAuD;AAGvD,mBACE,IAAU,EACV,OAA+B;;;QAE/B,MAAA,OAAO,CAAC,OAAO,oCAAf,OAAO,CAAC,OAAO,GAAK,uBAAuB,EAAC;QAC5C,MAAM,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,GAAG,IAAA,sBAAa,EACrE,aAAa,EACb,sBAAS,CACV,CAAC;QAEF,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7D,MAAM,eAAe,GAAG,MAAM,uBAAuB,CAAC,IAAI,kCACrD,OAAO,KACV,gBAAgB,EAAE,IAAI,IACtB,CAAC;QAEH,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,CACT,IAAA,0BAAiB,EAAC,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,CACpE,CAAC;QACF,IAAI,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e,EAAE,CAAC;YACxB,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC,CAAA,CAAC;;CACH;AAnFD,4BAmFC"}
|
|
@@ -4,5 +4,8 @@ export interface NormalizedSchema extends RemixGeneratorSchema {
|
|
|
4
4
|
appName: string;
|
|
5
5
|
projectRoot: string;
|
|
6
6
|
parsedTags: string[];
|
|
7
|
+
unitTestRunner?: 'jest' | 'none' | 'vitest';
|
|
8
|
+
e2eTestRunner?: 'cypress' | 'none';
|
|
9
|
+
js?: boolean;
|
|
7
10
|
}
|
|
8
11
|
export declare function normalizeOptions(tree: Tree, options: RemixGeneratorSchema): NormalizedSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/preset/lib/normalize-options.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/preset/lib/normalize-options.ts"],"names":[],"mappings":";;;AAYA,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAA6B;IAE7B,sKAAsK;IACtK,6EAA6E;IAC7E,+KAA+K;IAC/K,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAC7B,MAAM,WAAW,GAAG,YAAY,OAAO,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI;QAC7B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,CAAC,CAAC,EAAE,CAAC;IAEP,uCACK,OAAO,KACV,OAAO;QACP,WAAW;QACX,UAAU,IACV;AACJ,CAAC;AAnBD,4CAmBC"}
|
|
@@ -7,6 +7,7 @@ const application_impl_1 = require("../application/application.impl");
|
|
|
7
7
|
const setup_impl_1 = require("../setup/setup.impl");
|
|
8
8
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
9
9
|
function default_1(tree, _options) {
|
|
10
|
+
var _a, _b, _c;
|
|
10
11
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
12
|
const options = (0, normalize_options_1.normalizeOptions)(tree, _options);
|
|
12
13
|
const tasks = [];
|
|
@@ -17,6 +18,9 @@ function default_1(tree, _options) {
|
|
|
17
18
|
tags: options.tags,
|
|
18
19
|
skipFormat: true,
|
|
19
20
|
rootProject: true,
|
|
21
|
+
unitTestRunner: (_a = options.unitTestRunner) !== null && _a !== void 0 ? _a : 'vitest',
|
|
22
|
+
e2eTestRunner: (_b = options.e2eTestRunner) !== null && _b !== void 0 ? _b : 'cypress',
|
|
23
|
+
js: (_c = options.js) !== null && _c !== void 0 ? _c : false,
|
|
20
24
|
});
|
|
21
25
|
tasks.push(appGenTask);
|
|
22
26
|
tree.delete('apps');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/preset/preset.impl.ts"],"names":[],"mappings":";;;AAAA,uCAAkE;AAElE,uCAA8C;AAC9C,sEAAmE;AACnE,oDAAiD;AACjD,+DAA2D;AAG3D,mBAA+B,IAAU,EAAE,QAA8B
|
|
1
|
+
{"version":3,"file":"preset.impl.js","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/preset/preset.impl.ts"],"names":[],"mappings":";;;AAAA,uCAAkE;AAElE,uCAA8C;AAC9C,sEAAmE;AACnE,oDAAiD;AACjD,+DAA2D;AAG3D,mBAA+B,IAAU,EAAE,QAA8B;;;QACvE,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,MAAM,YAAY,GAAG,MAAM,IAAA,oBAAc,EAAC,IAAI,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEzB,MAAM,UAAU,GAAG,MAAM,IAAA,0BAAoB,EAAC,IAAI,EAAE;YAClD,IAAI,EAAE,OAAO,CAAC,OAAO;YACrB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,QAAQ;YAClD,aAAa,EAAE,MAAA,OAAO,CAAC,aAAa,mCAAI,SAAS;YACjD,EAAE,EAAE,MAAA,OAAO,CAAC,EAAE,mCAAI,KAAK;SACxB,CAAC,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEvB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEpB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;;CACnC;AAxBD,4BAwBC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
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
|
-
"
|
|
4
|
+
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
5
|
+
|
|
6
|
+
const config: StorybookConfig = {
|
|
5
7
|
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
|
6
|
-
addons: ['@storybook/addon-essentials'],
|
|
8
|
+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
|
7
9
|
framework: {
|
|
8
10
|
name: '@storybook/react-vite',
|
|
9
11
|
options: {
|
|
@@ -23,9 +25,11 @@ export default config;
|
|
|
23
25
|
`;
|
|
24
26
|
|
|
25
27
|
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework none 1`] = `
|
|
26
|
-
"
|
|
28
|
+
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
29
|
+
|
|
30
|
+
const config: StorybookConfig = {
|
|
27
31
|
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
|
28
|
-
addons: ['@storybook/addon-essentials'],
|
|
32
|
+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
|
29
33
|
framework: {
|
|
30
34
|
name: '@storybook/react-vite',
|
|
31
35
|
options: {
|
|
@@ -45,9 +49,11 @@ export default config;
|
|
|
45
49
|
`;
|
|
46
50
|
|
|
47
51
|
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework vitest 1`] = `
|
|
48
|
-
"
|
|
52
|
+
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
53
|
+
|
|
54
|
+
const config: StorybookConfig = {
|
|
49
55
|
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
|
50
|
-
addons: ['@storybook/addon-essentials'],
|
|
56
|
+
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
|
51
57
|
framework: {
|
|
52
58
|
name: '@storybook/react-vite',
|
|
53
59
|
options: {
|