@nrwl/js 13.4.0-beta.1 → 13.4.1-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/executors.json +20 -0
- package/generators.json +14 -0
- package/package.json +10 -6
- package/src/executors/node/compat.d.ts +2 -0
- package/src/executors/node/compat.js +6 -0
- package/src/executors/node/compat.js.map +1 -0
- package/src/executors/node/node-with-require-overrides.d.ts +5 -0
- package/src/executors/node/node-with-require-overrides.js +20 -0
- package/src/executors/node/node-with-require-overrides.js.map +1 -0
- package/src/executors/node/node.impl.d.ts +5 -0
- package/src/executors/node/node.impl.js +141 -0
- package/src/executors/node/node.impl.js.map +1 -0
- package/src/executors/node/schema.d.ts +16 -0
- package/src/executors/node/schema.json +67 -0
- package/src/executors/swc/compat.d.ts +2 -0
- package/src/executors/swc/compat.js +6 -0
- package/src/executors/swc/compat.js.map +1 -0
- package/src/executors/swc/schema.d.ts +10 -0
- package/src/executors/swc/schema.json +75 -0
- package/src/executors/swc/swc.impl.d.ts +5 -0
- package/src/executors/swc/swc.impl.js +50 -0
- package/src/executors/swc/swc.impl.js.map +1 -0
- package/src/executors/tsc/schema.json +34 -1
- package/src/executors/tsc/tsc.impl.d.ts +3 -4
- package/src/executors/tsc/tsc.impl.js +35 -50
- package/src/executors/tsc/tsc.impl.js.map +1 -1
- package/src/generators/application/application.d.ts +3 -3
- package/src/generators/application/application.js.map +1 -1
- package/src/generators/convert-to-swc/convert-to-swc.d.ts +5 -0
- package/src/generators/convert-to-swc/convert-to-swc.js +54 -0
- package/src/generators/convert-to-swc/convert-to-swc.js.map +1 -0
- package/src/generators/convert-to-swc/schema.d.ts +4 -0
- package/src/generators/convert-to-swc/schema.json +35 -0
- package/src/generators/library/library.d.ts +3 -3
- package/src/generators/library/library.js.map +1 -1
- package/src/generators/library/schema.json +6 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +5 -0
- package/src/index.js.map +1 -1
- package/src/utils/check-dependencies.d.ts +5 -0
- package/src/utils/check-dependencies.js +32 -0
- package/src/utils/check-dependencies.js.map +1 -0
- package/src/utils/normalize-ts-compilation-options.d.ts +2 -0
- package/src/utils/normalize-ts-compilation-options.js +9 -0
- package/src/utils/normalize-ts-compilation-options.js.map +1 -0
- package/src/utils/project-generator.d.ts +3 -3
- package/src/utils/project-generator.js +30 -16
- package/src/utils/project-generator.js.map +1 -1
- package/src/utils/schema.d.ts +42 -2
- package/src/utils/swc/add-swc-config.d.ts +2 -0
- package/src/utils/swc/add-swc-config.js +36 -0
- package/src/utils/swc/add-swc-config.js.map +1 -0
- package/src/utils/swc/add-swc-dependencies.d.ts +2 -0
- package/src/utils/swc/add-swc-dependencies.js +14 -0
- package/src/utils/swc/add-swc-dependencies.js.map +1 -0
- package/src/utils/swc/compile-swc.d.ts +6 -0
- package/src/utils/swc/compile-swc.js +128 -0
- package/src/utils/swc/compile-swc.js.map +1 -0
- package/src/utils/typescript/__mocks__/plugin-a.d.ts +1 -0
- package/src/utils/typescript/__mocks__/plugin-a.js +6 -0
- package/src/utils/typescript/__mocks__/plugin-a.js.map +1 -0
- package/src/utils/typescript/__mocks__/plugin-b.d.ts +1 -0
- package/src/utils/typescript/__mocks__/plugin-b.js +6 -0
- package/src/utils/typescript/__mocks__/plugin-b.js.map +1 -0
- package/src/utils/typescript/compile-typescript-files.d.ts +4 -0
- package/src/utils/typescript/compile-typescript-files.js +59 -0
- package/src/utils/typescript/compile-typescript-files.js.map +1 -0
- package/src/utils/typescript/load-ts-plugins.d.ts +5 -0
- package/src/utils/typescript/load-ts-plugins.js +63 -0
- package/src/utils/typescript/load-ts-plugins.js.map +1 -0
- package/src/utils/typescript/print-diagnostics.d.ts +1 -2
- package/src/utils/typescript/print-diagnostics.js +7 -7
- package/src/utils/typescript/print-diagnostics.js.map +1 -1
- package/src/utils/typescript/run-type-check.d.ts +8 -3
- package/src/utils/typescript/run-type-check.js +90 -58
- package/src/utils/typescript/run-type-check.js.map +1 -1
- package/src/utils/typescript/types.d.ts +18 -0
- package/src/utils/typescript/types.js +3 -0
- package/src/utils/typescript/types.js.map +1 -0
- package/src/utils/update-package-json.d.ts +1 -0
- package/src/utils/update-package-json.js +30 -0
- package/src/utils/update-package-json.js.map +1 -0
- package/src/utils/versions.d.ts +2 -0
- package/src/utils/versions.js +4 -2
- package/src/utils/versions.js.map +1 -1
- package/src/executors/tsc/schema.d.ts +0 -6
package/executors.json
CHANGED
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
"implementation": "./src/executors/tsc/tsc.impl",
|
|
6
6
|
"schema": "./src/executors/tsc/schema.json",
|
|
7
7
|
"description": "Build a project using TypeScript."
|
|
8
|
+
},
|
|
9
|
+
"swc": {
|
|
10
|
+
"implementation": "./src/executors/swc/swc.impl",
|
|
11
|
+
"schema": "./src/executors/swc/schema.json",
|
|
12
|
+
"description": "Build a project using SWC"
|
|
13
|
+
},
|
|
14
|
+
"node": {
|
|
15
|
+
"implementation": "./src/executors/node/node.impl",
|
|
16
|
+
"schema": "./src/executors/node/schema.json",
|
|
17
|
+
"description": "Build Node.js applications"
|
|
8
18
|
}
|
|
9
19
|
},
|
|
10
20
|
"builders": {
|
|
@@ -12,6 +22,16 @@
|
|
|
12
22
|
"implementation": "./src/executors/tsc/compat",
|
|
13
23
|
"schema": "./src/executors/tsc/schema.json",
|
|
14
24
|
"description": "Build a project using TypeScript."
|
|
25
|
+
},
|
|
26
|
+
"swc": {
|
|
27
|
+
"implementation": "./src/executors/swc/compat",
|
|
28
|
+
"schema": "./src/executors/swc/schema.json",
|
|
29
|
+
"description": "Build a project using SWC"
|
|
30
|
+
},
|
|
31
|
+
"node": {
|
|
32
|
+
"implementation": "./src/executors/node/compat",
|
|
33
|
+
"schema": "./src/executors/node/schema.json",
|
|
34
|
+
"description": "Build Node.js applications"
|
|
15
35
|
}
|
|
16
36
|
}
|
|
17
37
|
}
|
package/generators.json
CHANGED
|
@@ -15,6 +15,13 @@
|
|
|
15
15
|
"aliases": ["app"],
|
|
16
16
|
"x-type": "application",
|
|
17
17
|
"description": "Create a application"
|
|
18
|
+
},
|
|
19
|
+
"convert-to-swc": {
|
|
20
|
+
"factory": "./src/generators/convert-to-swc/convert-to-swc#convertToSwcSchematic",
|
|
21
|
+
"schema": "./src/generators/convert-to-swc/schema.json",
|
|
22
|
+
"aliases": ["swc"],
|
|
23
|
+
"x-type": "library",
|
|
24
|
+
"description": "Convert a tsc library to swc"
|
|
18
25
|
}
|
|
19
26
|
},
|
|
20
27
|
"generators": {
|
|
@@ -31,6 +38,13 @@
|
|
|
31
38
|
"aliases": ["app"],
|
|
32
39
|
"x-type": "application",
|
|
33
40
|
"description": "Create a application"
|
|
41
|
+
},
|
|
42
|
+
"convert-to-swc": {
|
|
43
|
+
"factory": "./src/generators/convert-to-swc/convert-to-swc#convertToSwcGenerator",
|
|
44
|
+
"schema": "./src/generators/convert-to-swc/schema.json",
|
|
45
|
+
"aliases": ["swc"],
|
|
46
|
+
"x-type": "library",
|
|
47
|
+
"description": "Convert a tsc library to swc"
|
|
34
48
|
}
|
|
35
49
|
}
|
|
36
50
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/js",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.1-beta.1",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"generators": "./generators.json",
|
|
6
6
|
"schematics": "./generators.json",
|
|
7
7
|
"executors": "./executors.json",
|
|
8
8
|
"builders": "./executors.json",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@nrwl/workspace": "13.4.
|
|
11
|
-
"@nrwl/devkit": "13.4.
|
|
12
|
-
"@nrwl/jest": "13.4.
|
|
13
|
-
"@nrwl/linter": "13.4.
|
|
10
|
+
"@nrwl/workspace": "13.4.1-beta.1",
|
|
11
|
+
"@nrwl/devkit": "13.4.1-beta.1",
|
|
12
|
+
"@nrwl/jest": "13.4.1-beta.1",
|
|
13
|
+
"@nrwl/linter": "13.4.1-beta.1",
|
|
14
14
|
"chalk": "4.1.0",
|
|
15
|
-
"js-tokens": "^4.0.0"
|
|
15
|
+
"js-tokens": "^4.0.0",
|
|
16
|
+
"rxjs": "^6.5.4",
|
|
17
|
+
"rxjs-for-await": "0.0.2",
|
|
18
|
+
"source-map-support": "0.5.19",
|
|
19
|
+
"tree-kill": "1.2.2"
|
|
16
20
|
},
|
|
17
21
|
"typings": "./src/index.d.ts"
|
|
18
22
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
+
const node_impl_1 = require("./node.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(node_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AACjD,2CAAuC;AAEvC,kBAAe,IAAA,0BAAiB,EAAC,mBAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Module = require('module');
|
|
2
|
+
const originalLoader = Module._load;
|
|
3
|
+
const mappings = JSON.parse(process.env.NX_MAPPINGS);
|
|
4
|
+
const keys = Object.keys(mappings);
|
|
5
|
+
const fileToRun = process.env.NX_FILE_TO_RUN;
|
|
6
|
+
Module._load = function (request, parent) {
|
|
7
|
+
if (!parent)
|
|
8
|
+
return originalLoader.apply(this, arguments);
|
|
9
|
+
const match = keys.find((k) => request === k);
|
|
10
|
+
if (match) {
|
|
11
|
+
const newArguments = [...arguments];
|
|
12
|
+
newArguments[0] = mappings[match];
|
|
13
|
+
return originalLoader.apply(this, newArguments);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return originalLoader.apply(this, arguments);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
require(fileToRun);
|
|
20
|
+
//# sourceMappingURL=node-with-require-overrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-with-require-overrides.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node-with-require-overrides.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC;AAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACrD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACnC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;AAE7C,MAAM,CAAC,KAAK,GAAG,UAAU,OAAO,EAAE,MAAM;IACtC,IAAI,CAAC,MAAM;QAAE,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC;IAC9C,IAAI,KAAK,EAAE;QACT,MAAM,YAAY,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC;QACpC,YAAY,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;KACjD;SAAM;QACL,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;KAC9C;AACH,CAAC,CAAC;AAEF,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { ExecutorEvent } from '../../utils/schema';
|
|
3
|
+
import { NodeExecutorOptions } from './schema';
|
|
4
|
+
export declare function nodeExecutor(options: NodeExecutorOptions, context: ExecutorContext): AsyncGenerator<ExecutorEvent, void, unknown>;
|
|
5
|
+
export default nodeExecutor;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nodeExecutor = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const treeKill = require("tree-kill");
|
|
8
|
+
const util_1 = require("util");
|
|
9
|
+
const project_graph_1 = require("@nrwl/workspace/src/core/project-graph");
|
|
10
|
+
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
11
|
+
let subProcess = null;
|
|
12
|
+
function nodeExecutor(options, context) {
|
|
13
|
+
return (0, tslib_1.__asyncGenerator)(this, arguments, function* nodeExecutor_1() {
|
|
14
|
+
var e_1, _a;
|
|
15
|
+
// for now we only run the executor in the watch mode
|
|
16
|
+
options.watch = true;
|
|
17
|
+
process.on('SIGTERM', () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
18
|
+
yield killProcess();
|
|
19
|
+
process.exit(128 + 15);
|
|
20
|
+
}));
|
|
21
|
+
process.on('SIGINT', () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
22
|
+
yield killProcess();
|
|
23
|
+
process.exit(128 + 2);
|
|
24
|
+
}));
|
|
25
|
+
process.on('SIGHUP', () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
26
|
+
yield killProcess();
|
|
27
|
+
process.exit(128 + 1);
|
|
28
|
+
}));
|
|
29
|
+
if (options.waitUntilTargets && options.waitUntilTargets.length > 0) {
|
|
30
|
+
const results = yield (0, tslib_1.__await)(runWaitUntilTargets(options, context));
|
|
31
|
+
for (const [i, result] of results.entries()) {
|
|
32
|
+
if (!result.success) {
|
|
33
|
+
throw new Error(`Wait until target failed: ${options.waitUntilTargets[i]}.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const mappings = calculateResolveMappings(context, options);
|
|
38
|
+
try {
|
|
39
|
+
for (var _b = (0, tslib_1.__asyncValues)(startBuild(options, context)), _c; _c = yield (0, tslib_1.__await)(_b.next()), !_c.done;) {
|
|
40
|
+
const event = _c.value;
|
|
41
|
+
if (!event.success) {
|
|
42
|
+
devkit_1.logger.error('There was an error with the build. See above.');
|
|
43
|
+
devkit_1.logger.info(`${event.outfile} was not restarted.`);
|
|
44
|
+
}
|
|
45
|
+
yield (0, tslib_1.__await)(handleBuildEvent(event, options, mappings));
|
|
46
|
+
yield yield (0, tslib_1.__await)(event);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
50
|
+
finally {
|
|
51
|
+
try {
|
|
52
|
+
if (_c && !_c.done && (_a = _b.return)) yield (0, tslib_1.__await)(_a.call(_b));
|
|
53
|
+
}
|
|
54
|
+
finally { if (e_1) throw e_1.error; }
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.nodeExecutor = nodeExecutor;
|
|
59
|
+
function calculateResolveMappings(context, options) {
|
|
60
|
+
const projectGraph = (0, project_graph_1.readCachedProjectGraph)();
|
|
61
|
+
const parsed = (0, devkit_1.parseTargetString)(options.buildTarget);
|
|
62
|
+
const { dependencies } = (0, buildable_libs_utils_1.calculateProjectDependencies)(projectGraph, context.root, parsed.project, parsed.target, parsed.configuration);
|
|
63
|
+
return dependencies.reduce((m, c) => {
|
|
64
|
+
m[c.name] = (0, devkit_1.joinPathFragments)(context.root, c.outputs[0]);
|
|
65
|
+
return m;
|
|
66
|
+
}, {});
|
|
67
|
+
}
|
|
68
|
+
function runProcess(event, options, mappings) {
|
|
69
|
+
subProcess = (0, child_process_1.fork)((0, devkit_1.joinPathFragments)(__dirname, 'node-with-require-overrides'), options.args, {
|
|
70
|
+
execArgv: getExecArgv(options),
|
|
71
|
+
stdio: 'inherit',
|
|
72
|
+
env: Object.assign(Object.assign({}, process.env), { NX_FILE_TO_RUN: event.outfile, NX_MAPPINGS: JSON.stringify(mappings) }),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function getExecArgv(options) {
|
|
76
|
+
const args = [
|
|
77
|
+
'-r',
|
|
78
|
+
require.resolve('source-map-support/register'),
|
|
79
|
+
...options.runtimeArgs,
|
|
80
|
+
];
|
|
81
|
+
if (options.inspect === true) {
|
|
82
|
+
options.inspect = "inspect" /* Inspect */;
|
|
83
|
+
}
|
|
84
|
+
if (options.inspect) {
|
|
85
|
+
args.push(`--${options.inspect}=${options.host}:${options.port}`);
|
|
86
|
+
}
|
|
87
|
+
return args;
|
|
88
|
+
}
|
|
89
|
+
function handleBuildEvent(event, options, mappings) {
|
|
90
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
91
|
+
if ((!event.success || options.watch) && subProcess) {
|
|
92
|
+
yield killProcess();
|
|
93
|
+
}
|
|
94
|
+
if (event.success) {
|
|
95
|
+
runProcess(event, options, mappings);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function killProcess() {
|
|
100
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
101
|
+
const promisifiedTreeKill = (0, util_1.promisify)(treeKill);
|
|
102
|
+
try {
|
|
103
|
+
yield promisifiedTreeKill(subProcess.pid, 'SIGTERM');
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
if (Array.isArray(err) && err[0] && err[2]) {
|
|
107
|
+
const errorMessage = err[2];
|
|
108
|
+
devkit_1.logger.error(errorMessage);
|
|
109
|
+
}
|
|
110
|
+
else if (err.message) {
|
|
111
|
+
devkit_1.logger.error(err.message);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
subProcess = null;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function startBuild(options, context) {
|
|
120
|
+
return (0, tslib_1.__asyncGenerator)(this, arguments, function* startBuild_1() {
|
|
121
|
+
const buildTarget = (0, devkit_1.parseTargetString)(options.buildTarget);
|
|
122
|
+
yield (0, tslib_1.__await)(yield* (0, tslib_1.__asyncDelegator)((0, tslib_1.__asyncValues)(yield (0, tslib_1.__await)((0, devkit_1.runExecutor)(buildTarget, Object.assign(Object.assign({}, options.buildTargetOptions), { watch: options.watch }), context)))));
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function runWaitUntilTargets(options, context) {
|
|
126
|
+
return Promise.all(options.waitUntilTargets.map((waitUntilTarget) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
127
|
+
const target = (0, devkit_1.parseTargetString)(waitUntilTarget);
|
|
128
|
+
const output = yield (0, devkit_1.runExecutor)(target, {}, context);
|
|
129
|
+
return new Promise((resolve) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
130
|
+
let event = yield output.next();
|
|
131
|
+
// Resolve after first event
|
|
132
|
+
resolve(event.value);
|
|
133
|
+
// Continue iterating
|
|
134
|
+
while (!event.done) {
|
|
135
|
+
event = yield output.next();
|
|
136
|
+
}
|
|
137
|
+
}));
|
|
138
|
+
})));
|
|
139
|
+
}
|
|
140
|
+
exports.default = nodeExecutor;
|
|
141
|
+
//# sourceMappingURL=node.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.impl.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/node/node.impl.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AACtB,iDAAmD;AACnD,sCAAsC;AACtC,+BAAiC;AAGjC,0EAAgF;AAChF,6FAAkG;AAElG,IAAI,UAAU,GAAiB,IAAI,CAAC;AAEpC,SAAuB,YAA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AED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const enum InspectType {
|
|
2
|
+
Inspect = 'inspect',
|
|
3
|
+
InspectBrk = 'inspect-brk',
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface NodeExecutorOptions {
|
|
7
|
+
inspect: boolean | InspectType;
|
|
8
|
+
runtimeArgs: string[];
|
|
9
|
+
args: string[];
|
|
10
|
+
waitUntilTargets: string[];
|
|
11
|
+
buildTarget: string;
|
|
12
|
+
buildTargetOptions: Record<string, any>;
|
|
13
|
+
host: string;
|
|
14
|
+
port: number;
|
|
15
|
+
watch: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"title": "Node executor",
|
|
5
|
+
"description": "Execute Nodejs applications",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"buildTarget": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The target to run to build you the app"
|
|
11
|
+
},
|
|
12
|
+
"buildTargetOptions": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"description": "Additional options to pass into the build target.",
|
|
15
|
+
"default": {}
|
|
16
|
+
},
|
|
17
|
+
"waitUntilTargets": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"description": "The targets to run to before starting the node app",
|
|
20
|
+
"default": [],
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"host": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"default": "localhost",
|
|
28
|
+
"description": "The host to inspect the process on"
|
|
29
|
+
},
|
|
30
|
+
"port": {
|
|
31
|
+
"type": "number",
|
|
32
|
+
"default": 9229,
|
|
33
|
+
"description": "The port to inspect the process on. Setting port to 0 will assign random free ports to all forked processes."
|
|
34
|
+
},
|
|
35
|
+
"inspect": {
|
|
36
|
+
"oneOf": [
|
|
37
|
+
{
|
|
38
|
+
"type": "string",
|
|
39
|
+
"enum": ["inspect", "inspect-brk"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "boolean"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"description": "Ensures the app is starting with debugging",
|
|
46
|
+
"default": "inspect"
|
|
47
|
+
},
|
|
48
|
+
"runtimeArgs": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"description": "Extra args passed to the node process",
|
|
51
|
+
"default": [],
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"args": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"description": "Extra args when starting the app",
|
|
59
|
+
"default": [],
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": ["buildTarget"]
|
|
67
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
+
const swc_impl_1 = require("./swc.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(swc_impl_1.swcExecutor);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/swc/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AACjD,yCAAyC;AAEzC,kBAAe,IAAA,0BAAiB,EAAC,sBAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExecutorOptions, NormalizedExecutorOptions } from '../../utils/schema';
|
|
2
|
+
|
|
3
|
+
export interface SwcExecutorOptions extends ExecutorOptions {
|
|
4
|
+
skipTypeCheck?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface NormalizedSwcExecutorOptions
|
|
8
|
+
extends NormalizedExecutorOptions {
|
|
9
|
+
skipTypeCheck: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"title": "Typescript Build Target",
|
|
5
|
+
"description": "Builds using SWC",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"main": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the main entry-point file."
|
|
11
|
+
},
|
|
12
|
+
"outputPath": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The output path of the generated files."
|
|
15
|
+
},
|
|
16
|
+
"tsConfig": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The path to the Typescript configuration file."
|
|
19
|
+
},
|
|
20
|
+
"assets": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"description": "List of static assets.",
|
|
23
|
+
"default": [],
|
|
24
|
+
"items": {
|
|
25
|
+
"$ref": "#/definitions/assetPattern"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"watch": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Enable re-building when files change.",
|
|
31
|
+
"default": false
|
|
32
|
+
},
|
|
33
|
+
"skipTypeCheck": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"description": "Whether to skip TypeScript type checking.",
|
|
36
|
+
"default": false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": ["main", "outputPath", "tsConfig"],
|
|
40
|
+
"definitions": {
|
|
41
|
+
"assetPattern": {
|
|
42
|
+
"oneOf": [
|
|
43
|
+
{
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"glob": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "The pattern to match."
|
|
49
|
+
},
|
|
50
|
+
"input": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
53
|
+
},
|
|
54
|
+
"ignore": {
|
|
55
|
+
"description": "An array of globs to ignore.",
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"output": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Absolute path within the output."
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["glob", "input", "output"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "string"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { ExecutorEvent, NormalizedSwcExecutorOptions, SwcExecutorOptions } from '../../utils/schema';
|
|
3
|
+
export declare function normalizeOptions(options: SwcExecutorOptions, contextRoot: string, sourceRoot?: string, projectRoot?: string): NormalizedSwcExecutorOptions;
|
|
4
|
+
export declare function swcExecutor(options: SwcExecutorOptions, context: ExecutorContext): AsyncGenerator<ExecutorEvent, any, undefined>;
|
|
5
|
+
export default swcExecutor;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.swcExecutor = exports.normalizeOptions = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const assets_1 = require("@nrwl/workspace/src/utilities/assets");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const rxjs_for_await_1 = require("rxjs-for-await");
|
|
8
|
+
const operators_1 = require("rxjs/operators");
|
|
9
|
+
const check_dependencies_1 = require("../../utils/check-dependencies");
|
|
10
|
+
const compile_swc_1 = require("../../utils/swc/compile-swc");
|
|
11
|
+
const update_package_json_1 = require("../../utils/update-package-json");
|
|
12
|
+
function normalizeOptions(options, contextRoot, sourceRoot, projectRoot) {
|
|
13
|
+
const outputPath = (0, path_1.join)(contextRoot, options.outputPath);
|
|
14
|
+
if (options.skipTypeCheck == null) {
|
|
15
|
+
options.skipTypeCheck = false;
|
|
16
|
+
}
|
|
17
|
+
if (options.watch == null) {
|
|
18
|
+
options.watch = false;
|
|
19
|
+
}
|
|
20
|
+
const files = (0, assets_1.assetGlobsToFiles)(options.assets, contextRoot, outputPath);
|
|
21
|
+
return Object.assign(Object.assign({}, options), { swcrcPath: (0, path_1.join)(projectRoot, '.swcrc'), mainOutputPath: (0, path_1.resolve)(outputPath, options.main.replace(`${projectRoot}/`, '').replace('.ts', '.js')), files, root: contextRoot, sourceRoot,
|
|
22
|
+
projectRoot,
|
|
23
|
+
outputPath, tsConfig: (0, path_1.join)(contextRoot, options.tsConfig) });
|
|
24
|
+
}
|
|
25
|
+
exports.normalizeOptions = normalizeOptions;
|
|
26
|
+
function swcExecutor(options, context) {
|
|
27
|
+
return (0, tslib_1.__asyncGenerator)(this, arguments, function* swcExecutor_1() {
|
|
28
|
+
const { sourceRoot, root } = context.workspace.projects[context.projectName];
|
|
29
|
+
const normalizedOptions = normalizeOptions(options, context.root, sourceRoot, root);
|
|
30
|
+
const { tmpTsConfig, projectRoot } = (0, check_dependencies_1.checkDependencies)(context, options.tsConfig);
|
|
31
|
+
if (tmpTsConfig) {
|
|
32
|
+
normalizedOptions.tsConfig = tmpTsConfig;
|
|
33
|
+
}
|
|
34
|
+
return yield (0, tslib_1.__await)(yield (0, tslib_1.__await)(yield* (0, tslib_1.__asyncDelegator)((0, tslib_1.__asyncValues)((0, rxjs_for_await_1.eachValueFrom)((0, compile_swc_1.compileSwc)(context, normalizedOptions, () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
35
|
+
yield updatePackageAndCopyAssets(normalizedOptions, projectRoot);
|
|
36
|
+
})).pipe((0, operators_1.map)(({ success }) => ({
|
|
37
|
+
success,
|
|
38
|
+
outfile: normalizedOptions.mainOutputPath,
|
|
39
|
+
}))))))));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
exports.swcExecutor = swcExecutor;
|
|
43
|
+
function updatePackageAndCopyAssets(options, projectRoot) {
|
|
44
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
45
|
+
yield (0, assets_1.copyAssetFiles)(options.files);
|
|
46
|
+
(0, update_package_json_1.updatePackageJson)(options.main, options.outputPath, projectRoot, !options.skipTypeCheck);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.default = swcExecutor;
|
|
50
|
+
//# sourceMappingURL=swc.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swc.impl.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/swc/swc.impl.ts"],"names":[],"mappings":";;;;AACA,iEAI8C;AAC9C,+BAAqC;AACrC,mDAA+C;AAC/C,8CAAqC;AACrC,uEAAmE;AAMnE,6DAAyD;AACzD,yEAAoE;AAEpE,SAAgB,gBAAgB,CAC9B,OAA2B,EAC3B,WAAmB,EACnB,UAAmB,EACnB,WAAoB;IAEpB,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAEzD,IAAI,OAAO,CAAC,aAAa,IAAI,IAAI,EAAE;QACjC,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC;KAC/B;IAED,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE;QACzB,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;KACvB;IAED,MAAM,KAAK,GAAsB,IAAA,0BAAiB,EAChD,OAAO,CAAC,MAAM,EACd,WAAW,EACX,UAAU,CACX,CAAC;IAEF,OAAO,gCACF,OAAO,KACV,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,CAAA,EAAC;IACJ,CAAC;CAAA;AAjCD,kCAiCC;AAED,SAAe,0BAA0B,CACvC,OAAqC,EACrC,WAAmB;;QAEnB,MAAM,IAAA,uBAAc,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,IAAA,uCAAiB,EACf,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,UAAU,EAClB,WAAW,EACX,CAAC,OAAO,CAAC,aAAa,CACvB,CAAC;IACJ,CAAC;CAAA;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -23,10 +23,22 @@
|
|
|
23
23
|
"items": {
|
|
24
24
|
"$ref": "#/definitions/assetPattern"
|
|
25
25
|
}
|
|
26
|
+
},
|
|
27
|
+
"watch": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"description": "Enable re-building when files change.",
|
|
30
|
+
"default": false
|
|
31
|
+
},
|
|
32
|
+
"transformers": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"description": "List of TypeScript Transformer Plugins.",
|
|
35
|
+
"default": [],
|
|
36
|
+
"items": {
|
|
37
|
+
"$ref": "#/definitions/transformerPattern"
|
|
38
|
+
}
|
|
26
39
|
}
|
|
27
40
|
},
|
|
28
41
|
"required": ["main", "outputPath", "tsConfig"],
|
|
29
|
-
|
|
30
42
|
"definitions": {
|
|
31
43
|
"assetPattern": {
|
|
32
44
|
"oneOf": [
|
|
@@ -60,6 +72,27 @@
|
|
|
60
72
|
"type": "string"
|
|
61
73
|
}
|
|
62
74
|
]
|
|
75
|
+
},
|
|
76
|
+
"transformerPattern": {
|
|
77
|
+
"oneOf": [
|
|
78
|
+
{
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"name": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"options": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"additionalProperties": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": ["name"]
|
|
94
|
+
}
|
|
95
|
+
]
|
|
63
96
|
}
|
|
64
97
|
}
|
|
65
98
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
3
|
-
export declare function
|
|
4
|
-
|
|
5
|
-
}>;
|
|
2
|
+
import { ExecutorEvent, ExecutorOptions, NormalizedExecutorOptions } from '../../utils/schema';
|
|
3
|
+
export declare function normalizeOptions(options: ExecutorOptions, contextRoot: string, sourceRoot?: string, projectRoot?: string): NormalizedExecutorOptions;
|
|
4
|
+
export declare function tscExecutor(options: ExecutorOptions, context: ExecutorContext): AsyncGenerator<ExecutorEvent, any, undefined>;
|
|
6
5
|
export default tscExecutor;
|