nx 19.4.3 → 19.5.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/init-local.js +2 -3
- package/package.json +30 -26
- package/src/adapter/angular-json.js +6 -6
- package/src/adapter/decorate-cli.js +1 -2
- package/src/adapter/ngcli-adapter.js +8 -8
- package/src/adapter/rxjs-for-await.js +5 -5
- package/src/command-line/add/add.js +2 -2
- package/src/command-line/affected/affected.js +2 -3
- package/src/command-line/connect/connect-to-nx-cloud.js +5 -6
- package/src/command-line/connect/view-logs.js +1 -2
- package/src/command-line/daemon/daemon.js +1 -2
- package/src/command-line/exec/exec.js +1 -2
- package/src/command-line/format/format.js +1 -2
- package/src/command-line/generate/generate.js +4 -5
- package/src/command-line/generate/generator-utils.js +2 -3
- package/src/command-line/graph/command-object.js +2 -2
- package/src/command-line/graph/graph.js +9 -5
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +1 -2
- package/src/command-line/init/implementation/add-nx-to-nest.js +1 -2
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +1 -2
- package/src/command-line/init/implementation/angular/index.js +1 -2
- package/src/command-line/init/implementation/angular/integrated-workspace.js +1 -2
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +1 -2
- package/src/command-line/init/implementation/angular/standalone-workspace.js +1 -2
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +1 -1
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +7 -7
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +1 -2
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +1 -2
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +1 -2
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +1 -2
- package/src/command-line/init/implementation/react/clean-up-files.js +1 -2
- package/src/command-line/init/implementation/react/index.js +1 -2
- package/src/command-line/init/implementation/react/read-name-from-package-json.js +1 -2
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +1 -2
- package/src/command-line/init/implementation/react/tsconfig-setup.js +1 -2
- package/src/command-line/init/implementation/react/write-craco-config.js +1 -2
- package/src/command-line/init/implementation/react/write-vite-config.js +1 -2
- package/src/command-line/init/implementation/react/write-vite-index-html.js +1 -2
- package/src/command-line/init/implementation/utils.js +10 -11
- package/src/command-line/init/init-v1.js +1 -2
- package/src/command-line/init/init-v2.js +1 -2
- package/src/command-line/list/list.js +1 -2
- package/src/command-line/migrate/migrate.d.ts +1 -1
- package/src/command-line/migrate/migrate.js +5 -5
- package/src/command-line/new/new.js +1 -2
- package/src/command-line/release/changelog.js +3 -3
- package/src/command-line/release/config/config.js +3 -3
- package/src/command-line/release/config/filter-release-groups.js +1 -2
- package/src/command-line/release/config/version-plans.js +3 -4
- package/src/command-line/release/plan.js +2 -2
- package/src/command-line/release/publish.js +2 -2
- package/src/command-line/release/release.js +2 -2
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +1 -2
- package/src/command-line/release/utils/exec-command.js +1 -2
- package/src/command-line/release/utils/git.js +11 -12
- package/src/command-line/release/utils/github.js +5 -6
- package/src/command-line/release/utils/launch-editor.js +1 -2
- package/src/command-line/release/utils/markdown.js +1 -2
- package/src/command-line/release/utils/print-changes.d.ts +0 -1
- package/src/command-line/release/utils/print-changes.js +2 -3
- package/src/command-line/release/utils/resolve-changelog-renderer.js +1 -2
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +1 -2
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -3
- package/src/command-line/release/utils/semver.js +4 -5
- package/src/command-line/release/utils/shared.js +6 -6
- package/src/command-line/release/version.js +2 -2
- package/src/command-line/repair/repair.js +1 -2
- package/src/command-line/report/report.js +7 -7
- package/src/command-line/reset/reset.js +1 -2
- package/src/command-line/run/executor-utils.js +2 -3
- package/src/command-line/run/run-one.js +1 -2
- package/src/command-line/run/run.js +5 -6
- package/src/command-line/run-many/run-many.js +2 -3
- package/src/command-line/show/project.js +1 -2
- package/src/command-line/show/projects.js +1 -2
- package/src/command-line/watch/watch.js +8 -2
- package/src/command-line/yargs-utils/documentation.js +1 -2
- package/src/command-line/yargs-utils/shared-options.js +12 -13
- package/src/commands-runner/create-command-graph.js +1 -2
- package/src/commands-runner/get-command-projects.js +1 -2
- package/src/config/calculate-default-project-name.js +2 -3
- package/src/config/configuration.js +2 -2
- package/src/config/nx-json.js +2 -3
- package/src/config/project-graph.js +3 -3
- package/src/config/schema-utils.js +3 -4
- package/src/config/to-project-name.js +1 -2
- package/src/core/graph/main.js +1 -1
- package/src/daemon/cache.js +6 -6
- package/src/daemon/client/client.d.ts +1 -2
- package/src/daemon/client/client.js +13 -1
- package/src/daemon/client/daemon-socket-messenger.d.ts +0 -1
- package/src/daemon/client/generate-help-output.js +1 -2
- package/src/daemon/is-on-daemon.js +1 -2
- package/src/daemon/message-types/get-context-file-data.js +2 -2
- package/src/daemon/message-types/get-files-in-directory.js +2 -2
- package/src/daemon/message-types/get-nx-workspace-files.js +2 -2
- package/src/daemon/message-types/glob.js +2 -2
- package/src/daemon/message-types/hash-glob.js +2 -2
- package/src/daemon/message-types/task-history.js +3 -3
- package/src/daemon/message-types/update-context-files.js +2 -2
- package/src/daemon/server/file-watching/changed-projects.js +1 -2
- package/src/daemon/server/file-watching/file-watcher-sockets.d.ts +0 -1
- package/src/daemon/server/file-watching/file-watcher-sockets.js +4 -4
- package/src/daemon/server/handle-context-file-data.js +1 -2
- package/src/daemon/server/handle-get-files-in-directory.js +1 -2
- package/src/daemon/server/handle-get-task-history.js +1 -2
- package/src/daemon/server/handle-glob.js +1 -2
- package/src/daemon/server/handle-hash-glob.js +1 -2
- package/src/daemon/server/handle-hash-tasks.js +1 -2
- package/src/daemon/server/handle-nx-workspace-files.js +1 -2
- package/src/daemon/server/handle-outputs-tracking.js +2 -3
- package/src/daemon/server/handle-process-in-background.js +1 -2
- package/src/daemon/server/handle-request-project-graph.js +1 -2
- package/src/daemon/server/handle-request-shutdown.d.ts +0 -1
- package/src/daemon/server/handle-request-shutdown.js +1 -2
- package/src/daemon/server/handle-write-task-runs-to-history.js +1 -2
- package/src/daemon/server/outputs-tracking.js +7 -8
- package/src/daemon/server/plugins.js +2 -3
- package/src/daemon/server/project-graph-incremental-recomputation.js +3 -3
- package/src/daemon/server/server.d.ts +0 -1
- package/src/daemon/server/server.js +2 -3
- package/src/daemon/server/shutdown-utils.d.ts +0 -1
- package/src/daemon/server/shutdown-utils.js +9 -9
- package/src/daemon/server/watcher.d.ts +0 -1
- package/src/daemon/server/watcher.js +3 -4
- package/src/daemon/socket-utils.js +3 -3
- package/src/daemon/tmp-dir.js +6 -6
- package/src/devkit-exports.d.ts +1 -0
- package/src/devkit-exports.js +3 -1
- package/src/executors/noop/noop.impl.js +1 -1
- package/src/executors/run-commands/run-commands.impl.js +3 -3
- package/src/executors/run-script/run-script.impl.js +1 -1
- package/src/executors/utils/convert-nx-executor.js +1 -2
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +1 -2
- package/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +1 -1
- package/src/generators/testing-utils/create-tree-with-empty-workspace.js +2 -3
- package/src/generators/testing-utils/create-tree.js +1 -2
- package/src/generators/tree.d.ts +0 -2
- package/src/generators/tree.js +3 -3
- package/src/generators/utils/glob.js +2 -3
- package/src/generators/utils/json.js +3 -4
- package/src/generators/utils/nx-json.js +2 -3
- package/src/generators/utils/project-configuration.js +7 -7
- package/src/hasher/create-task-hasher.js +1 -2
- package/src/hasher/file-hasher.js +2 -3
- package/src/hasher/hash-task.d.ts +0 -1
- package/src/hasher/hash-task.js +2 -3
- package/src/hasher/native-task-hasher-impl.d.ts +0 -1
- package/src/hasher/node-task-hasher-impl.d.ts +0 -1
- package/src/hasher/task-hasher.d.ts +0 -1
- package/src/hasher/task-hasher.js +10 -10
- package/src/migrations/update-15-0-0/migrate-to-inputs.js +1 -1
- package/src/migrations/update-15-0-0/prefix-outputs.js +1 -1
- package/src/migrations/update-16-0-0/remove-nrwl-cli.js +1 -1
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +1 -1
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +1 -1
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +1 -1
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +1 -1
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.js +1 -1
- package/src/migrations/update-17-0-0/move-cache-directory.js +1 -1
- package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +1 -1
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +1 -1
- package/src/migrations/update-17-2-0/move-default-base.js +1 -1
- package/src/migrations/update-17-3-0/nx-release-path.js +2 -3
- package/src/migrations/update-17-3-0/update-nxw.js +1 -1
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +1 -1
- package/src/migrations/update-19-2-0/move-workspace-data-directory.js +3 -4
- package/src/migrations/update-19-2-4/set-project-name.js +1 -1
- package/src/native/assert-supported-platform.js +1 -2
- package/src/native/browser.js +1 -0
- package/src/native/index.d.ts +178 -138
- package/src/native/index.js +16 -0
- package/src/native/native-bindings.js +352 -238
- package/src/native/native-file-cache-location.js +1 -2
- package/src/native/nx.wasi-browser.js +108 -0
- package/src/native/nx.wasi.cjs +139 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/native/transform-objects.js +1 -2
- package/src/native/wasi-worker-browser.mjs +32 -0
- package/src/native/wasi-worker.mjs +63 -0
- package/src/nx-cloud/debug-logger.js +1 -2
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -2
- package/src/nx-cloud/resolution-helpers.js +1 -2
- package/src/nx-cloud/update-manager.js +2 -2
- package/src/nx-cloud/utilities/axios.js +1 -2
- package/src/nx-cloud/utilities/get-cloud-options.js +1 -2
- package/src/nx-cloud/utilities/url-shorten.js +8 -9
- package/src/plugins/js/hasher/hasher.js +1 -2
- package/src/plugins/js/lock-file/lock-file.js +6 -6
- package/src/plugins/js/lock-file/npm-parser.js +3 -4
- package/src/plugins/js/lock-file/pnpm-parser.js +3 -4
- package/src/plugins/js/lock-file/project-graph-pruning.js +1 -2
- package/src/plugins/js/lock-file/utils/package-json.js +2 -3
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +5 -6
- package/src/plugins/js/lock-file/yarn-parser.js +3 -4
- package/src/plugins/js/package-json/create-package-json.js +2 -3
- package/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -2
- package/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.js +1 -2
- package/src/plugins/js/utils/config.js +1 -2
- package/src/plugins/js/utils/register.d.ts +1 -0
- package/src/plugins/js/utils/register.js +7 -8
- package/src/plugins/js/utils/resolve-relative-to-dir.js +1 -2
- package/src/plugins/js/utils/typescript.js +5 -6
- package/src/plugins/js/versions.d.ts +1 -1
- package/src/plugins/js/versions.js +1 -1
- package/src/plugins/package-json-workspaces/create-nodes.js +5 -5
- package/src/plugins/project-json/build-nodes/project-json.js +3 -3
- package/src/project-graph/affected/affected-project-graph.js +1 -2
- package/src/project-graph/build-project-graph.js +3 -4
- package/src/project-graph/error-types.js +11 -11
- package/src/project-graph/file-map-utils.js +4 -5
- package/src/project-graph/file-utils.d.ts +1 -1
- package/src/project-graph/file-utils.js +7 -7
- package/src/project-graph/nx-deps-cache.js +8 -8
- package/src/project-graph/operators.js +5 -5
- package/src/project-graph/plugins/internal-api.js +4 -5
- package/src/project-graph/plugins/isolation/index.js +1 -2
- package/src/project-graph/plugins/isolation/messaging.d.ts +0 -2
- package/src/project-graph/plugins/isolation/messaging.js +4 -5
- package/src/project-graph/plugins/isolation/plugin-pool.js +1 -2
- package/src/project-graph/plugins/loader.js +7 -7
- package/src/project-graph/plugins/utils.js +4 -5
- package/src/project-graph/project-graph-builder.js +2 -2
- package/src/project-graph/project-graph.js +7 -8
- package/src/project-graph/utils/build-all-workspace-files.js +1 -2
- package/src/project-graph/utils/find-project-for-path.js +4 -5
- package/src/project-graph/utils/implicit-project-dependencies.js +1 -2
- package/src/project-graph/utils/normalize-project-nodes.js +2 -3
- package/src/project-graph/utils/project-configuration-utils.d.ts +8 -6
- package/src/project-graph/utils/project-configuration-utils.js +118 -54
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -3
- package/src/project-graph/utils/retrieve-workspace-files.js +6 -7
- package/src/tasks-runner/create-task-graph.js +3 -3
- package/src/tasks-runner/forked-process-task-runner.d.ts +0 -1
- package/src/tasks-runner/init-tasks-runner.js +1 -2
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/formatting-utils.js +2 -3
- package/src/tasks-runner/life-cycles/pretty-time.js +1 -2
- package/src/tasks-runner/life-cycles/view-logs-utils.js +1 -2
- package/src/tasks-runner/pseudo-ipc.d.ts +0 -1
- package/src/tasks-runner/pseudo-terminal.d.ts +0 -1
- package/src/tasks-runner/pseudo-terminal.js +5 -2
- package/src/tasks-runner/run-command.js +4 -5
- package/src/tasks-runner/task-env.d.ts +0 -1
- package/src/tasks-runner/task-env.js +5 -6
- package/src/tasks-runner/task-graph-utils.js +2 -3
- package/src/tasks-runner/utils.js +25 -26
- package/src/utils/ab-testing.js +2 -2
- package/src/utils/all-file-data.js +1 -2
- package/src/utils/assert-workspace-validity.js +1 -2
- package/src/utils/async-iterator.js +2 -3
- package/src/utils/cache-directory.js +2 -2
- package/src/utils/child-process.d.ts +0 -1
- package/src/utils/child-process.js +3 -3
- package/src/utils/chunkify.js +1 -2
- package/src/utils/code-frames.js +1 -2
- package/src/utils/collapse-expanded-outputs.js +1 -2
- package/src/utils/command-line-utils.js +5 -6
- package/src/utils/consume-messages-from-socket.js +1 -2
- package/src/utils/default-base.js +1 -2
- package/src/utils/dotenv.js +1 -2
- package/src/utils/exit-codes.d.ts +0 -1
- package/src/utils/exit-codes.js +1 -2
- package/src/utils/fileutils.d.ts +0 -1
- package/src/utils/fileutils.js +9 -10
- package/src/utils/find-matching-projects.js +2 -2
- package/src/utils/find-workspace-root.js +1 -2
- package/src/utils/get-package-name-from-import-path.js +1 -2
- package/src/utils/git-utils.js +4 -5
- package/src/utils/globs.js +1 -2
- package/src/utils/ignore.js +4 -4
- package/src/utils/installation-directory.js +2 -3
- package/src/utils/is-ci.js +1 -2
- package/src/utils/json-diff.js +5 -5
- package/src/utils/json.js +3 -3
- package/src/utils/logger.js +2 -2
- package/src/utils/nx-cloud-utils.js +3 -4
- package/src/utils/nx-plugin.deprecated.js +1 -4
- package/src/utils/object-sort.js +1 -2
- package/src/utils/package-json.js +8 -9
- package/src/utils/package-manager.js +13 -14
- package/src/utils/params.js +14 -14
- package/src/utils/path.js +3 -4
- package/src/utils/plugins/community-plugins.js +1 -2
- package/src/utils/plugins/core-plugins.js +2 -3
- package/src/utils/plugins/installed-plugins.js +3 -4
- package/src/utils/plugins/local-plugins.js +2 -3
- package/src/utils/plugins/plugin-capabilities.js +2 -3
- package/src/utils/plugins/shared.js +1 -2
- package/src/utils/print-help.js +1 -2
- package/src/utils/project-graph-utils.js +4 -5
- package/src/utils/serializable-error.js +1 -2
- package/src/utils/serialize-overrides-into-command-line.js +1 -2
- package/src/utils/serialize-target.js +1 -2
- package/src/utils/split-target.js +2 -3
- package/src/utils/strip-indents.js +1 -2
- package/src/utils/task-history.js +3 -3
- package/src/utils/update-nxw.js +1 -2
- package/src/utils/workspace-configuration-check.js +1 -2
- package/src/utils/workspace-context.js +10 -11
- package/src/utils/workspace-root.js +3 -3
- package/src/plugins/target-defaults/symbols.d.ts +0 -17
- package/src/plugins/target-defaults/symbols.js +0 -20
- package/src/plugins/target-defaults/target-defaults-plugin.d.ts +0 -121
- package/src/plugins/target-defaults/target-defaults-plugin.js +0 -176
package/src/native/index.js
CHANGED
@@ -4,6 +4,22 @@ const Module = require('module');
|
|
4
4
|
const { nxVersion } = require('../utils/versions');
|
5
5
|
const { getNativeFileCacheLocation } = require('./native-file-cache-location');
|
6
6
|
|
7
|
+
// WASI is still experimental and throws a warning when used
|
8
|
+
// We spawn many many processes so the warning gets printed a lot
|
9
|
+
// We have a different warning elsewhere to warn people using WASI
|
10
|
+
const originalEmit = process.emit;
|
11
|
+
process.emit = function (eventName, eventData) {
|
12
|
+
if (
|
13
|
+
eventName === `warning` &&
|
14
|
+
typeof eventData === `object` &&
|
15
|
+
eventData?.name === `ExperimentalWarning` &&
|
16
|
+
eventData?.message?.includes(`WASI`)
|
17
|
+
) {
|
18
|
+
return false;
|
19
|
+
}
|
20
|
+
return originalEmit.apply(process, arguments);
|
21
|
+
};
|
22
|
+
|
7
23
|
const nxPackages = new Set([
|
8
24
|
'@nx/nx-android-arm64',
|
9
25
|
'@nx/nx-android-arm-eabi',
|
@@ -1,268 +1,382 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
// prettier-ignore
|
2
|
+
/* eslint-disable */
|
3
|
+
/* auto-generated by NAPI-RS */
|
3
4
|
|
4
|
-
const {
|
5
|
+
const { readFileSync } = require('fs')
|
5
6
|
|
6
7
|
let nativeBinding = null
|
7
|
-
|
8
|
-
let loadError = null
|
8
|
+
const loadErrors = []
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
if (
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
}
|
10
|
+
const isMusl = () => {
|
11
|
+
let musl = false
|
12
|
+
if (process.platform === 'linux') {
|
13
|
+
musl = isMuslFromFilesystem()
|
14
|
+
if (musl === null) {
|
15
|
+
musl = isMuslFromReport()
|
16
|
+
}
|
17
|
+
if (musl === null) {
|
18
|
+
musl = isMuslFromChildProcess()
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return musl
|
22
|
+
}
|
23
|
+
|
24
|
+
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
|
25
|
+
|
26
|
+
const isMuslFromFilesystem = () => {
|
27
|
+
try {
|
28
|
+
return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
|
29
|
+
} catch {
|
30
|
+
return null
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
const isMuslFromReport = () => {
|
35
|
+
const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null
|
36
|
+
if (!report) {
|
37
|
+
return null
|
38
|
+
}
|
39
|
+
if (report.header && report.header.glibcVersionRuntime) {
|
40
|
+
return false
|
41
|
+
}
|
42
|
+
if (Array.isArray(report.sharedObjects)) {
|
43
|
+
if (report.sharedObjects.some(isFileMusl)) {
|
17
44
|
return true
|
18
45
|
}
|
19
|
-
} else {
|
20
|
-
const { glibcVersionRuntime } = process.report.getReport().header
|
21
|
-
return !glibcVersionRuntime
|
22
46
|
}
|
47
|
+
return false
|
23
48
|
}
|
24
49
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
50
|
+
const isMuslFromChildProcess = () => {
|
51
|
+
try {
|
52
|
+
return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
|
53
|
+
} catch (e) {
|
54
|
+
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
55
|
+
return false
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
function requireNative() {
|
60
|
+
if (process.platform === 'android') {
|
61
|
+
if (process.arch === 'arm64') {
|
62
|
+
try {
|
63
|
+
return require('./nx.android-arm64.node')
|
64
|
+
} catch (e) {
|
65
|
+
loadErrors.push(e)
|
66
|
+
}
|
67
|
+
try {
|
68
|
+
return require('@nx/nx-android-arm64')
|
69
|
+
} catch (e) {
|
70
|
+
loadErrors.push(e)
|
71
|
+
}
|
72
|
+
|
73
|
+
} else if (process.arch === 'arm') {
|
74
|
+
try {
|
75
|
+
return require('./nx.android-arm-eabi.node')
|
76
|
+
} catch (e) {
|
77
|
+
loadErrors.push(e)
|
78
|
+
}
|
79
|
+
try {
|
80
|
+
return require('@nx/nx-android-arm-eabi')
|
81
|
+
} catch (e) {
|
82
|
+
loadErrors.push(e)
|
83
|
+
}
|
84
|
+
|
85
|
+
} else {
|
86
|
+
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
87
|
+
}
|
88
|
+
} else if (process.platform === 'win32') {
|
89
|
+
if (process.arch === 'x64') {
|
90
|
+
try {
|
91
|
+
return require('./nx.win32-x64-msvc.node')
|
92
|
+
} catch (e) {
|
93
|
+
loadErrors.push(e)
|
94
|
+
}
|
95
|
+
try {
|
96
|
+
return require('@nx/nx-win32-x64-msvc')
|
97
|
+
} catch (e) {
|
98
|
+
loadErrors.push(e)
|
99
|
+
}
|
100
|
+
|
101
|
+
} else if (process.arch === 'ia32') {
|
102
|
+
try {
|
103
|
+
return require('./nx.win32-ia32-msvc.node')
|
104
|
+
} catch (e) {
|
105
|
+
loadErrors.push(e)
|
106
|
+
}
|
107
|
+
try {
|
108
|
+
return require('@nx/nx-win32-ia32-msvc')
|
109
|
+
} catch (e) {
|
110
|
+
loadErrors.push(e)
|
111
|
+
}
|
112
|
+
|
113
|
+
} else if (process.arch === 'arm64') {
|
114
|
+
try {
|
115
|
+
return require('./nx.win32-arm64-msvc.node')
|
116
|
+
} catch (e) {
|
117
|
+
loadErrors.push(e)
|
118
|
+
}
|
119
|
+
try {
|
120
|
+
return require('@nx/nx-win32-arm64-msvc')
|
121
|
+
} catch (e) {
|
122
|
+
loadErrors.push(e)
|
123
|
+
}
|
124
|
+
|
125
|
+
} else {
|
126
|
+
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
127
|
+
}
|
128
|
+
} else if (process.platform === 'darwin') {
|
129
|
+
try {
|
130
|
+
return require('./nx.darwin-universal.node')
|
131
|
+
} catch (e) {
|
132
|
+
loadErrors.push(e)
|
133
|
+
}
|
134
|
+
try {
|
135
|
+
return require('@nx/nx-darwin-universal')
|
136
|
+
} catch (e) {
|
137
|
+
loadErrors.push(e)
|
138
|
+
}
|
139
|
+
|
140
|
+
if (process.arch === 'x64') {
|
141
|
+
try {
|
142
|
+
return require('./nx.darwin-x64.node')
|
143
|
+
} catch (e) {
|
144
|
+
loadErrors.push(e)
|
145
|
+
}
|
146
|
+
try {
|
147
|
+
return require('@nx/nx-darwin-x64')
|
148
|
+
} catch (e) {
|
149
|
+
loadErrors.push(e)
|
150
|
+
}
|
151
|
+
|
152
|
+
} else if (process.arch === 'arm64') {
|
153
|
+
try {
|
154
|
+
return require('./nx.darwin-arm64.node')
|
155
|
+
} catch (e) {
|
156
|
+
loadErrors.push(e)
|
157
|
+
}
|
158
|
+
try {
|
159
|
+
return require('@nx/nx-darwin-arm64')
|
160
|
+
} catch (e) {
|
161
|
+
loadErrors.push(e)
|
162
|
+
}
|
163
|
+
|
164
|
+
} else {
|
165
|
+
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
166
|
+
}
|
167
|
+
} else if (process.platform === 'freebsd') {
|
168
|
+
if (process.arch === 'x64') {
|
169
|
+
try {
|
170
|
+
return require('./nx.freebsd-x64.node')
|
171
|
+
} catch (e) {
|
172
|
+
loadErrors.push(e)
|
173
|
+
}
|
174
|
+
try {
|
175
|
+
return require('@nx/nx-freebsd-x64')
|
176
|
+
} catch (e) {
|
177
|
+
loadErrors.push(e)
|
178
|
+
}
|
179
|
+
|
180
|
+
} else if (process.arch === 'arm64') {
|
181
|
+
try {
|
182
|
+
return require('./nx.freebsd-arm64.node')
|
183
|
+
} catch (e) {
|
184
|
+
loadErrors.push(e)
|
185
|
+
}
|
186
|
+
try {
|
187
|
+
return require('@nx/nx-freebsd-arm64')
|
188
|
+
} catch (e) {
|
189
|
+
loadErrors.push(e)
|
190
|
+
}
|
191
|
+
|
192
|
+
} else {
|
193
|
+
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
194
|
+
}
|
195
|
+
} else if (process.platform === 'linux') {
|
196
|
+
if (process.arch === 'x64') {
|
197
|
+
if (isMusl()) {
|
30
198
|
try {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
199
|
+
return require('./nx.linux-x64-musl.node')
|
200
|
+
} catch (e) {
|
201
|
+
loadErrors.push(e)
|
202
|
+
}
|
203
|
+
try {
|
204
|
+
return require('@nx/nx-linux-x64-musl')
|
205
|
+
} catch (e) {
|
206
|
+
loadErrors.push(e)
|
207
|
+
}
|
208
|
+
|
209
|
+
} else {
|
42
210
|
try {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
}
|
55
|
-
|
56
|
-
case 'win32':
|
57
|
-
switch (arch) {
|
58
|
-
case 'x64':
|
59
|
-
localFileExisted = existsSync(
|
60
|
-
join(__dirname, 'nx.win32-x64-msvc.node')
|
61
|
-
)
|
211
|
+
return require('./nx.linux-x64-gnu.node')
|
212
|
+
} catch (e) {
|
213
|
+
loadErrors.push(e)
|
214
|
+
}
|
215
|
+
try {
|
216
|
+
return require('@nx/nx-linux-x64-gnu')
|
217
|
+
} catch (e) {
|
218
|
+
loadErrors.push(e)
|
219
|
+
}
|
220
|
+
|
221
|
+
}
|
222
|
+
} else if (process.arch === 'arm64') {
|
223
|
+
if (isMusl()) {
|
62
224
|
try {
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
join(__dirname, 'nx.win32-ia32-msvc.node')
|
75
|
-
)
|
225
|
+
return require('./nx.linux-arm64-musl.node')
|
226
|
+
} catch (e) {
|
227
|
+
loadErrors.push(e)
|
228
|
+
}
|
229
|
+
try {
|
230
|
+
return require('@nx/nx-linux-arm64-musl')
|
231
|
+
} catch (e) {
|
232
|
+
loadErrors.push(e)
|
233
|
+
}
|
234
|
+
|
235
|
+
} else {
|
76
236
|
try {
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
237
|
+
return require('./nx.linux-arm64-gnu.node')
|
238
|
+
} catch (e) {
|
239
|
+
loadErrors.push(e)
|
240
|
+
}
|
241
|
+
try {
|
242
|
+
return require('@nx/nx-linux-arm64-gnu')
|
243
|
+
} catch (e) {
|
244
|
+
loadErrors.push(e)
|
245
|
+
}
|
246
|
+
|
247
|
+
}
|
248
|
+
} else if (process.arch === 'arm') {
|
249
|
+
if (isMusl()) {
|
90
250
|
try {
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
102
|
-
}
|
103
|
-
break
|
104
|
-
case 'darwin':
|
105
|
-
localFileExisted = existsSync(join(__dirname, 'nx.darwin-universal.node'))
|
106
|
-
try {
|
107
|
-
if (localFileExisted) {
|
108
|
-
nativeBinding = require('./nx.darwin-universal.node')
|
251
|
+
return require('./nx.linux-arm-musleabihf.node')
|
252
|
+
} catch (e) {
|
253
|
+
loadErrors.push(e)
|
254
|
+
}
|
255
|
+
try {
|
256
|
+
return require('@nx/nx-linux-arm-musleabihf')
|
257
|
+
} catch (e) {
|
258
|
+
loadErrors.push(e)
|
259
|
+
}
|
260
|
+
|
109
261
|
} else {
|
110
|
-
|
262
|
+
try {
|
263
|
+
return require('./nx.linux-arm-gnueabihf.node')
|
264
|
+
} catch (e) {
|
265
|
+
loadErrors.push(e)
|
266
|
+
}
|
267
|
+
try {
|
268
|
+
return require('@nx/nx-linux-arm-gnueabihf')
|
269
|
+
} catch (e) {
|
270
|
+
loadErrors.push(e)
|
271
|
+
}
|
272
|
+
|
111
273
|
}
|
112
|
-
|
113
|
-
|
114
|
-
switch (arch) {
|
115
|
-
case 'x64':
|
116
|
-
localFileExisted = existsSync(join(__dirname, 'nx.darwin-x64.node'))
|
274
|
+
} else if (process.arch === 'riscv64') {
|
275
|
+
if (isMusl()) {
|
117
276
|
try {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
join(__dirname, 'nx.darwin-arm64.node')
|
130
|
-
)
|
277
|
+
return require('./nx.linux-riscv64-musl.node')
|
278
|
+
} catch (e) {
|
279
|
+
loadErrors.push(e)
|
280
|
+
}
|
281
|
+
try {
|
282
|
+
return require('@nx/nx-linux-riscv64-musl')
|
283
|
+
} catch (e) {
|
284
|
+
loadErrors.push(e)
|
285
|
+
}
|
286
|
+
|
287
|
+
} else {
|
131
288
|
try {
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
289
|
+
return require('./nx.linux-riscv64-gnu.node')
|
290
|
+
} catch (e) {
|
291
|
+
loadErrors.push(e)
|
292
|
+
}
|
293
|
+
try {
|
294
|
+
return require('@nx/nx-linux-riscv64-gnu')
|
295
|
+
} catch (e) {
|
296
|
+
loadErrors.push(e)
|
297
|
+
}
|
298
|
+
|
299
|
+
}
|
300
|
+
} else if (process.arch === 'ppc64') {
|
301
|
+
try {
|
302
|
+
return require('./nx.linux-ppc64-gnu.node')
|
303
|
+
} catch (e) {
|
304
|
+
loadErrors.push(e)
|
305
|
+
}
|
306
|
+
try {
|
307
|
+
return require('@nx/nx-linux-ppc64-gnu')
|
308
|
+
} catch (e) {
|
309
|
+
loadErrors.push(e)
|
310
|
+
}
|
311
|
+
|
312
|
+
} else if (process.arch === 's390x') {
|
313
|
+
try {
|
314
|
+
return require('./nx.linux-s390x-gnu.node')
|
315
|
+
} catch (e) {
|
316
|
+
loadErrors.push(e)
|
317
|
+
}
|
318
|
+
try {
|
319
|
+
return require('@nx/nx-linux-s390x-gnu')
|
320
|
+
} catch (e) {
|
321
|
+
loadErrors.push(e)
|
322
|
+
}
|
323
|
+
|
324
|
+
} else {
|
325
|
+
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
|
143
326
|
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
327
|
+
} else {
|
328
|
+
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
nativeBinding = requireNative()
|
333
|
+
|
334
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
335
|
+
try {
|
336
|
+
nativeBinding = require('./nx.wasi.cjs')
|
337
|
+
} catch (err) {
|
338
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
339
|
+
console.error(err)
|
148
340
|
}
|
149
|
-
|
341
|
+
}
|
342
|
+
if (!nativeBinding) {
|
150
343
|
try {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
344
|
+
nativeBinding = require('@nx/nx-wasm32-wasi')
|
345
|
+
} catch (err) {
|
346
|
+
if (process.env.NAPI_RS_FORCE_WASI) {
|
347
|
+
console.error(err)
|
155
348
|
}
|
156
|
-
} catch (e) {
|
157
|
-
loadError = e
|
158
349
|
}
|
159
|
-
|
160
|
-
case 'linux':
|
161
|
-
switch (arch) {
|
162
|
-
case 'x64':
|
163
|
-
if (isMusl()) {
|
164
|
-
localFileExisted = existsSync(
|
165
|
-
join(__dirname, 'nx.linux-x64-musl.node')
|
166
|
-
)
|
167
|
-
try {
|
168
|
-
if (localFileExisted) {
|
169
|
-
nativeBinding = require('./nx.linux-x64-musl.node')
|
170
|
-
} else {
|
171
|
-
nativeBinding = require('@nx/nx-linux-x64-musl')
|
172
|
-
}
|
173
|
-
} catch (e) {
|
174
|
-
loadError = e
|
175
|
-
}
|
176
|
-
} else {
|
177
|
-
localFileExisted = existsSync(
|
178
|
-
join(__dirname, 'nx.linux-x64-gnu.node')
|
179
|
-
)
|
180
|
-
try {
|
181
|
-
if (localFileExisted) {
|
182
|
-
nativeBinding = require('./nx.linux-x64-gnu.node')
|
183
|
-
} else {
|
184
|
-
nativeBinding = require('@nx/nx-linux-x64-gnu')
|
185
|
-
}
|
186
|
-
} catch (e) {
|
187
|
-
loadError = e
|
188
|
-
}
|
189
|
-
}
|
190
|
-
break
|
191
|
-
case 'arm64':
|
192
|
-
if (isMusl()) {
|
193
|
-
localFileExisted = existsSync(
|
194
|
-
join(__dirname, 'nx.linux-arm64-musl.node')
|
195
|
-
)
|
196
|
-
try {
|
197
|
-
if (localFileExisted) {
|
198
|
-
nativeBinding = require('./nx.linux-arm64-musl.node')
|
199
|
-
} else {
|
200
|
-
nativeBinding = require('@nx/nx-linux-arm64-musl')
|
201
|
-
}
|
202
|
-
} catch (e) {
|
203
|
-
loadError = e
|
204
|
-
}
|
205
|
-
} else {
|
206
|
-
localFileExisted = existsSync(
|
207
|
-
join(__dirname, 'nx.linux-arm64-gnu.node')
|
208
|
-
)
|
209
|
-
try {
|
210
|
-
if (localFileExisted) {
|
211
|
-
nativeBinding = require('./nx.linux-arm64-gnu.node')
|
212
|
-
} else {
|
213
|
-
nativeBinding = require('@nx/nx-linux-arm64-gnu')
|
214
|
-
}
|
215
|
-
} catch (e) {
|
216
|
-
loadError = e
|
217
|
-
}
|
218
|
-
}
|
219
|
-
break
|
220
|
-
case 'arm':
|
221
|
-
localFileExisted = existsSync(
|
222
|
-
join(__dirname, 'nx.linux-arm-gnueabihf.node')
|
223
|
-
)
|
224
|
-
try {
|
225
|
-
if (localFileExisted) {
|
226
|
-
nativeBinding = require('./nx.linux-arm-gnueabihf.node')
|
227
|
-
} else {
|
228
|
-
nativeBinding = require('@nx/nx-linux-arm-gnueabihf')
|
229
|
-
}
|
230
|
-
} catch (e) {
|
231
|
-
loadError = e
|
232
|
-
}
|
233
|
-
break
|
234
|
-
default:
|
235
|
-
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
236
|
-
}
|
237
|
-
break
|
238
|
-
default:
|
239
|
-
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
350
|
+
}
|
240
351
|
}
|
241
352
|
|
242
353
|
if (!nativeBinding) {
|
243
|
-
if (
|
244
|
-
|
354
|
+
if (loadErrors.length > 0) {
|
355
|
+
// TODO Link to documentation with potential fixes
|
356
|
+
// - The package owner could build/publish bindings for this arch
|
357
|
+
// - The user may need to bundle the correct files
|
358
|
+
// - The user may need to re-install node_modules to get new packages
|
359
|
+
throw new Error('Failed to load native binding', { cause: loadErrors })
|
245
360
|
}
|
246
361
|
throw new Error(`Failed to load native binding`)
|
247
362
|
}
|
248
363
|
|
249
|
-
|
250
|
-
|
251
|
-
module.exports.
|
252
|
-
module.exports.
|
253
|
-
module.exports.
|
254
|
-
module.exports.
|
255
|
-
module.exports.
|
256
|
-
module.exports.
|
257
|
-
module.exports.
|
258
|
-
module.exports.
|
259
|
-
module.exports.
|
260
|
-
module.exports.
|
261
|
-
module.exports.
|
262
|
-
module.exports.
|
263
|
-
module.exports.
|
264
|
-
module.exports.
|
265
|
-
module.exports.
|
266
|
-
module.exports.
|
267
|
-
module.exports.WorkspaceErrors = WorkspaceErrors
|
268
|
-
module.exports.testOnlyTransferFileMap = testOnlyTransferFileMap
|
364
|
+
module.exports.ChildProcess = nativeBinding.ChildProcess
|
365
|
+
module.exports.HashPlanner = nativeBinding.HashPlanner
|
366
|
+
module.exports.ImportResult = nativeBinding.ImportResult
|
367
|
+
module.exports.RustPseudoTerminal = nativeBinding.RustPseudoTerminal
|
368
|
+
module.exports.TaskHasher = nativeBinding.TaskHasher
|
369
|
+
module.exports.Watcher = nativeBinding.Watcher
|
370
|
+
module.exports.WorkspaceContext = nativeBinding.WorkspaceContext
|
371
|
+
module.exports.copy = nativeBinding.copy
|
372
|
+
module.exports.EventType = nativeBinding.EventType
|
373
|
+
module.exports.expandOutputs = nativeBinding.expandOutputs
|
374
|
+
module.exports.findImports = nativeBinding.findImports
|
375
|
+
module.exports.getFilesForOutputs = nativeBinding.getFilesForOutputs
|
376
|
+
module.exports.hashArray = nativeBinding.hashArray
|
377
|
+
module.exports.hashFile = nativeBinding.hashFile
|
378
|
+
module.exports.IS_WASM = nativeBinding.IS_WASM
|
379
|
+
module.exports.remove = nativeBinding.remove
|
380
|
+
module.exports.testOnlyTransferFileMap = nativeBinding.testOnlyTransferFileMap
|
381
|
+
module.exports.transferProjectGraph = nativeBinding.transferProjectGraph
|
382
|
+
module.exports.WorkspaceErrors = nativeBinding.WorkspaceErrors
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getNativeFileCacheLocation =
|
3
|
+
exports.getNativeFileCacheLocation = getNativeFileCacheLocation;
|
4
4
|
const os_1 = require("os");
|
5
5
|
const path_1 = require("path");
|
6
6
|
const crypto_1 = require("crypto");
|
@@ -20,4 +20,3 @@ function getNativeFileCacheLocation() {
|
|
20
20
|
return (0, path_1.join)((0, os_1.tmpdir)(), `nx-native-file-cache-${hash.digest('hex').substring(0, 7)}`);
|
21
21
|
}
|
22
22
|
}
|
23
|
-
exports.getNativeFileCacheLocation = getNativeFileCacheLocation;
|