@nx/nuxt 17.0.4
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 +22 -0
- package/README.md +68 -0
- package/generators.json +26 -0
- package/index.d.ts +5 -0
- package/index.js +11 -0
- package/migrations.json +14 -0
- package/package.json +51 -0
- package/plugin.d.ts +1 -0
- package/plugin.js +5 -0
- package/src/generators/application/application.d.ts +4 -0
- package/src/generators/application/application.js +83 -0
- package/src/generators/application/files/__dot__npmrc +2 -0
- package/src/generators/application/files/nuxt.config.ts__tmpl__ +30 -0
- package/src/generators/application/files/src/app.vue__tmpl__ +48 -0
- package/src/generators/application/files/src/assets/css/styles.__style__ +41 -0
- package/src/generators/application/files/src/components/NxWelcome.vue__tmpl__ +843 -0
- package/src/generators/application/files/src/pages/about.vue__tmpl__ +16 -0
- package/src/generators/application/files/src/pages/index.vue__tmpl__ +6 -0
- package/src/generators/application/files/src/public/__dot__gitkeep +0 -0
- package/src/generators/application/files/src/public/favicon.ico__tmpl__ +0 -0
- package/src/generators/application/files/src/server/api/greet.ts__tmpl__ +10 -0
- package/src/generators/application/files/src/server/tsconfig.json__tmpl__ +3 -0
- package/src/generators/application/lib/add-e2e.d.ts +3 -0
- package/src/generators/application/lib/add-e2e.js +56 -0
- package/src/generators/application/lib/add-vitest.d.ts +3 -0
- package/src/generators/application/lib/add-vitest.js +38 -0
- package/src/generators/application/lib/ensure-dependencies.d.ts +3 -0
- package/src/generators/application/lib/ensure-dependencies.js +27 -0
- package/src/generators/application/lib/normalize-options.d.ts +4 -0
- package/src/generators/application/lib/normalize-options.js +65 -0
- package/src/generators/application/schema.d.ts +29 -0
- package/src/generators/application/schema.json +110 -0
- package/src/generators/init/init.d.ts +4 -0
- package/src/generators/init/init.js +19 -0
- package/src/generators/init/lib/utils.d.ts +5 -0
- package/src/generators/init/lib/utils.js +65 -0
- package/src/generators/init/schema.d.ts +6 -0
- package/src/generators/init/schema.json +33 -0
- package/src/generators/storybook-configuration/configuration.d.ts +4 -0
- package/src/generators/storybook-configuration/configuration.js +28 -0
- package/src/generators/storybook-configuration/schema.d.ts +12 -0
- package/src/generators/storybook-configuration/schema.json +80 -0
- package/src/migrations/update-18-1-0/add-include-tsconfig.d.ts +2 -0
- package/src/migrations/update-18-1-0/add-include-tsconfig.js +48 -0
- package/src/plugins/plugin.d.ts +9 -0
- package/src/plugins/plugin.js +168 -0
- package/src/utils/add-linting.d.ts +10 -0
- package/src/utils/add-linting.js +43 -0
- package/src/utils/create-ts-config.d.ts +6 -0
- package/src/utils/create-ts-config.js +47 -0
- package/src/utils/executor-utils.d.ts +1 -0
- package/src/utils/executor-utils.js +7 -0
- package/src/utils/update-gitignore.d.ts +2 -0
- package/src/utils/update-gitignore.js +23 -0
- package/src/utils/versions.d.ts +6 -0
- package/src/utils/versions.js +11 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxNuxtStorybookConfigure",
|
|
5
|
+
"title": "Nuxt Storybook Configure",
|
|
6
|
+
"description": "Set up Storybook for a Nuxt project.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"project": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"aliases": ["name", "projectName"],
|
|
12
|
+
"description": "Project for which to generate Storybook configuration.",
|
|
13
|
+
"$default": {
|
|
14
|
+
"$source": "argv",
|
|
15
|
+
"index": 0
|
|
16
|
+
},
|
|
17
|
+
"x-prompt": "For which project do you want to generate Storybook configuration?",
|
|
18
|
+
"x-dropdown": "projects",
|
|
19
|
+
"x-priority": "important"
|
|
20
|
+
},
|
|
21
|
+
"interactionTests": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Set up Storybook interaction tests.",
|
|
24
|
+
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
|
25
|
+
"x-priority": "important",
|
|
26
|
+
"alias": ["configureTestRunner"],
|
|
27
|
+
"default": true
|
|
28
|
+
},
|
|
29
|
+
"generateStories": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"description": "Automatically generate `*.stories.ts` files for components declared in this project?",
|
|
32
|
+
"x-prompt": "Automatically generate *.stories.ts files for components declared in this project?",
|
|
33
|
+
"default": true,
|
|
34
|
+
"x-priority": "important"
|
|
35
|
+
},
|
|
36
|
+
"configureStaticServe": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"description": "Specifies whether to configure a static file server target for serving storybook. Helpful for speeding up CI build/test times.",
|
|
39
|
+
"x-prompt": "Configure a static file server for the storybook instance?",
|
|
40
|
+
"default": true,
|
|
41
|
+
"x-priority": "important"
|
|
42
|
+
},
|
|
43
|
+
"js": {
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"description": "Generate JavaScript story files rather than TypeScript story files.",
|
|
46
|
+
"default": false
|
|
47
|
+
},
|
|
48
|
+
"tsConfiguration": {
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
|
51
|
+
"default": true
|
|
52
|
+
},
|
|
53
|
+
"linter": {
|
|
54
|
+
"description": "The tool to use for running lint checks.",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"enum": ["eslint"],
|
|
57
|
+
"default": "eslint"
|
|
58
|
+
},
|
|
59
|
+
"ignorePaths": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"description": "Paths to ignore when looking for components.",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "Path to ignore."
|
|
65
|
+
},
|
|
66
|
+
"default": [
|
|
67
|
+
"*.stories.ts,*.stories.tsx,*.stories.js,*.stories.jsx,*.stories.mdx"
|
|
68
|
+
],
|
|
69
|
+
"examples": [
|
|
70
|
+
"apps/my-app/src/not-stories/**",
|
|
71
|
+
"**/**/src/**/not-stories/**",
|
|
72
|
+
"libs/my-lib/**/*.something.ts",
|
|
73
|
+
"**/**/src/**/*.other.*",
|
|
74
|
+
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": ["project"],
|
|
79
|
+
"examplesFile": "../../../docs/storybook-configuration-examples.md"
|
|
80
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const executor_utils_1 = require("../../utils/executor-utils");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
async function default_1(tree) {
|
|
7
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
8
|
+
for (const project of projects.values()) {
|
|
9
|
+
const nuxtConfigPath = findNuxtConfig(tree, project.root);
|
|
10
|
+
if (!nuxtConfigPath) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const nuxtConfig = await getInfoFromNuxtConfig(nuxtConfigPath, project.root);
|
|
14
|
+
const buildDir = nuxtConfig.buildDir ?? '.nuxt';
|
|
15
|
+
const tsConfigPath = (0, devkit_1.joinPathFragments)(project.root, 'tsconfig.json');
|
|
16
|
+
if (tree.exists(tsConfigPath)) {
|
|
17
|
+
(0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
|
|
18
|
+
if (!json.include) {
|
|
19
|
+
json.include = [];
|
|
20
|
+
}
|
|
21
|
+
if (!json.include.includes(buildDir + '/nuxt.d.ts')) {
|
|
22
|
+
json.include.push(buildDir + '/nuxt.d.ts');
|
|
23
|
+
}
|
|
24
|
+
return json;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
29
|
+
}
|
|
30
|
+
exports.default = default_1;
|
|
31
|
+
function findNuxtConfig(tree, projectRoot) {
|
|
32
|
+
const allowsExt = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts'];
|
|
33
|
+
for (const ext of allowsExt) {
|
|
34
|
+
if (tree.exists((0, devkit_1.joinPathFragments)(projectRoot, `nuxt.config.${ext}`))) {
|
|
35
|
+
return (0, devkit_1.joinPathFragments)(projectRoot, `nuxt.config.${ext}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function getInfoFromNuxtConfig(configFilePath, projectRoot) {
|
|
40
|
+
const { loadNuxtConfig } = await (0, executor_utils_1.loadNuxtKitDynamicImport)();
|
|
41
|
+
const config = await loadNuxtConfig({
|
|
42
|
+
cwd: (0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, projectRoot),
|
|
43
|
+
configFile: (0, path_1.basename)(configFilePath),
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
buildDir: config?.buildDir,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CreateDependencies, CreateNodes } from '@nx/devkit';
|
|
2
|
+
export declare const createDependencies: CreateDependencies;
|
|
3
|
+
export interface NuxtPluginOptions {
|
|
4
|
+
buildTargetName?: string;
|
|
5
|
+
serveTargetName?: string;
|
|
6
|
+
serveStaticTargetName?: string;
|
|
7
|
+
buildStaticTargetName?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const createNodes: CreateNodes<NuxtPluginOptions>;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNodes = exports.createDependencies = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
7
|
+
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
10
|
+
const js_1 = require("@nx/js");
|
|
11
|
+
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
12
|
+
const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'nuxt.hash');
|
|
13
|
+
const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
|
|
14
|
+
const calculatedTargets = {};
|
|
15
|
+
function readTargetsCache() {
|
|
16
|
+
return (0, devkit_1.readJsonFile)(cachePath);
|
|
17
|
+
}
|
|
18
|
+
function writeTargetsToCache(targets) {
|
|
19
|
+
(0, devkit_1.writeJsonFile)(cachePath, targets);
|
|
20
|
+
}
|
|
21
|
+
const createDependencies = () => {
|
|
22
|
+
writeTargetsToCache(calculatedTargets);
|
|
23
|
+
return [];
|
|
24
|
+
};
|
|
25
|
+
exports.createDependencies = createDependencies;
|
|
26
|
+
exports.createNodes = [
|
|
27
|
+
'**/nuxt.config.{js,ts,mjs,mts,cjs,cts}',
|
|
28
|
+
async (configFilePath, options, context) => {
|
|
29
|
+
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
30
|
+
// Do not create a project if package.json and project.json isn't there.
|
|
31
|
+
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
32
|
+
if (!siblingFiles.includes('package.json') &&
|
|
33
|
+
!siblingFiles.includes('project.json')) {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
options = normalizeOptions(options);
|
|
37
|
+
const hash = (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [
|
|
38
|
+
(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
|
|
39
|
+
]);
|
|
40
|
+
const targets = targetsCache[hash]
|
|
41
|
+
? targetsCache[hash]
|
|
42
|
+
: await buildNuxtTargets(configFilePath, projectRoot, options, context);
|
|
43
|
+
calculatedTargets[hash] = targets;
|
|
44
|
+
return {
|
|
45
|
+
projects: {
|
|
46
|
+
[projectRoot]: {
|
|
47
|
+
root: projectRoot,
|
|
48
|
+
targets,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
async function buildNuxtTargets(configFilePath, projectRoot, options, context) {
|
|
55
|
+
const nuxtConfig = await getInfoFromNuxtConfig(configFilePath, context, projectRoot);
|
|
56
|
+
const { buildOutputs } = getOutputs(nuxtConfig, projectRoot);
|
|
57
|
+
const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
|
|
58
|
+
const targets = {};
|
|
59
|
+
targets[options.buildTargetName] = buildTarget(options.buildTargetName, namedInputs, buildOutputs, projectRoot);
|
|
60
|
+
targets[options.serveTargetName] = serveTarget(projectRoot);
|
|
61
|
+
targets[options.serveStaticTargetName] = serveStaticTarget(options);
|
|
62
|
+
targets[options.buildStaticTargetName] = buildStaticTarget(options.buildStaticTargetName, namedInputs, buildOutputs, projectRoot);
|
|
63
|
+
return targets;
|
|
64
|
+
}
|
|
65
|
+
function buildTarget(buildTargetName, namedInputs, buildOutputs, projectRoot) {
|
|
66
|
+
return {
|
|
67
|
+
command: `nuxt build`,
|
|
68
|
+
options: { cwd: projectRoot },
|
|
69
|
+
cache: true,
|
|
70
|
+
dependsOn: [`^${buildTargetName}`],
|
|
71
|
+
inputs: [
|
|
72
|
+
...('production' in namedInputs
|
|
73
|
+
? ['production', '^production']
|
|
74
|
+
: ['default', '^default']),
|
|
75
|
+
{
|
|
76
|
+
externalDependencies: ['nuxt'],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
outputs: buildOutputs,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function serveTarget(projectRoot) {
|
|
83
|
+
const targetConfig = {
|
|
84
|
+
command: `nuxt dev`,
|
|
85
|
+
options: {
|
|
86
|
+
cwd: projectRoot,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
return targetConfig;
|
|
90
|
+
}
|
|
91
|
+
function serveStaticTarget(options) {
|
|
92
|
+
const targetConfig = {
|
|
93
|
+
executor: '@nx/web:file-server',
|
|
94
|
+
options: {
|
|
95
|
+
buildTarget: `${options.buildStaticTargetName}`,
|
|
96
|
+
staticFilePath: '{projectRoot}/dist',
|
|
97
|
+
port: 4200,
|
|
98
|
+
// Routes are found correctly with serve-static
|
|
99
|
+
spa: false,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
return targetConfig;
|
|
103
|
+
}
|
|
104
|
+
function buildStaticTarget(buildStaticTargetName, namedInputs, buildOutputs, projectRoot) {
|
|
105
|
+
const targetConfig = {
|
|
106
|
+
command: `nuxt build --prerender`,
|
|
107
|
+
options: { cwd: projectRoot },
|
|
108
|
+
cache: true,
|
|
109
|
+
dependsOn: [`^${buildStaticTargetName}`],
|
|
110
|
+
inputs: [
|
|
111
|
+
...('production' in namedInputs
|
|
112
|
+
? ['production', '^production']
|
|
113
|
+
: ['default', '^default']),
|
|
114
|
+
{
|
|
115
|
+
externalDependencies: ['nuxt'],
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
outputs: buildOutputs,
|
|
119
|
+
};
|
|
120
|
+
return targetConfig;
|
|
121
|
+
}
|
|
122
|
+
async function getInfoFromNuxtConfig(configFilePath, context, projectRoot) {
|
|
123
|
+
// TODO(Colum): Once plugins are isolated we can go back to @nuxt/kit since each plugin will be run in its own worker.
|
|
124
|
+
const config = await (0, config_utils_1.loadConfigFile)((0, path_1.join)(context.workspaceRoot, configFilePath));
|
|
125
|
+
return {
|
|
126
|
+
buildDir: config?.buildDir ??
|
|
127
|
+
// Match .nuxt default build dir from '@nuxt/schema'
|
|
128
|
+
// See: https://github.com/nuxt/nuxt/blob/871404ae5673425aeedde82f123ea58aa7c6facf/packages/schema/src/config/common.ts#L117-L119
|
|
129
|
+
'.nuxt',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function getOutputs(nuxtConfig, projectRoot) {
|
|
133
|
+
const buildOutputPath = normalizeOutputPath(nuxtConfig?.buildDir, projectRoot);
|
|
134
|
+
return {
|
|
135
|
+
buildOutputs: [buildOutputPath],
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function normalizeOutputPath(outputPath, projectRoot) {
|
|
139
|
+
if (!outputPath) {
|
|
140
|
+
if (projectRoot === '.') {
|
|
141
|
+
return `{projectRoot}`;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return `{workspaceRoot}/{projectRoot}`;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if ((0, path_1.isAbsolute)(outputPath)) {
|
|
149
|
+
return `{workspaceRoot}/${(0, path_1.relative)(devkit_1.workspaceRoot, outputPath)}`;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
if (outputPath.startsWith('..')) {
|
|
153
|
+
return (0, path_1.join)('{workspaceRoot}', (0, path_1.join)(projectRoot, outputPath));
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
return (0, path_1.join)('{projectRoot}', outputPath);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function normalizeOptions(options) {
|
|
162
|
+
options ??= {};
|
|
163
|
+
options.buildTargetName ??= 'build';
|
|
164
|
+
options.serveTargetName ??= 'serve';
|
|
165
|
+
options.serveStaticTargetName ??= 'serve-static';
|
|
166
|
+
options.buildStaticTargetName ??= 'build-static';
|
|
167
|
+
return options;
|
|
168
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tree } from 'nx/src/generators/tree';
|
|
2
|
+
import { Linter } from '@nx/eslint';
|
|
3
|
+
import { GeneratorCallback } from '@nx/devkit';
|
|
4
|
+
export declare function addLinting(host: Tree, options: {
|
|
5
|
+
linter: Linter;
|
|
6
|
+
projectName: string;
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
unitTestRunner?: 'vitest' | 'none';
|
|
9
|
+
rootProject?: boolean;
|
|
10
|
+
}): Promise<GeneratorCallback>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addLinting = void 0;
|
|
4
|
+
const eslint_1 = require("@nx/eslint");
|
|
5
|
+
const path_1 = require("nx/src/utils/path");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const vue_1 = require("@nx/vue");
|
|
8
|
+
const versions_1 = require("./versions");
|
|
9
|
+
async function addLinting(host, options) {
|
|
10
|
+
const tasks = [];
|
|
11
|
+
if (options.linter === 'eslint') {
|
|
12
|
+
const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
|
|
13
|
+
linter: options.linter,
|
|
14
|
+
project: options.projectName,
|
|
15
|
+
tsConfigPaths: [(0, path_1.joinPathFragments)(options.projectRoot, 'tsconfig.json')],
|
|
16
|
+
unitTestRunner: options.unitTestRunner,
|
|
17
|
+
skipFormat: true,
|
|
18
|
+
rootProject: options.rootProject,
|
|
19
|
+
addPlugin: true,
|
|
20
|
+
});
|
|
21
|
+
tasks.push(lintTask);
|
|
22
|
+
(0, vue_1.editEslintConfigFiles)(host, options.projectRoot, options.rootProject);
|
|
23
|
+
(0, devkit_1.updateJson)(host, (0, path_1.joinPathFragments)(options.projectRoot, '.eslintrc.json'), (json) => {
|
|
24
|
+
const { extends: pluginExtends, ignorePatterns: pluginIgnorePatters, ...config } = json;
|
|
25
|
+
return {
|
|
26
|
+
extends: ['@nuxt/eslint-config', ...(pluginExtends || [])],
|
|
27
|
+
ignorePatterns: [
|
|
28
|
+
...(pluginIgnorePatters || []),
|
|
29
|
+
'.nuxt/**',
|
|
30
|
+
'.output/**',
|
|
31
|
+
'node_modules',
|
|
32
|
+
],
|
|
33
|
+
...config,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
|
|
37
|
+
'@nuxt/eslint-config': versions_1.nuxtEslintConfigVersion,
|
|
38
|
+
});
|
|
39
|
+
tasks.push(installTask);
|
|
40
|
+
}
|
|
41
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
42
|
+
}
|
|
43
|
+
exports.addLinting = addLinting;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTsConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const shared = require("@nx/js/src/utils/typescript/create-ts-config");
|
|
6
|
+
function createTsConfig(host, options, relativePathToRootTsConfig) {
|
|
7
|
+
createAppTsConfig(host, options);
|
|
8
|
+
const json = {
|
|
9
|
+
compilerOptions: {},
|
|
10
|
+
files: [],
|
|
11
|
+
include: ['.nuxt/nuxt.d.ts'],
|
|
12
|
+
references: [
|
|
13
|
+
{
|
|
14
|
+
path: './tsconfig.app.json',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
};
|
|
18
|
+
if (options.unitTestRunner !== 'none') {
|
|
19
|
+
json.references.push({
|
|
20
|
+
path: './tsconfig.spec.json',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// inline tsconfig.base.json into the project
|
|
24
|
+
if (options.rootProject) {
|
|
25
|
+
json.compileOnSave = false;
|
|
26
|
+
json.compilerOptions = {
|
|
27
|
+
...shared.tsConfigBaseOptions,
|
|
28
|
+
...json.compilerOptions,
|
|
29
|
+
};
|
|
30
|
+
json.exclude = ['node_modules', 'tmp'];
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
json.extends = relativePathToRootTsConfig;
|
|
34
|
+
}
|
|
35
|
+
(0, devkit_1.writeJson)(host, `${options.projectRoot}/tsconfig.json`, json);
|
|
36
|
+
}
|
|
37
|
+
exports.createTsConfig = createTsConfig;
|
|
38
|
+
function createAppTsConfig(host, options) {
|
|
39
|
+
const json = {
|
|
40
|
+
extends: './tsconfig.json',
|
|
41
|
+
compilerOptions: {
|
|
42
|
+
composite: true,
|
|
43
|
+
},
|
|
44
|
+
exclude: [],
|
|
45
|
+
};
|
|
46
|
+
(0, devkit_1.writeJson)(host, `${options.projectRoot}/tsconfig.app.json`, json);
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadNuxtKitDynamicImport(): Promise<typeof import("@nuxt/kit")>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadNuxtKitDynamicImport = void 0;
|
|
4
|
+
function loadNuxtKitDynamicImport() {
|
|
5
|
+
return Function('return import("@nuxt/kit")')();
|
|
6
|
+
}
|
|
7
|
+
exports.loadNuxtKitDynamicImport = loadNuxtKitDynamicImport;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateGitIgnore = void 0;
|
|
4
|
+
function updateGitIgnore(tree) {
|
|
5
|
+
const contents = tree.read('.gitignore', 'utf-8') ?? '';
|
|
6
|
+
const nuxtEntries = [
|
|
7
|
+
'# Nuxt dev/build outputs',
|
|
8
|
+
'.output',
|
|
9
|
+
'.data',
|
|
10
|
+
'.nuxt',
|
|
11
|
+
'.nitro',
|
|
12
|
+
'.cache',
|
|
13
|
+
];
|
|
14
|
+
let newContents = contents;
|
|
15
|
+
for (const entry of nuxtEntries) {
|
|
16
|
+
const regex = new RegExp(`^${entry}$`, 'm');
|
|
17
|
+
if (!regex.test(newContents)) {
|
|
18
|
+
newContents += `\n${entry}`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
tree.write('.gitignore', [newContents].join('\n'));
|
|
22
|
+
}
|
|
23
|
+
exports.updateGitIgnore = updateGitIgnore;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const nxVersion: any;
|
|
2
|
+
export declare const h3Version = "^1.8.2";
|
|
3
|
+
export declare const nuxtVersion = "^3.10.0";
|
|
4
|
+
export declare const nuxtDevtoolsVersion = "1.0.0";
|
|
5
|
+
export declare const nuxtUiTemplatesVersion = "^1.3.1";
|
|
6
|
+
export declare const nuxtEslintConfigVersion = "~0.3.0-alpha.1";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nuxtEslintConfigVersion = exports.nuxtUiTemplatesVersion = exports.nuxtDevtoolsVersion = exports.nuxtVersion = exports.h3Version = exports.nxVersion = void 0;
|
|
4
|
+
exports.nxVersion = require('../../package.json').version;
|
|
5
|
+
// nuxt deps
|
|
6
|
+
exports.h3Version = '^1.8.2';
|
|
7
|
+
exports.nuxtVersion = '^3.10.0';
|
|
8
|
+
exports.nuxtDevtoolsVersion = '1.0.0';
|
|
9
|
+
exports.nuxtUiTemplatesVersion = '^1.3.1';
|
|
10
|
+
// linting deps
|
|
11
|
+
exports.nuxtEslintConfigVersion = '~0.3.0-alpha.1';
|