nx 21.5.2 → 21.6.1-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "21.5.2",
3
+ "version": "21.6.1-beta.0",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -83,16 +83,16 @@
83
83
  }
84
84
  },
85
85
  "optionalDependencies": {
86
- "@nx/nx-darwin-arm64": "21.5.2",
87
- "@nx/nx-darwin-x64": "21.5.2",
88
- "@nx/nx-freebsd-x64": "21.5.2",
89
- "@nx/nx-linux-arm-gnueabihf": "21.5.2",
90
- "@nx/nx-linux-arm64-gnu": "21.5.2",
91
- "@nx/nx-linux-arm64-musl": "21.5.2",
92
- "@nx/nx-linux-x64-gnu": "21.5.2",
93
- "@nx/nx-linux-x64-musl": "21.5.2",
94
- "@nx/nx-win32-arm64-msvc": "21.5.2",
95
- "@nx/nx-win32-x64-msvc": "21.5.2"
86
+ "@nx/nx-darwin-arm64": "21.6.1-beta.0",
87
+ "@nx/nx-darwin-x64": "21.6.1-beta.0",
88
+ "@nx/nx-freebsd-x64": "21.6.1-beta.0",
89
+ "@nx/nx-linux-arm-gnueabihf": "21.6.1-beta.0",
90
+ "@nx/nx-linux-arm64-gnu": "21.6.1-beta.0",
91
+ "@nx/nx-linux-arm64-musl": "21.6.1-beta.0",
92
+ "@nx/nx-linux-x64-gnu": "21.6.1-beta.0",
93
+ "@nx/nx-linux-x64-musl": "21.6.1-beta.0",
94
+ "@nx/nx-win32-arm64-msvc": "21.6.1-beta.0",
95
+ "@nx/nx-win32-x64-msvc": "21.6.1-beta.0"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -10,7 +10,7 @@ exports.yargsMigrateCommand = {
10
10
  - Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.`,
11
11
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withMigrationOptions(yargs), 'migrate'),
12
12
  handler: async () => {
13
- await (await Promise.resolve().then(() => require('./migrate'))).runMigration();
13
+ (await Promise.resolve().then(() => require('./migrate'))).runMigration();
14
14
  process.exit(0);
15
15
  },
16
16
  };
@@ -122,7 +122,7 @@ export declare function runNxOrAngularMigration(root: string, migration: {
122
122
  export declare function migrate(root: string, args: {
123
123
  [k: string]: any;
124
124
  }, rawArgs: string[]): Promise<number>;
125
- export declare function runMigration(): Promise<void>;
125
+ export declare function runMigration(): void;
126
126
  export declare function readMigrationCollection(packageName: string, root: string): {
127
127
  collection: MigrationsJson;
128
128
  collectionPath: string;
@@ -131,6 +131,6 @@ export declare function getImplementationPath(collection: MigrationsJson, collec
131
131
  path: string;
132
132
  fnSymbol: string;
133
133
  };
134
- export declare function nxCliPath(nxWorkspaceRoot?: string): Promise<string>;
134
+ export declare function nxCliPath(nxWorkspaceRoot?: string): string;
135
135
  export {};
136
136
  //# sourceMappingURL=migrate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/migrate/migrate.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,cAAc,EAEd,2BAA2B,IAAI,aAAa,EAE7C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,UAAU,EAIX,MAAM,uBAAuB,CAAC;AAW/B,OAAO,EACL,iBAAiB,EAEjB,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAuClC,MAAM,WAAW,8BAA+B,SAAQ,cAAc;IACpE,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC;AAID,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,UAgC/C;AAUD,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EA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AAG,GAAG,CAAA;CAAE,EAC1B,OAAO,EAAE,MAAM,EAAE,mBAmBlB;AAED,wBAAgB,YAAY,SA6B3B;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;EAWxE;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,cAAc,EAC1B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAyBpC;AAED,wBAAgB,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,UAkEjD"}
@@ -36,7 +36,6 @@ const client_1 = require("../../daemon/client/client");
36
36
  const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
37
37
  const project_graph_1 = require("../../project-graph/project-graph");
38
38
  const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
39
- const provenance_1 = require("../../utils/provenance");
40
39
  const execAsync = (0, util_1.promisify)(child_process_1.exec);
41
40
  function normalizeVersion(version) {
42
41
  const [semver, ...prereleaseTagParts] = version.split('-');
@@ -597,9 +596,6 @@ function createFetcher() {
597
596
  }
598
597
  // testing-fetch-end
599
598
  async function getPackageMigrationsUsingRegistry(packageName, packageVersion) {
600
- if ((0, provenance_1.getNxPackageGroup)().includes(packageName)) {
601
- await (0, provenance_1.ensurePackageHasProvenance)(packageName, packageVersion);
602
- }
603
599
  // check if there are migrations in the packages by looking at the
604
600
  // registry directly
605
601
  const migrationsConfig = await getPackageMigrationsConfigFromRegistry(packageName, packageVersion);
@@ -656,9 +652,6 @@ async function downloadPackageMigrationsFromRegistry(packageName, packageVersion
656
652
  async function getPackageMigrationsUsingInstall(packageName, packageVersion) {
657
653
  const { dir, cleanup } = (0, package_manager_1.createTempNpmDirectory)();
658
654
  let result;
659
- if ((0, provenance_1.getNxPackageGroup)().includes(packageName)) {
660
- await (0, provenance_1.ensurePackageHasProvenance)(packageName, packageVersion);
661
- }
662
655
  try {
663
656
  const pmc = (0, package_manager_1.getPackageManagerCommand)((0, package_manager_1.detectPackageManager)(dir), dir);
664
657
  await execAsync(`${pmc.add} ${packageName}@${packageVersion}`, {
@@ -933,11 +926,10 @@ function runInstall(nxWorkspaceRoot) {
933
926
  if (packageManager ?? (0, package_manager_1.detectPackageManager)() === 'npm') {
934
927
  process.env.npm_config_legacy_peer_deps ??= 'true';
935
928
  }
936
- const installCommand = `${pmCommands.install} ${pmCommands.ignoreScriptsFlag ?? ''}`;
937
929
  output_1.output.log({
938
- title: `Running '${installCommand}' to make sure necessary packages are installed`,
930
+ title: `Running '${pmCommands.install}' to make sure necessary packages are installed`,
939
931
  });
940
- (0, child_process_1.execSync)(installCommand, {
932
+ (0, child_process_1.execSync)(pmCommands.install, {
941
933
  stdio: [0, 1, 2],
942
934
  windowsHide: false,
943
935
  cwd: nxWorkspaceRoot ?? process.cwd(),
@@ -1143,14 +1135,14 @@ async function migrate(root, args, rawArgs) {
1143
1135
  }
1144
1136
  });
1145
1137
  }
1146
- async function runMigration() {
1138
+ function runMigration() {
1147
1139
  const runLocalMigrate = () => {
1148
1140
  (0, child_process_2.runNxSync)(`_migrate ${process.argv.slice(3).join(' ')}`, {
1149
1141
  stdio: ['inherit', 'inherit', 'inherit'],
1150
1142
  });
1151
1143
  };
1152
1144
  if (process.env.NX_MIGRATE_USE_LOCAL === undefined) {
1153
- const p = await nxCliPath();
1145
+ const p = nxCliPath();
1154
1146
  if (p === null) {
1155
1147
  runLocalMigrate();
1156
1148
  }
@@ -1199,10 +1191,9 @@ function getImplementationPath(collection, collectionPath, name) {
1199
1191
  }
1200
1192
  return { path: implPath, fnSymbol };
1201
1193
  }
1202
- async function nxCliPath(nxWorkspaceRoot) {
1194
+ function nxCliPath(nxWorkspaceRoot) {
1203
1195
  const version = process.env.NX_MIGRATE_CLI_VERSION || 'latest';
1204
1196
  const isVerbose = process.env.NX_VERBOSE_LOGGING === 'true';
1205
- await (0, provenance_1.ensurePackageHasProvenance)('nx', version);
1206
1197
  try {
1207
1198
  const packageManager = (0, package_manager_1.detectPackageManager)();
1208
1199
  const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
@@ -1238,7 +1229,7 @@ async function nxCliPath(nxWorkspaceRoot) {
1238
1229
  });
1239
1230
  }
1240
1231
  }
1241
- (0, child_process_1.execSync)(`${pmc.install} ${pmc.ignoreScriptsFlag ?? ''}`, {
1232
+ (0, child_process_1.execSync)(pmc.install, {
1242
1233
  cwd: tmpDir,
1243
1234
  stdio,
1244
1235
  windowsHide: false,
@@ -64,49 +64,46 @@ function __napi_rs_initialize_modules(__napiInstance) {
64
64
  __napiInstance.exports['__napi_register__NxConsolePreferences_struct_10']?.()
65
65
  __napiInstance.exports['__napi_register__NxConsolePreferences_impl_14']?.()
66
66
  __napiInstance.exports['__napi_register__log_debug_15']?.()
67
- __napiInstance.exports['__napi_register__IS_WASM_16']?.()
68
- __napiInstance.exports['__napi_register__get_binary_target_17']?.()
69
- __napiInstance.exports['__napi_register__ImportResult_struct_18']?.()
70
- __napiInstance.exports['__napi_register__find_imports_19']?.()
71
- __napiInstance.exports['__napi_register__transfer_project_graph_20']?.()
72
- __napiInstance.exports['__napi_register__ExternalNode_struct_21']?.()
73
- __napiInstance.exports['__napi_register__Target_struct_22']?.()
74
- __napiInstance.exports['__napi_register__Project_struct_23']?.()
75
- __napiInstance.exports['__napi_register__ProjectGraph_struct_24']?.()
76
- __napiInstance.exports['__napi_register__HashPlanInspector_struct_25']?.()
77
- __napiInstance.exports['__napi_register__HashPlanInspector_impl_28']?.()
78
- __napiInstance.exports['__napi_register__HashPlanner_struct_29']?.()
79
- __napiInstance.exports['__napi_register__HashPlanner_impl_33']?.()
80
- __napiInstance.exports['__napi_register__HashDetails_struct_34']?.()
81
- __napiInstance.exports['__napi_register__HasherOptions_struct_35']?.()
82
- __napiInstance.exports['__napi_register__TaskHasher_struct_36']?.()
83
- __napiInstance.exports['__napi_register__TaskHasher_impl_39']?.()
84
- __napiInstance.exports['__napi_register__Task_struct_40']?.()
85
- __napiInstance.exports['__napi_register__TaskTarget_struct_41']?.()
86
- __napiInstance.exports['__napi_register__TaskResult_struct_42']?.()
87
- __napiInstance.exports['__napi_register__TaskGraph_struct_43']?.()
88
- __napiInstance.exports['__napi_register__FileData_struct_44']?.()
89
- __napiInstance.exports['__napi_register__InputsInput_struct_45']?.()
90
- __napiInstance.exports['__napi_register__FileSetInput_struct_46']?.()
91
- __napiInstance.exports['__napi_register__RuntimeInput_struct_47']?.()
92
- __napiInstance.exports['__napi_register__EnvironmentInput_struct_48']?.()
93
- __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_49']?.()
94
- __napiInstance.exports['__napi_register__DepsOutputsInput_struct_50']?.()
95
- __napiInstance.exports['__napi_register__NxJson_struct_51']?.()
96
- __napiInstance.exports['__napi_register__is_ai_agent_52']?.()
97
- __napiInstance.exports['__napi_register__FileLock_struct_53']?.()
98
- __napiInstance.exports['__napi_register__FileLock_impl_55']?.()
99
- __napiInstance.exports['__napi_register__WorkspaceContext_struct_56']?.()
100
- __napiInstance.exports['__napi_register__WorkspaceContext_impl_67']?.()
101
- __napiInstance.exports['__napi_register__WorkspaceErrors_68']?.()
102
- __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_69']?.()
103
- __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_70']?.()
104
- __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_71']?.()
105
- __napiInstance.exports['__napi_register__FileMap_struct_72']?.()
106
- __napiInstance.exports['__napi_register____test_only_transfer_file_map_73']?.()
67
+ __napiInstance.exports['__napi_register__log_error_16']?.()
68
+ __napiInstance.exports['__napi_register__IS_WASM_17']?.()
69
+ __napiInstance.exports['__napi_register__get_binary_target_18']?.()
70
+ __napiInstance.exports['__napi_register__ImportResult_struct_19']?.()
71
+ __napiInstance.exports['__napi_register__find_imports_20']?.()
72
+ __napiInstance.exports['__napi_register__transfer_project_graph_21']?.()
73
+ __napiInstance.exports['__napi_register__ExternalNode_struct_22']?.()
74
+ __napiInstance.exports['__napi_register__Target_struct_23']?.()
75
+ __napiInstance.exports['__napi_register__Project_struct_24']?.()
76
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_25']?.()
77
+ __napiInstance.exports['__napi_register__HashPlanner_struct_26']?.()
78
+ __napiInstance.exports['__napi_register__HashPlanner_impl_30']?.()
79
+ __napiInstance.exports['__napi_register__HashDetails_struct_31']?.()
80
+ __napiInstance.exports['__napi_register__HasherOptions_struct_32']?.()
81
+ __napiInstance.exports['__napi_register__TaskHasher_struct_33']?.()
82
+ __napiInstance.exports['__napi_register__TaskHasher_impl_36']?.()
83
+ __napiInstance.exports['__napi_register__Task_struct_37']?.()
84
+ __napiInstance.exports['__napi_register__TaskTarget_struct_38']?.()
85
+ __napiInstance.exports['__napi_register__TaskResult_struct_39']?.()
86
+ __napiInstance.exports['__napi_register__TaskGraph_struct_40']?.()
87
+ __napiInstance.exports['__napi_register__FileData_struct_41']?.()
88
+ __napiInstance.exports['__napi_register__InputsInput_struct_42']?.()
89
+ __napiInstance.exports['__napi_register__FileSetInput_struct_43']?.()
90
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_44']?.()
91
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_45']?.()
92
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_46']?.()
93
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_47']?.()
94
+ __napiInstance.exports['__napi_register__NxJson_struct_48']?.()
95
+ __napiInstance.exports['__napi_register__FileLock_struct_49']?.()
96
+ __napiInstance.exports['__napi_register__FileLock_impl_51']?.()
97
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_52']?.()
98
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_63']?.()
99
+ __napiInstance.exports['__napi_register__WorkspaceErrors_64']?.()
100
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_65']?.()
101
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_66']?.()
102
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_67']?.()
103
+ __napiInstance.exports['__napi_register__FileMap_struct_68']?.()
104
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_69']?.()
107
105
  }
108
106
  export const FileLock = __napiModule.exports.FileLock
109
- export const HashPlanInspector = __napiModule.exports.HashPlanInspector
110
107
  export const HashPlanner = __napiModule.exports.HashPlanner
111
108
  export const ImportResult = __napiModule.exports.ImportResult
112
109
  export const NxConsolePreferences = __napiModule.exports.NxConsolePreferences
@@ -123,8 +120,8 @@ export const hashArray = __napiModule.exports.hashArray
123
120
  export const hashFile = __napiModule.exports.hashFile
124
121
  export const installNxConsole = __napiModule.exports.installNxConsole
125
122
  export const IS_WASM = __napiModule.exports.IS_WASM
126
- export const isAiAgent = __napiModule.exports.isAiAgent
127
123
  export const logDebug = __napiModule.exports.logDebug
124
+ export const logError = __napiModule.exports.logError
128
125
  export const remove = __napiModule.exports.remove
129
126
  export const testOnlyTransferFileMap = __napiModule.exports.testOnlyTransferFileMap
130
127
  export const transferProjectGraph = __napiModule.exports.transferProjectGraph
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"nx-console-prompt.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/nx-console-prompt.ts"],"names":[],"mappings":"AASA,wBAAsB,wBAAwB,kBA4B7C"}
1
+ {"version":3,"file":"nx-console-prompt.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/nx-console-prompt.ts"],"names":[],"mappings":"AASA,wBAAsB,wBAAwB,kBAmB7C"}
@@ -9,14 +9,6 @@ async function ensureNxConsoleInstalled() {
9
9
  const preferences = new native_1.NxConsolePreferences((0, os_1.homedir)());
10
10
  let setting = preferences.getAutoInstallPreference();
11
11
  const canInstallConsole = (0, native_1.canInstallNxConsole)();
12
- // If user previously opted in but extension is not installed,
13
- // they must have manually uninstalled it - respect that choice
14
- if (setting === true && canInstallConsole) {
15
- // User had auto-install enabled but extension is missing
16
- // This means they manually uninstalled it
17
- preferences.setAutoInstallPreference(false);
18
- return;
19
- }
20
12
  // Noop
21
13
  if (!canInstallConsole) {
22
14
  return;
@@ -13,7 +13,6 @@ export interface PackageManagerCommands {
13
13
  run: (script: string, args?: string) => string;
14
14
  getRegistryUrl?: string;
15
15
  publish: (packageRoot: string, registry: string, registryConfigKey: string, tag: string) => string;
16
- ignoreScriptsFlag?: string;
17
16
  }
18
17
  /**
19
18
  * Detects which package manager is used in the workspace based on the lock file.
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/package-manager.ts"],"names":[],"mappings":"AA+BA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAE/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,CACP,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,MAAM,EACzB,GAAG,EAAE,MAAM,KACR,MAAM,CAAC;IAEZ,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAW,GAAG,cAAc,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C,CAoBjB;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAsBlC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,GAAE,cAAuC,EACvD,IAAI,GAAE,MAAsB,GAC3B,MAAM,EAAE,CAoBV;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,cAAc,GAAE,cAAuC,EACvD,UAAU,GAAE,MAAM,EAAyC,EAC3D,IAAI,GAAE,MAAsB,GAC3B,IAAI,CAiEN"}
1
+ {"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/package-manager.ts"],"names":[],"mappings":"AA+BA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAE/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,CACP,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,MAAM,EACzB,GAAG,EAAE,MAAM,KACR,MAAM,CAAC;CACb;AAED;;GAEG;AACH,w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M,EACf,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAsBlC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,GAAE,cAAuC,EACvD,IAAI,GAAE,MAAsB,GAC3B,MAAM,EAAE,CAoBV;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,cAAc,GAAE,cAAuC,EACvD,UAAU,GAAE,MAAM,EAAyC,EAC3D,IAAI,GAAE,MAAsB,GAC3B,IAAI,CAiEN"}
@@ -95,7 +95,6 @@ function getPackageManagerCommand(packageManager = detectPackageManager(), root
95
95
  yarnVersion = 'latest';
96
96
  useBerry = true;
97
97
  }
98
- // new versions of yarn only support ignoring scripts via .yarnrc.yml
99
98
  return {
100
99
  preInstall: `yarn set version ${yarnVersion}`,
101
100
  install: 'yarn',
@@ -109,14 +108,13 @@ function getPackageManagerCommand(packageManager = detectPackageManager(), root
109
108
  addDev: useBerry ? 'yarn add -D' : 'yarn add -D -W',
110
109
  rm: 'yarn remove',
111
110
  exec: 'yarn',
112
- dlx: useBerry ? 'yarn dlx' : 'npx',
111
+ dlx: useBerry ? 'yarn dlx' : 'yarn',
113
112
  run: (script, args) => `yarn ${script}${args ? ` ${args}` : ''}`,
114
113
  list: useBerry ? 'yarn info --name-only' : 'yarn list',
115
114
  getRegistryUrl: useBerry
116
115
  ? 'yarn config get npmRegistryServer'
117
116
  : 'yarn config get registry',
118
117
  publish: (packageRoot, registry, registryConfigKey, tag) => `npm publish "${packageRoot}" --json --"${registryConfigKey}=${registry}" --tag=${tag}`,
119
- ignoreScriptsFlag: useBerry ? undefined : `--ignore-scripts`,
120
118
  };
121
119
  },
122
120
  pnpm: () => {
@@ -152,7 +150,6 @@ function getPackageManagerCommand(packageManager = detectPackageManager(), root
152
150
  list: 'pnpm ls --depth 100',
153
151
  getRegistryUrl: 'pnpm config get registry',
154
152
  publish: (packageRoot, registry, registryConfigKey, tag) => `pnpm publish "${packageRoot}" --json --"${allowRegistryConfigKey ? registryConfigKey : 'registry'}=${registry}" --tag=${tag} --no-git-checks`,
155
- ignoreScriptsFlag: '--ignore-scripts',
156
153
  };
157
154
  },
158
155
  npm: () => {
@@ -171,7 +168,6 @@ function getPackageManagerCommand(packageManager = detectPackageManager(), root
171
168
  list: 'npm ls',
172
169
  getRegistryUrl: 'npm config get registry',
173
170
  publish: (packageRoot, registry, registryConfigKey, tag) => `npm publish "${packageRoot}" --json --"${registryConfigKey}=${registry}" --tag=${tag}`,
174
- ignoreScriptsFlag: '--ignore-scripts',
175
171
  };
176
172
  },
177
173
  bun: () => {
@@ -189,7 +185,6 @@ function getPackageManagerCommand(packageManager = detectPackageManager(), root
189
185
  list: 'bun pm ls',
190
186
  // Unlike npm, bun publish does not support a custom registryConfigKey option
191
187
  publish: (packageRoot, registry, registryConfigKey, tag) => `bun publish --cwd="${packageRoot}" --json --registry="${registry}" --tag=${tag}`,
192
- ignoreScriptsFlag: '--ignore-scripts',
193
188
  };
194
189
  },
195
190
  };
@@ -1,46 +0,0 @@
1
- export declare function ensurePackageHasProvenance(packageName: string, packageVersion: string): Promise<void>;
2
- export declare const noProvenanceError: (packageName: string, packageVersion: string, error?: string) => string;
3
- export declare function getNxPackageGroup(): string[];
4
- export type DecodedAttestationPayload = {
5
- _type: 'https://in-toto.io/Statement/v1';
6
- subject: unknown[];
7
- predicateType: 'https://slsa.dev/provenance/v1';
8
- predicate: {
9
- buildDefinition: {
10
- buildType: string;
11
- externalParameters: Record<string, any>;
12
- internalParameters?: Record<string, any>;
13
- resolvedDependencies?: ResourceDescriptor[];
14
- };
15
- runDetails: {
16
- builder: {
17
- id: string;
18
- builderDependencies?: ResourceDescriptor[];
19
- version?: Record<string, string>;
20
- };
21
- metadata?: {
22
- invocationId?: string;
23
- startedOn?: string;
24
- finishedOn?: string;
25
- };
26
- byproducts?: ResourceDescriptor[];
27
- };
28
- };
29
- };
30
- export interface ResourceDescriptor {
31
- uri?: string;
32
- digest?: {
33
- sha256?: string;
34
- sha512?: string;
35
- gitCommit?: string;
36
- [key: string]: string | undefined;
37
- };
38
- name?: string;
39
- downloadLocation?: string;
40
- mediaType?: string;
41
- content?: string;
42
- annotations?: {
43
- [key: string]: any;
44
- };
45
- }
46
- //# sourceMappingURL=provenance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/provenance.ts"],"names":[],"mappings":"AAYA,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA4Ff;AAED,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,EACnB,gBAAgB,MAAM,EACtB,QAAQ,MAAM,WAIZ,CAAC;AAEL,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAQ5C;AAoBD,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,iCAAiC,CAAC;IACzC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,aAAa,EAAE,gCAAgC,CAAC;IAChD,SAAS,EAAE;QACT,eAAe,EAAE;YACf,SAAS,EAAE,MAAM,CAAC;YAClB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACzC,oBAAoB,CAAC,EAAE,kBAAkB,EAAE,CAAC;SAC7C,CAAC;QACF,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM,CAAC;gBACX,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;gBAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;aAClC,CAAC;YACF,QAAQ,CAAC,EAAE;gBACT,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,SAAS,CAAC,EAAE,MAAM,CAAC;gBACnB,UAAU,CAAC,EAAE,MAAM,CAAC;aACrB,CAAC;YACF,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;SACnC,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACnC,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.noProvenanceError = void 0;
4
- exports.ensurePackageHasProvenance = ensurePackageHasProvenance;
5
- exports.getNxPackageGroup = getNxPackageGroup;
6
- const child_process_1 = require("child_process");
7
- const path_1 = require("path");
8
- const util_1 = require("util");
9
- const fileutils_1 = require("./fileutils");
10
- /*
11
- * Verifies that the given npm package has provenance attestations
12
- * generated by the GitHub Actions workflow at .github/workflows/publish.yml
13
- * in the nrwl/nx repository.
14
- *
15
- * Will throw if the package does not have valid provenance.
16
- */
17
- async function ensurePackageHasProvenance(packageName, packageVersion) {
18
- // this is used for locally released versions without provenance
19
- // do not set this for other reasons or you might be exposed to security risks
20
- if (process.env.NX_SKIP_PROVENANCE_CHECK) {
21
- return;
22
- }
23
- const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
24
- const npmViewResult = JSON.parse((await execFileAsync('npm', ['view', `${packageName}@${packageVersion}`, '--json', '--silent'], {
25
- timeout: 20000,
26
- })).stdout.trim());
27
- const attURL = npmViewResult.dist?.attestations?.url;
28
- if (!attURL)
29
- throw (0, exports.noProvenanceError)(packageName, packageVersion, 'No attestation URL found');
30
- const attestations = (await (await fetch(attURL)).json());
31
- const provenanceAttestation = attestations?.attestations?.find((a) => a.predicateType === 'https://slsa.dev/provenance/v1');
32
- if (!provenanceAttestation)
33
- throw (0, exports.noProvenanceError)(packageName, packageVersion, 'No provenance attestation found');
34
- const dsseEnvelopePayload = JSON.parse(Buffer.from(provenanceAttestation.bundle.dsseEnvelope.payload, 'base64').toString());
35
- const workflowParameters = dsseEnvelopePayload?.predicate?.buildDefinition?.externalParameters
36
- ?.workflow;
37
- // verify that provenance was actually generated from the right publishing workflow
38
- if (workflowParameters?.repository !== 'https://github.com/nrwl/nx') {
39
- throw (0, exports.noProvenanceError)(packageName, packageVersion, 'Repository does not match nrwl/nx');
40
- }
41
- if (workflowParameters?.path !== '.github/workflows/publish.yml') {
42
- throw (0, exports.noProvenanceError)(packageName, packageVersion, 'Publishing workflow does not match .github/workflows/publish.yml');
43
- }
44
- if (workflowParameters?.ref !== `refs/tags/${npmViewResult.version}`) {
45
- throw (0, exports.noProvenanceError)(packageName, packageVersion, `Version ref does not match refs/tags/${npmViewResult.version}`);
46
- }
47
- // verify that provenance was generated from the exact same artifact as the one we are installing
48
- const distSha = Buffer.from(npmViewResult.dist.integrity.replace('sha512-', ''), 'base64').toString('hex');
49
- const attestationSha = dsseEnvelopePayload?.subject[0]?.digest.sha512;
50
- if (distSha !== attestationSha) {
51
- throw (0, exports.noProvenanceError)(packageName, packageVersion, 'Integrity hash does not match attestation hash');
52
- }
53
- return;
54
- }
55
- const noProvenanceError = (packageName, packageVersion, error) => `An error occurred while checking the provenance of ${packageName}@${packageVersion}. This could indicate a security risk. Please double check https://www.npmjs.com/package/${packageName} to see if the package is published correctly or file an issue at https://github.com/nrwl/nx/issues \n Error: ${error ?? ''}`;
56
- exports.noProvenanceError = noProvenanceError;
57
- function getNxPackageGroup() {
58
- const packageJsonPath = (0, path_1.join)(__dirname, '../../package.json');
59
- const packageJson = (0, fileutils_1.readJsonFile)(packageJsonPath);
60
- const packages = packageJson['nx-migrations'].packageGroup.filter((dep) => typeof dep === 'string' && dep.startsWith('@nx/'));
61
- packages.push('nx');
62
- return packages;
63
- }