@nx/nuxt 20.3.1 → 20.4.0-beta.0
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/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nuxt",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.4.0-beta.0",
|
|
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.0",
|
|
35
|
+
"@nx/js": "20.4.0-beta.0",
|
|
36
|
+
"@nx/eslint": "20.4.0-beta.0",
|
|
37
|
+
"@nx/vue": "20.4.0-beta.0",
|
|
38
|
+
"@nx/vite": "20.4.0-beta.0",
|
|
39
39
|
"@phenomnomnominal/tsquery": "~5.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -108,6 +108,22 @@ async function applicationGenerator(tree, schema) {
|
|
|
108
108
|
tasks.push(await (0, add_e2e_1.addE2e)(tree, options));
|
|
109
109
|
if (options.js)
|
|
110
110
|
(0, devkit_1.toJS)(tree);
|
|
111
|
+
if (options.isUsingTsSolutionConfig) {
|
|
112
|
+
(0, ts_solution_setup_1.updateTsconfigFiles)(tree, options.appProjectRoot, 'tsconfig.app.json', {
|
|
113
|
+
jsx: 'preserve',
|
|
114
|
+
jsxImportSource: 'vue',
|
|
115
|
+
module: 'esnext',
|
|
116
|
+
moduleResolution: 'bundler',
|
|
117
|
+
resolveJsonModule: true,
|
|
118
|
+
}, options.linter === 'eslint'
|
|
119
|
+
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
120
|
+
: undefined);
|
|
121
|
+
}
|
|
122
|
+
// If we are using the new TS solution
|
|
123
|
+
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
124
|
+
if (options.isUsingTsSolutionConfig) {
|
|
125
|
+
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
126
|
+
}
|
|
111
127
|
if (!options.skipFormat)
|
|
112
128
|
await (0, devkit_1.formatFiles)(tree);
|
|
113
129
|
tasks.push(() => {
|
|
@@ -121,17 +137,6 @@ async function applicationGenerator(tree, schema) {
|
|
|
121
137
|
console.error(`Failed to run \`nuxi prepare\` in "${options.appProjectRoot}". Please run the command manually.`);
|
|
122
138
|
}
|
|
123
139
|
});
|
|
124
|
-
if (options.isUsingTsSolutionConfig) {
|
|
125
|
-
(0, ts_solution_setup_1.updateTsconfigFiles)(tree, options.appProjectRoot, 'tsconfig.app.json', {
|
|
126
|
-
jsx: 'preserve',
|
|
127
|
-
jsxImportSource: 'vue',
|
|
128
|
-
module: 'esnext',
|
|
129
|
-
moduleResolution: 'bundler',
|
|
130
|
-
resolveJsonModule: true,
|
|
131
|
-
}, options.linter === 'eslint'
|
|
132
|
-
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
133
|
-
: undefined);
|
|
134
|
-
}
|
|
135
140
|
tasks.push(() => {
|
|
136
141
|
(0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
|
|
137
142
|
});
|
|
@@ -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) {
|