@nx/nuxt 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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nuxt",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.4.0-beta.1",
|
|
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": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"tslib": "^2.3.0",
|
|
33
33
|
"@nuxt/kit": "^3.10.0",
|
|
34
|
-
"@nx/devkit": "20.
|
|
35
|
-
"@nx/js": "20.
|
|
36
|
-
"@nx/eslint": "20.
|
|
37
|
-
"@nx/vue": "20.
|
|
38
|
-
"@nx/vite": "20.
|
|
34
|
+
"@nx/devkit": "20.4.0-beta.1",
|
|
35
|
+
"@nx/js": "20.4.0-beta.1",
|
|
36
|
+
"@nx/eslint": "20.4.0-beta.1",
|
|
37
|
+
"@nx/vue": "20.4.0-beta.1",
|
|
38
|
+
"@nx/vite": "20.4.0-beta.1",
|
|
39
39
|
"@phenomnomnominal/tsquery": "~5.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -18,6 +18,7 @@ const node_child_process_1 = require("node:child_process");
|
|
|
18
18
|
const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
|
|
19
19
|
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
20
20
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
21
|
+
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
21
22
|
async function applicationGenerator(tree, schema) {
|
|
22
23
|
const tasks = [];
|
|
23
24
|
const jsInitTask = await (0, js_1.initGenerator)(tree, {
|
|
@@ -25,6 +26,7 @@ async function applicationGenerator(tree, schema) {
|
|
|
25
26
|
tsConfigName: schema.rootProject ? 'tsconfig.json' : 'tsconfig.base.json',
|
|
26
27
|
skipFormat: true,
|
|
27
28
|
addTsPlugin: schema.useTsSolution,
|
|
29
|
+
platform: 'web',
|
|
28
30
|
});
|
|
29
31
|
tasks.push(jsInitTask);
|
|
30
32
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
|
|
@@ -124,6 +126,7 @@ async function applicationGenerator(tree, schema) {
|
|
|
124
126
|
if (options.isUsingTsSolutionConfig) {
|
|
125
127
|
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
126
128
|
}
|
|
129
|
+
(0, sort_fields_1.sortPackageJsonFields)(tree, options.appProjectRoot);
|
|
127
130
|
if (!options.skipFormat)
|
|
128
131
|
await (0, devkit_1.formatFiles)(tree);
|
|
129
132
|
tasks.push(() => {
|
|
@@ -9,6 +9,8 @@ async function nuxtInitGenerator(host, schema) {
|
|
|
9
9
|
await (0, add_plugin_1.addPluginV1)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/nuxt/plugin', plugin_1.createNodes, {
|
|
10
10
|
buildTargetName: ['build', 'nuxt:build', 'nuxt-build'],
|
|
11
11
|
serveTargetName: ['serve', 'nuxt:serve', 'nuxt-serve'],
|
|
12
|
+
buildDepsTargetName: ['build-deps', 'nuxt:build-deps', 'nuxt-build-deps'],
|
|
13
|
+
watchDepsTargetName: ['watch-deps', 'nuxt:watch-deps', 'nuxt-watch-deps'],
|
|
12
14
|
}, schema.updatePackageScripts);
|
|
13
15
|
let installTask = () => { };
|
|
14
16
|
if (!schema.skipPackageJson) {
|
package/src/plugins/plugin.d.ts
CHANGED
|
@@ -5,5 +5,7 @@ export interface NuxtPluginOptions {
|
|
|
5
5
|
serveTargetName?: string;
|
|
6
6
|
serveStaticTargetName?: string;
|
|
7
7
|
buildStaticTargetName?: string;
|
|
8
|
+
buildDepsTargetName?: string;
|
|
9
|
+
watchDepsTargetName?: string;
|
|
8
10
|
}
|
|
9
11
|
export declare const createNodes: CreateNodes<NuxtPluginOptions>;
|
package/src/plugins/plugin.js
CHANGED
|
@@ -10,8 +10,10 @@ const js_1 = require("@nx/js");
|
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const executor_utils_1 = require("../utils/executor-utils");
|
|
13
|
+
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
13
14
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, 'nuxt.hash');
|
|
14
15
|
const targetsCache = readTargetsCache();
|
|
16
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
15
17
|
function readTargetsCache() {
|
|
16
18
|
return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
17
19
|
}
|
|
@@ -59,6 +61,7 @@ async function buildNuxtTargets(configFilePath, projectRoot, options, context) {
|
|
|
59
61
|
targets[options.serveTargetName] = serveTarget(projectRoot);
|
|
60
62
|
targets[options.serveStaticTargetName] = serveStaticTarget(options);
|
|
61
63
|
targets[options.buildStaticTargetName] = buildStaticTarget(options.buildStaticTargetName, namedInputs, buildOutputs, projectRoot);
|
|
64
|
+
(0, util_1.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
|
|
62
65
|
return targets;
|
|
63
66
|
}
|
|
64
67
|
function buildTarget(buildTargetName, namedInputs, buildOutputs, projectRoot) {
|