@nx/nuxt 19.2.0 → 19.2.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 +6 -6
- package/src/generators/application/application.js +10 -1
- package/src/generators/application/files/nuxt.config.ts__tmpl__ +1 -1
- package/src/generators/application/files/src/server/api/greet.ts__tmpl__ +1 -1
- package/src/generators/application/lib/add-vitest.js +3 -2
- package/src/plugins/plugin.js +1 -1
- package/src/utils/create-ts-config.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nuxt",
|
|
3
|
-
"version": "19.2.
|
|
3
|
+
"version": "19.2.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": "19.2.
|
|
35
|
-
"@nx/js": "19.2.
|
|
36
|
-
"@nx/eslint": "19.2.
|
|
37
|
-
"@nx/vue": "19.2.
|
|
38
|
-
"@nx/vite": "19.2.
|
|
34
|
+
"@nx/devkit": "19.2.1",
|
|
35
|
+
"@nx/js": "19.2.1",
|
|
36
|
+
"@nx/eslint": "19.2.1",
|
|
37
|
+
"@nx/vue": "19.2.1",
|
|
38
|
+
"@nx/vite": "19.2.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {},
|
|
41
41
|
"publishConfig": {
|
|
@@ -14,6 +14,7 @@ const add_vitest_1 = require("./lib/add-vitest");
|
|
|
14
14
|
const vue_1 = require("@nx/vue");
|
|
15
15
|
const ensure_dependencies_1 = require("./lib/ensure-dependencies");
|
|
16
16
|
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
17
|
+
const node_child_process_1 = require("node:child_process");
|
|
17
18
|
async function applicationGenerator(tree, schema) {
|
|
18
19
|
const tasks = [];
|
|
19
20
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
|
|
@@ -25,7 +26,7 @@ async function applicationGenerator(tree, schema) {
|
|
|
25
26
|
});
|
|
26
27
|
tasks.push(jsInitTask);
|
|
27
28
|
tasks.push((0, ensure_dependencies_1.ensureDependencies)(tree, options));
|
|
28
|
-
(0, devkit_1.addProjectConfiguration)(tree, options.
|
|
29
|
+
(0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
|
|
29
30
|
root: options.appProjectRoot,
|
|
30
31
|
projectType: 'application',
|
|
31
32
|
sourceRoot: `${options.appProjectRoot}/src`,
|
|
@@ -74,6 +75,14 @@ async function applicationGenerator(tree, schema) {
|
|
|
74
75
|
(0, devkit_1.toJS)(tree);
|
|
75
76
|
if (!options.skipFormat)
|
|
76
77
|
await (0, devkit_1.formatFiles)(tree);
|
|
78
|
+
tasks.push(() => {
|
|
79
|
+
try {
|
|
80
|
+
(0, node_child_process_1.execSync)(`npx -y nuxi prepare`, { cwd: options.appProjectRoot });
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
console.error(`Failed to run \`nuxi prepare\` in "${options.appProjectRoot}". Please run the command manually.`);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
77
86
|
tasks.push(() => {
|
|
78
87
|
(0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
|
|
79
88
|
});
|
|
@@ -13,7 +13,7 @@ export default defineNuxtConfig({
|
|
|
13
13
|
typescript: {
|
|
14
14
|
typeCheck: true,
|
|
15
15
|
tsConfig: {
|
|
16
|
-
extends: '
|
|
16
|
+
extends: '../tsconfig.app.json', // Nuxt copies this string as-is to the `./.nuxt/tsconfig.json`, therefore it needs to be relative to that directory
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
imports: {
|
|
@@ -12,7 +12,7 @@ async function addVitest(tree, options) {
|
|
|
12
12
|
: p.plugin === '@nx/nuxt/plugin');
|
|
13
13
|
const { createOrEditViteConfig, vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
14
14
|
const vitestTask = await vitestGenerator(tree, {
|
|
15
|
-
project: options.
|
|
15
|
+
project: options.projectName,
|
|
16
16
|
uiFramework: 'none',
|
|
17
17
|
coverageProvider: 'v8',
|
|
18
18
|
skipFormat: true,
|
|
@@ -21,7 +21,7 @@ async function addVitest(tree, options) {
|
|
|
21
21
|
addPlugin: true,
|
|
22
22
|
}, hasPlugin);
|
|
23
23
|
createOrEditViteConfig(tree, {
|
|
24
|
-
project: options.
|
|
24
|
+
project: options.projectName,
|
|
25
25
|
includeLib: false,
|
|
26
26
|
includeVitest: true,
|
|
27
27
|
testEnvironment: 'jsdom',
|
|
@@ -31,6 +31,7 @@ async function addVitest(tree, options) {
|
|
|
31
31
|
(0, devkit_1.updateJson)(tree, `${options.appProjectRoot}/tsconfig.spec.json`, (json) => {
|
|
32
32
|
json.compilerOptions ??= {};
|
|
33
33
|
json.compilerOptions.composite = true;
|
|
34
|
+
json.include = ['.nuxt/nuxt.d.ts', ...(json.include ?? [])];
|
|
34
35
|
return json;
|
|
35
36
|
});
|
|
36
37
|
return vitestTask;
|
package/src/plugins/plugin.js
CHANGED
|
@@ -130,7 +130,7 @@ async function getInfoFromNuxtConfig(configFilePath, context, projectRoot) {
|
|
|
130
130
|
function getOutputs(nuxtConfig, projectRoot) {
|
|
131
131
|
const buildOutputPath = normalizeOutputPath(nuxtConfig?.buildDir, projectRoot);
|
|
132
132
|
return {
|
|
133
|
-
buildOutputs: [buildOutputPath],
|
|
133
|
+
buildOutputs: [buildOutputPath, '{projectRoot}/.output'],
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
function normalizeOutputPath(outputPath, projectRoot) {
|