@nx/esbuild 16.0.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +22 -0
  3. package/README.md +63 -0
  4. package/executors.json +16 -0
  5. package/generators.json +33 -0
  6. package/index.d.ts +3 -0
  7. package/index.js +7 -0
  8. package/index.js.map +1 -0
  9. package/migrations.json +27 -0
  10. package/package.json +55 -0
  11. package/src/executors/esbuild/compat.d.ts +2 -0
  12. package/src/executors/esbuild/compat.js +6 -0
  13. package/src/executors/esbuild/compat.js.map +1 -0
  14. package/src/executors/esbuild/esbuild.impl.d.ts +8 -0
  15. package/src/executors/esbuild/esbuild.impl.js +268 -0
  16. package/src/executors/esbuild/esbuild.impl.js.map +1 -0
  17. package/src/executors/esbuild/lib/build-esbuild-options.d.ts +7 -0
  18. package/src/executors/esbuild/lib/build-esbuild-options.js +232 -0
  19. package/src/executors/esbuild/lib/build-esbuild-options.js.map +1 -0
  20. package/src/executors/esbuild/lib/get-extra-dependencies.d.ts +3 -0
  21. package/src/executors/esbuild/lib/get-extra-dependencies.js +35 -0
  22. package/src/executors/esbuild/lib/get-extra-dependencies.js.map +1 -0
  23. package/src/executors/esbuild/lib/normalize.d.ts +3 -0
  24. package/src/executors/esbuild/lib/normalize.js +56 -0
  25. package/src/executors/esbuild/lib/normalize.js.map +1 -0
  26. package/src/executors/esbuild/schema.d.ts +38 -0
  27. package/src/executors/esbuild/schema.json +189 -0
  28. package/src/generators/esbuild-project/esbuild-project.d.ts +5 -0
  29. package/src/generators/esbuild-project/esbuild-project.js +100 -0
  30. package/src/generators/esbuild-project/esbuild-project.js.map +1 -0
  31. package/src/generators/esbuild-project/schema.d.ts +12 -0
  32. package/src/generators/esbuild-project/schema.json +62 -0
  33. package/src/generators/init/init.d.ts +5 -0
  34. package/src/generators/init/init.js +21 -0
  35. package/src/generators/init/init.js.map +1 -0
  36. package/src/generators/init/schema.d.ts +4 -0
  37. package/src/generators/init/schema.json +22 -0
  38. package/src/migrations/update-15-8-7/set-generate-package-json.d.ts +2 -0
  39. package/src/migrations/update-15-8-7/set-generate-package-json.js +27 -0
  40. package/src/migrations/update-15-8-7/set-generate-package-json.js.map +1 -0
  41. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  42. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
  43. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
  44. package/src/utils/environment-variables.d.ts +1 -0
  45. package/src/utils/environment-variables.js +14 -0
  46. package/src/utils/environment-variables.js.map +1 -0
  47. package/src/utils/fs.d.ts +4 -0
  48. package/src/utils/fs.js +17 -0
  49. package/src/utils/fs.js.map +1 -0
  50. package/src/utils/get-entry-points.d.ts +8 -0
  51. package/src/utils/get-entry-points.js +62 -0
  52. package/src/utils/get-entry-points.js.map +1 -0
  53. package/src/utils/versions.d.ts +2 -0
  54. package/src/utils/versions.js +6 -0
  55. package/src/utils/versions.js.map +1 -0
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.esbuildProjectSchematic = exports.esbuildProjectGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const init_1 = require("../init/init");
7
+ function esbuildProjectGenerator(tree, options) {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ const task = yield (0, init_1.esbuildInitGenerator)(tree, Object.assign(Object.assign({}, options), { skipFormat: true }));
10
+ checkForTargetConflicts(tree, options);
11
+ addBuildTarget(tree, options);
12
+ yield (0, devkit_1.formatFiles)(tree);
13
+ return task;
14
+ });
15
+ }
16
+ exports.esbuildProjectGenerator = esbuildProjectGenerator;
17
+ function checkForTargetConflicts(tree, options) {
18
+ var _a;
19
+ if (options.skipValidation)
20
+ return;
21
+ const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
22
+ if ((_a = project.targets) === null || _a === void 0 ? void 0 : _a.build) {
23
+ throw new Error(`Project "${options.project}" already has a build target. Pass --skipValidation to ignore this error.`);
24
+ }
25
+ }
26
+ function addBuildTarget(tree, options) {
27
+ const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
28
+ const packageJsonPath = (0, devkit_1.joinPathFragments)(project.root, 'package.json');
29
+ if (!tree.exists(packageJsonPath)) {
30
+ const { npmScope } = (0, devkit_1.getWorkspaceLayout)(tree);
31
+ const importPath = options.importPath || (0, devkit_1.getImportPath)(npmScope, options.project);
32
+ (0, devkit_1.writeJson)(tree, packageJsonPath, {
33
+ name: importPath,
34
+ version: '0.0.1',
35
+ });
36
+ }
37
+ const tsConfig = getTsConfigFile(tree, options);
38
+ const buildOptions = {
39
+ main: getMainFile(tree, options),
40
+ outputPath: (0, devkit_1.joinPathFragments)('dist', project.root),
41
+ outputFileName: 'main.js',
42
+ tsConfig,
43
+ assets: [],
44
+ platform: options.platform,
45
+ };
46
+ if (options.platform === 'browser') {
47
+ buildOptions.outputHashing = 'all';
48
+ buildOptions.minify = true;
49
+ }
50
+ if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'README.md'))) {
51
+ buildOptions.assets = [
52
+ {
53
+ glob: `${project.root}/README.md`,
54
+ input: '.',
55
+ output: '.',
56
+ },
57
+ ];
58
+ }
59
+ (0, devkit_1.updateProjectConfiguration)(tree, options.project, Object.assign(Object.assign({}, project), { targets: Object.assign(Object.assign({}, project.targets), { build: {
60
+ executor: '@nrwl/esbuild:esbuild',
61
+ outputs: ['{options.outputPath}'],
62
+ defaultConfiguration: 'production',
63
+ options: buildOptions,
64
+ configurations: {
65
+ development: {
66
+ minify: false,
67
+ },
68
+ production: {
69
+ minify: true,
70
+ },
71
+ },
72
+ } }) }));
73
+ }
74
+ function getMainFile(tree, options) {
75
+ const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
76
+ const candidates = [
77
+ (0, devkit_1.joinPathFragments)(project.root, 'src/main.ts'),
78
+ (0, devkit_1.joinPathFragments)(project.root, 'src/index.ts'),
79
+ ];
80
+ for (const file of candidates) {
81
+ if (tree.exists(file))
82
+ return file;
83
+ }
84
+ return options.main;
85
+ }
86
+ function getTsConfigFile(tree, options) {
87
+ const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
88
+ const candidates = [
89
+ (0, devkit_1.joinPathFragments)(project.root, 'tsconfig.lib.json'),
90
+ (0, devkit_1.joinPathFragments)(project.root, 'tsconfig.app.json'),
91
+ ];
92
+ for (const file of candidates) {
93
+ if (tree.exists(file))
94
+ return file;
95
+ }
96
+ return options.tsConfig;
97
+ }
98
+ exports.esbuildProjectSchematic = (0, devkit_1.convertNxGenerator)(esbuildProjectGenerator);
99
+ exports.default = esbuildProjectGenerator;
100
+ //# sourceMappingURL=esbuild-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild-project.js","sourceRoot":"","sources":["../../../../../../packages/esbuild/src/generators/esbuild-project/esbuild-project.ts"],"names":[],"mappings":";;;;AACA,uCASoB;AAEpB,uCAAoD;AAIpD,SAAsB,uBAAuB,CAC3C,IAAU,EACV,OAA6B;;QAE7B,MAAM,IAAI,GAAG,MAAM,IAAA,2BAAoB,EAAC,IAAI,kCACvC,OAAO,KACV,UAAU,EAAE,IAAI,IAChB,CAAC;QACH,uBAAuB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAZD,0DAYC;AAED,SAAS,uBAAuB,CAAC,IAAU,EAAE,OAA6B;;IACxE,IAAI,OAAO,CAAC,cAAc;QAAE,OAAO;IACnC,MAAM,OAAO,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC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,UAAU,GAAG;QACjB,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC;QACpD,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC;KACrD,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE;QAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;KACpC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC;AAEY,QAAA,uBAAuB,GAAG,IAAA,2BAAkB,EACvD,uBAAuB,CACxB,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface EsBuildProjectSchema {
2
+ project: string;
3
+ main?: string;
4
+ tsConfig?: string;
5
+ devServer?: boolean;
6
+ skipFormat?: boolean;
7
+ skipPackageJson?: boolean;
8
+ skipValidation?: boolean;
9
+ importPath?: string;
10
+ esbuildConfig?: string;
11
+ platform?: 'node' | 'browser' | 'neutral';
12
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "NxEsBuildProject",
4
+ "cli": "nx",
5
+ "title": "Add esbuild configuration to a project",
6
+ "description": "Add esbuild configuration to a project.",
7
+ "type": "object",
8
+ "properties": {
9
+ "project": {
10
+ "type": "string",
11
+ "description": "The name of the project.",
12
+ "$default": {
13
+ "$source": "argv",
14
+ "index": 0
15
+ },
16
+ "x-dropdown": "project",
17
+ "x-prompt": "What is the name of the project to set up a esbuild for?",
18
+ "x-priority": "important"
19
+ },
20
+ "main": {
21
+ "type": "string",
22
+ "description": "Path relative to the workspace root for the main entry file. Defaults to `<project-root>/src/main.ts` or `<project-root>src/index.ts`, whichever is found.",
23
+ "alias": "entryFile",
24
+ "x-priority": "important"
25
+ },
26
+ "tsConfig": {
27
+ "type": "string",
28
+ "description": "Path relative to the workspace root for the tsconfig file to build with. Defaults to `<project-root>/tsconfig.app.json` or `<project-root>/tsconfig.lib.json`, whichever is found.",
29
+ "x-priority": "important"
30
+ },
31
+ "skipFormat": {
32
+ "description": "Skip formatting files.",
33
+ "type": "boolean",
34
+ "default": false,
35
+ "x-priority": "internal"
36
+ },
37
+ "skipPackageJson": {
38
+ "type": "boolean",
39
+ "default": false,
40
+ "description": "Do not add dependencies to `package.json`.",
41
+ "x-priority": "internal"
42
+ },
43
+ "skipValidation": {
44
+ "type": "boolean",
45
+ "default": false,
46
+ "description": "Do not perform any validation on existing project.",
47
+ "x-priority": "internal"
48
+ },
49
+ "importPath": {
50
+ "type": "string",
51
+ "description": "The library name used to import it, like `@myorg/my-awesome-lib`."
52
+ },
53
+ "platform": {
54
+ "type": "string",
55
+ "description": "Platform target for outputs.",
56
+ "enum": ["browser", "node", "neutral"],
57
+ "default": "node"
58
+ }
59
+ },
60
+ "required": [],
61
+ "examplesFile": "../../../docs/esbuild-project-examples.md"
62
+ }
@@ -0,0 +1,5 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import { Schema } from './schema';
3
+ export declare function esbuildInitGenerator(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
4
+ export default esbuildInitGenerator;
5
+ export declare const esbuildInitSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.esbuildInitSchematic = exports.esbuildInitGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const versions_1 = require("@nx/js/src/utils/versions");
7
+ function esbuildInitGenerator(tree, schema) {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ const task = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
10
+ esbuild: versions_1.esbuildVersion,
11
+ });
12
+ if (!schema.skipFormat) {
13
+ yield (0, devkit_1.formatFiles)(tree);
14
+ }
15
+ return task;
16
+ });
17
+ }
18
+ exports.esbuildInitGenerator = esbuildInitGenerator;
19
+ exports.default = esbuildInitGenerator;
20
+ exports.esbuildInitSchematic = (0, devkit_1.convertNxGenerator)(esbuildInitGenerator);
21
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/esbuild/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AAEpB,wDAA2D;AAE3D,SAAsB,oBAAoB,CAAC,IAAU,EAAE,MAAc;;QACnE,MAAM,IAAI,GAAG,IAAA,qCAA4B,EACvC,IAAI,EACJ,EAAE,EACF;YACE,OAAO,EAAE,yBAAc;SACxB,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAdD,oDAcC;AAED,kBAAe,oBAAoB,CAAC;AAEvB,QAAA,oBAAoB,GAAG,IAAA,2BAAkB,EAAC,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export interface Schema {
2
+ compiler?: 'babel' | 'swc' | 'tsc';
3
+ skipFormat?: boolean;
4
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "NxWebpackInit",
4
+ "cli": "nx",
5
+ "title": "Init Webpack Plugin",
6
+ "description": "Init Webpack Plugin.",
7
+ "type": "object",
8
+ "properties": {
9
+ "compiler": {
10
+ "type": "string",
11
+ "enum": ["babel", "swc", "tsc"],
12
+ "description": "The compiler to initialize for.",
13
+ "default": "babel"
14
+ },
15
+ "skipFormat": {
16
+ "description": "Skip formatting files.",
17
+ "type": "boolean",
18
+ "default": false
19
+ }
20
+ },
21
+ "required": []
22
+ }
@@ -0,0 +1,2 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ function update(tree) {
6
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
7
+ const projects = (0, devkit_1.getProjects)(tree);
8
+ projects.forEach((projectConfig, projectName) => {
9
+ let shouldUpdate = false;
10
+ Object.entries(projectConfig.targets).forEach(([targetName, targetConfig]) => {
11
+ var _a, _b;
12
+ var _c, _d;
13
+ if (targetConfig.executor === '@nrwl/esbuild:esbuild') {
14
+ shouldUpdate = true;
15
+ (_a = (_c = projectConfig.targets[targetName]).options) !== null && _a !== void 0 ? _a : (_c.options = {});
16
+ (_b = (_d = projectConfig.targets[targetName].options).generatePackageJson) !== null && _b !== void 0 ? _b : (_d.generatePackageJson = true);
17
+ }
18
+ });
19
+ if (shouldUpdate) {
20
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfig);
21
+ }
22
+ });
23
+ yield (0, devkit_1.formatFiles)(tree);
24
+ });
25
+ }
26
+ exports.default = update;
27
+ //# sourceMappingURL=set-generate-package-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-generate-package-json.js","sourceRoot":"","sources":["../../../../../../packages/esbuild/src/migrations/update-15-8-7/set-generate-package-json.ts"],"names":[],"mappings":";;;AACA,uCAIoB;AAEpB,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,EAAE;YAC9C,IAAI,YAAY,GAAG,KAAK,CAAC;YAEzB,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,CAC3C,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,EAAE;;;gBAC7B,IAAI,YAAY,CAAC,QAAQ,KAAK,uBAAuB,EAAE;oBACrD,YAAY,GAAG,IAAI,CAAC;oBAEpB,YAAA,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,EAAC,OAAO,uCAAP,OAAO,GAAK,EAAE,EAAC;oBACjD,YAAA,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,EAAC,mBAAmB,uCAAnB,mBAAmB,GAC3D,IAAI,EAAC;iBACR;YACH,CAAC,CACF,CAAC;YAEF,IAAI,YAAY,EAAE;gBAChB,IAAA,mCAA0B,EAAC,IAAI,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;aAC9D;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAxBD,yBAwBC"}
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function replacePackage(tree: Tree): Promise<void>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
6
+ function replacePackage(tree) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ yield (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/esbuild', '@nx/esbuild');
9
+ yield (0, devkit_1.formatFiles)(tree);
10
+ });
11
+ }
12
+ exports.default = replacePackage;
13
+ //# sourceMappingURL=update-16-0-0-add-nx-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-16-0-0-add-nx-packages.js","sourceRoot":"","sources":["../../../../../../packages/esbuild/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAC/C,0EAAuF;AAEvF,SAA8B,cAAc,CAAC,IAAU;;QACrD,MAAM,IAAA,iDAA+B,EAAC,IAAI,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;QAE5E,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAJD,iCAIC"}
@@ -0,0 +1 @@
1
+ export declare function getClientEnvironment(): Record<string, string>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getClientEnvironment = void 0;
4
+ function getClientEnvironment() {
5
+ const NX_APP = /^NX_/i;
6
+ return Object.keys(process.env)
7
+ .filter((key) => NX_APP.test(key) || key === 'NODE_ENV')
8
+ .reduce((env, key) => {
9
+ env[`process.env.${key}`] = JSON.stringify(process.env[key]);
10
+ return env;
11
+ }, {});
12
+ }
13
+ exports.getClientEnvironment = getClientEnvironment;
14
+ //# sourceMappingURL=environment-variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-variables.js","sourceRoot":"","sources":["../../../../../packages/esbuild/src/utils/environment-variables.ts"],"names":[],"mappings":";;;AAAA,SAAgB,oBAAoB;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC;IAEvB,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;SAC5B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,UAAU,CAAC;SACvD,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACnB,GAAG,CAAC,eAAe,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AATD,oDASC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Delete an output directory, but error out if it's the root of the project.
3
+ */
4
+ export declare function deleteOutputDir(root: string, outputPath: string): void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteOutputDir = void 0;
4
+ const path = require("path");
5
+ const fs_extra_1 = require("fs-extra");
6
+ /**
7
+ * Delete an output directory, but error out if it's the root of the project.
8
+ */
9
+ function deleteOutputDir(root, outputPath) {
10
+ const resolvedOutputPath = path.resolve(root, outputPath);
11
+ if (resolvedOutputPath === root) {
12
+ throw new Error('Output path MUST not be project root directory!');
13
+ }
14
+ (0, fs_extra_1.removeSync)(resolvedOutputPath);
15
+ }
16
+ exports.deleteOutputDir = deleteOutputDir;
17
+ //# sourceMappingURL=fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.js","sourceRoot":"","sources":["../../../../../packages/esbuild/src/utils/fs.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,uCAAsC;AAEtC;;GAEG;AACH,SAAgB,eAAe,CAAC,IAAY,EAAE,UAAkB;IAC9D,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1D,IAAI,kBAAkB,KAAK,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;KACpE;IAED,IAAA,qBAAU,EAAC,kBAAkB,CAAC,CAAC;AACjC,CAAC;AAPD,0CAOC"}
@@ -0,0 +1,8 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ export interface GetEntryPointsOptions {
3
+ recursive?: boolean;
4
+ initialEntryPoints?: string[];
5
+ initialTsConfigFileName?: string;
6
+ onProjectFilesMatched?: (projectName: string, files: string[]) => void;
7
+ }
8
+ export declare function getEntryPoints(projectName: string, context: ExecutorContext, options?: GetEntryPointsOptions): string[];
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEntryPoints = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const glob = require("fast-glob");
8
+ function getEntryPoints(projectName, context, options = {}) {
9
+ const entryPoints = options.initialEntryPoints
10
+ ? new Set(options.initialEntryPoints)
11
+ : new Set();
12
+ const seenProjects = new Set();
13
+ const findEntryPoints = (projectName, tsConfigFileName) => {
14
+ var _a, _b, _c, _d;
15
+ if (seenProjects.has(projectName))
16
+ return;
17
+ seenProjects.add(projectName);
18
+ const project = (_a = context.projectGraph) === null || _a === void 0 ? void 0 : _a.nodes[projectName];
19
+ if (!project)
20
+ return;
21
+ // Known files we generate from our generators. Only one of these should be used to build the project.
22
+ const tsconfigCandidates = [
23
+ 'tsconfig.app.json',
24
+ 'tsconfig.lib.json',
25
+ 'tsconfig.json',
26
+ ];
27
+ if (tsConfigFileName)
28
+ tsconfigCandidates.unshift(tsConfigFileName);
29
+ const foundTsConfig = tsconfigCandidates.find((f) => {
30
+ try {
31
+ return fs.statSync(path.join(project.data.root, f)).isFile();
32
+ }
33
+ catch (_a) {
34
+ return false;
35
+ }
36
+ });
37
+ // Workspace projects may not be a TS project, so skip reading source files if tsconfig is not found.
38
+ if (foundTsConfig) {
39
+ const tsconfig = (0, devkit_1.readJsonFile)(path.join(project.data.root, foundTsConfig));
40
+ const projectFiles = glob
41
+ .sync((_b = tsconfig.include) !== null && _b !== void 0 ? _b : [], {
42
+ cwd: project.data.root,
43
+ ignore: (_c = tsconfig.exclude) !== null && _c !== void 0 ? _c : [],
44
+ })
45
+ .map((f) => path.join(project.data.root, f));
46
+ projectFiles.forEach((f) => entryPoints.add(f));
47
+ (_d = options === null || options === void 0 ? void 0 : options.onProjectFilesMatched) === null || _d === void 0 ? void 0 : _d.call(options, projectName, projectFiles);
48
+ }
49
+ if (options.recursive) {
50
+ const deps = context.projectGraph.dependencies[projectName];
51
+ deps.forEach((dep) => {
52
+ if (context.projectGraph.nodes[dep.target]) {
53
+ findEntryPoints(dep.target);
54
+ }
55
+ });
56
+ }
57
+ };
58
+ findEntryPoints(projectName, options.initialTsConfigFileName);
59
+ return Array.from(entryPoints);
60
+ }
61
+ exports.getEntryPoints = getEntryPoints;
62
+ //# sourceMappingURL=get-entry-points.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-entry-points.js","sourceRoot":"","sources":["../../../../../packages/esbuild/src/utils/get-entry-points.ts"],"names":[],"mappings":";;;AAAA,uCAA2D;AAC3D,yBAAyB;AACzB,6BAA6B;AAC7B,kCAAkC;AASlC,SAAgB,cAAc,CAC5B,WAAmB,EACnB,OAAwB,EACxB,UAAiC,EAAE;IAEnC,MAAM,WAAW,GAAG,OAAO,CAAC,kBAAkB;QAC5C,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACrC,CAAC,CAAC,IAAI,GAAG,EAAU,CAAC;IACtB,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAEvC,MAAM,eAAe,GAAG,CACtB,WAAmB,EACnB,gBAAyB,EACnB,EAAE;;QACR,IAAI,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC;YAAE,OAAO;QAC1C,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAE9B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,YAAY,0CAAE,KAAK,CAAC,WAAW,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,sGAAsG;QACtG,MAAM,kBAAkB,GAAG;YACzB,mBAAmB;YACnB,mBAAmB;YACnB,eAAe;SAChB,CAAC;QACF,IAAI,gBAAgB;YAAE,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACnE,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YAClD,IAAI;gBACF,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aAC9D;YAAC,WAAM;gBACN,OAAO,KAAK,CAAC;aACd;QACH,CAAC,CAAC,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
@@ -0,0 +1,2 @@
1
+ export declare const nxVersion: any;
2
+ export declare const tsLibVersion = "^2.3.0";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tsLibVersion = exports.nxVersion = void 0;
4
+ exports.nxVersion = require('../../package.json').version;
5
+ exports.tsLibVersion = '^2.3.0';
6
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/esbuild/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,YAAY,GAAG,QAAQ,CAAC"}