@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
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+
7
+
8
+ **Note:** Version bump only for package @nx/esbuild
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017-2023 Narwhal Technologies Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
2
+
3
+ <div style="text-align: center;">
4
+
5
+ [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
6
+ [![License](https://img.shields.io/npm/l/@nrwl/workspace.svg?style=flat-square)]()
7
+ [![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nrwl/workspace)
8
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
9
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10
+ [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
11
+ [![Join us @nrwl/community on slack](https://img.shields.io/badge/slack-%40nrwl%2Fcommunity-brightgreen)](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc)
12
+
13
+ </div>
14
+
15
+
16
+ <hr>
17
+
18
+ # Nx: Smart, Fast and Extensible Build System
19
+
20
+ Nx is a next generation build system with first class monorepo support and powerful integrations.
21
+
22
+ This package is a [EsBuild plugin for Nx](https://nx.dev/packages/esbuild).
23
+
24
+ ## Getting Started
25
+
26
+ ### Creating an Nx Workspace
27
+
28
+ **Using `npx`**
29
+
30
+ ```bash
31
+ npx create-nx-workspace
32
+ ```
33
+
34
+ **Using `npm init`**
35
+
36
+ ```bash
37
+ npm init nx-workspace
38
+ ```
39
+
40
+ **Using `yarn create`**
41
+
42
+ ```bash
43
+ yarn create nx-workspace
44
+ ```
45
+
46
+ ### Adding Nx to an Existing Repository
47
+
48
+ Run:
49
+
50
+ ```bash
51
+ npx nx@latest init
52
+ ```
53
+
54
+ ## Documentation & Resources
55
+
56
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
57
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
58
+ - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
59
+ - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
60
+
61
+ <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
62
+ width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
63
+
package/executors.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "builders": {
3
+ "esbuild": {
4
+ "implementation": "./src/executors/esbuild/compat",
5
+ "schema": "./src/executors/esbuild/schema.json",
6
+ "description": "Bundle a package using EsBuild."
7
+ }
8
+ },
9
+ "executors": {
10
+ "esbuild": {
11
+ "implementation": "./src/executors/esbuild/esbuild.impl",
12
+ "schema": "./src/executors/esbuild/schema.json",
13
+ "description": "Bundle a package using EsBuild."
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "Nx esbuild",
3
+ "version": "0.1",
4
+ "schematics": {
5
+ "init": {
6
+ "factory": "./src/generators/init/init#esbuildInitSchematic",
7
+ "schema": "./src/generators/init/schema.json",
8
+ "description": "Initialize the `@nrwl/esbuild` plugin.",
9
+ "hidden": true
10
+ },
11
+ "esbuild-project": {
12
+ "factory": "./src/generators/esbuild-project/esbuild-project#esbuildProjectSchematic",
13
+ "schema": "./src/generators/esbuild-project/schema.json",
14
+ "description": "Add esbuild configuration to a project.",
15
+ "hidden": true
16
+ }
17
+ },
18
+ "generators": {
19
+ "init": {
20
+ "factory": "./src/generators/init/init#esbuildInitGenerator",
21
+ "schema": "./src/generators/init/schema.json",
22
+ "description": "Initialize the `@nrwl/esbuild` plugin.",
23
+ "aliases": ["ng-add"],
24
+ "hidden": true
25
+ },
26
+ "esbuild-project": {
27
+ "factory": "./src/generators/esbuild-project/esbuild-project#esbuildProjectGenerator",
28
+ "schema": "./src/generators/esbuild-project/schema.json",
29
+ "description": "Add esbuild configuration to a project.",
30
+ "hidden": true
31
+ }
32
+ }
33
+ }
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './src/executors/esbuild/schema';
2
+ export * from './src/executors/esbuild/esbuild.impl';
3
+ export * from './src/utils/versions';
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./src/executors/esbuild/schema"), exports);
5
+ tslib_1.__exportStar(require("./src/executors/esbuild/esbuild.impl"), exports);
6
+ tslib_1.__exportStar(require("./src/utils/versions"), exports);
7
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/esbuild/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,+EAAqD;AACrD,+DAAqC"}
@@ -0,0 +1,27 @@
1
+ {
2
+ "generators": {
3
+ "set-generate-package-json": {
4
+ "cli": "nx",
5
+ "version": "15.8.7-beta.0",
6
+ "description": "Set generatePackageJson to true to maintain existing behavior of generating package.json in output path.",
7
+ "factory": "./src/migrations/update-15-8-7/set-generate-package-json"
8
+ },
9
+ "update-16-0-0-add-nx-packages": {
10
+ "cli": "nx",
11
+ "version": "16.0.0-beta.1",
12
+ "description": "Replace @nrwl/esbuild with @nx/esbuild",
13
+ "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
14
+ }
15
+ },
16
+ "packageJsonUpdates": {
17
+ "15.7.0": {
18
+ "version": "15.7.0-beta.0",
19
+ "packages": {
20
+ "esbuild": {
21
+ "version": "0.17.5",
22
+ "alwaysAddToPackageJson": false
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@nx/esbuild",
3
+ "version": "16.0.0-beta.1",
4
+ "private": false,
5
+ "description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/nrwl/nx.git",
9
+ "directory": "packages/esbuild"
10
+ },
11
+ "keywords": [
12
+ "Monorepo",
13
+ "EsBuild",
14
+ "Web",
15
+ "CLI"
16
+ ],
17
+ "main": "./index",
18
+ "typings": "./index.d.ts",
19
+ "author": "Victor Savkin",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/nrwl/nx/issues"
23
+ },
24
+ "homepage": "https://nx.dev",
25
+ "schematics": "./generators.json",
26
+ "builders": "./executors.json",
27
+ "ng-update": {
28
+ "requirements": {},
29
+ "migrations": "./migrations.json"
30
+ },
31
+ "dependencies": {
32
+ "@nrwl/esbuild": "16.0.0-beta.1",
33
+ "@nx/devkit": "16.0.0-beta.1",
34
+ "@nx/js": "16.0.0-beta.1",
35
+ "chalk": "^4.1.0",
36
+ "dotenv": "~10.0.0",
37
+ "fast-glob": "3.2.7",
38
+ "fs-extra": "^11.1.0",
39
+ "tsconfig-paths": "^4.1.2",
40
+ "tslib": "^2.3.0"
41
+ },
42
+ "peerDependencies": {
43
+ "esbuild": "~0.17.5"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "esbuild": {
47
+ "optional": true
48
+ }
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "types": "./index.d.ts",
54
+ "gitHead": "abf534c265f5aa3aac146e55bb31de598ea281d7"
55
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const devkit_1 = require("@nx/devkit");
4
+ const esbuild_impl_1 = require("./esbuild.impl");
5
+ exports.default = (0, devkit_1.convertNxExecutor)(esbuild_impl_1.default);
6
+ //# sourceMappingURL=compat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/esbuild/src/executors/esbuild/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,iDAA6C;AAE7C,kBAAe,IAAA,0BAAiB,EAAC,sBAAe,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import 'dotenv/config';
2
+ import type { ExecutorContext } from '@nx/devkit';
3
+ import { EsBuildExecutorOptions } from './schema';
4
+ export declare function esbuildExecutor(_options: EsBuildExecutorOptions, context: ExecutorContext): AsyncGenerator<{
5
+ success: boolean;
6
+ outfile?: string;
7
+ }, any, undefined>;
8
+ export default esbuildExecutor;
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.esbuildExecutor = void 0;
4
+ const tslib_1 = require("tslib");
5
+ require("dotenv/config");
6
+ const chalk = require("chalk");
7
+ const devkit_1 = require("@nx/devkit");
8
+ const js_1 = require("@nx/js");
9
+ const esbuild = require("esbuild");
10
+ const normalize_1 = require("./lib/normalize");
11
+ const fs_extra_1 = require("fs-extra");
12
+ const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
13
+ const build_esbuild_options_1 = require("./lib/build-esbuild-options");
14
+ const get_extra_dependencies_1 = require("./lib/get-extra-dependencies");
15
+ const path_1 = require("path");
16
+ const BUILD_WATCH_FAILED = `[ ${chalk.red('watch')} ] build finished with errors (see above), watching for changes...`;
17
+ const BUILD_WATCH_SUCCEEDED = `[ ${chalk.green('watch')} ] build succeeded, watching for changes...`;
18
+ function esbuildExecutor(_options, context) {
19
+ return tslib_1.__asyncGenerator(this, arguments, function* esbuildExecutor_1() {
20
+ const options = (0, normalize_1.normalizeOptions)(_options, context);
21
+ if (options.deleteOutputPath)
22
+ (0, fs_extra_1.removeSync)(options.outputPath);
23
+ const assetsResult = yield tslib_1.__await((0, js_1.copyAssets)(options, context));
24
+ const externalDependencies = options.external.reduce((acc, name) => {
25
+ const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
26
+ if (externalNode) {
27
+ acc.push({
28
+ name,
29
+ outputs: [],
30
+ node: externalNode,
31
+ });
32
+ }
33
+ return acc;
34
+ }, []);
35
+ if (!options.thirdParty) {
36
+ const thirdPartyDependencies = (0, get_extra_dependencies_1.getExtraDependencies)(context.projectName, context.projectGraph);
37
+ for (const tpd of thirdPartyDependencies) {
38
+ options.external.push(tpd.node.data.packageName);
39
+ externalDependencies.push(tpd);
40
+ }
41
+ }
42
+ let packageJsonResult;
43
+ if (options.generatePackageJson) {
44
+ const cpjOptions = Object.assign(Object.assign({}, options), {
45
+ // TODO(jack): make types generate with esbuild
46
+ skipTypings: true, outputFileExtensionForCjs: (0, build_esbuild_options_1.getOutExtension)('cjs', options), excludeLibsInPackageJson: !options.thirdParty, updateBuildableProjectDepsInPackageJson: externalDependencies.length > 0 });
47
+ // If we're bundling third-party packages, then any extra deps from external should be the only deps in package.json
48
+ if (options.thirdParty && externalDependencies.length > 0) {
49
+ cpjOptions.overrideDependencies = externalDependencies;
50
+ }
51
+ else {
52
+ cpjOptions.extraDependencies = externalDependencies;
53
+ }
54
+ packageJsonResult = yield tslib_1.__await((0, js_1.copyPackageJson)(cpjOptions, context));
55
+ }
56
+ if ('context' in esbuild) {
57
+ // 0.17.0+ adds esbuild.context and context.watch()
58
+ if (options.watch) {
59
+ return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, async_iterable_1.createAsyncIterable)(({ next, done }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
60
+ let hasTypeErrors = false;
61
+ const disposeFns = yield Promise.all(options.format.map((format, idx) => tslib_1.__awaiter(this, void 0, void 0, function* () {
62
+ const esbuildOptions = (0, build_esbuild_options_1.buildEsbuildOptions)(format, options, context);
63
+ const ctx = yield esbuild.context(Object.assign(Object.assign({}, esbuildOptions), { plugins: [
64
+ // Only emit info on one of the watch processes.
65
+ idx === 0
66
+ ? {
67
+ name: 'nx-watch-plugin',
68
+ setup(build) {
69
+ build.onEnd((result) => tslib_1.__awaiter(this, void 0, void 0, function* () {
70
+ if (!options.skipTypeCheck) {
71
+ const { errors } = yield runTypeCheck(options, context);
72
+ hasTypeErrors = errors.length > 0;
73
+ }
74
+ const success = result.errors.length === 0 && !hasTypeErrors;
75
+ if (!success) {
76
+ devkit_1.logger.info(BUILD_WATCH_FAILED);
77
+ }
78
+ else {
79
+ devkit_1.logger.info(BUILD_WATCH_SUCCEEDED);
80
+ }
81
+ next({
82
+ success,
83
+ // Need to call getOutfile directly in the case of bundle=false and outfile is not set for esbuild.
84
+ outfile: (0, path_1.join)(context.root, (0, build_esbuild_options_1.getOutfile)(format, options, context)),
85
+ });
86
+ }));
87
+ },
88
+ }
89
+ : null,
90
+ ].filter(Boolean) }));
91
+ yield ctx.watch();
92
+ return () => ctx.dispose();
93
+ })));
94
+ registerCleanupCallback(() => {
95
+ assetsResult === null || assetsResult === void 0 ? void 0 : assetsResult.stop();
96
+ packageJsonResult === null || packageJsonResult === void 0 ? void 0 : packageJsonResult.stop();
97
+ disposeFns.forEach((fn) => fn());
98
+ done(); // return from async iterable
99
+ });
100
+ }))))));
101
+ }
102
+ else {
103
+ // Run type-checks first and bail if they don't pass.
104
+ if (!options.skipTypeCheck) {
105
+ const { errors } = yield tslib_1.__await(runTypeCheck(options, context));
106
+ if (errors.length > 0) {
107
+ yield yield tslib_1.__await({ success: false });
108
+ return yield tslib_1.__await(void 0);
109
+ }
110
+ }
111
+ // Emit a build event for each file format.
112
+ for (let i = 0; i < options.format.length; i++) {
113
+ const format = options.format[i];
114
+ const esbuildOptions = (0, build_esbuild_options_1.buildEsbuildOptions)(format, options, context);
115
+ const buildResult = yield tslib_1.__await(esbuild.build(esbuildOptions));
116
+ if (options.metafile) {
117
+ const filename = options.format.length === 1
118
+ ? 'meta.json'
119
+ : `meta.${options.format[i]}.json`;
120
+ (0, fs_extra_1.writeJsonSync)((0, devkit_1.joinPathFragments)(options.outputPath, filename), buildResult.metafile);
121
+ }
122
+ yield yield tslib_1.__await({
123
+ success: buildResult.errors.length === 0,
124
+ // Need to call getOutfile directly in the case of bundle=false and outfile is not set for esbuild.
125
+ // This field is needed for `@nrwl/js:node` executor to work.
126
+ outfile: (0, path_1.join)(context.root, (0, build_esbuild_options_1.getOutfile)(format, options, context)),
127
+ });
128
+ }
129
+ }
130
+ }
131
+ else {
132
+ // TODO(jack): Remove in Nx 16
133
+ // < 0.17.0 takes watch as an argument to build()
134
+ if (options.watch) {
135
+ return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, async_iterable_1.createAsyncIterable)(({ next, done }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
136
+ let hasTypeErrors = false;
137
+ const results = yield Promise.all(options.format.map((format, idx) => tslib_1.__awaiter(this, void 0, void 0, function* () {
138
+ const esbuildOptions = (0, build_esbuild_options_1.buildEsbuildOptions)(format, options, context);
139
+ const watch =
140
+ // Only emit info on one of the watch processes.
141
+ idx === 0
142
+ ? {
143
+ onRebuild: (error, result) => tslib_1.__awaiter(this, void 0, void 0, function* () {
144
+ if (!options.skipTypeCheck) {
145
+ const { errors } = yield runTypeCheck(options, context);
146
+ hasTypeErrors = errors.length > 0;
147
+ }
148
+ const success = !error && !hasTypeErrors;
149
+ if (!success) {
150
+ devkit_1.logger.info(BUILD_WATCH_FAILED);
151
+ }
152
+ else {
153
+ devkit_1.logger.info(BUILD_WATCH_SUCCEEDED);
154
+ }
155
+ next({
156
+ success,
157
+ // Need to call getOutfile directly in the case of bundle=false and outfile is not set for esbuild.
158
+ // This field is needed for `@nrwl/js:node` executor to work.
159
+ outfile: (0, path_1.join)(context.root, (0, build_esbuild_options_1.getOutfile)(format, options, context)),
160
+ });
161
+ }),
162
+ }
163
+ : true;
164
+ try {
165
+ const result = yield esbuild.build(Object.assign(Object.assign({}, esbuildOptions), { watch }));
166
+ next({
167
+ success: true,
168
+ // Need to call getOutfile directly in the case of bundle=false and outfile is not set for esbuild.
169
+ outfile: (0, path_1.join)(context.root, (0, build_esbuild_options_1.getOutfile)(format, options, context)),
170
+ });
171
+ return result;
172
+ }
173
+ catch (_a) {
174
+ next({ success: false });
175
+ }
176
+ })));
177
+ registerCleanupCallback(() => {
178
+ assetsResult === null || assetsResult === void 0 ? void 0 : assetsResult.stop();
179
+ packageJsonResult === null || packageJsonResult === void 0 ? void 0 : packageJsonResult.stop();
180
+ results.forEach((r) => { var _a;
181
+ // result.stop() is no in esbuild 0.17.0+ but it exists in earlier versions
182
+ return (_a = r === null || r === void 0 ? void 0 : r['stop']) === null || _a === void 0 ? void 0 : _a.call(r); });
183
+ done();
184
+ });
185
+ if (!options.skipTypeCheck) {
186
+ const { errors } = yield runTypeCheck(options, context);
187
+ hasTypeErrors = errors.length > 0;
188
+ }
189
+ const success = results.every((r) => { var _a; return ((_a = r.errors) === null || _a === void 0 ? void 0 : _a.length) === 0; }) && !hasTypeErrors;
190
+ if (!success) {
191
+ devkit_1.logger.info(BUILD_WATCH_FAILED);
192
+ }
193
+ else {
194
+ devkit_1.logger.info(BUILD_WATCH_SUCCEEDED);
195
+ }
196
+ }))))));
197
+ }
198
+ else {
199
+ // Run type-checks first and bail if they don't pass.
200
+ if (!options.skipTypeCheck) {
201
+ const { errors } = yield tslib_1.__await(runTypeCheck(options, context));
202
+ if (errors.length > 0) {
203
+ yield yield tslib_1.__await({ success: false });
204
+ return yield tslib_1.__await(void 0);
205
+ }
206
+ }
207
+ // Emit a build event for each file format.
208
+ for (let i = 0; i < options.format.length; i++) {
209
+ const format = options.format[i];
210
+ const esbuildOptions = (0, build_esbuild_options_1.buildEsbuildOptions)(format, options, context);
211
+ const buildResult = yield tslib_1.__await(esbuild.build(esbuildOptions));
212
+ if (options.metafile) {
213
+ const filename = options.format.length === 1
214
+ ? 'meta.json'
215
+ : `meta.${options.format[i]}.json`;
216
+ (0, fs_extra_1.writeJsonSync)((0, devkit_1.joinPathFragments)(options.outputPath, filename), buildResult.metafile);
217
+ }
218
+ yield yield tslib_1.__await({
219
+ success: buildResult.errors.length === 0,
220
+ // Need to call getOutfile directly in the case of bundle=false and outfile is not set for esbuild.
221
+ outfile: (0, path_1.join)(context.root, (0, build_esbuild_options_1.getOutfile)(format, options, context)),
222
+ });
223
+ }
224
+ }
225
+ }
226
+ });
227
+ }
228
+ exports.esbuildExecutor = esbuildExecutor;
229
+ function getTypeCheckOptions(options, context) {
230
+ const { watch, tsConfig, outputPath } = options;
231
+ const typeCheckOptions = {
232
+ // TODO(jack): Add support for d.ts declaration files -- once the `@nrwl/js:tsc` changes are in we can use the same logic.
233
+ mode: 'noEmit',
234
+ tsConfigPath: tsConfig,
235
+ // outDir: outputPath,
236
+ workspaceRoot: context.root,
237
+ rootDir: context.root,
238
+ };
239
+ if (watch) {
240
+ typeCheckOptions.incremental = true;
241
+ typeCheckOptions.cacheDir = devkit_1.cacheDir;
242
+ }
243
+ return typeCheckOptions;
244
+ }
245
+ function runTypeCheck(options, context) {
246
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
247
+ const { errors, warnings } = yield (0, js_1.runTypeCheck)(getTypeCheckOptions(options, context));
248
+ const hasErrors = errors.length > 0;
249
+ const hasWarnings = warnings.length > 0;
250
+ if (hasErrors || hasWarnings) {
251
+ yield (0, js_1.printDiagnostics)(errors, warnings);
252
+ }
253
+ return { errors, warnings };
254
+ });
255
+ }
256
+ function registerCleanupCallback(callback) {
257
+ const wrapped = () => {
258
+ callback();
259
+ process.off('SIGINT', wrapped);
260
+ process.off('SIGTERM', wrapped);
261
+ process.off('exit', wrapped);
262
+ };
263
+ process.on('SIGINT', wrapped);
264
+ process.on('SIGTERM', wrapped);
265
+ process.on('exit', wrapped);
266
+ }
267
+ exports.default = esbuildExecutor;
268
+ //# sourceMappingURL=esbuild.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.impl.js","sourceRoot":"","sources":["../../../../../../packages/esbuild/src/executors/esbuild/esbuild.impl.ts"],"names":[],"mappings":";;;;AAAA,yBAAuB;AACvB,+BAA+B;AAE/B,uCAAiE;AACjE,+BAOgB;AAChB,mCAAmC;AACnC,+CAAmD;AAGnD,uCAAqD;AACrD,wEAA0E;AAC1E,uEAIqC;AACrC,yEAAoE;AAEpE,+BAA4B;AAE5B,MAAM,kBAAkB,GAAG,KAAK,KAAK,CAAC,GAAG,CACvC,OAAO,CACR,oEAAoE,CAAC;AACtE,MAAM,qBAAqB,GAAG,KAAK,KAAK,CAAC,KAAK,CAC5C,OAAO,CACR,6CAA6C,CAAC;AAO/C,SAAuB,eAAe,CACpC,QAAgC,EAChC,OAAwB;;QAExB,MAAM,OAAO,GAAG,IAAA,4BAAgB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACpD,IAAI,OAAO,CAAC,gBAAgB;YAAE,IAAA,qBAAU,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAE7D,MAAM,YAAY,GAAG,sBAAM,IAAA,eAAU,EAAC,OAAO,EAAE,OAAO,CAAC,CAAA,CAAC;QAExD,MAAM,o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AC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED,kBAAe,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ import * as esbuild from 'esbuild';
2
+ import { ExecutorContext, ProjectGraphProjectNode } from '@nx/devkit';
3
+ import { NormalizedEsBuildExecutorOptions } from '../schema';
4
+ export declare function buildEsbuildOptions(format: 'cjs' | 'esm', options: NormalizedEsBuildExecutorOptions, context: ExecutorContext): esbuild.BuildOptions;
5
+ export declare function getOutExtension(format: 'cjs' | 'esm', options: NormalizedEsBuildExecutorOptions): '.cjs' | '.mjs' | '.js';
6
+ export declare function getOutfile(format: 'cjs' | 'esm', options: NormalizedEsBuildExecutorOptions, context: ExecutorContext): string;
7
+ export declare function getRegisterFileContent(project: ProjectGraphProjectNode, paths: Record<string, string[]>, mainFile: string, outExtension?: string): string;