@nx/vue 0.0.0-pr-3-e51e28c → 0.0.0-pr-30418-4e2b721
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 +22 -13
- package/src/generators/application/lib/add-e2e.js +45 -15
- package/src/generators/application/lib/normalize-options.js +7 -7
- package/src/generators/application/schema.d.ts +3 -1
- package/src/generators/application/schema.json +4 -0
- package/src/generators/library/lib/create-library-files.js +3 -2
- package/src/generators/library/lib/normalize-options.js +8 -8
- package/src/generators/library/library.js +38 -23
- package/src/generators/library/schema.d.ts +1 -0
- package/src/generators/library/schema.json +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-30418-4e2b721",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Vue plugin for Nx contains executors and generators for managing Vue 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
|
"minimatch": "9.0.3",
|
|
33
33
|
"tslib": "^2.3.0",
|
|
34
|
-
"@nx/devkit": "0.0.0-pr-
|
|
35
|
-
"@nx/js": "0.0.0-pr-
|
|
36
|
-
"@nx/eslint": "0.0.0-pr-
|
|
37
|
-
"@nx/vite": "0.0.0-pr-
|
|
38
|
-
"@nx/web": "0.0.0-pr-
|
|
34
|
+
"@nx/devkit": "0.0.0-pr-30418-4e2b721",
|
|
35
|
+
"@nx/js": "0.0.0-pr-30418-4e2b721",
|
|
36
|
+
"@nx/eslint": "0.0.0-pr-30418-4e2b721",
|
|
37
|
+
"@nx/vite": "0.0.0-pr-30418-4e2b721",
|
|
38
|
+
"@nx/web": "0.0.0-pr-30418-4e2b721"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -18,7 +18,11 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
|
|
|
18
18
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
19
19
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
20
20
|
function applicationGenerator(tree, options) {
|
|
21
|
-
return applicationGeneratorInternal(tree, {
|
|
21
|
+
return applicationGeneratorInternal(tree, {
|
|
22
|
+
addPlugin: false,
|
|
23
|
+
useProjectJson: true,
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
22
26
|
}
|
|
23
27
|
async function applicationGeneratorInternal(tree, _options) {
|
|
24
28
|
const tasks = [];
|
|
@@ -36,23 +40,25 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
36
40
|
// If we are using the new TS solution
|
|
37
41
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
38
42
|
if (options.isUsingTsSolutionConfig) {
|
|
39
|
-
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
43
|
+
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
40
44
|
}
|
|
41
45
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
42
46
|
options.addPlugin ??=
|
|
43
47
|
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
44
48
|
nxJson.useInferencePlugins !== false;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
const packageJson = {
|
|
50
|
+
name: options.importPath,
|
|
51
|
+
version: '0.0.1',
|
|
52
|
+
private: true,
|
|
53
|
+
};
|
|
54
|
+
if (!options.useProjectJson) {
|
|
55
|
+
if (options.projectName !== options.importPath) {
|
|
56
|
+
packageJson.nx = { name: options.projectName };
|
|
57
|
+
}
|
|
58
|
+
if (options.parsedTags?.length) {
|
|
59
|
+
packageJson.nx ??= {};
|
|
60
|
+
packageJson.nx.tags = options.parsedTags;
|
|
61
|
+
}
|
|
56
62
|
}
|
|
57
63
|
else {
|
|
58
64
|
(0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
|
|
@@ -63,6 +69,9 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
63
69
|
targets: {},
|
|
64
70
|
});
|
|
65
71
|
}
|
|
72
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
73
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
|
|
74
|
+
}
|
|
66
75
|
tasks.push(await (0, init_1.vueInitGenerator)(tree, {
|
|
67
76
|
...options,
|
|
68
77
|
skipFormat: true,
|
|
@@ -34,14 +34,29 @@ async function addE2e(tree, options) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
const packageJson = {
|
|
38
|
+
name: options.e2eProjectName,
|
|
39
|
+
version: '0.0.1',
|
|
40
|
+
private: true,
|
|
41
|
+
};
|
|
42
|
+
if (!options.useProjectJson) {
|
|
43
|
+
packageJson.nx = {
|
|
44
|
+
implicitDependencies: [options.projectName],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
49
|
+
projectType: 'application',
|
|
50
|
+
root: options.e2eProjectRoot,
|
|
51
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
52
|
+
targets: {},
|
|
53
|
+
tags: [],
|
|
54
|
+
implicitDependencies: [options.projectName],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
58
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
59
|
+
}
|
|
45
60
|
const e2eTask = await configurationGenerator(tree, {
|
|
46
61
|
...options,
|
|
47
62
|
project: options.e2eProjectName,
|
|
@@ -77,13 +92,28 @@ async function addE2e(tree, options) {
|
|
|
77
92
|
}
|
|
78
93
|
case 'playwright': {
|
|
79
94
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
const packageJson = {
|
|
96
|
+
name: options.e2eProjectName,
|
|
97
|
+
version: '0.0.1',
|
|
98
|
+
private: true,
|
|
99
|
+
};
|
|
100
|
+
if (!options.useProjectJson) {
|
|
101
|
+
packageJson.nx = {
|
|
102
|
+
implicitDependencies: [options.projectName],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
107
|
+
projectType: 'application',
|
|
108
|
+
root: options.e2eProjectRoot,
|
|
109
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
110
|
+
targets: {},
|
|
111
|
+
implicitDependencies: [options.projectName],
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
115
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
116
|
+
}
|
|
87
117
|
const e2eTask = await configurationGenerator(tree, {
|
|
88
118
|
...options,
|
|
89
119
|
project: options.e2eProjectName,
|
|
@@ -3,32 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
5
5
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
|
-
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
7
6
|
async function normalizeOptions(host, options) {
|
|
8
|
-
await (0, project_name_and_root_utils_1.
|
|
9
|
-
const { projectName
|
|
7
|
+
await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
|
|
8
|
+
const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
10
9
|
name: options.name,
|
|
11
10
|
projectType: 'application',
|
|
12
11
|
directory: options.directory,
|
|
13
12
|
rootProject: options.rootProject,
|
|
14
13
|
});
|
|
15
14
|
options.rootProject = appProjectRoot === '.';
|
|
15
|
+
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
16
|
+
const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
|
|
16
17
|
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
17
18
|
const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
18
19
|
const parsedTags = options.tags
|
|
19
20
|
? options.tags.split(',').map((s) => s.trim())
|
|
20
21
|
: [];
|
|
21
|
-
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
22
22
|
const normalized = {
|
|
23
23
|
...options,
|
|
24
|
-
projectName:
|
|
25
|
-
? (0, get_import_path_1.getImportPath)(host, appProjectName)
|
|
26
|
-
: appProjectName,
|
|
24
|
+
projectName: appProjectName,
|
|
27
25
|
appProjectRoot,
|
|
26
|
+
importPath,
|
|
28
27
|
e2eProjectName,
|
|
29
28
|
e2eProjectRoot,
|
|
30
29
|
parsedTags,
|
|
31
30
|
isUsingTsSolutionConfig,
|
|
31
|
+
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
32
32
|
};
|
|
33
33
|
normalized.style = options.style ?? 'css';
|
|
34
34
|
normalized.routing = normalized.routing ?? false;
|
|
@@ -21,11 +21,13 @@ export interface Schema {
|
|
|
21
21
|
addPlugin?: boolean;
|
|
22
22
|
nxCloudToken?: string;
|
|
23
23
|
useTsSolution?: boolean;
|
|
24
|
+
useProjectJson?: boolean;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export interface NormalizedSchema extends Schema {
|
|
27
|
+
export interface NormalizedSchema extends Omit<Schema, 'useTsSolution'> {
|
|
27
28
|
projectName: string;
|
|
28
29
|
appProjectRoot: string;
|
|
30
|
+
importPath: string;
|
|
29
31
|
e2eProjectName: string;
|
|
30
32
|
e2eProjectRoot: string;
|
|
31
33
|
parsedTags: string[];
|
|
@@ -139,6 +139,10 @@
|
|
|
139
139
|
"type": "boolean",
|
|
140
140
|
"default": false,
|
|
141
141
|
"hidden": true
|
|
142
|
+
},
|
|
143
|
+
"useProjectJson": {
|
|
144
|
+
"type": "boolean",
|
|
145
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
142
146
|
}
|
|
143
147
|
},
|
|
144
148
|
"required": ["directory"],
|
|
@@ -15,17 +15,18 @@ function createLibraryFiles(host, options) {
|
|
|
15
15
|
};
|
|
16
16
|
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, '../files'), options.projectRoot, substitutions);
|
|
17
17
|
if (!options.isUsingTsSolutionConfig &&
|
|
18
|
+
options.useProjectJson &&
|
|
18
19
|
(options.publishable || options.bundler !== 'none')) {
|
|
19
20
|
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), {
|
|
20
|
-
name: options.
|
|
21
|
+
name: options.importPath ?? options.projectName,
|
|
21
22
|
version: '0.0.1',
|
|
22
23
|
main: './index.js',
|
|
23
24
|
types: './index.d.ts',
|
|
24
25
|
exports: {
|
|
25
26
|
'.': {
|
|
27
|
+
types: './index.d.ts',
|
|
26
28
|
import: './index.mjs',
|
|
27
29
|
require: './index.js',
|
|
28
|
-
types: './index.d.ts',
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
});
|
|
@@ -4,9 +4,8 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
6
6
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
|
-
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
8
7
|
async function normalizeOptions(host, options) {
|
|
9
|
-
await (0, project_name_and_root_utils_1.
|
|
8
|
+
await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'library');
|
|
10
9
|
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
11
10
|
name: options.name,
|
|
12
11
|
projectType: 'library',
|
|
@@ -31,9 +30,7 @@ async function normalizeOptions(host, options) {
|
|
|
31
30
|
const normalized = {
|
|
32
31
|
addPlugin,
|
|
33
32
|
...options,
|
|
34
|
-
projectName: isUsingTsSolutionConfig
|
|
35
|
-
? (0, get_import_path_1.getImportPath)(host, projectName)
|
|
36
|
-
: projectName,
|
|
33
|
+
projectName: isUsingTsSolutionConfig && !options.name ? importPath : projectName,
|
|
37
34
|
bundler,
|
|
38
35
|
fileName,
|
|
39
36
|
routePath: `/${projectNames.projectFileName}`,
|
|
@@ -42,6 +39,7 @@ async function normalizeOptions(host, options) {
|
|
|
42
39
|
parsedTags,
|
|
43
40
|
importPath,
|
|
44
41
|
isUsingTsSolutionConfig,
|
|
42
|
+
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
45
43
|
};
|
|
46
44
|
// Libraries with a bundler or is publishable must also be buildable.
|
|
47
45
|
normalized.bundler =
|
|
@@ -49,12 +47,14 @@ async function normalizeOptions(host, options) {
|
|
|
49
47
|
normalized.inSourceTests === normalized.minimal || normalized.inSourceTests;
|
|
50
48
|
if (options.appProject) {
|
|
51
49
|
const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const appProjectType = (0, ts_solution_setup_1.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
|
|
51
|
+
if (appProjectType !== 'application') {
|
|
52
|
+
throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
|
|
54
53
|
}
|
|
54
|
+
const appSourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(host, appProjectConfig.sourceRoot, appProjectConfig.root);
|
|
55
55
|
try {
|
|
56
56
|
normalized.appMain = appProjectConfig.targets.build.options.main;
|
|
57
|
-
normalized.appSourceRoot = (0, devkit_1.normalizePath)(
|
|
57
|
+
normalized.appSourceRoot = (0, devkit_1.normalizePath)(appSourceRoot);
|
|
58
58
|
}
|
|
59
59
|
catch (e) {
|
|
60
60
|
throw new Error(`Could not locate project main for ${options.appProject}`);
|
|
@@ -15,41 +15,49 @@ const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
|
15
15
|
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
16
16
|
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
17
17
|
const path_1 = require("path");
|
|
18
|
-
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
19
18
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
20
19
|
const determine_entry_fields_1 = require("./lib/determine-entry-fields");
|
|
21
20
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
21
|
+
const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
|
|
22
22
|
function libraryGenerator(tree, schema) {
|
|
23
|
-
return libraryGeneratorInternal(tree, {
|
|
23
|
+
return libraryGeneratorInternal(tree, {
|
|
24
|
+
addPlugin: false,
|
|
25
|
+
useProjectJson: true,
|
|
26
|
+
...schema,
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
async function libraryGeneratorInternal(tree, schema) {
|
|
26
30
|
const tasks = [];
|
|
27
|
-
tasks.push(await (0, js_1.initGenerator)(tree, { ...schema, skipFormat: true }));
|
|
28
31
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
|
|
29
32
|
if (options.publishable === true && !schema.importPath) {
|
|
30
33
|
throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
|
|
31
34
|
}
|
|
35
|
+
tasks.push(await (0, js_1.initGenerator)(tree, { ...options, skipFormat: true }));
|
|
32
36
|
// If we are using the new TS solution
|
|
33
37
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
34
38
|
if (options.isUsingTsSolutionConfig) {
|
|
35
|
-
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
|
|
39
|
+
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
|
|
36
40
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
let packageJson = {
|
|
42
|
+
name: options.importPath,
|
|
43
|
+
version: '0.0.1',
|
|
44
|
+
};
|
|
45
|
+
if (!options.useProjectJson) {
|
|
46
|
+
packageJson = {
|
|
47
|
+
...packageJson,
|
|
42
48
|
...(0, determine_entry_fields_1.determineEntryFields)(options),
|
|
43
49
|
files: options.publishable ? ['dist', '!**/*.tsbuildinfo'] : undefined,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
};
|
|
51
|
+
if (options.projectName !== options.importPath) {
|
|
52
|
+
packageJson.nx = { name: options.projectName };
|
|
53
|
+
}
|
|
54
|
+
if (options.parsedTags?.length) {
|
|
55
|
+
packageJson.nx ??= {};
|
|
56
|
+
packageJson.nx.tags = options.parsedTags;
|
|
57
|
+
}
|
|
50
58
|
}
|
|
51
59
|
else {
|
|
52
|
-
(0, devkit_1.addProjectConfiguration)(tree, options.
|
|
60
|
+
(0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
|
|
53
61
|
root: options.projectRoot,
|
|
54
62
|
sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
|
|
55
63
|
projectType: 'library',
|
|
@@ -57,6 +65,9 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
57
65
|
targets: {},
|
|
58
66
|
});
|
|
59
67
|
}
|
|
68
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
69
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), packageJson);
|
|
70
|
+
}
|
|
60
71
|
tasks.push(await (0, init_1.vueInitGenerator)(tree, {
|
|
61
72
|
...options,
|
|
62
73
|
skipFormat: true,
|
|
@@ -82,13 +93,6 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
82
93
|
skipFormat: true,
|
|
83
94
|
});
|
|
84
95
|
}
|
|
85
|
-
if (!options.isUsingTsSolutionConfig &&
|
|
86
|
-
(options.publishable || options.bundler !== 'none')) {
|
|
87
|
-
(0, devkit_1.updateJson)(tree, `${options.projectRoot}/package.json`, (json) => {
|
|
88
|
-
json.name = options.importPath;
|
|
89
|
-
return json;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
96
|
if (!options.skipTsConfig && !options.isUsingTsSolutionConfig) {
|
|
93
97
|
(0, js_1.addTsConfigPath)(tree, options.importPath, [
|
|
94
98
|
(0, devkit_1.joinPathFragments)(options.projectRoot, './src', 'index.' + (options.js ? 'js' : 'ts')),
|
|
@@ -108,6 +112,17 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
108
112
|
: undefined);
|
|
109
113
|
}
|
|
110
114
|
(0, sort_fields_1.sortPackageJsonFields)(tree, options.projectRoot);
|
|
115
|
+
if (options.publishable) {
|
|
116
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.projectName);
|
|
117
|
+
if (options.isUsingTsSolutionConfig) {
|
|
118
|
+
await (0, add_release_config_1.addReleaseConfigForTsSolution)(tree, options.projectName, projectConfig);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
await (0, add_release_config_1.addReleaseConfigForNonTsSolution)(tree, options.projectName, projectConfig);
|
|
122
|
+
}
|
|
123
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.projectName, projectConfig);
|
|
124
|
+
tasks.push(await (0, add_release_config_1.releaseTasks)(tree));
|
|
125
|
+
}
|
|
111
126
|
if (!options.skipFormat)
|
|
112
127
|
await (0, devkit_1.formatFiles)(tree);
|
|
113
128
|
// Always run install to link packages.
|
|
@@ -125,6 +125,10 @@
|
|
|
125
125
|
"description": "Create a Vue library with a minimal setup, no separate test files.",
|
|
126
126
|
"type": "boolean",
|
|
127
127
|
"default": false
|
|
128
|
+
},
|
|
129
|
+
"useProjectJson": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
128
132
|
}
|
|
129
133
|
},
|
|
130
134
|
"required": ["directory"]
|