@nx/esbuild 17.0.2 → 17.0.4
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/LICENSE +1 -1
- package/README.md +9 -4
- package/package.json +4 -4
- package/src/executors/esbuild/schema.d.ts +0 -1
- package/src/executors/esbuild/schema.json +0 -6
- package/src/generators/configuration/configuration.d.ts +1 -1
- package/src/generators/configuration/configuration.js +2 -0
- package/src/generators/configuration/schema.json +1 -1
- package/src/generators/init/init.d.ts +2 -2
- package/src/generators/init/init.js +8 -5
- package/src/generators/init/schema.d.ts +2 -1
- package/src/generators/init/schema.json +15 -10
- package/src/utils/environment-variables.js +4 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
<p style="text-align: center;"
|
|
1
|
+
<p style="text-align: center;">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
|
|
4
|
+
<img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
8
|
<div style="text-align: center;">
|
|
4
9
|
|
|
@@ -15,9 +20,9 @@
|
|
|
15
20
|
|
|
16
21
|
<hr>
|
|
17
22
|
|
|
18
|
-
# Nx: Smart
|
|
23
|
+
# Nx: Smart Monorepos · Fast CI
|
|
19
24
|
|
|
20
|
-
Nx is a
|
|
25
|
+
Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
|
|
21
26
|
|
|
22
27
|
This package is a [EsBuild plugin for Nx](https://nx.dev/packages/esbuild).
|
|
23
28
|
|
|
@@ -59,5 +64,5 @@ npx nx@latest init
|
|
|
59
64
|
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
|
|
60
65
|
|
|
61
66
|
<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
|
|
67
|
+
width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
|
|
63
68
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/esbuild",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild",
|
|
6
6
|
"repository": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"fs-extra": "^11.1.0",
|
|
35
35
|
"tslib": "^2.3.0",
|
|
36
36
|
"tsconfig-paths": "^4.1.2",
|
|
37
|
-
"@nx/devkit": "17.0.
|
|
38
|
-
"@nx/js": "17.0.
|
|
39
|
-
"@nrwl/esbuild": "17.0.
|
|
37
|
+
"@nx/devkit": "17.0.4",
|
|
38
|
+
"@nx/js": "17.0.4",
|
|
39
|
+
"@nrwl/esbuild": "17.0.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"esbuild": "~0.19.2"
|
|
@@ -130,12 +130,6 @@
|
|
|
130
130
|
"type": "boolean",
|
|
131
131
|
"description": "Includes third-party packages in the bundle (i.e. npm packages)."
|
|
132
132
|
},
|
|
133
|
-
"dependenciesFieldType": {
|
|
134
|
-
"type": "string",
|
|
135
|
-
"description": "When `bundleInternalProjectsOnly` is true, this option determines whether external packages should be in 'dependencies' or 'peerDependencies' field in the generated package.json file.",
|
|
136
|
-
"enum": ["dependencies", "peerDependencies"],
|
|
137
|
-
"default": "dependencies"
|
|
138
|
-
},
|
|
139
133
|
"esbuildOptions": {
|
|
140
134
|
"type": "object",
|
|
141
135
|
"description": "Additional options to pass to esbuild. See https://esbuild.github.io/api/. Cannot be used with 'esbuildConfig' option.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
2
|
import { EsBuildProjectSchema } from './schema';
|
|
3
3
|
export declare function configurationGenerator(tree: Tree, options: EsBuildProjectSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
4
|
export default configurationGenerator;
|
|
@@ -4,6 +4,7 @@ exports.configurationGenerator = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
6
6
|
const init_1 = require("../init/init");
|
|
7
|
+
const add_build_target_defaults_1 = require("@nx/devkit/src/generators/add-build-target-defaults");
|
|
7
8
|
async function configurationGenerator(tree, options) {
|
|
8
9
|
const task = await (0, init_1.esbuildInitGenerator)(tree, {
|
|
9
10
|
...options,
|
|
@@ -25,6 +26,7 @@ function checkForTargetConflicts(tree, options) {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
function addBuildTarget(tree, options) {
|
|
29
|
+
(0, add_build_target_defaults_1.addBuildTargetDefaults)(tree, '@nx/esbuild:esbuild', options.buildTarget);
|
|
28
30
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
29
31
|
const packageJsonPath = (0, devkit_1.joinPathFragments)(project.root, 'package.json');
|
|
30
32
|
if (!tree.exists(packageJsonPath)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
import { Schema } from './schema';
|
|
3
|
-
export declare function esbuildInitGenerator(tree: Tree, schema: Schema): Promise<
|
|
3
|
+
export declare function esbuildInitGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export default esbuildInitGenerator;
|
|
@@ -5,14 +5,17 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const versions_1 = require("@nx/js/src/utils/versions");
|
|
6
6
|
const versions_2 = require("../../utils/versions");
|
|
7
7
|
async function esbuildInitGenerator(tree, schema) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
let installTask = () => { };
|
|
9
|
+
if (!schema.skipPackageJson) {
|
|
10
|
+
installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
11
|
+
'@nx/esbuild': versions_2.nxVersion,
|
|
12
|
+
esbuild: versions_1.esbuildVersion,
|
|
13
|
+
}, undefined, schema.keepExistingVersions);
|
|
14
|
+
}
|
|
12
15
|
if (!schema.skipFormat) {
|
|
13
16
|
await (0, devkit_1.formatFiles)(tree);
|
|
14
17
|
}
|
|
15
|
-
return
|
|
18
|
+
return installTask;
|
|
16
19
|
}
|
|
17
20
|
exports.esbuildInitGenerator = esbuildInitGenerator;
|
|
18
21
|
exports.default = esbuildInitGenerator;
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
3
|
-
"$id": "
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "NxEsbuildInit",
|
|
4
4
|
"cli": "nx",
|
|
5
|
-
"title": "Init
|
|
6
|
-
"description": "Init
|
|
5
|
+
"title": "Init Esbuild Plugin",
|
|
6
|
+
"description": "Init Esbuild Plugin.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
|
-
"compiler": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"enum": ["babel", "swc", "tsc"],
|
|
12
|
-
"description": "The compiler to initialize for.",
|
|
13
|
-
"default": "babel"
|
|
14
|
-
},
|
|
15
9
|
"skipFormat": {
|
|
16
10
|
"description": "Skip formatting files.",
|
|
17
11
|
"type": "boolean",
|
|
18
12
|
"default": false
|
|
13
|
+
},
|
|
14
|
+
"skipPackageJson": {
|
|
15
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"default": false
|
|
18
|
+
},
|
|
19
|
+
"keepExistingVersions": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"x-priority": "internal",
|
|
22
|
+
"description": "Keep existing dependencies versions",
|
|
23
|
+
"default": false
|
|
19
24
|
}
|
|
20
25
|
},
|
|
21
26
|
"required": []
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getClientEnvironment = void 0;
|
|
4
|
+
// Prevent sensitive keys from being bundled when source code uses entire `process.env` object rather than individual keys (e.g. `process.env.NX_FOO`).
|
|
5
|
+
// TODO(v19): Only env vars prefixed with NX_PUBLIC should be bundled. This is a breaking change so we won't do it in v18.
|
|
6
|
+
const excludedKeys = ['NX_CLOUD_ACCESS_TOKEN', 'NX_CLOUD_ENCRYPTION_KEY'];
|
|
4
7
|
function getClientEnvironment() {
|
|
5
8
|
const NX_APP = /^NX_/i;
|
|
6
9
|
return Object.keys(process.env)
|
|
7
|
-
.filter((key) => NX_APP.test(key) || key === 'NODE_ENV')
|
|
10
|
+
.filter((key) => !excludedKeys.includes(key) && (NX_APP.test(key) || key === 'NODE_ENV'))
|
|
8
11
|
.reduce((env, key) => {
|
|
9
12
|
env[`process.env.${key}`] = JSON.stringify(process.env[key]);
|
|
10
13
|
return env;
|