@nx/devkit 16.8.0-beta.0 → 16.8.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/devkit",
|
|
3
|
-
"version": "16.8.0-beta.
|
|
3
|
+
"version": "16.8.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://nx.dev",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nrwl/devkit": "16.8.0-beta.
|
|
31
|
+
"@nrwl/devkit": "16.8.0-beta.1",
|
|
32
32
|
"ejs": "^3.1.7",
|
|
33
33
|
"enquirer": "~2.3.6",
|
|
34
34
|
"ignore": "^5.0.4",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"migrations": "./migrations.json"
|
|
47
47
|
},
|
|
48
48
|
"type": "commonjs",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "231a998e004c13e559c171ba6c164a9127886153"
|
|
50
50
|
}
|
|
@@ -38,7 +38,9 @@ function formatFiles(tree) {
|
|
|
38
38
|
if (support.ignored || !support.inferredParser) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
tree.write(file.path,
|
|
41
|
+
tree.write(file.path,
|
|
42
|
+
// In prettier v3 the format result is a promise
|
|
43
|
+
yield prettier.format(file.content.toString('utf-8'), options));
|
|
42
44
|
}
|
|
43
45
|
catch (e) {
|
|
44
46
|
console.warn(`Could not format ${file.path}. Error: "${e.message}"`);
|
|
@@ -6,7 +6,7 @@ const enquirer_1 = require("enquirer");
|
|
|
6
6
|
const nx_1 = require("../../nx");
|
|
7
7
|
const get_workspace_layout_1 = require("../utils/get-workspace-layout");
|
|
8
8
|
const names_1 = require("../utils/names");
|
|
9
|
-
const { joinPathFragments, normalizePath, readJson, readNxJson, updateNxJson } = (0, nx_1.requireNx)();
|
|
9
|
+
const { joinPathFragments, normalizePath, logger, readJson, readNxJson, updateNxJson, } = (0, nx_1.requireNx)();
|
|
10
10
|
function determineProjectNameAndRootOptions(tree, options) {
|
|
11
11
|
var _a;
|
|
12
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -54,7 +54,7 @@ function determineFormat(tree, formats, callingGenerator) {
|
|
|
54
54
|
const derivedDescription = `Derived:
|
|
55
55
|
Name: ${formats['derived'].projectName}
|
|
56
56
|
Root: ${formats['derived'].projectRoot}`;
|
|
57
|
-
const derivedSelectedValue = `${formats['derived'].projectName} @ ${formats['derived'].projectRoot}
|
|
57
|
+
const derivedSelectedValue = `${formats['derived'].projectName} @ ${formats['derived'].projectRoot}`;
|
|
58
58
|
const result = yield (0, enquirer_1.prompt)({
|
|
59
59
|
type: 'select',
|
|
60
60
|
name: 'format',
|
|
@@ -71,11 +71,13 @@ function determineFormat(tree, formats, callingGenerator) {
|
|
|
71
71
|
],
|
|
72
72
|
initial: 'as-provided',
|
|
73
73
|
}).then(({ format }) => format === asProvidedSelectedValue ? 'as-provided' : 'derived');
|
|
74
|
+
const deprecationWarning = 'In Nx 18, generating projects will no longer derive the name and root. Please provide the exact project name and root in the future.';
|
|
74
75
|
if (result === 'as-provided' && callingGenerator) {
|
|
75
76
|
const { saveDefault } = yield (0, enquirer_1.prompt)({
|
|
76
77
|
type: 'confirm',
|
|
77
|
-
message:
|
|
78
|
+
message: `Would you like to configure Nx to always take project name and root as provided for ${callingGenerator}?`,
|
|
78
79
|
name: 'saveDefault',
|
|
80
|
+
initial: true,
|
|
79
81
|
});
|
|
80
82
|
if (saveDefault) {
|
|
81
83
|
const nxJson = readNxJson(tree);
|
|
@@ -84,6 +86,12 @@ function determineFormat(tree, formats, callingGenerator) {
|
|
|
84
86
|
nxJson.generators[callingGenerator].projectNameAndRootFormat = result;
|
|
85
87
|
updateNxJson(tree, nxJson);
|
|
86
88
|
}
|
|
89
|
+
else {
|
|
90
|
+
logger.warn(deprecationWarning);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
logger.warn(deprecationWarning);
|
|
87
95
|
}
|
|
88
96
|
return result;
|
|
89
97
|
});
|
|
@@ -29,9 +29,6 @@ function installPackagesTask(tree, alwaysRun = false, cwd = '', packageManager =
|
|
|
29
29
|
cwd: (0, path_1.join)(tree.root, cwd),
|
|
30
30
|
stdio: process.env.NX_GENERATE_QUIET === 'true' ? 'ignore' : 'inherit',
|
|
31
31
|
};
|
|
32
|
-
if (pmc.preInstall) {
|
|
33
|
-
(0, child_process_1.execSync)(pmc.preInstall, execSyncOptions);
|
|
34
|
-
}
|
|
35
32
|
(0, child_process_1.execSync)(pmc.install, execSyncOptions);
|
|
36
33
|
}
|
|
37
34
|
}
|