@nrwl/js 14.8.8 → 14.9.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/CHANGELOG.md +1 -1
- package/LICENSE +22 -22
- package/README.md +5 -26
- package/babel.d.ts +10 -0
- package/babel.js +89 -0
- package/babel.js.map +1 -0
- package/generators.json +4 -2
- package/migrations.json +20 -1
- package/package.json +19 -10
- package/src/executors/node/node.impl.js +36 -28
- package/src/executors/node/node.impl.js.map +1 -1
- package/src/executors/node/schema.json +3 -1
- package/src/executors/swc/schema.json +39 -5
- package/src/executors/swc/swc.impl.d.ts +4 -0
- package/src/executors/swc/swc.impl.js +56 -6
- package/src/executors/swc/swc.impl.js.map +1 -1
- package/src/executors/tsc/schema.json +36 -3
- package/src/executors/tsc/tsc.impl.d.ts +2 -5
- package/src/executors/tsc/tsc.impl.js +35 -13
- package/src/executors/tsc/tsc.impl.js.map +1 -1
- package/src/generators/convert-to-swc/convert-to-swc.js +2 -4
- package/src/generators/convert-to-swc/convert-to-swc.js.map +1 -1
- package/src/generators/init/files/__fileName__ +20 -0
- package/src/generators/init/init.d.ts +4 -2
- package/src/generators/init/init.js +59 -2
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/init/schema.d.ts +6 -0
- package/src/generators/init/schema.json +24 -1
- package/src/generators/library/files/jest-config/jest.config.__ext__ +8 -1
- package/src/generators/library/files/lib/tsconfig.lib.json__tmpl__ +2 -2
- package/src/generators/library/library.js +136 -85
- package/src/generators/library/library.js.map +1 -1
- package/src/generators/library/schema.json +29 -19
- package/src/index.d.ts +8 -0
- package/src/index.js +12 -1
- package/src/index.js.map +1 -1
- package/src/migrations/update-13-10-1/update-lib-swcrc-exclude.js +1 -1
- package/src/migrations/update-13-10-1/update-lib-swcrc-exclude.js.map +1 -1
- package/src/migrations/update-13-8-5/update-swcrc.js +2 -2
- package/src/migrations/update-13-8-5/update-swcrc.js.map +1 -1
- package/src/migrations/update-14-0-0/exclude-jest-config-swcrc.js +1 -1
- package/src/migrations/update-14-0-0/exclude-jest-config-swcrc.js.map +1 -1
- package/src/migrations/update-14-1-5/update-swcrc-path.js +1 -1
- package/src/migrations/update-14-1-5/update-swcrc-path.js.map +1 -1
- package/src/migrations/update-15-8-0/rename-swcrc-config.d.ts +2 -0
- package/src/migrations/update-15-8-0/rename-swcrc-config.js +81 -0
- package/src/migrations/update-15-8-0/rename-swcrc-config.js.map +1 -0
- package/src/utils/add-babel-inputs.d.ts +2 -0
- package/src/utils/add-babel-inputs.js +27 -0
- package/src/utils/add-babel-inputs.js.map +1 -0
- package/src/utils/assets/copy-assets-handler.d.ts +2 -2
- package/src/utils/assets/copy-assets-handler.js +12 -5
- package/src/utils/assets/copy-assets-handler.js.map +1 -1
- package/src/utils/assets/index.js +11 -14
- package/src/utils/assets/index.js.map +1 -1
- package/src/utils/buildable-libs-utils.d.ts +32 -0
- package/src/utils/buildable-libs-utils.js +309 -0
- package/src/utils/buildable-libs-utils.js.map +1 -0
- package/src/utils/check-dependencies.d.ts +2 -2
- package/src/utils/check-dependencies.js +1 -1
- package/src/utils/check-dependencies.js.map +1 -1
- package/src/utils/code-frames/identifiers.d.ts +0 -20
- package/src/utils/code-frames/identifiers.js +38 -184
- package/src/utils/code-frames/identifiers.js.map +1 -1
- package/src/utils/compiler-helper-dependency.d.ts +1 -1
- package/src/utils/compiler-helper-dependency.js +2 -2
- package/src/utils/compiler-helper-dependency.js.map +1 -1
- package/src/utils/generate-globs.d.ts +6 -0
- package/src/utils/generate-globs.js +81 -0
- package/src/utils/generate-globs.js.map +1 -0
- package/src/utils/inline.d.ts +19 -0
- package/src/utils/inline.js +210 -0
- package/src/utils/inline.js.map +1 -0
- package/src/utils/package-json/index.d.ts +2 -1
- package/src/utils/package-json/index.js +6 -5
- package/src/utils/package-json/index.js.map +1 -1
- package/src/utils/package-json/update-package-json.d.ts +4 -2
- package/src/utils/package-json/update-package-json.js +96 -16
- package/src/utils/package-json/update-package-json.js.map +1 -1
- package/src/utils/prettier.d.ts +6 -0
- package/src/utils/prettier.js +38 -0
- package/src/utils/prettier.js.map +1 -0
- package/src/utils/schema.d.ts +8 -3
- package/src/utils/swc/add-swc-config.d.ts +1 -1
- package/src/utils/swc/add-swc-config.js +7 -7
- package/src/utils/swc/add-swc-config.js.map +1 -1
- package/src/utils/swc/compile-swc.d.ts +4 -0
- package/src/utils/swc/compile-swc.js +10 -7
- package/src/utils/swc/compile-swc.js.map +1 -1
- package/src/utils/swc/get-swcrc-path.d.ts +1 -1
- package/src/utils/swc/get-swcrc-path.js +7 -4
- package/src/utils/swc/get-swcrc-path.js.map +1 -1
- package/src/utils/swc/inline.d.ts +2 -0
- package/src/utils/swc/inline.js +13 -0
- package/src/utils/swc/inline.js.map +1 -0
- package/src/utils/typescript/ast-utils.d.ts +22 -0
- package/src/utils/typescript/ast-utils.js +199 -0
- package/src/utils/typescript/ast-utils.js.map +1 -0
- package/src/utils/typescript/compile-typescript-files.d.ts +6 -2
- package/src/utils/typescript/compile-typescript-files.js +16 -10
- package/src/utils/typescript/compile-typescript-files.js.map +1 -1
- package/src/utils/typescript/create-ts-config.d.ts +17 -0
- package/src/utils/typescript/create-ts-config.js +48 -0
- package/src/utils/typescript/create-ts-config.js.map +1 -0
- package/src/utils/typescript/ensure-typescript.d.ts +1 -0
- package/src/utils/typescript/ensure-typescript.js +10 -0
- package/src/utils/typescript/ensure-typescript.js.map +1 -0
- package/src/utils/typescript/get-source-nodes.d.ts +2 -0
- package/src/utils/typescript/get-source-nodes.js +19 -0
- package/src/utils/typescript/get-source-nodes.js.map +1 -0
- package/src/utils/typescript/run-type-check.d.ts +2 -2
- package/src/utils/typescript/run-type-check.js +7 -5
- package/src/utils/typescript/run-type-check.js.map +1 -1
- package/src/utils/typescript/ts-config.d.ts +11 -0
- package/src/utils/typescript/ts-config.js +55 -0
- package/src/utils/typescript/ts-config.js.map +1 -0
- package/src/utils/typescript/types.d.ts +2 -2
- package/src/utils/versions.d.ts +4 -2
- package/src/utils/versions.js +5 -3
- package/src/utils/versions.js.map +1 -1
- package/src/utils/watch-for-single-file-changes.d.ts +1 -1
- package/src/utils/watch-for-single-file-changes.js +11 -13
- package/src/utils/watch-for-single-file-changes.js.map +1 -1
- package/src/utils/code-frames/code-frames.d.ts +0 -14
- package/src/utils/code-frames/code-frames.js +0 -125
- package/src/utils/code-frames/code-frames.js.map +0 -1
- package/src/utils/create-async-iterable/create-async-iteratable.d.ts +0 -6
- package/src/utils/create-async-iterable/create-async-iteratable.js +0 -62
- package/src/utils/create-async-iterable/create-async-iteratable.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/js
|
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(The MIT License)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017-
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
'Software'), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-2023 Narwhal Technologies Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -43,40 +43,19 @@ npm init nx-workspace
|
|
|
43
43
|
yarn create nx-workspace
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
? What to create in the new workspace (Use arrow keys)
|
|
50
|
-
❯ apps [an empty workspace with no plugins with a layout that works best for building apps]
|
|
51
|
-
core [an empty workspace with no plugins set up to publish npm packages (similar to yarn workspaces)]
|
|
52
|
-
ts [an empty workspace with the JS/TS plugin preinstalled]
|
|
53
|
-
react [a workspace with a single React application]
|
|
54
|
-
angular [a workspace with a single Angular application]
|
|
55
|
-
next.js [a workspace with a single Next.js application]
|
|
56
|
-
nest [a workspace with a single Nest application]
|
|
57
|
-
express [a workspace with a single Express application]
|
|
58
|
-
web components [a workspace with a single app built using web components]
|
|
59
|
-
react-native [a workspace with a single React Native application]
|
|
60
|
-
react-express [a workspace with a full stack application (React + Express)]
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Select the preset that works best for you
|
|
64
|
-
|
|
65
|
-
### Adding Nx to an Existing Monorepo
|
|
46
|
+
### Adding Nx to an Existing Repository
|
|
66
47
|
|
|
67
48
|
Run:
|
|
68
49
|
|
|
69
50
|
```bash
|
|
70
|
-
npx
|
|
51
|
+
npx nx@latest init
|
|
71
52
|
```
|
|
72
53
|
|
|
73
54
|
## Documentation & Resources
|
|
74
55
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- [Nx
|
|
78
|
-
- [Tutorial: Adding Nx to an Existing Monorepo](/recipe/adding-to-monorepo)
|
|
79
|
-
- [Official Nx YouTube Channel](https://www.youtube.com/c/Nrwl_io)
|
|
56
|
+
- [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
|
|
57
|
+
- [Intro to Nx](https://nx.dev/getting-started/intro)
|
|
58
|
+
- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
|
|
80
59
|
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
|
|
81
60
|
|
|
82
61
|
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
package/babel.d.ts
ADDED
package/babel.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const path_1 = require("path");
|
|
4
|
+
module.exports = function (api, options = {}) {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
api.assertVersion(7);
|
|
7
|
+
const isModern = api.caller((caller) => caller === null || caller === void 0 ? void 0 : caller.isModern);
|
|
8
|
+
// This is set by `@nrwl/web:rollup` executor
|
|
9
|
+
const isNxPackage = api.caller((caller) => caller === null || caller === void 0 ? void 0 : caller.isNxPackage);
|
|
10
|
+
const emitDecoratorMetadata = api.caller((caller) => { var _a; return (_a = caller === null || caller === void 0 ? void 0 : caller.emitDecoratorMetadata) !== null && _a !== void 0 ? _a : true; });
|
|
11
|
+
// Determine settings for `@babel/plugin-proposal-class-properties`,
|
|
12
|
+
// so that we can sync the `loose` option with `@babel/preset-env`.
|
|
13
|
+
const classProperties = (_a = options.classProperties) !== null && _a !== void 0 ? _a : { loose: true };
|
|
14
|
+
return {
|
|
15
|
+
presets: [
|
|
16
|
+
// Support module/nomodule pattern.
|
|
17
|
+
[
|
|
18
|
+
require.resolve('@babel/preset-env'),
|
|
19
|
+
// For Jest tests, NODE_ENV is set as 'test' and we only want to set target as Node.
|
|
20
|
+
// All other options will fail in Jest since Node does not support some ES features
|
|
21
|
+
// such as import syntax.
|
|
22
|
+
process.env.NODE_ENV === 'test'
|
|
23
|
+
? { targets: { node: 'current' }, loose: true }
|
|
24
|
+
: {
|
|
25
|
+
// Allow importing core-js in entrypoint and use browserslist to select polyfills.
|
|
26
|
+
useBuiltIns: (_b = options.useBuiltIns) !== null && _b !== void 0 ? _b : 'entry',
|
|
27
|
+
corejs: 3,
|
|
28
|
+
// Do not transform modules to CJS
|
|
29
|
+
modules: false,
|
|
30
|
+
targets: isModern ? { esmodules: 'intersect' } : undefined,
|
|
31
|
+
bugfixes: true,
|
|
32
|
+
// Exclude transforms that make all code slower
|
|
33
|
+
exclude: ['transform-typeof-symbol'],
|
|
34
|
+
// This must match the setting for `@babel/plugin-proposal-class-properties`
|
|
35
|
+
loose: classProperties.loose,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
require.resolve('@babel/preset-typescript'),
|
|
40
|
+
{
|
|
41
|
+
allowDeclareFields: true,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
],
|
|
45
|
+
plugins: [
|
|
46
|
+
!isNxPackage
|
|
47
|
+
? [
|
|
48
|
+
require.resolve('@babel/plugin-transform-runtime'),
|
|
49
|
+
{
|
|
50
|
+
corejs: false,
|
|
51
|
+
helpers: true,
|
|
52
|
+
regenerator: true,
|
|
53
|
+
useESModules: isModern,
|
|
54
|
+
absoluteRuntime: (0, path_1.dirname)(require.resolve('@babel/runtime/package.json')),
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
: null,
|
|
58
|
+
require.resolve('babel-plugin-macros'),
|
|
59
|
+
emitDecoratorMetadata
|
|
60
|
+
? require.resolve('babel-plugin-transform-typescript-metadata')
|
|
61
|
+
: undefined,
|
|
62
|
+
// Must use legacy decorators to remain compatible with TypeScript.
|
|
63
|
+
[
|
|
64
|
+
require.resolve('@babel/plugin-proposal-decorators'),
|
|
65
|
+
(_c = options.decorators) !== null && _c !== void 0 ? _c : { legacy: true },
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
require.resolve('@babel/plugin-proposal-class-properties'),
|
|
69
|
+
classProperties,
|
|
70
|
+
],
|
|
71
|
+
].filter(Boolean),
|
|
72
|
+
overrides: [
|
|
73
|
+
// Convert `const enum` to `enum`. The former cannot be supported by babel
|
|
74
|
+
// but at least we can get it to not error out.
|
|
75
|
+
{
|
|
76
|
+
test: /\.tsx?$/,
|
|
77
|
+
plugins: [
|
|
78
|
+
[
|
|
79
|
+
require.resolve('babel-plugin-const-enum'),
|
|
80
|
+
{
|
|
81
|
+
transform: 'removeConst',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=babel.js.map
|
package/babel.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.js","sourceRoot":"","sources":["../../../packages/js/babel.ts"],"names":[],"mappings":";;AAAA,+BAA+B;AAiB/B,MAAM,CAAC,OAAO,GAAG,UAAU,GAAQ,EAAE,UAAmC,EAAE;;IACxE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAErB,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,CAAC;IAE1D,6CAA6C;IAC7C,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,CAAC;IAEhE,MAAM,qBAAqB,GAAG,GAAG,CAAC,MAAM,CACtC,CAAC,MAAM,EAAE,EAAE,WAAC,OAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,qBAAqB,mCAAI,IAAI,CAAA,EAAA,CAClD,CAAC;IAEF,qEAAqE;IACrE,mEAAmE;IACnE,MAAM,eAAe,GAAG,MAAA,OAAO,CAAC,eAAe,mCAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAEnE,OAAO;QACL,OAAO,EAAE;YACP,mCAAmC;YACnC;gBACE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC;gBACpC,oFAAoF;gBACpF,mFAAmF;gBACnF,yBAAyB;gBACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;oBAC7B,CAAC,CAAC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AAC;gBAC1D,eAAe;aAChB;SACF,CAAC,MAAM,CAAC,OAAO,CAAC;QACjB,SAAS,EAAE;YACT,0EAA0E;YAC1E,+CAA+C;YAC/C;gBACE,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACP;wBACE,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC;wBAC1C;4BACE,SAAS,EAAE,aAAa;yBACzB;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/generators.json
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"schema": "./src/generators/init/schema.json",
|
|
15
15
|
"aliases": ["lib"],
|
|
16
16
|
"x-type": "init",
|
|
17
|
-
"description": "
|
|
17
|
+
"description": "Initialize a TS/JS workspace.",
|
|
18
|
+
"hidden": true
|
|
18
19
|
},
|
|
19
20
|
"convert-to-swc": {
|
|
20
21
|
"factory": "./src/generators/convert-to-swc/convert-to-swc#convertToSwcSchematic",
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
"schema": "./src/generators/init/schema.json",
|
|
38
39
|
"aliases": ["lib"],
|
|
39
40
|
"x-type": "init",
|
|
40
|
-
"description": "
|
|
41
|
+
"description": "Initialize a TS/JS workspace.",
|
|
42
|
+
"hidden": true
|
|
41
43
|
},
|
|
42
44
|
"convert-to-swc": {
|
|
43
45
|
"factory": "./src/generators/convert-to-swc/convert-to-swc#convertToSwcGenerator",
|
package/migrations.json
CHANGED
|
@@ -29,7 +29,26 @@
|
|
|
29
29
|
"version": "14.1.5-beta.0",
|
|
30
30
|
"description": "Rename option swcrcPath to swcrc, and resolve relative to workspace root",
|
|
31
31
|
"factory": "./src/migrations/update-14-1-5/update-swcrc-path"
|
|
32
|
+
},
|
|
33
|
+
"rename-swcrc-config": {
|
|
34
|
+
"cli": "nx",
|
|
35
|
+
"version": "15.8.0-beta.0",
|
|
36
|
+
"description": "Rename .lib.swcrc to .swcrc for better SWC support throughout the workspace",
|
|
37
|
+
"factory": "./src/migrations/update-15-8-0/rename-swcrc-config"
|
|
32
38
|
}
|
|
33
39
|
},
|
|
34
|
-
"packageJsonUpdates": {
|
|
40
|
+
"packageJsonUpdates": {
|
|
41
|
+
"15.8.0": {
|
|
42
|
+
"version": "15.8.0-beta.2",
|
|
43
|
+
"x-prompt": "Do you want to update to TypeScript v4.9?",
|
|
44
|
+
"requires": {
|
|
45
|
+
"typescript": ">=4.8.2 <4.9.0"
|
|
46
|
+
},
|
|
47
|
+
"packages": {
|
|
48
|
+
"typescript": {
|
|
49
|
+
"version": "~4.9.5"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
35
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/js",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.9.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -32,23 +32,32 @@
|
|
|
32
32
|
"executors": "./executors.json",
|
|
33
33
|
"builders": "./executors.json",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
35
|
+
"@babel/core": "^7.15.0",
|
|
36
|
+
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
37
|
+
"@babel/plugin-proposal-decorators": "^7.14.5",
|
|
38
|
+
"@babel/plugin-transform-runtime": "^7.15.0",
|
|
39
|
+
"@babel/preset-env": "^7.15.0",
|
|
40
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
41
|
+
"@babel/runtime": "^7.14.8",
|
|
42
|
+
"@nrwl/devkit": "14.9.0-beta.1",
|
|
43
|
+
"@nrwl/workspace": "14.9.0-beta.1",
|
|
44
|
+
"@phenomnomnominal/tsquery": "4.1.1",
|
|
45
|
+
"babel-plugin-const-enum": "^1.0.1",
|
|
46
|
+
"babel-plugin-macros": "^2.8.0",
|
|
47
|
+
"babel-plugin-transform-typescript-metadata": "^0.3.1",
|
|
48
|
+
"chalk": "^4.1.0",
|
|
41
49
|
"fast-glob": "3.2.7",
|
|
42
|
-
"fs-extra": "^
|
|
50
|
+
"fs-extra": "^11.1.0",
|
|
43
51
|
"ignore": "^5.0.4",
|
|
44
52
|
"js-tokens": "^4.0.0",
|
|
45
53
|
"minimatch": "3.0.5",
|
|
46
54
|
"source-map-support": "0.5.19",
|
|
47
|
-
"tree-kill": "1.2.2"
|
|
55
|
+
"tree-kill": "1.2.2",
|
|
56
|
+
"tslib": "^2.3.0"
|
|
48
57
|
},
|
|
49
58
|
"publishConfig": {
|
|
50
59
|
"access": "public"
|
|
51
60
|
},
|
|
52
61
|
"types": "./src/index.d.ts",
|
|
53
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b2a467bcb2bdc124ed52f3755780bca429a43855"
|
|
54
63
|
}
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.nodeExecutor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const buildable_libs_utils_1 = require("
|
|
6
|
+
const buildable_libs_utils_1 = require("../../utils/buildable-libs-utils");
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
|
+
const crypto_1 = require("crypto");
|
|
8
9
|
const hashing_impl_1 = require("nx/src/hasher/hashing-impl");
|
|
9
10
|
const treeKill = require("tree-kill");
|
|
10
11
|
const util_1 = require("util");
|
|
@@ -13,17 +14,18 @@ const processMap = new Map();
|
|
|
13
14
|
const hashedMap = new Map();
|
|
14
15
|
function nodeExecutor(options, context) {
|
|
15
16
|
return tslib_1.__asyncGenerator(this, arguments, function* nodeExecutor_1() {
|
|
16
|
-
var e_1,
|
|
17
|
+
var _a, e_1, _b, _c;
|
|
18
|
+
const uniqueKey = (0, crypto_1.randomUUID)();
|
|
17
19
|
process.on('SIGTERM', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
yield killCurrentProcess(options, 'SIGTERM');
|
|
20
|
+
yield killCurrentProcess(uniqueKey, options, 'SIGTERM');
|
|
19
21
|
process.exit(128 + 15);
|
|
20
22
|
}));
|
|
21
23
|
process.on('SIGINT', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
yield killCurrentProcess(options, 'SIGINT');
|
|
24
|
+
yield killCurrentProcess(uniqueKey, options, 'SIGINT');
|
|
23
25
|
process.exit(128 + 2);
|
|
24
26
|
}));
|
|
25
27
|
process.on('SIGHUP', () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
yield killCurrentProcess(options, 'SIGHUP');
|
|
28
|
+
yield killCurrentProcess(uniqueKey, options, 'SIGHUP');
|
|
27
29
|
process.exit(128 + 1);
|
|
28
30
|
}));
|
|
29
31
|
if (options.waitUntilTargets && options.waitUntilTargets.length > 0) {
|
|
@@ -36,20 +38,27 @@ function nodeExecutor(options, context) {
|
|
|
36
38
|
}
|
|
37
39
|
const mappings = calculateResolveMappings(context, options);
|
|
38
40
|
try {
|
|
39
|
-
for (var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
for (var _d = true, _e = tslib_1.__asyncValues(startBuild(options, context)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a;) {
|
|
42
|
+
_c = _f.value;
|
|
43
|
+
_d = false;
|
|
44
|
+
try {
|
|
45
|
+
const event = _c;
|
|
46
|
+
if (!event.success) {
|
|
47
|
+
devkit_1.logger.error('There was an error with the build. See above.');
|
|
48
|
+
devkit_1.logger.info(`${event.outfile} was not restarted.`);
|
|
49
|
+
}
|
|
50
|
+
yield tslib_1.__await(handleBuildEvent(uniqueKey, event, options, mappings));
|
|
51
|
+
yield yield tslib_1.__await(event);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
_d = true;
|
|
44
55
|
}
|
|
45
|
-
yield tslib_1.__await(handleBuildEvent(event, options, mappings));
|
|
46
|
-
yield yield tslib_1.__await(event);
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
58
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
50
59
|
finally {
|
|
51
60
|
try {
|
|
52
|
-
if (
|
|
61
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
53
62
|
}
|
|
54
63
|
finally { if (e_1) throw e_1.error; }
|
|
55
64
|
}
|
|
@@ -57,7 +66,7 @@ function nodeExecutor(options, context) {
|
|
|
57
66
|
}
|
|
58
67
|
exports.nodeExecutor = nodeExecutor;
|
|
59
68
|
function calculateResolveMappings(context, options) {
|
|
60
|
-
const parsed = (0, devkit_1.parseTargetString)(options.buildTarget);
|
|
69
|
+
const parsed = (0, devkit_1.parseTargetString)(options.buildTarget, context.projectGraph);
|
|
61
70
|
const { dependencies } = (0, buildable_libs_utils_1.calculateProjectDependencies)(context.projectGraph, context.root, parsed.project, parsed.target, parsed.configuration);
|
|
62
71
|
return dependencies.reduce((m, c) => {
|
|
63
72
|
if (c.node.type !== 'npm' && c.outputs[0] != null) {
|
|
@@ -66,11 +75,12 @@ function calculateResolveMappings(context, options) {
|
|
|
66
75
|
return m;
|
|
67
76
|
}, {});
|
|
68
77
|
}
|
|
69
|
-
function runProcess(event, options, mappings) {
|
|
78
|
+
function runProcess(uniqueKey, event, options, mappings) {
|
|
70
79
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
80
|
const execArgv = getExecArgv(options);
|
|
72
|
-
const
|
|
73
|
-
|
|
81
|
+
const hashedKey = JSON.stringify([uniqueKey, ...options.args]);
|
|
82
|
+
const hashed = hasher.hashArray(execArgv.concat(hashedKey));
|
|
83
|
+
hashedMap.set(hashedKey, hashed);
|
|
74
84
|
const subProcess = (0, child_process_1.fork)((0, devkit_1.joinPathFragments)(__dirname, 'node-with-require-overrides'), options.args, {
|
|
75
85
|
execArgv,
|
|
76
86
|
stdio: 'inherit',
|
|
@@ -105,21 +115,22 @@ function getExecArgv(options) {
|
|
|
105
115
|
}
|
|
106
116
|
return args;
|
|
107
117
|
}
|
|
108
|
-
function handleBuildEvent(event, options, mappings) {
|
|
118
|
+
function handleBuildEvent(uniqueKey, event, options, mappings) {
|
|
109
119
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
110
120
|
// Don't kill previous run unless new build is successful.
|
|
111
121
|
if (options.watch && event.success) {
|
|
112
|
-
yield killCurrentProcess(options);
|
|
122
|
+
yield killCurrentProcess(uniqueKey, options);
|
|
113
123
|
}
|
|
114
124
|
if (event.success) {
|
|
115
|
-
yield runProcess(event, options, mappings);
|
|
125
|
+
yield runProcess(uniqueKey, event, options, mappings);
|
|
116
126
|
}
|
|
117
127
|
});
|
|
118
128
|
}
|
|
119
129
|
const promisifiedTreeKill = (0, util_1.promisify)(treeKill);
|
|
120
|
-
function killCurrentProcess(options, signal = 'SIGTERM') {
|
|
130
|
+
function killCurrentProcess(uniqueKey, options, signal = 'SIGTERM') {
|
|
121
131
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
const
|
|
132
|
+
const hashedKey = JSON.stringify([uniqueKey, ...options.args]);
|
|
133
|
+
const currentProcessKey = hashedMap.get(hashedKey);
|
|
123
134
|
if (!currentProcessKey)
|
|
124
135
|
return;
|
|
125
136
|
const currentProcess = processMap.get(currentProcessKey);
|
|
@@ -144,22 +155,19 @@ function killCurrentProcess(options, signal = 'SIGTERM') {
|
|
|
144
155
|
}
|
|
145
156
|
finally {
|
|
146
157
|
processMap.delete(currentProcessKey);
|
|
147
|
-
hashedMap.delete(
|
|
158
|
+
hashedMap.delete(hashedKey);
|
|
148
159
|
}
|
|
149
160
|
});
|
|
150
161
|
}
|
|
151
162
|
function startBuild(options, context) {
|
|
152
|
-
var _a;
|
|
153
163
|
return tslib_1.__asyncGenerator(this, arguments, function* startBuild_1() {
|
|
154
|
-
const buildTarget = (0, devkit_1.parseTargetString)(options.buildTarget);
|
|
155
|
-
// TODO(jack): [Nx 14] Remove this line once we generate `development` configuration by default + add migration for it if missing
|
|
156
|
-
(_a = buildTarget.configuration) !== null && _a !== void 0 ? _a : (buildTarget.configuration = '');
|
|
164
|
+
const buildTarget = (0, devkit_1.parseTargetString)(options.buildTarget, context.projectGraph);
|
|
157
165
|
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(yield tslib_1.__await((0, devkit_1.runExecutor)(buildTarget, Object.assign(Object.assign({}, options.buildTargetOptions), { watch: options.watch }), context)))));
|
|
158
166
|
});
|
|
159
167
|
}
|
|
160
168
|
function runWaitUntilTargets(options, context) {
|
|
161
169
|
return Promise.all(options.waitUntilTargets.map((waitUntilTarget) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
const target = (0, devkit_1.parseTargetString)(waitUntilTarget);
|
|
170
|
+
const target = (0, devkit_1.parseTargetString)(waitUntilTarget, context.projectGraph);
|
|
163
171
|
const output = yield (0, devkit_1.runExecutor)(target, {}, context);
|
|
164
172
|
return new Promise((resolve) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
165
173
|
let event = yield output.next();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.impl.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AACtB,
|
|
1
|
+
{"version":3,"file":"node.impl.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AACtB,2EAAgF;AAChF,iDAAmD;AACnD,mCAAoC;AACpC,6DAAyD;AACzD,sCAAsC;AACtC,+BAAiC;AAGjC,MAAM,MAAM,GAAG,IAAI,0BAAW,EAAE,CAAC;AACjC,MAAM,UAAU,GAAG,I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,0BAAiB,EAAC,eAAe,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QACxE,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAW,EAAC,MAAM,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QACtD,OAAO,IAAI,OAAO,CAAuB,CAAO,OAAO,EAAE,EAAE;YACzD,IAAI,KAAK,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAChC,4BAA4B;YAC5B,OAAO,CAAC,KAAK,CAAC,KAA6B,CAAC,CAAC;YAE7C,qBAAqB;YACrB,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE;gBAClB,KAAK,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;aAC7B;QACH,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CACH,CAAC;AACJ,CAAC;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
2
4
|
"$schema": "http://json-schema.org/schema",
|
|
3
5
|
"cli": "nx",
|
|
4
6
|
"title": "Node executor",
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
},
|
|
17
19
|
"waitUntilTargets": {
|
|
18
20
|
"type": "array",
|
|
19
|
-
"description": "The targets to run
|
|
21
|
+
"description": "The targets to run before starting the node app.",
|
|
20
22
|
"default": [],
|
|
21
23
|
"items": {
|
|
22
24
|
"type": "string"
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
2
4
|
"$schema": "http://json-schema.org/schema",
|
|
3
5
|
"cli": "nx",
|
|
4
6
|
"title": "Typescript Build Target",
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
},
|
|
25
27
|
"swcrc": {
|
|
26
28
|
"type": "string",
|
|
27
|
-
"description": "The path to the SWC configuration file. Default: .
|
|
29
|
+
"description": "The path to the SWC configuration file. Default: .swcrc",
|
|
28
30
|
"x-completion-type": "file",
|
|
29
31
|
"x-completion-glob": ".swcrc"
|
|
30
32
|
},
|
|
@@ -49,7 +51,8 @@
|
|
|
49
51
|
"skipTypeCheck": {
|
|
50
52
|
"type": "boolean",
|
|
51
53
|
"description": "Whether to skip TypeScript type checking.",
|
|
52
|
-
"default": false
|
|
54
|
+
"default": false,
|
|
55
|
+
"x-priority": "important"
|
|
53
56
|
},
|
|
54
57
|
"swcExclude": {
|
|
55
58
|
"type": "array",
|
|
@@ -60,11 +63,12 @@
|
|
|
60
63
|
"./src/**/jest-setup.ts$",
|
|
61
64
|
"./**/jest-setup.ts$",
|
|
62
65
|
"./**/.*.js$"
|
|
63
|
-
]
|
|
66
|
+
],
|
|
67
|
+
"hidden": true
|
|
64
68
|
},
|
|
65
69
|
"updateBuildableProjectDepsInPackageJson": {
|
|
66
70
|
"type": "boolean",
|
|
67
|
-
"description": "Whether to update the buildable project dependencies in
|
|
71
|
+
"description": "Whether to update the buildable project dependencies in the build output package.json.",
|
|
68
72
|
"default": true
|
|
69
73
|
},
|
|
70
74
|
"buildableProjectDepsInPackageJsonType": {
|
|
@@ -72,6 +76,35 @@
|
|
|
72
76
|
"description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
|
|
73
77
|
"enum": ["dependencies", "peerDependencies"],
|
|
74
78
|
"default": "peerDependencies"
|
|
79
|
+
},
|
|
80
|
+
"external": {
|
|
81
|
+
"description": "A list projects to be treated as external. This feature is experimental",
|
|
82
|
+
"oneOf": [
|
|
83
|
+
{
|
|
84
|
+
"type": "string",
|
|
85
|
+
"enum": ["all", "none"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "array",
|
|
89
|
+
"items": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"externalBuildTargets": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"description": "List of target names that annotate a build target for a project",
|
|
101
|
+
"default": ["build"]
|
|
102
|
+
},
|
|
103
|
+
"generateLockfile": {
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"description": "Generate a lockfile (e.g. yarn.lock) that matches the workspace lockfile to ensure package versions match.",
|
|
106
|
+
"default": false,
|
|
107
|
+
"x-priority": "internal"
|
|
75
108
|
}
|
|
76
109
|
},
|
|
77
110
|
"required": ["main", "outputPath", "tsConfig"],
|
|
@@ -109,5 +142,6 @@
|
|
|
109
142
|
}
|
|
110
143
|
]
|
|
111
144
|
}
|
|
112
|
-
}
|
|
145
|
+
},
|
|
146
|
+
"examplesFile": "../../../docs/swc-examples.md"
|
|
113
147
|
}
|
|
@@ -3,5 +3,9 @@ import { NormalizedSwcExecutorOptions, SwcExecutorOptions } from '../../utils/sc
|
|
|
3
3
|
export declare function normalizeOptions(options: SwcExecutorOptions, contextRoot: string, sourceRoot?: string, projectRoot?: string): NormalizedSwcExecutorOptions;
|
|
4
4
|
export declare function swcExecutor(_options: SwcExecutorOptions, context: ExecutorContext): AsyncGenerator<{
|
|
5
5
|
success: boolean;
|
|
6
|
+
outfile?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
success: boolean;
|
|
9
|
+
outfile: string;
|
|
6
10
|
}, any, undefined>;
|
|
7
11
|
export default swcExecutor;
|