@nx/remix 23.0.0-beta.5 → 23.0.0-beta.7
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 +8 -8
- package/src/executors/serve/serve.impl.js +2 -2
- package/src/generators/application/application.impl.d.ts.map +1 -1
- package/src/generators/application/application.impl.js +2 -2
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +2 -2
- package/src/generators/application/lib/normalize-options.js +3 -3
- package/src/generators/convert-to-inferred/convert-to-inferred.js +4 -5
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +1 -1
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.js +2 -2
- package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts +1 -1
- package/src/generators/convert-to-inferred/lib/serve-post-target-transformer.d.ts.map +1 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +2 -2
- package/src/generators/library/lib/normalize-options.js +3 -3
- package/src/generators/resource-route/resource-route.impl.js +2 -2
- package/src/generators/route/route.impl.d.ts.map +1 -1
- package/src/generators/route/route.impl.js +2 -3
- package/src/generators/style/style.impl.d.ts.map +1 -1
- package/src/generators/style/style.impl.js +2 -2
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +15 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/remix",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.7",
|
|
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",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"migrations": "./migrations.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nx/devkit": "23.0.0-beta.
|
|
34
|
-
"@nx/js": "23.0.0-beta.
|
|
35
|
-
"@nx/react": "23.0.0-beta.
|
|
36
|
-
"@nx/workspace": "23.0.0-beta.
|
|
33
|
+
"@nx/devkit": "23.0.0-beta.7",
|
|
34
|
+
"@nx/js": "23.0.0-beta.7",
|
|
35
|
+
"@nx/react": "23.0.0-beta.7",
|
|
36
|
+
"@nx/workspace": "23.0.0-beta.7",
|
|
37
37
|
"tslib": "^2.3.0",
|
|
38
|
-
"@phenomnomnominal/tsquery": "~6.
|
|
38
|
+
"@phenomnomnominal/tsquery": "~6.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"nx": "23.0.0-beta.
|
|
42
|
-
"@nx/vitest": "23.0.0-beta.
|
|
41
|
+
"nx": "23.0.0-beta.7",
|
|
42
|
+
"@nx/vitest": "23.0.0-beta.7"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@remix-run/dev": "^2.17.3"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = serveExecutor;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
7
7
|
const node_child_process_1 = require("node:child_process");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
@@ -46,7 +46,7 @@ async function* serveExecutor(schema, context) {
|
|
|
46
46
|
? process.env.NODE_ENV
|
|
47
47
|
: 'development';
|
|
48
48
|
process.env.PORT = `${options.port}`;
|
|
49
|
-
yield* (0,
|
|
49
|
+
yield* (0, internal_1.createAsyncIterable)(async ({ done, next, error }) => {
|
|
50
50
|
const server = (0, node_child_process_1.fork)(remixBin, ['dev', ...args], {
|
|
51
51
|
cwd: (0, node_path_1.join)(devkit_1.workspaceRoot, projectRoot),
|
|
52
52
|
stdio: 'inherit',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"application.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/application/application.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,iBAAiB,EAMjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA4BpB,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"}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.remixApplicationGenerator = remixApplicationGenerator;
|
|
4
4
|
exports.remixApplicationGeneratorInternal = remixApplicationGeneratorInternal;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
8
8
|
const js_1 = require("@nx/js");
|
|
9
9
|
const create_ts_config_1 = require("@nx/js/src/utils/typescript/create-ts-config");
|
|
10
10
|
const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
|
|
@@ -225,7 +225,7 @@ export default {...nxPreset};
|
|
|
225
225
|
await (0, devkit_1.formatFiles)(tree);
|
|
226
226
|
}
|
|
227
227
|
tasks.push(() => {
|
|
228
|
-
(0,
|
|
228
|
+
(0, internal_1.logShowProjectCommand)(options.projectName);
|
|
229
229
|
});
|
|
230
230
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
231
231
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,EAIT,iBAAiB,EAGlB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,wBAAsB,MAAM,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAoH5B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addE2E = addE2E;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const versions_1 = require("../../../utils/versions");
|
|
6
|
-
const e2e_web_server_info_utils_1 = require("@nx/devkit/src/generators/e2e-web-server-info-utils");
|
|
7
7
|
async function addE2E(tree, options) {
|
|
8
8
|
const hasRemixPlugin = (0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
|
9
9
|
? p === '@nx/remix/plugin'
|
|
@@ -102,7 +102,7 @@ async function getRemixE2EWebServerInfo(tree, projectName, configFilePath, isPlu
|
|
|
102
102
|
nxJson.targetDefaults?.[defaultServeTarget].options?.port) {
|
|
103
103
|
e2ePort = nxJson.targetDefaults?.[defaultServeTarget].options?.port;
|
|
104
104
|
}
|
|
105
|
-
return (0,
|
|
105
|
+
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
106
106
|
plugin: '@nx/remix/plugin',
|
|
107
107
|
serveTargetName: 'serveTargetName',
|
|
108
108
|
serveStaticTargetName: 'serveStaticTargetName',
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
7
|
async function normalizeOptions(tree, options) {
|
|
8
|
-
await (0,
|
|
9
|
-
const { projectName, projectRoot, importPath } = await (0,
|
|
8
|
+
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
9
|
+
const { projectName, projectRoot, importPath } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
10
10
|
name: options.name,
|
|
11
11
|
projectType: 'application',
|
|
12
12
|
directory: options.directory,
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToInferred = convertToInferred;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
7
|
const build_post_target_transformer_1 = require("./lib/build-post-target-transformer");
|
|
9
8
|
const serve_post_target_transformer_1 = require("./lib/serve-post-target-transformer");
|
|
10
9
|
async function convertToInferred(tree, options) {
|
|
11
10
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
12
|
-
const migrationLogs = new
|
|
13
|
-
const migratedProjects = await (0,
|
|
11
|
+
const migrationLogs = new internal_1.AggregatedLog();
|
|
12
|
+
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/remix/plugin', plugin_1.createNodesV2, {
|
|
14
13
|
buildTargetName: 'build',
|
|
15
14
|
devTargetName: 'dev',
|
|
16
15
|
startTargetName: 'start',
|
|
@@ -33,7 +32,7 @@ async function convertToInferred(tree, options) {
|
|
|
33
32
|
},
|
|
34
33
|
], options.project);
|
|
35
34
|
if (migratedProjects.size === 0) {
|
|
36
|
-
throw new
|
|
35
|
+
throw new internal_1.NoTargetsToMigrateError();
|
|
37
36
|
}
|
|
38
37
|
if (!options.skipFormat) {
|
|
39
38
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Tree, type TargetConfiguration } from '@nx/devkit';
|
|
2
|
-
import { AggregatedLog } from '@nx/devkit/
|
|
2
|
+
import { AggregatedLog } from '@nx/devkit/internal';
|
|
3
3
|
export declare function buildPostTargetTransformer(migrationLogs: AggregatedLog): (target: TargetConfiguration, tree: Tree, projectDetails: {
|
|
4
4
|
projectName: string;
|
|
5
5
|
root: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/convert-to-inferred/lib/build-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"build-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/convert-to-inferred/lib/build-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,EAAwB,MAAM,qBAAqB,CAAC;AAG1E,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,IAEnE,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAqDnD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildPostTargetTransformer = buildPostTargetTransformer;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const utils_1 = require("./utils");
|
|
5
|
-
const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
|
|
6
6
|
function buildPostTargetTransformer(migrationLogs) {
|
|
7
7
|
return (target, tree, projectDetails, inferredTargetConfiguration) => {
|
|
8
8
|
const remixConfigPath = (0, utils_1.getConfigFilePath)(tree, projectDetails.root);
|
|
@@ -27,7 +27,7 @@ function buildPostTargetTransformer(migrationLogs) {
|
|
|
27
27
|
}
|
|
28
28
|
if (target.outputs) {
|
|
29
29
|
target.outputs = target.outputs.filter((out) => !out.includes('options.outputPath'));
|
|
30
|
-
(0,
|
|
30
|
+
(0, internal_1.processTargetOutputs)(target, [], inferredTargetConfiguration, {
|
|
31
31
|
projectName: projectDetails.projectName,
|
|
32
32
|
projectRoot: projectDetails.root,
|
|
33
33
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Tree, type TargetConfiguration } from '@nx/devkit';
|
|
2
|
-
import { AggregatedLog } from '@nx/devkit/
|
|
2
|
+
import { AggregatedLog } from '@nx/devkit/internal';
|
|
3
3
|
export declare function servePostTargetTransformer(migrationLogs: AggregatedLog): (target: TargetConfiguration, tree: Tree, projectDetails: {
|
|
4
4
|
projectName: string;
|
|
5
5
|
root: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/convert-to-inferred/lib/serve-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/remix/src/generators/convert-to-inferred/lib/serve-post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,aAAa,IAEnE,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAwCnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAGjB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,8BAE7D;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,8BAgE3E;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.remixInitGenerator = remixInitGenerator;
|
|
4
4
|
exports.remixInitGeneratorInternal = remixInitGeneratorInternal;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
7
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
8
|
const versions_1 = require("../../utils/versions");
|
|
9
9
|
function remixInitGenerator(tree, options) {
|
|
@@ -25,7 +25,7 @@ async function remixInitGeneratorInternal(tree, options) {
|
|
|
25
25
|
nxJson.useInferencePlugins !== false;
|
|
26
26
|
options.addPlugin ??= addPluginDefault;
|
|
27
27
|
if (options.addPlugin) {
|
|
28
|
-
await (0,
|
|
28
|
+
await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/remix/plugin', plugin_1.createNodesV2, {
|
|
29
29
|
startTargetName: ['start', 'remix:start', 'remix-start'],
|
|
30
30
|
buildTargetName: ['build', 'remix:build', 'remix-build'],
|
|
31
31
|
devTargetName: ['dev', 'remix:dev', 'remix-dev'],
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
7
|
async function normalizeOptions(tree, options) {
|
|
8
|
-
await (0,
|
|
9
|
-
const { projectName, projectRoot, importPath } = await (0,
|
|
8
|
+
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
9
|
+
const { projectName, projectRoot, importPath } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
10
10
|
name: options.name,
|
|
11
11
|
projectType: 'library',
|
|
12
12
|
directory: options.directory,
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const remix_route_utils_1 = require("../../utils/remix-route-utils");
|
|
8
8
|
const action_impl_1 = tslib_1.__importDefault(require("../action/action.impl"));
|
|
9
9
|
const loader_impl_1 = tslib_1.__importDefault(require("../loader/loader.impl"));
|
|
10
10
|
async function default_1(tree, options) {
|
|
11
|
-
const { filePath: routeFilePath } = await (0,
|
|
11
|
+
const { filePath: routeFilePath } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
12
12
|
path: options.path.replace(/^\//, '').replace(/\/$/, ''),
|
|
13
13
|
allowedFileExtensions: ['ts', 'tsx'],
|
|
14
14
|
fileExtension: 'tsx',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/route/route.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,IAAI,EAAE,MAAM,YAAY,CAAC;AAQpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,yBAA+B,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"route.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/route/route.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,IAAI,EAAE,MAAM,YAAY,CAAC;AAQpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,yBAA+B,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,iBAkEnE"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const remix_route_utils_1 = require("../../utils/remix-route-utils");
|
|
9
9
|
const action_impl_1 = tslib_1.__importDefault(require("../action/action.impl"));
|
|
@@ -11,7 +11,7 @@ const loader_impl_1 = tslib_1.__importDefault(require("../loader/loader.impl"));
|
|
|
11
11
|
const meta_impl_1 = tslib_1.__importDefault(require("../meta/meta.impl"));
|
|
12
12
|
const style_impl_1 = tslib_1.__importDefault(require("../style/style.impl"));
|
|
13
13
|
async function default_1(tree, options) {
|
|
14
|
-
const { artifactName: name, filePath: routeFilePath } = await (0,
|
|
14
|
+
const { artifactName: name, filePath: routeFilePath } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
15
15
|
path: options.path.replace(/^\//, '').replace(/\/$/, ''),
|
|
16
16
|
allowedFileExtensions: ['ts', 'tsx'],
|
|
17
17
|
fileExtension: 'tsx',
|
|
@@ -24,7 +24,6 @@ async function default_1(tree, options) {
|
|
|
24
24
|
throw new Error(`Path already exists: ${routeFilePath}`);
|
|
25
25
|
tree.write(routeFilePath, (0, devkit_1.stripIndents) `
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
export default function ${componentName}() {
|
|
29
28
|
${options.loader
|
|
30
29
|
? `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/style/style.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/remix/src/generators/style/style.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAU5C,yBAA+B,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,iBAoEnE"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const insert_import_1 = require("../../utils/insert-import");
|
|
8
8
|
const insert_statement_after_imports_1 = require("../../utils/insert-statement-after-imports");
|
|
9
9
|
const remix_route_utils_1 = require("../../utils/remix-route-utils");
|
|
10
10
|
async function default_1(tree, options) {
|
|
11
|
-
const { project: projectName, directory, fileName, } = await (0,
|
|
11
|
+
const { project: projectName, directory, fileName, } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
12
12
|
path: options.path,
|
|
13
13
|
});
|
|
14
14
|
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/remix/src/plugins/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/remix/src/plugins/plugin.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,kBAAkB,EAGvB,aAAa,EAOd,MAAM,YAAY,CAAC;AASpB,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAID;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,kBAAkB,CA6BzD,CAAC;AAEF,eAAO,MAAM,aAAa,mCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createNodes = exports.createDependencies = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
5
6
|
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
8
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
9
|
-
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
10
8
|
const js_1 = require("@nx/js");
|
|
11
9
|
const path_1 = require("path");
|
|
12
10
|
const fs_1 = require("fs");
|
|
13
11
|
const executor_utils_1 = require("../utils/executor-utils");
|
|
14
12
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
15
13
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
16
|
-
function readTargetsCache(cachePath) {
|
|
17
|
-
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
18
|
-
}
|
|
19
|
-
function writeTargetsToCache(cachePath, results) {
|
|
20
|
-
(0, devkit_1.writeJsonFile)(cachePath, results);
|
|
21
|
-
}
|
|
22
14
|
/**
|
|
23
15
|
* @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
|
|
24
16
|
*/
|
|
@@ -32,18 +24,20 @@ exports.createNodes = [
|
|
|
32
24
|
async (configFilePaths, options, context) => {
|
|
33
25
|
const optionsHash = (0, file_hasher_1.hashObject)(options);
|
|
34
26
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `remix-${optionsHash}.hash`);
|
|
35
|
-
const targetsCache =
|
|
36
|
-
const
|
|
27
|
+
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
28
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
29
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
30
|
+
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
37
31
|
try {
|
|
38
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, (0, ts_solution_setup_1.isUsingTsSolutionSetup)(), pmc), configFilePaths, options, context);
|
|
32
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, (0, ts_solution_setup_1.isUsingTsSolutionSetup)(), pmc, lockFileName), configFilePaths, options, context);
|
|
39
33
|
}
|
|
40
34
|
finally {
|
|
41
|
-
|
|
35
|
+
targetsCache.writeToDisk();
|
|
42
36
|
}
|
|
43
37
|
},
|
|
44
38
|
];
|
|
45
39
|
exports.createNodesV2 = exports.createNodes;
|
|
46
|
-
async function createNodesInternal(configFilePath, options, context, targetsCache, isUsingTsSolutionSetup, pmc) {
|
|
40
|
+
async function createNodesInternal(configFilePath, options, context, targetsCache, isUsingTsSolutionSetup, pmc, lockFileName) {
|
|
47
41
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
48
42
|
const fullyQualifiedProjectRoot = (0, path_1.join)(context.workspaceRoot, projectRoot);
|
|
49
43
|
// Do not create a project if package.json and project.json isn't there
|
|
@@ -57,9 +51,11 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
57
51
|
if (remixCompiler === RemixCompiler.IsNotRemix) {
|
|
58
52
|
return {};
|
|
59
53
|
}
|
|
60
|
-
const hash = (await (0,
|
|
61
|
-
targetsCache
|
|
62
|
-
|
|
54
|
+
const hash = (await (0, internal_1.calculateHashForCreateNodes)(projectRoot, { ...options, isUsingTsSolutionSetup }, context, [lockFileName])) + configFilePath;
|
|
55
|
+
if (!targetsCache.has(hash)) {
|
|
56
|
+
targetsCache.set(hash, await buildRemixTargets(configFilePath, projectRoot, options, context, siblingFiles, remixCompiler, isUsingTsSolutionSetup, pmc));
|
|
57
|
+
}
|
|
58
|
+
const { targets, metadata } = targetsCache.get(hash);
|
|
63
59
|
const project = {
|
|
64
60
|
root: projectRoot,
|
|
65
61
|
targets,
|
|
@@ -72,7 +68,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
72
68
|
};
|
|
73
69
|
}
|
|
74
70
|
async function buildRemixTargets(configFilePath, projectRoot, options, context, siblingFiles, remixCompiler, isUsingTsSolutionSetup, pmc) {
|
|
75
|
-
const namedInputs = (0,
|
|
71
|
+
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
76
72
|
const { buildDirectory, assetsBuildDirectory, serverBuildPath } = await getBuildPaths(configFilePath, projectRoot, context.workspaceRoot, remixCompiler);
|
|
77
73
|
const targets = {};
|
|
78
74
|
targets[options.buildTargetName] = buildTarget(options.buildTargetName, projectRoot, buildDirectory, assetsBuildDirectory, namedInputs, remixCompiler, isUsingTsSolutionSetup);
|
|
@@ -188,7 +184,7 @@ function typecheckTarget(typecheckTargetName, projectRoot, namedInputs, siblingF
|
|
|
188
184
|
async function getBuildPaths(configFilePath, projectRoot, workspaceRoot, remixCompiler) {
|
|
189
185
|
const configPath = (0, path_1.join)(workspaceRoot, configFilePath);
|
|
190
186
|
if (remixCompiler === RemixCompiler.IsClassic) {
|
|
191
|
-
let appConfig = await (0,
|
|
187
|
+
let appConfig = await (0, internal_1.loadConfigFile)(configPath);
|
|
192
188
|
return {
|
|
193
189
|
buildDirectory: 'build',
|
|
194
190
|
serverBuildPath: appConfig.serverBuildPath ?? 'build/index.js',
|