@nx/nuxt 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/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.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/init/init.js +2 -2
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +15 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nuxt",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nuxt plugin for Nx contains executors and generators for managing Nuxt applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"tslib": "^2.3.0",
|
|
47
47
|
"@nuxt/kit": "^3.10.0 || ^4.0.0",
|
|
48
|
-
"@nx/devkit": "23.0.0-beta.
|
|
49
|
-
"@nx/js": "23.0.0-beta.
|
|
50
|
-
"@nx/eslint": "23.0.0-beta.
|
|
51
|
-
"@nx/vue": "23.0.0-beta.
|
|
52
|
-
"@nx/vite": "23.0.0-beta.
|
|
53
|
-
"@nx/vitest": "23.0.0-beta.
|
|
48
|
+
"@nx/devkit": "23.0.0-beta.7",
|
|
49
|
+
"@nx/js": "23.0.0-beta.7",
|
|
50
|
+
"@nx/eslint": "23.0.0-beta.7",
|
|
51
|
+
"@nx/vue": "23.0.0-beta.7",
|
|
52
|
+
"@nx/vite": "23.0.0-beta.7",
|
|
53
|
+
"@nx/vitest": "23.0.0-beta.7",
|
|
54
54
|
"semver": "^7.5.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"nx": "23.0.0-beta.
|
|
57
|
+
"nx": "23.0.0-beta.7"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@nuxt/schema": "^3.10.0 || ^4.0.0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/nuxt/src/generators/application/application.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/nuxt/src/generators/application/application.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,iBAAiB,EAKjB,IAAI,EAEL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA4BlC,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAKpE;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAiN5E;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.applicationGenerator = applicationGenerator;
|
|
4
4
|
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
8
9
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
@@ -14,7 +15,6 @@ const add_linting_1 = require("../../utils/add-linting");
|
|
|
14
15
|
const add_vitest_1 = require("./lib/add-vitest");
|
|
15
16
|
const vue_1 = require("@nx/vue");
|
|
16
17
|
const ensure_dependencies_1 = require("./lib/ensure-dependencies");
|
|
17
|
-
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
18
18
|
const node_child_process_1 = require("node:child_process");
|
|
19
19
|
const node_path_1 = require("node:path");
|
|
20
20
|
const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
|
|
@@ -163,7 +163,7 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
tasks.push(() => {
|
|
166
|
-
(0,
|
|
166
|
+
(0, internal_1.logShowProjectCommand)(options.projectName);
|
|
167
167
|
});
|
|
168
168
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
169
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nuxt/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nuxt/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,EAGjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,wBAAsB,MAAM,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CA8G5B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
const e2e_web_server_info_utils_1 = require("@nx/devkit/src/generators/e2e-web-server-info-utils");
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
|
7
7
|
async function addE2e(host, options) {
|
|
8
8
|
const e2eWebServerInfo = await getNuxtE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `nuxt.config.${options.js ? 'js' : 'ts'}`));
|
|
@@ -96,7 +96,7 @@ async function getNuxtE2EWebServerInfo(tree, projectName, configFilePath) {
|
|
|
96
96
|
nxJson.targetDefaults?.['serve'].options?.port) {
|
|
97
97
|
e2ePort = nxJson.targetDefaults?.['serve'].options?.port;
|
|
98
98
|
}
|
|
99
|
-
return (0,
|
|
99
|
+
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
100
100
|
plugin: '@nx/nuxt/plugin',
|
|
101
101
|
serveTargetName: 'serveTargetName',
|
|
102
102
|
serveStaticTargetName: 'serveStaticTargetName',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
6
|
const version_utils_1 = require("../../../utils/version-utils");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
|
-
await (0,
|
|
9
|
-
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0,
|
|
8
|
+
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
9
|
+
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
10
10
|
name: options.name,
|
|
11
11
|
projectType: 'application',
|
|
12
12
|
directory: options.directory,
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nuxtInitGenerator = nuxtInitGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
7
7
|
const utils_1 = require("./lib/utils");
|
|
8
8
|
async function nuxtInitGenerator(host, schema) {
|
|
9
|
-
await (0,
|
|
9
|
+
await (0, internal_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/nuxt/plugin', plugin_1.createNodesV2, {
|
|
10
10
|
buildTargetName: ['build', 'nuxt:build', 'nuxt-build'],
|
|
11
11
|
serveTargetName: ['serve', 'nuxt:serve', 'nuxt-serve'],
|
|
12
12
|
buildDepsTargetName: ['build-deps', 'nuxt:build-deps', 'nuxt-build-deps'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/nuxt/src/plugins/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/nuxt/src/plugins/plugin.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,aAAa,EAMd,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAiBxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createNodes = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
6
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
7
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
8
6
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
9
7
|
const js_1 = require("@nx/js");
|
|
10
8
|
const path_1 = require("path");
|
|
@@ -12,28 +10,21 @@ const fs_1 = require("fs");
|
|
|
12
10
|
const executor_utils_1 = require("../utils/executor-utils");
|
|
13
11
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
14
12
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'nuxt.hash');
|
|
15
|
-
const targetsCache =
|
|
16
|
-
function readTargetsCache() {
|
|
17
|
-
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
18
|
-
}
|
|
19
|
-
function writeTargetsToCache() {
|
|
20
|
-
const oldCache = readTargetsCache();
|
|
21
|
-
(0, devkit_1.writeJsonFile)(cachePath, {
|
|
22
|
-
...oldCache,
|
|
23
|
-
...targetsCache,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
13
|
+
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
26
14
|
exports.createNodes = [
|
|
27
15
|
'**/nuxt.config.{js,ts,mjs,mts,cjs,cts}',
|
|
28
16
|
async (files, options, context) => {
|
|
29
17
|
//TODO(@nrwl/nx-vue-reviewers): This should batch hashing like our other plugins.
|
|
30
|
-
const
|
|
31
|
-
|
|
18
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
19
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
20
|
+
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
21
|
+
const result = await (0, devkit_1.createNodesFromFiles)((configFile, opts, ctx) => createNodesInternal(configFile, opts, ctx, pmc, lockFileName), files, options, context);
|
|
22
|
+
targetsCache.writeToDisk();
|
|
32
23
|
return result;
|
|
33
24
|
},
|
|
34
25
|
];
|
|
35
26
|
exports.createNodesV2 = exports.createNodes;
|
|
36
|
-
async function createNodesInternal(configFilePath, options, context) {
|
|
27
|
+
async function createNodesInternal(configFilePath, options, context, pmc, lockFileName) {
|
|
37
28
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
38
29
|
// Do not create a project if package.json and project.json isn't there.
|
|
39
30
|
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
@@ -42,14 +33,15 @@ async function createNodesInternal(configFilePath, options, context) {
|
|
|
42
33
|
return {};
|
|
43
34
|
}
|
|
44
35
|
options = normalizeOptions(options);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
const hash = await (0, internal_1.calculateHashForCreateNodes)(projectRoot, options, context, [lockFileName]);
|
|
37
|
+
if (!targetsCache.has(hash)) {
|
|
38
|
+
targetsCache.set(hash, await buildNuxtTargets(configFilePath, projectRoot, options, context, pmc));
|
|
39
|
+
}
|
|
48
40
|
return {
|
|
49
41
|
projects: {
|
|
50
42
|
[projectRoot]: {
|
|
51
43
|
root: projectRoot,
|
|
52
|
-
targets: targetsCache
|
|
44
|
+
targets: targetsCache.get(hash),
|
|
53
45
|
},
|
|
54
46
|
},
|
|
55
47
|
};
|
|
@@ -57,7 +49,7 @@ async function createNodesInternal(configFilePath, options, context) {
|
|
|
57
49
|
async function buildNuxtTargets(configFilePath, projectRoot, options, context, pmc) {
|
|
58
50
|
const nuxtConfig = await getInfoFromNuxtConfig(configFilePath, context, projectRoot);
|
|
59
51
|
const { buildOutputs } = getOutputs(nuxtConfig, projectRoot);
|
|
60
|
-
const namedInputs = (0,
|
|
52
|
+
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
61
53
|
const targets = {};
|
|
62
54
|
targets[options.buildTargetName] = buildTarget(options.buildTargetName, namedInputs, buildOutputs, projectRoot);
|
|
63
55
|
targets[options.serveTargetName] = serveTarget(projectRoot);
|
|
@@ -134,7 +126,7 @@ async function getInfoFromNuxtConfig(configFilePath, context, projectRoot) {
|
|
|
134
126
|
});
|
|
135
127
|
}
|
|
136
128
|
else {
|
|
137
|
-
config = await (0,
|
|
129
|
+
config = await (0, internal_1.loadConfigFile)((0, path_1.join)(context.workspaceRoot, configFilePath));
|
|
138
130
|
}
|
|
139
131
|
return {
|
|
140
132
|
buildDir: config?.buildDir ??
|