@nx/devkit 20.4.0-canary.20250123-7524356 → 20.4.0-canary.20250124-45847a6
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": "20.4.0-canary.
|
3
|
+
"version": "20.4.0-canary.20250124-45847a6",
|
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. Learn more about [extending Nx by leveraging the Nx Devkit](https://nx.dev/extending-nx/intro/getting-started) on our docs.",
|
6
6
|
"repository": {
|
@@ -3,21 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateTsConfigsToJs = updateTsConfigsToJs;
|
4
4
|
const devkit_exports_1 = require("nx/src/devkit-exports");
|
5
5
|
function updateTsConfigsToJs(tree, options) {
|
6
|
-
let updateConfigPath;
|
6
|
+
let updateConfigPath = null;
|
7
7
|
const paths = {
|
8
8
|
tsConfig: `${options.projectRoot}/tsconfig.json`,
|
9
9
|
tsConfigLib: `${options.projectRoot}/tsconfig.lib.json`,
|
10
10
|
tsConfigApp: `${options.projectRoot}/tsconfig.app.json`,
|
11
11
|
};
|
12
|
-
const getProjectType = (tree) => {
|
13
|
-
if (tree.exists(paths.tsConfigApp)) {
|
14
|
-
return 'application';
|
15
|
-
}
|
16
|
-
if (tree.exists(paths.tsConfigLib)) {
|
17
|
-
return 'library';
|
18
|
-
}
|
19
|
-
throw new Error(`project is missing tsconfig.lib.json or tsconfig.app.json`);
|
20
|
-
};
|
21
12
|
(0, devkit_exports_1.updateJson)(tree, paths.tsConfig, (json) => {
|
22
13
|
if (json.compilerOptions) {
|
23
14
|
json.compilerOptions.allowJs = true;
|
@@ -27,21 +18,25 @@ function updateTsConfigsToJs(tree, options) {
|
|
27
18
|
}
|
28
19
|
return json;
|
29
20
|
});
|
30
|
-
|
31
|
-
if (projectType === 'library') {
|
21
|
+
if (tree.exists(paths.tsConfigLib)) {
|
32
22
|
updateConfigPath = paths.tsConfigLib;
|
33
23
|
}
|
34
|
-
if (
|
24
|
+
if (tree.exists(paths.tsConfigApp)) {
|
35
25
|
updateConfigPath = paths.tsConfigApp;
|
36
26
|
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
27
|
+
if (updateConfigPath) {
|
28
|
+
(0, devkit_exports_1.updateJson)(tree, updateConfigPath, (json) => {
|
29
|
+
json.include = uniq([...json.include, 'src/**/*.js']);
|
30
|
+
json.exclude = uniq([
|
31
|
+
...json.exclude,
|
32
|
+
'src/**/*.spec.js',
|
33
|
+
'src/**/*.test.js',
|
34
|
+
]);
|
35
|
+
return json;
|
36
|
+
});
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
throw new Error(`project is missing tsconfig.lib.json or tsconfig.app.json`);
|
40
|
+
}
|
46
41
|
}
|
47
42
|
const uniq = (value) => [...new Set(value)];
|