@nrwl/js 13.3.4 → 13.3.8
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 +10 -0
- package/generators.json +14 -0
- package/package.json +5 -5
- 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 +70 -0
- package/src/executors/swc/swc.impl.d.ts +7 -0
- package/src/executors/swc/swc.impl.js +76 -0
- package/src/executors/swc/swc.impl.js.map +1 -0
- package/src/executors/tsc/tsc.impl.d.ts +2 -2
- package/src/executors/tsc/tsc.impl.js +23 -41
- 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 +5 -0
- package/src/utils/check-dependencies.d.ts +8 -0
- package/src/utils/check-dependencies.js +29 -0
- package/src/utils/check-dependencies.js.map +1 -0
- package/src/utils/compile.d.ts +6 -0
- package/src/utils/compile.js +20 -0
- package/src/utils/compile.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 +23 -18
- package/src/utils/project-generator.js.map +1 -1
- package/src/utils/schema.d.ts +20 -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 +4 -0
- package/src/utils/swc/compile-swc.js +53 -0
- package/src/utils/swc/compile-swc.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 +3 -0
- package/src/utils/versions.js +5 -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,11 @@
|
|
|
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"
|
|
8
13
|
}
|
|
9
14
|
},
|
|
10
15
|
"builders": {
|
|
@@ -12,6 +17,11 @@
|
|
|
12
17
|
"implementation": "./src/executors/tsc/compat",
|
|
13
18
|
"schema": "./src/executors/tsc/schema.json",
|
|
14
19
|
"description": "Build a project using TypeScript."
|
|
20
|
+
},
|
|
21
|
+
"swc": {
|
|
22
|
+
"implementation": "./src/executors/swc/compat",
|
|
23
|
+
"schema": "./src/executors/swc/schema.json",
|
|
24
|
+
"description": "Build a project using SWC"
|
|
15
25
|
}
|
|
16
26
|
}
|
|
17
27
|
}
|
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,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/js",
|
|
3
|
-
"version": "13.3.
|
|
3
|
+
"version": "13.3.8",
|
|
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.3.
|
|
11
|
-
"@nrwl/devkit": "13.3.
|
|
12
|
-
"@nrwl/jest": "13.3.
|
|
13
|
-
"@nrwl/linter": "13.3.
|
|
10
|
+
"@nrwl/workspace": "13.3.8",
|
|
11
|
+
"@nrwl/devkit": "13.3.8",
|
|
12
|
+
"@nrwl/jest": "13.3.8",
|
|
13
|
+
"@nrwl/linter": "13.3.8",
|
|
14
14
|
"chalk": "4.1.0",
|
|
15
15
|
"js-tokens": "^4.0.0"
|
|
16
16
|
},
|
|
@@ -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,70 @@
|
|
|
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
|
+
"skipTypeCheck": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"description": "Whether to skip TypeScript type checking.",
|
|
23
|
+
"default": false
|
|
24
|
+
},
|
|
25
|
+
"assets": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"description": "List of static assets.",
|
|
28
|
+
"default": [],
|
|
29
|
+
"items": {
|
|
30
|
+
"$ref": "#/definitions/assetPattern"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["main", "outputPath", "tsConfig"],
|
|
35
|
+
"definitions": {
|
|
36
|
+
"assetPattern": {
|
|
37
|
+
"oneOf": [
|
|
38
|
+
{
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"glob": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "The pattern to match."
|
|
44
|
+
},
|
|
45
|
+
"input": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
48
|
+
},
|
|
49
|
+
"ignore": {
|
|
50
|
+
"description": "An array of globs to ignore.",
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"output": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "Absolute path within the output."
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["glob", "input", "output"]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "string"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { NormalizedSwcExecutorOptions, SwcExecutorOptions } from './schema';
|
|
3
|
+
export declare function normalizeOptions(options: SwcExecutorOptions, context: ExecutorContext): NormalizedSwcExecutorOptions;
|
|
4
|
+
export declare function swcExecutor(options: SwcExecutorOptions, context: ExecutorContext): Promise<{
|
|
5
|
+
success: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export default swcExecutor;
|
|
@@ -0,0 +1,76 @@
|
|
|
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 app_root_1 = require("@nrwl/tao/src/utils/app-root");
|
|
6
|
+
const assets_1 = require("@nrwl/workspace/src/utilities/assets");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const check_dependencies_1 = require("../../utils/check-dependencies");
|
|
9
|
+
const compile_swc_1 = require("../../utils/swc/compile-swc");
|
|
10
|
+
const print_diagnostics_1 = require("../../utils/typescript/print-diagnostics");
|
|
11
|
+
const run_type_check_1 = require("../../utils/typescript/run-type-check");
|
|
12
|
+
const update_package_json_1 = require("../../utils/update-package-json");
|
|
13
|
+
function normalizeOptions(options, context) {
|
|
14
|
+
const outputPath = (0, path_1.join)(context.root, options.outputPath);
|
|
15
|
+
if (options.skipTypeCheck == null) {
|
|
16
|
+
options.skipTypeCheck = false;
|
|
17
|
+
}
|
|
18
|
+
const files = (0, assets_1.assetGlobsToFiles)(options.assets, context.root, outputPath);
|
|
19
|
+
return Object.assign(Object.assign({}, options), { files,
|
|
20
|
+
outputPath, tsConfig: (0, path_1.join)(context.root, options.tsConfig) });
|
|
21
|
+
}
|
|
22
|
+
exports.normalizeOptions = normalizeOptions;
|
|
23
|
+
function swcExecutor(options, context) {
|
|
24
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
25
|
+
const normalizedOptions = normalizeOptions(options, context);
|
|
26
|
+
const { shouldContinue, tmpTsConfig, projectRoot } = (0, check_dependencies_1.checkDependencies)(context, options.tsConfig);
|
|
27
|
+
if (!shouldContinue) {
|
|
28
|
+
return { success: false };
|
|
29
|
+
}
|
|
30
|
+
if (tmpTsConfig) {
|
|
31
|
+
normalizedOptions.tsConfig = tmpTsConfig;
|
|
32
|
+
}
|
|
33
|
+
const tsOptions = {
|
|
34
|
+
outputPath: normalizedOptions.outputPath,
|
|
35
|
+
projectName: context.projectName,
|
|
36
|
+
projectRoot,
|
|
37
|
+
tsConfig: normalizedOptions.tsConfig,
|
|
38
|
+
};
|
|
39
|
+
if (!options.skipTypeCheck) {
|
|
40
|
+
const ts = yield Promise.resolve().then(() => require('typescript'));
|
|
41
|
+
// start two promises, one for type checking, one for transpiling
|
|
42
|
+
return Promise.all([
|
|
43
|
+
(0, run_type_check_1.runTypeCheck)({
|
|
44
|
+
ts,
|
|
45
|
+
mode: 'emitDeclarationOnly',
|
|
46
|
+
tsConfigPath: tsOptions.tsConfig,
|
|
47
|
+
outDir: tsOptions.outputPath.replace(`/${projectRoot}`, ''),
|
|
48
|
+
workspaceRoot: app_root_1.appRootPath,
|
|
49
|
+
}).then((result) => {
|
|
50
|
+
const hasErrors = result.errors.length > 0;
|
|
51
|
+
if (hasErrors) {
|
|
52
|
+
(0, print_diagnostics_1.printDiagnostics)(result);
|
|
53
|
+
}
|
|
54
|
+
return Promise.resolve({ success: !hasErrors });
|
|
55
|
+
}),
|
|
56
|
+
(0, compile_swc_1.compileSwc)(tsOptions, () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
57
|
+
yield updatePackageAndCopyAssets(normalizedOptions, projectRoot);
|
|
58
|
+
})),
|
|
59
|
+
]).then(([typeCheckResult, transpileResult]) => ({
|
|
60
|
+
success: typeCheckResult.success && transpileResult.success,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
return (0, compile_swc_1.compileSwc)(tsOptions, () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
64
|
+
yield updatePackageAndCopyAssets(normalizedOptions, projectRoot);
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
exports.swcExecutor = swcExecutor;
|
|
69
|
+
function updatePackageAndCopyAssets(options, projectRoot) {
|
|
70
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
71
|
+
yield (0, assets_1.copyAssetFiles)(options.files);
|
|
72
|
+
(0, update_package_json_1.updatePackageJson)(options.main, options.outputPath, projectRoot, !options.skipTypeCheck);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
exports.default = swcExecutor;
|
|
76
|
+
//# 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,2DAA2D;AAC3D,iEAI8C;AAC9C,+BAA4B;AAC5B,uEAAmE;AACnE,6DAAyD;AACzD,gFAA4E;AAC5E,0EAAqE;AACrE,yEAAoE;AAGpE,SAAgB,gBAAgB,CAC9B,OAA2B,EAC3B,OAAwB;IAExB,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1D,IAAI,OAAO,CAAC,aAAa,IAAI,IAAI,EAAE;QACjC,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC;KAC/B;IAED,MAAM,KAAK,GAAsB,IAAA,0BAAiB,EAChD,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,IAAI,EACZ,UAAU,CACX,CAAC;IAEF,OAAO,gCACF,OAAO,KACV,KAAK;QACL,UAAU,EACV,QAAQ,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACf,CAAC;AACpC,CAAC;AAtBD,4CAsBC;AAED,SAAsB,WAAW,CAC/B,OAA2B,EAC3B,OAAwB;;QAExB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7D,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAA,sCAAiB,EACpE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,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC/C,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,eAAe,CAAC,OAAO;aAC5D,CAAC,CAAC,CAAC;SACL;QAED,OAAO,IAAA,wBAAU,EAAC,SAAS,EAAE,GAAS,EAAE;YACtC,MAAM,0BAA0B,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QACnE,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;CAAA;AAvDD,kCAuDC;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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
3
|
-
export declare function tscExecutor(options:
|
|
2
|
+
import { ExecutorOptions } from '../../utils/schema';
|
|
3
|
+
export declare function tscExecutor(options: ExecutorOptions, context: ExecutorContext): Promise<{
|
|
4
4
|
success: boolean;
|
|
5
5
|
}>;
|
|
6
6
|
export default tscExecutor;
|
|
@@ -2,62 +2,44 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tscExecutor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const project_graph_1 = require("@nrwl/workspace/src/core/project-graph");
|
|
7
5
|
const assets_1 = require("@nrwl/workspace/src/utilities/assets");
|
|
8
|
-
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
9
|
-
const compilation_1 = require("@nrwl/workspace/src/utilities/typescript/compilation");
|
|
10
6
|
const path_1 = require("path");
|
|
7
|
+
const check_dependencies_1 = require("../../utils/check-dependencies");
|
|
8
|
+
const compile_1 = require("../../utils/compile");
|
|
9
|
+
const update_package_json_1 = require("../../utils/update-package-json");
|
|
11
10
|
function tscExecutor(options, context) {
|
|
12
11
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
13
12
|
const normalizedOptions = normalizeOptions(options, context);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const projectRoot = target.data.root;
|
|
18
|
-
if (dependencies.length > 0) {
|
|
19
|
-
const areDependentProjectsBuilt = (0, buildable_libs_utils_1.checkDependentProjectsHaveBeenBuilt)(context.root, context.projectName, context.targetName, dependencies);
|
|
20
|
-
if (!areDependentProjectsBuilt) {
|
|
21
|
-
return { success: false };
|
|
22
|
-
}
|
|
23
|
-
normalizedOptions.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)((0, path_1.join)(context.root, options.tsConfig), context.root, projectRoot, dependencies);
|
|
13
|
+
const { projectRoot, tmpTsConfig, shouldContinue } = (0, check_dependencies_1.checkDependencies)(context, options.tsConfig);
|
|
14
|
+
if (!shouldContinue) {
|
|
15
|
+
return { success: false };
|
|
24
16
|
}
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
if (tmpTsConfig) {
|
|
18
|
+
normalizedOptions.tsConfig = tmpTsConfig;
|
|
19
|
+
}
|
|
20
|
+
const tsOptions = {
|
|
27
21
|
outputPath: normalizedOptions.outputPath,
|
|
28
22
|
projectName: context.projectName,
|
|
29
23
|
projectRoot,
|
|
30
24
|
tsConfig: normalizedOptions.tsConfig,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
};
|
|
26
|
+
return (0, compile_1.compile)('tsc', context, tsOptions, () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
27
|
+
yield updatePackageAndCopyAssets(normalizedOptions, projectRoot);
|
|
28
|
+
}));
|
|
35
29
|
});
|
|
36
30
|
}
|
|
37
31
|
exports.tscExecutor = tscExecutor;
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
function updatePackageAndCopyAssets(options, projectRoot) {
|
|
33
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
34
|
+
yield (0, assets_1.copyAssetFiles)(options.files);
|
|
35
|
+
(0, update_package_json_1.updatePackageJson)(options.main, options.outputPath, projectRoot);
|
|
36
|
+
});
|
|
43
37
|
}
|
|
44
38
|
function normalizeOptions(options, context) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(projectRoot, 'package.json'));
|
|
50
|
-
if (packageJson.main && packageJson.typings) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const mainFile = (0, path_1.basename)(options.main).replace(/\.[tj]s$/, '');
|
|
54
|
-
const relativeMainFileDir = getMainFileDirRelativeToProjectRoot(options.main, projectRoot);
|
|
55
|
-
const mainJsFile = `${relativeMainFileDir}${mainFile}.js`;
|
|
56
|
-
const typingsFile = `${relativeMainFileDir}${mainFile}.d.ts`;
|
|
57
|
-
packageJson.main = (_a = packageJson.main) !== null && _a !== void 0 ? _a : mainJsFile;
|
|
58
|
-
packageJson.typings = (_b = packageJson.typings) !== null && _b !== void 0 ? _b : typingsFile;
|
|
59
|
-
const outputPackageJson = (0, path_1.join)(options.outputPath, 'package.json');
|
|
60
|
-
(0, devkit_1.writeJsonFile)(outputPackageJson, packageJson);
|
|
39
|
+
const outputPath = (0, path_1.join)(context.root, options.outputPath);
|
|
40
|
+
const files = (0, assets_1.assetGlobsToFiles)(options.assets, context.root, outputPath);
|
|
41
|
+
return Object.assign(Object.assign({}, options), { files,
|
|
42
|
+
outputPath, tsConfig: (0, path_1.join)(context.root, options.tsConfig) });
|
|
61
43
|
}
|
|
62
44
|
exports.default = tscExecutor;
|
|
63
45
|
//# sourceMappingURL=tsc.impl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsc.impl.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/tsc/tsc.impl.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tsc.impl.js","sourceRoot":"","sources":["../../../../../../packages/js/src/executors/tsc/tsc.impl.ts"],"names":[],"mappings":";;;;AACA,iEAI8C;AAC9C,+BAA4B;AAC5B,uEAAmE;AACnE,iDAA8C;AAE9C,yEAAoE;AAEpE,SAAsB,WAAW,CAC/B,OAAwB,EACxB,OAAwB;;QAExB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE7D,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAA,sCAAiB,EACpE,OAAO,EACP,OAAO,CAAC,QAAQ,CACjB,CAAC;QAEF,IAAI,CAAC,cAAc,EAAE;YACnB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;SAC3B;QAED,IAAI,WAAW,EAAE;YACf,iBAAiB,CAAC,QAAQ,GAAG,WAAW,CAAC;SAC1C;QAED,MAAM,SAAS,GAAG;YAChB,UAAU,EAAE,iBAAiB,CAAC,UAAU;YACxC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,WAAW;YACX,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;SACrC,CAAC;QAEF,OAAO,IAAA,iBAAO,EAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,GAAS,EAAE;YACnD,MAAM,0BAA0B,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QACnE,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;CAAA;AA7BD,kCA6BC;AAED,SAAe,0BAA0B,CACvC,OAAkC,EAClC,WAAmB;;QAEnB,MAAM,IAAA,uBAAc,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,IAAA,uCAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IACnE,CAAC;CAAA;AAED,SAAS,gBAAgB,CACvB,OAAwB,EACxB,OAAwB;IAExB,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1D,MAAM,KAAK,GAAsB,IAAA,0BAAiB,EAChD,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,IAAI,EACZ,UAAU,CACX,CAAC;IAEF,uCACK,OAAO,KACV,KAAK;QACL,UAAU,EACV,QAAQ,EAAE,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAC9C;AACJ,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
3
|
-
export declare function applicationGenerator(tree: Tree, schema:
|
|
2
|
+
import { GeneratorSchema } from '../../utils/schema';
|
|
3
|
+
export declare function applicationGenerator(tree: Tree, schema: GeneratorSchema): Promise<import("@nrwl/devkit").GeneratorCallback>;
|
|
4
4
|
export default applicationGenerator;
|
|
5
|
-
export declare const applicationSchematic: (options:
|
|
5
|
+
export declare const applicationSchematic: (options: GeneratorSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAAA,yCAA4E;AAC5E,+BAA4B;AAC5B,qEAAiE;AAGjE,SAAsB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAAA,yCAA4E;AAC5E,+BAA4B;AAC5B,qEAAiE;AAGjE,SAAsB,oBAAoB,CACxC,IAAU,EACV,MAAuB;;QAEvB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,IAAA,oCAAgB,EACrB,IAAI,kCACC,MAAM,KAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,KAChD,OAAO,EACP,IAAA,WAAI,EAAC,SAAS,EAAE,SAAS,CAAC,EAC1B,aAAa,CACd,CAAC;IACJ,CAAC;CAAA;AAZD,oDAYC;AAED,kBAAe,oBAAoB,CAAC;AACvB,QAAA,oBAAoB,GAAG,IAAA,2BAAkB,EAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tree } from '@nrwl/devkit';
|
|
2
|
+
import { ConvertToSwcGeneratorSchema } from './schema';
|
|
3
|
+
export declare function convertToSwcGenerator(tree: Tree, schema: ConvertToSwcGeneratorSchema): Promise<() => void>;
|
|
4
|
+
export default convertToSwcGenerator;
|
|
5
|
+
export declare const convertToSwcSchematic: (options: ConvertToSwcGeneratorSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToSwcSchematic = exports.convertToSwcGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const add_swc_config_1 = require("../../utils/swc/add-swc-config");
|
|
8
|
+
const add_swc_dependencies_1 = require("../../utils/swc/add-swc-dependencies");
|
|
9
|
+
function convertToSwcGenerator(tree, schema) {
|
|
10
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
11
|
+
const options = normalizeOptions(schema);
|
|
12
|
+
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, options.name);
|
|
13
|
+
updateProjectBuildTargets(tree, projectConfiguration, options.name, options.targets);
|
|
14
|
+
return checkSwcDependencies(tree, projectConfiguration);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.convertToSwcGenerator = convertToSwcGenerator;
|
|
18
|
+
function normalizeOptions(schema) {
|
|
19
|
+
const options = Object.assign({}, schema);
|
|
20
|
+
if (!options.targets) {
|
|
21
|
+
options.targets = ['build'];
|
|
22
|
+
}
|
|
23
|
+
return options;
|
|
24
|
+
}
|
|
25
|
+
function updateProjectBuildTargets(tree, projectConfiguration, projectName, projectTargets) {
|
|
26
|
+
for (const target of projectTargets) {
|
|
27
|
+
const targetConfiguration = projectConfiguration.targets[target];
|
|
28
|
+
if (!targetConfiguration || targetConfiguration.executor !== '@nrwl/js:tsc')
|
|
29
|
+
continue;
|
|
30
|
+
targetConfiguration.executor = '@nrwl/js:swc';
|
|
31
|
+
}
|
|
32
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
|
|
33
|
+
}
|
|
34
|
+
function checkSwcDependencies(tree, projectConfiguration) {
|
|
35
|
+
const isSwcrcPresent = tree.exists((0, path_1.join)(projectConfiguration.root, '.swcrc'));
|
|
36
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
37
|
+
const hasSwcDependency = packageJson.dependencies && packageJson.dependencies['@swc/core'];
|
|
38
|
+
if (isSwcrcPresent && hasSwcDependency)
|
|
39
|
+
return;
|
|
40
|
+
if (!isSwcrcPresent) {
|
|
41
|
+
(0, add_swc_config_1.addSwcConfig)(tree, projectConfiguration.root);
|
|
42
|
+
}
|
|
43
|
+
if (!hasSwcDependency) {
|
|
44
|
+
(0, add_swc_dependencies_1.addSwcDependencies)(tree);
|
|
45
|
+
}
|
|
46
|
+
return () => {
|
|
47
|
+
if (!hasSwcDependency) {
|
|
48
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.default = convertToSwcGenerator;
|
|
53
|
+
exports.convertToSwcSchematic = (0, devkit_1.convertNxGenerator)(convertToSwcGenerator);
|
|
54
|
+
//# sourceMappingURL=convert-to-swc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-to-swc.js","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/convert-to-swc/convert-to-swc.ts"],"names":[],"mappings":";;;;AAAA,yCAQsB;AACtB,+BAA4B;AAC5B,mEAA8D;AAC9D,+EAA0E;AAG1E,SAAsB,qBAAqB,CACzC,IAAU,EACV,MAAmC;;QAEnC,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,oBAAoB,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAE1E,yBAAyB,CACvB,IAAI,EACJ,oBAAoB,EACpB,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,OAAO,CAChB,CAAC;QAEF,OAAO,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC1D,CAAC;CAAA;AAfD,sDAeC;AAED,SAAS,gBAAgB,CACvB,MAAmC;IAEnC,MAAM,OAAO,qBAAQ,MAAM,CAAE,CAAC;IAE9B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,OAAO,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;KAC7B;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,yBAAyB,CAChC,IAAU,EACV,oBAA0C,EAC1C,WAAmB,EACnB,cAAwB;IAExB,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE;QACnC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,CAAC,QAAQ,KAAK,cAAc;YACzE,SAAS;QACX,mBAAmB,CAAC,QAAQ,GAAG,cAAc,CAAC;KAC/C;IAED,IAAA,mCAA0B,EAAC,IAAI,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,oBAAoB,CAC3B,IAAU,EACV,oBAA0C;IAE1C,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE9E,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACnD,MAAM,gBAAgB,GACpB,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAEpE,IAAI,cAAc,IAAI,gBAAgB;QAAE,OAAO;IAE/C,IAAI,CAAC,cAAc,EAAE;QACnB,IAAA,6BAAY,EAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC;KAC/C;IAED,IAAI,CAAC,gBAAgB,EAAE;QACrB,IAAA,yCAAkB,EAAC,IAAI,CAAC,CAAC;KAC1B;IAED,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,gBAAgB,EAAE;YACrB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;SAC3B;IACH,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,qBAAqB,CAAC;AACxB,QAAA,qBAAqB,GAAG,IAAA,2BAAkB,EAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "NxTypescriptLibrary",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Convert a tsc library to swc",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "g swc mylib",
|
|
10
|
+
"description": "Convert libs/myapp/mylib to swc"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"name": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Library name",
|
|
17
|
+
"$default": {
|
|
18
|
+
"$source": "argv",
|
|
19
|
+
"index": 0
|
|
20
|
+
},
|
|
21
|
+
"x-prompt": "What name would you like to use for the library?",
|
|
22
|
+
"pattern": "^[a-zA-Z].*$"
|
|
23
|
+
},
|
|
24
|
+
"targets": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"description": "List of targets to convert",
|
|
27
|
+
"items": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Target to convert"
|
|
30
|
+
},
|
|
31
|
+
"default": ["build"]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["name"]
|
|
35
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
3
|
-
export declare function libraryGenerator(tree: Tree, schema:
|
|
2
|
+
import { GeneratorSchema } from '../../utils/schema';
|
|
3
|
+
export declare function libraryGenerator(tree: Tree, schema: GeneratorSchema): Promise<import("@nrwl/devkit").GeneratorCallback>;
|
|
4
4
|
export default libraryGenerator;
|
|
5
|
-
export declare const librarySchematic: (options:
|
|
5
|
+
export declare const librarySchematic: (options: GeneratorSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/library/library.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/library/library.ts"],"names":[],"mappings":";;;;AAAA,yCAA4E;AAC5E,+BAA4B;AAC5B,qEAAiE;AAGjE,SAAsB,gBAAgB,CAAC,IAAU,EAAE,MAAuB;;QACxE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,IAAA,oCAAgB,EACrB,IAAI,EACJ,MAAM,EACN,OAAO,EACP,IAAA,WAAI,EAAC,SAAS,EAAE,SAAS,CAAC,EAC1B,SAAS,CACV,CAAC;IACJ,CAAC;CAAA;AATD,4CASC;AAED,kBAAe,gBAAgB,CAAC;AACnB,QAAA,gBAAgB,GAAG,IAAA,2BAAkB,EAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -98,6 +98,11 @@
|
|
|
98
98
|
"enum": ["tsc", "swc"],
|
|
99
99
|
"default": "tsc",
|
|
100
100
|
"description": "The compiler used by the build and test targets"
|
|
101
|
+
},
|
|
102
|
+
"skipTypeCheck": {
|
|
103
|
+
"type": "boolean",
|
|
104
|
+
"description": "Whether to skip TypeScript type checking for SWC compiler.",
|
|
105
|
+
"default": false
|
|
101
106
|
}
|
|
102
107
|
},
|
|
103
108
|
"required": ["name"]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { DependentBuildableProjectNode } from '@nrwl/workspace/src/utilities/buildable-libs-utils';
|
|
3
|
+
export declare function checkDependencies(context: ExecutorContext, tsConfigPath: string): {
|
|
4
|
+
shouldContinue: boolean;
|
|
5
|
+
tmpTsConfig: string | null;
|
|
6
|
+
projectRoot: string;
|
|
7
|
+
projectDependencies: DependentBuildableProjectNode[];
|
|
8
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkDependencies = void 0;
|
|
4
|
+
const project_graph_1 = require("@nrwl/workspace/src/core/project-graph");
|
|
5
|
+
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function checkDependencies(context, tsConfigPath) {
|
|
8
|
+
const projectGraph = (0, project_graph_1.readCachedProjectGraph)();
|
|
9
|
+
const { target, dependencies } = (0, buildable_libs_utils_1.calculateProjectDependencies)(projectGraph, context.root, context.projectName, context.targetName, context.configurationName);
|
|
10
|
+
const projectRoot = target.data.root;
|
|
11
|
+
if (dependencies.length > 0) {
|
|
12
|
+
const areDependentProjectsBuilt = (0, buildable_libs_utils_1.checkDependentProjectsHaveBeenBuilt)(context.root, context.projectName, context.targetName, dependencies);
|
|
13
|
+
return {
|
|
14
|
+
shouldContinue: areDependentProjectsBuilt,
|
|
15
|
+
tmpTsConfig: areDependentProjectsBuilt &&
|
|
16
|
+
(0, buildable_libs_utils_1.createTmpTsConfig)((0, path_1.join)(context.root, tsConfigPath), context.root, projectRoot, dependencies),
|
|
17
|
+
projectRoot,
|
|
18
|
+
projectDependencies: dependencies,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
shouldContinue: true,
|
|
23
|
+
tmpTsConfig: null,
|
|
24
|
+
projectRoot,
|
|
25
|
+
projectDependencies: dependencies,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.checkDependencies = checkDependencies;
|
|
29
|
+
//# sourceMappingURL=check-dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-dependencies.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/check-dependencies.ts"],"names":[],"mappings":";;;AACA,0EAAgF;AAChF,6FAK4D;AAC5D,+BAA4B;AAE5B,SAAgB,iBAAiB,CAC/B,OAAwB,EACxB,YAAoB;IAOpB,MAAM,YAAY,GAAG,IAAA,sCAAsB,GAAE,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,mDAA4B,EAC3D,YAAY,EACZ,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,iBAAiB,CAC1B,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAErC,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;QAC3B,MAAM,yBAAyB,GAAG,IAAA,0DAAmC,EACnE,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,UAAU,EAClB,YAAY,CACb,CAAC;QACF,OAAO;YACL,cAAc,EAAE,yBAAyB;YACzC,WAAW,EACT,yBAAyB;gBACzB,IAAA,wCAAiB,EACf,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,EAChC,OAAO,CAAC,IAAI,EACZ,WAAW,EACX,YAAY,CACb;YACH,WAAW;YACX,mBAAmB,EAAE,YAAY;SAClC,CAAC;KACH;IAED,OAAO;QACL,cAAc,EAAE,IAAI;QACpB,WAAW,EAAE,IAAI;QACjB,WAAW;QACX,mBAAmB,EAAE,YAAY;KAClC,CAAC;AACJ,CAAC;AA/CD,8CA+CC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { TypeScriptCompilationOptions } from '@nrwl/workspace/src/utilities/typescript/compilation';
|
|
3
|
+
import { Compiler } from './schema';
|
|
4
|
+
export declare function compile(compilerOptions: Compiler, context: ExecutorContext, tsCompilationOptions: TypeScriptCompilationOptions, postCompilationCallback: () => void | Promise<void>): Promise<{
|
|
5
|
+
success: boolean;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const compilation_1 = require("@nrwl/workspace/src/utilities/typescript/compilation");
|
|
6
|
+
const compile_swc_1 = require("./swc/compile-swc");
|
|
7
|
+
function compile(compilerOptions, context, tsCompilationOptions, postCompilationCallback) {
|
|
8
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
9
|
+
if (compilerOptions === 'tsc') {
|
|
10
|
+
const result = (0, compilation_1.compileTypeScript)(tsCompilationOptions);
|
|
11
|
+
yield postCompilationCallback();
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
if (compilerOptions === 'swc') {
|
|
15
|
+
return (0, compile_swc_1.compileSwc)(tsCompilationOptions, postCompilationCallback);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.compile = compile;
|
|
20
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/compile.ts"],"names":[],"mappings":";;;;AACA,sFAG8D;AAE9D,mDAA+C;AAE/C,SAAsB,OAAO,CAC3B,eAAyB,EACzB,OAAwB,EACxB,oBAAkD,EAClD,uBAAmD;;QAEnD,IAAI,eAAe,KAAK,KAAK,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAA,+BAAiB,EAAC,oBAAoB,CAAC,CAAC;YACvD,MAAM,uBAAuB,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC;SACf;QAED,IAAI,eAAe,KAAK,KAAK,EAAE;YAC7B,OAAO,IAAA,wBAAU,EAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAC;SAClE;IACH,CAAC;CAAA;AAfD,0BAeC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeTsCompilationOptions = void 0;
|
|
4
|
+
function normalizeTsCompilationOptions(options) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return Object.assign(Object.assign({}, options), { deleteOutputPath: (_a = options.deleteOutputPath) !== null && _a !== void 0 ? _a : true, rootDir: (_b = options.rootDir) !== null && _b !== void 0 ? _b : options.projectRoot });
|
|
7
|
+
}
|
|
8
|
+
exports.normalizeTsCompilationOptions = normalizeTsCompilationOptions;
|
|
9
|
+
//# sourceMappingURL=normalize-ts-compilation-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-ts-compilation-options.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/normalize-ts-compilation-options.ts"],"names":[],"mappings":";;;AAEA,SAAgB,6BAA6B,CAC3C,OAAqC;;IAErC,uCACK,OAAO,KACV,gBAAgB,EAAE,MAAA,OAAO,CAAC,gBAAgB,mCAAI,IAAI,EAClD,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,OAAO,CAAC,WAAW,IAC/C;AACJ,CAAC;AARD,sEAQC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
2
|
-
import {
|
|
3
|
-
export declare function projectGenerator(tree: Tree, schema:
|
|
4
|
-
export interface NormalizedSchema extends
|
|
2
|
+
import { GeneratorSchema } from './schema';
|
|
3
|
+
export declare function projectGenerator(tree: Tree, schema: GeneratorSchema, destinationDir: string, filesDir: string, projectType: 'library' | 'application'): Promise<GeneratorCallback>;
|
|
4
|
+
export interface NormalizedSchema extends GeneratorSchema {
|
|
5
5
|
name: string;
|
|
6
6
|
fileName: string;
|
|
7
7
|
projectRoot: string;
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addLint = exports.projectGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const path_1 = require("path");
|
|
7
6
|
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const add_swc_config_1 = require("./swc/add-swc-config");
|
|
9
|
+
const add_swc_dependencies_1 = require("./swc/add-swc-dependencies");
|
|
8
10
|
// nx-ignore-next-line
|
|
9
11
|
const { jestProjectGenerator } = require('@nrwl/jest');
|
|
10
12
|
// nx-ignore-next-line
|
|
@@ -42,22 +44,18 @@ function addProject(tree, options, destinationDir, projectType) {
|
|
|
42
44
|
tags: options.parsedTags,
|
|
43
45
|
};
|
|
44
46
|
if (options.buildable && options.config != 'npm-scripts') {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
throw new Error(`Compiler ${options.compiler} is not supported`);
|
|
47
|
+
projectConfiguration.targets.build = {
|
|
48
|
+
executor: `@nrwl/js:${options.compiler}`,
|
|
49
|
+
outputs: ['{options.outputPath}'],
|
|
50
|
+
options: {
|
|
51
|
+
outputPath: `dist/${destinationDir}/${options.projectDirectory}`,
|
|
52
|
+
main: `${options.projectRoot}/src/index` + (options.js ? '.js' : '.ts'),
|
|
53
|
+
tsConfig: `${options.projectRoot}/${projectType === 'library' ? 'tsconfig.lib.json' : 'tsconfig.app.json'}`,
|
|
54
|
+
assets: [`${options.projectRoot}/*.md`],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
if (options.compiler === 'swc' && options.skipTypeCheck) {
|
|
58
|
+
projectConfiguration.targets.build.options.skipTypeCheck = true;
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
if (options.config === 'workspace') {
|
|
@@ -91,7 +89,7 @@ exports.addLint = addLint;
|
|
|
91
89
|
function updateTsConfig(tree, options) {
|
|
92
90
|
(0, devkit_1.updateJson)(tree, (0, path_1.join)(options.projectRoot, 'tsconfig.json'), (json) => {
|
|
93
91
|
if (options.strict) {
|
|
94
|
-
json.compilerOptions = Object.assign(Object.assign({}, json.compilerOptions), { forceConsistentCasingInFileNames: true, strict: true, noImplicitReturns: true, noFallthroughCasesInSwitch: true });
|
|
92
|
+
json.compilerOptions = Object.assign(Object.assign({}, json.compilerOptions), { forceConsistentCasingInFileNames: true, strict: true, noImplicitOverride: true, noPropertyAccessFromIndexSignature: true, noImplicitReturns: true, noFallthroughCasesInSwitch: true });
|
|
95
93
|
}
|
|
96
94
|
return json;
|
|
97
95
|
});
|
|
@@ -101,6 +99,10 @@ function createFiles(tree, options, filesDir) {
|
|
|
101
99
|
(0, devkit_1.generateFiles)(tree, filesDir, options.projectRoot, Object.assign(Object.assign({}, options), { dot: '.', className,
|
|
102
100
|
name,
|
|
103
101
|
propertyName, js: !!options.js, cliCommand: 'nx', strict: undefined, tmpl: '', offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.projectRoot), buildable: options.buildable === true, hasUnitTestRunner: options.unitTestRunner !== 'none' }));
|
|
102
|
+
if (options.buildable && options.compiler === 'swc') {
|
|
103
|
+
(0, add_swc_dependencies_1.addSwcDependencies)(tree);
|
|
104
|
+
(0, add_swc_config_1.addSwcConfig)(tree, options.projectRoot);
|
|
105
|
+
}
|
|
104
106
|
if (options.unitTestRunner === 'none') {
|
|
105
107
|
tree.delete((0, path_1.join)(options.projectRoot, 'src/lib', `${options.fileName}.spec.ts`));
|
|
106
108
|
tree.delete((0, path_1.join)(options.projectRoot, 'src/app', `${options.fileName}.spec.ts`));
|
|
@@ -141,6 +143,9 @@ function normalizeOptions(tree, options, destinationDir) {
|
|
|
141
143
|
options.linter = Linter.None;
|
|
142
144
|
options.buildable = false;
|
|
143
145
|
}
|
|
146
|
+
if (options.compiler === 'swc' && options.skipTypeCheck == null) {
|
|
147
|
+
options.skipTypeCheck = false;
|
|
148
|
+
}
|
|
144
149
|
const name = (0, devkit_1.names)(options.name).fileName;
|
|
145
150
|
const projectDirectory = options.directory
|
|
146
151
|
? `${(0, devkit_1.names)(options.directory).fileName}/${name}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-generator.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/project-generator.ts"],"names":[],"mappings":";;;;AAAA,yCAasB;AACtB,+BAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"project-generator.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/project-generator.ts"],"names":[],"mappings":";;;;AAAA,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-ignore-next-line
|
|
2
2
|
const { Linter } = require('@nrwl/linter');
|
|
3
|
+
import type {
|
|
4
|
+
AssetGlob,
|
|
5
|
+
FileInputOutput,
|
|
6
|
+
} from '@nrwl/workspace/src/utilities/assets';
|
|
3
7
|
|
|
4
|
-
export
|
|
8
|
+
export type Compiler = 'tsc' | 'swc';
|
|
9
|
+
|
|
10
|
+
export interface GeneratorSchema {
|
|
5
11
|
name: string;
|
|
6
12
|
directory?: string;
|
|
7
13
|
skipFormat?: boolean;
|
|
@@ -18,5 +24,17 @@ export interface Schema {
|
|
|
18
24
|
buildable?: boolean;
|
|
19
25
|
setParserOptionsProject?: boolean;
|
|
20
26
|
config?: 'workspace' | 'project' | 'npm-scripts';
|
|
21
|
-
compiler?:
|
|
27
|
+
compiler?: Compiler;
|
|
28
|
+
skipTypeCheck?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ExecutorOptions {
|
|
32
|
+
assets: Array<AssetGlob | string>;
|
|
33
|
+
main: string;
|
|
34
|
+
outputPath: string;
|
|
35
|
+
tsConfig: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface NormalizedExecutorOptions extends ExecutorOptions {
|
|
39
|
+
files: Array<FileInputOutput>;
|
|
22
40
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addSwcConfig = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const swcOptionsString = () => `{
|
|
6
|
+
"jsc": {
|
|
7
|
+
"target": "es2017",
|
|
8
|
+
"parser": {
|
|
9
|
+
"syntax": "typescript",
|
|
10
|
+
"decorators": true,
|
|
11
|
+
"dynamicImport": true
|
|
12
|
+
},
|
|
13
|
+
"transform": {
|
|
14
|
+
"decoratorMetadata": true,
|
|
15
|
+
"legacyDecorator": true
|
|
16
|
+
},
|
|
17
|
+
"keepClassNames": true,
|
|
18
|
+
"externalHelpers": true,
|
|
19
|
+
"loose": true
|
|
20
|
+
},
|
|
21
|
+
"module": {
|
|
22
|
+
"type": "commonjs",
|
|
23
|
+
"strict": true,
|
|
24
|
+
"noInterop": true
|
|
25
|
+
},
|
|
26
|
+
"exclude": ["./src/**/.*.spec.ts$", "./**/.*.js$"]
|
|
27
|
+
}`;
|
|
28
|
+
function addSwcConfig(tree, projectDir) {
|
|
29
|
+
const swcrcPath = (0, path_1.join)(projectDir, '.swcrc');
|
|
30
|
+
const isSwcConfigExist = tree.exists(swcrcPath);
|
|
31
|
+
if (isSwcConfigExist)
|
|
32
|
+
return;
|
|
33
|
+
tree.write(swcrcPath, swcOptionsString());
|
|
34
|
+
}
|
|
35
|
+
exports.addSwcConfig = addSwcConfig;
|
|
36
|
+
//# sourceMappingURL=add-swc-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-swc-config.js","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/swc/add-swc-config.ts"],"names":[],"mappings":";;;AAKA,+BAA4B;AAE5B,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;EAsB7B,CAAC;AAEH,SAAgB,YAAY,CAAC,IAAU,EAAE,UAAkB;IACzD,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC7C,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAChD,IAAI,gBAAgB;QAAE,OAAO;IAE7B,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAC5C,CAAC;AAND,oCAMC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addSwcDependencies = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const versions_1 = require("../versions");
|
|
6
|
+
function addSwcDependencies(tree) {
|
|
7
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
8
|
+
'@swc/core': versions_1.swcCoreVersion,
|
|
9
|
+
'@swc/helpers': versions_1.swcHelpersVersion,
|
|
10
|
+
'@swc/cli': versions_1.swcCliVersion,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
exports.addSwcDependencies = addSwcDependencies;
|
|
14
|
+
//# sourceMappingURL=add-swc-dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-swc-dependencies.js","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/swc/add-swc-dependencies.ts"],"names":[],"mappings":";;;AAAA,yCAAkE;AAClE,0CAA+E;AAE/E,SAAgB,kBAAkB,CAAC,IAAU;IAC3C,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF;QACE,WAAW,EAAE,yBAAc;QAC3B,cAAc,EAAE,4BAAiB;QACjC,UAAU,EAAE,wBAAa;KAC1B,CACF,CAAC;AACJ,CAAC;AAVD,gDAUC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TypeScriptCompilationOptions } from '@nrwl/workspace/src/utilities/typescript/compilation';
|
|
2
|
+
export declare function compileSwc(tsCompilationOptions: TypeScriptCompilationOptions, postCompilationCallback: () => void | Promise<void>): Promise<{
|
|
3
|
+
success: boolean;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compileSwc = 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 normalize_ts_compilation_options_1 = require("../normalize-ts-compilation-options");
|
|
8
|
+
function compileSwc(tsCompilationOptions, postCompilationCallback) {
|
|
9
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
10
|
+
const normalizedOptions = (0, normalize_ts_compilation_options_1.normalizeTsCompilationOptions)(tsCompilationOptions);
|
|
11
|
+
devkit_1.logger.log(`Compiling with SWC for ${normalizedOptions.projectName}...`);
|
|
12
|
+
const srcPath = normalizedOptions.projectRoot;
|
|
13
|
+
const destPath = normalizedOptions.outputPath.replace(`/${normalizedOptions.projectName}`, '');
|
|
14
|
+
const swcrcPath = `${normalizedOptions.projectRoot}/.swcrc`;
|
|
15
|
+
// TODO(chau): use `--ignore` for swc cli to exclude spec files
|
|
16
|
+
// Open issue: https://github.com/swc-project/cli/issues/20
|
|
17
|
+
let swcCmd = `npx swc ${srcPath} -d ${destPath} --source-maps --config-file=${swcrcPath}`;
|
|
18
|
+
if (normalizedOptions.watch) {
|
|
19
|
+
swcCmd += ' --watch';
|
|
20
|
+
return createSwcWatchProcess(swcCmd, postCompilationCallback);
|
|
21
|
+
}
|
|
22
|
+
const swcCmdLog = (0, child_process_1.execSync)(swcCmd).toString();
|
|
23
|
+
devkit_1.logger.log(swcCmdLog.replace(/\n/, ''));
|
|
24
|
+
yield postCompilationCallback();
|
|
25
|
+
return { success: true };
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.compileSwc = compileSwc;
|
|
29
|
+
function createSwcWatchProcess(swcCmd, postCompilationCallback) {
|
|
30
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
31
|
+
return new Promise((res) => {
|
|
32
|
+
const watchProcess = (0, child_process_1.exec)(swcCmd);
|
|
33
|
+
watchProcess.stdout.on('data', (data) => {
|
|
34
|
+
process.stdout.write(data);
|
|
35
|
+
if (data.includes('Successfully compiled')) {
|
|
36
|
+
postCompilationCallback();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
watchProcess.stderr.on('data', (err) => {
|
|
40
|
+
process.stderr.write(err);
|
|
41
|
+
res({ success: false });
|
|
42
|
+
});
|
|
43
|
+
const processExitListener = () => watchProcess.kill();
|
|
44
|
+
process.on('SIGINT', processExitListener);
|
|
45
|
+
process.on('SIGTERM', processExitListener);
|
|
46
|
+
process.on('exit', processExitListener);
|
|
47
|
+
watchProcess.on('exit', () => {
|
|
48
|
+
res({ success: true });
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=compile-swc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-swc.js","sourceRoot":"","sources":["../../../../../../packages/js/src/utils/swc/compile-swc.ts"],"names":[],"mappings":";;;;AAAA,yCAAsC;AAEtC,iDAA+C;AAC/C,0FAAoF;AAEpF,SAAsB,UAAU,CAC9B,oBAAkD,EAClD,uBAAmD;;QAEnD,MAAM,iBAAiB,GAAG,IAAA,gEAA6B,EAAC,oBAAoB,CAAC,CAAC;QAE9E,eAAM,CAAC,GAAG,CAAC,0BAA0B,iBAAiB,CAAC,WAAW,KAAK,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,iBAAiB,CAAC,WAAW,CAAC;QAC9C,MAAM,QAAQ,GAAG,iBAAiB,CAAC,UAAU,CAAC,OAAO,CACnD,IAAI,iBAAiB,CAAC,WAAW,EAAE,EACnC,EAAE,CACH,CAAC;QACF,MAAM,SAAS,GAAG,GAAG,iBAAiB,CAAC,WAAW,SAAS,CAAC;QAE5D,+DAA+D;QAC/D,2DAA2D;QAC3D,IAAI,MAAM,GAAG,WAAW,OAAO,OAAO,QAAQ,gCAAgC,SAAS,EAAE,CAAC;QAE1F,IAAI,iBAAiB,CAAC,KAAK,EAAE;YAC3B,MAAM,IAAI,UAAU,CAAC;YACrB,OAAO,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;SAC/D;QAED,MAAM,SAAS,GAAG,IAAA,wBAAQ,EAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC9C,eAAM,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,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CAAC;IACL,CAAC;CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function updatePackageJson(main: string, outputPath: string, projectRoot: string, withTypings?: boolean): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatePackageJson = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const fileutils_1 = require("@nrwl/tao/src/utils/fileutils");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function getMainFileDirRelativeToProjectRoot(main, projectRoot) {
|
|
8
|
+
const mainFileDir = (0, path_1.dirname)(main);
|
|
9
|
+
const relativeDir = (0, devkit_1.normalizePath)((0, path_1.relative)(projectRoot, mainFileDir));
|
|
10
|
+
return relativeDir === '' ? `./` : `./${relativeDir}/`;
|
|
11
|
+
}
|
|
12
|
+
function updatePackageJson(main, outputPath, projectRoot, withTypings = true) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const packageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(projectRoot, 'package.json'));
|
|
15
|
+
if (packageJson.main && packageJson.typings) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const mainFile = (0, path_1.basename)(main).replace(/\.[tj]s$/, '');
|
|
19
|
+
const relativeMainFileDir = getMainFileDirRelativeToProjectRoot(main, projectRoot);
|
|
20
|
+
const mainJsFile = `${relativeMainFileDir}${mainFile}.js`;
|
|
21
|
+
const typingsFile = `${relativeMainFileDir}${mainFile}.d.ts`;
|
|
22
|
+
packageJson.main = (_a = packageJson.main) !== null && _a !== void 0 ? _a : mainJsFile;
|
|
23
|
+
if (withTypings) {
|
|
24
|
+
packageJson.typings = (_b = packageJson.typings) !== null && _b !== void 0 ? _b : typingsFile;
|
|
25
|
+
}
|
|
26
|
+
const outputPackageJson = (0, path_1.join)(outputPath, 'package.json');
|
|
27
|
+
(0, fileutils_1.writeJsonFile)(outputPackageJson, packageJson);
|
|
28
|
+
}
|
|
29
|
+
exports.updatePackageJson = updatePackageJson;
|
|
30
|
+
//# sourceMappingURL=update-package-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-package-json.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/update-package-json.ts"],"names":[],"mappings":";;;AAAA,yCAA6C;AAC7C,6DAA4E;AAC5E,+BAAyD;AAEzD,SAAS,mCAAmC,CAC1C,IAAY,EACZ,WAAmB;IAEnB,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;IAClC,MAAM,WAAW,GAAG,IAAA,sBAAa,EAAC,IAAA,eAAQ,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IACtE,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,GAAG,CAAC;AACzD,CAAC;AAED,SAAgB,iBAAiB,CAC/B,IAAY,EACZ,UAAkB,EAClB,WAAmB,EACnB,WAAW,GAAG,IAAI;;IAElB,MAAM,WAAW,GAAG,IAAA,wBAAY,EAAC,IAAA,WAAI,EAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;IACpE,IAAI,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,OAAO,EAAE;QAC3C,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACxD,MAAM,mBAAmB,GAAG,mCAAmC,CAC7D,IAAI,EACJ,WAAW,CACZ,CAAC;IACF,MAAM,UAAU,GAAG,GAAG,mBAAmB,GAAG,QAAQ,KAAK,CAAC;IAC1D,MAAM,WAAW,GAAG,GAAG,mBAAmB,GAAG,QAAQ,OAAO,CAAC;IAE7D,WAAW,CAAC,IAAI,GAAG,MAAA,WAAW,CAAC,IAAI,mCAAI,UAAU,CAAC;IAElD,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,OAAO,GAAG,MAAA,WAAW,CAAC,OAAO,mCAAI,WAAW,CAAC;KAC1D;IAED,MAAM,iBAAiB,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC3D,IAAA,yBAAa,EAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;AAChD,CAAC;AA3BD,8CA2BC"}
|
package/src/utils/versions.d.ts
CHANGED
package/src/utils/versions.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nxVersion = void 0;
|
|
4
|
-
exports.nxVersion = '13.3.
|
|
3
|
+
exports.swcHelpersVersion = exports.swcCliVersion = exports.swcCoreVersion = exports.nxVersion = void 0;
|
|
4
|
+
exports.nxVersion = '13.3.8';
|
|
5
|
+
exports.swcCoreVersion = '1.2.118';
|
|
6
|
+
exports.swcCliVersion = '~0.1.52';
|
|
7
|
+
exports.swcHelpersVersion = '~0.2.14';
|
|
5
8
|
//# sourceMappingURL=versions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,GAAG,CAAC"}
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/js/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,GAAG,CAAC;AAEhB,QAAA,cAAc,GAAG,SAAS,CAAC;AAE3B,QAAA,aAAa,GAAG,SAAS,CAAC;AAE1B,QAAA,iBAAiB,GAAG,SAAS,CAAC"}
|