pnpm 6.20.3 → 6.20.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.
@@ -0,0 +1,25 @@
1
+ name: Tests on Windows
2
+ on: [push, pull_request]
3
+ jobs:
4
+ Tests:
5
+ strategy:
6
+ fail-fast: false
7
+ max-parallel: 15
8
+ matrix:
9
+ os: [windows-2022]
10
+ runs-on: ${{ matrix.os }}
11
+ steps:
12
+ - name: Checkout Repository
13
+ uses: actions/checkout@v2
14
+ - name: Install Dependencies
15
+ run: |
16
+ npm install --no-progress
17
+ - name: Set Windows environment
18
+ if: matrix.os == 'windows-latest'
19
+ run: |
20
+ echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
21
+ echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
22
+ - name: Environment Information
23
+ run: npx envinfo
24
+ - name: Run Node tests
25
+ run: npm test
@@ -97,17 +97,15 @@ function configure (gyp, argv, callback) {
97
97
  process.env.GYP_MSVS_VERSION = Math.min(vsInfo.versionYear, 2015)
98
98
  process.env.GYP_MSVS_OVERRIDE_PATH = vsInfo.path
99
99
  }
100
- createConfigGypi({ gyp, buildDir, nodeDir, vsInfo }, (err, configPath) => {
100
+ createConfigGypi({ gyp, buildDir, nodeDir, vsInfo }).then(configPath => {
101
101
  configs.push(configPath)
102
- findConfigs(err)
102
+ findConfigs()
103
+ }).catch(err => {
104
+ callback(err)
103
105
  })
104
106
  }
105
107
 
106
- function findConfigs (err) {
107
- if (err) {
108
- return callback(err)
109
- }
110
-
108
+ function findConfigs () {
111
109
  var name = configNames.shift()
112
110
  if (!name) {
113
111
  return runGyp()
@@ -4,19 +4,45 @@ const fs = require('graceful-fs')
4
4
  const log = require('npmlog')
5
5
  const path = require('path')
6
6
 
7
- function getBaseConfigGypi () {
8
- const config = JSON.parse(JSON.stringify(process.config))
7
+ function parseConfigGypi (config) {
8
+ // translated from tools/js2c.py of Node.js
9
+ // 1. string comments
10
+ config = config.replace(/#.*/g, '')
11
+ // 2. join multiline strings
12
+ config = config.replace(/'$\s+'/mg, '')
13
+ // 3. normalize string literals from ' into "
14
+ config = config.replace(/'/g, '"')
15
+ return JSON.parse(config)
16
+ }
17
+
18
+ async function getBaseConfigGypi ({ gyp, nodeDir }) {
19
+ // try reading $nodeDir/include/node/config.gypi first when:
20
+ // 1. --dist-url or --nodedir is specified
21
+ // 2. and --force-process-config is not specified
22
+ const shouldReadConfigGypi = (gyp.opts.nodedir || gyp.opts['dist-url']) && !gyp.opts['force-process-config']
23
+ if (shouldReadConfigGypi && nodeDir) {
24
+ try {
25
+ const baseConfigGypiPath = path.resolve(nodeDir, 'include/node/config.gypi')
26
+ const baseConfigGypi = await fs.promises.readFile(baseConfigGypiPath)
27
+ return parseConfigGypi(baseConfigGypi.toString())
28
+ } catch (err) {
29
+ log.warn('read config.gypi', err.message)
30
+ }
31
+ }
32
+
33
+ // fallback to process.config if it is invalid
34
+ return JSON.parse(JSON.stringify(process.config))
35
+ }
36
+
37
+ async function getCurrentConfigGypi ({ gyp, nodeDir, vsInfo }) {
38
+ const config = await getBaseConfigGypi({ gyp, nodeDir })
9
39
  if (!config.target_defaults) {
10
40
  config.target_defaults = {}
11
41
  }
12
42
  if (!config.variables) {
13
43
  config.variables = {}
14
44
  }
15
- return config
16
- }
17
45
 
18
- function getCurrentConfigGypi ({ gyp, nodeDir, vsInfo }) {
19
- const config = getBaseConfigGypi()
20
46
  const defaults = config.target_defaults
21
47
  const variables = config.variables
22
48
 
@@ -85,13 +111,13 @@ function getCurrentConfigGypi ({ gyp, nodeDir, vsInfo }) {
85
111
  return config
86
112
  }
87
113
 
88
- function createConfigGypi ({ gyp, buildDir, nodeDir, vsInfo }, callback) {
114
+ async function createConfigGypi ({ gyp, buildDir, nodeDir, vsInfo }) {
89
115
  const configFilename = 'config.gypi'
90
116
  const configPath = path.resolve(buildDir, configFilename)
91
117
 
92
118
  log.verbose('build/' + configFilename, 'creating config file')
93
119
 
94
- const config = getCurrentConfigGypi({ gyp, nodeDir, vsInfo })
120
+ const config = await getCurrentConfigGypi({ gyp, nodeDir, vsInfo })
95
121
 
96
122
  // ensures that any boolean values in config.gypi get stringified
97
123
  function boolsToString (k, v) {
@@ -108,12 +134,13 @@ function createConfigGypi ({ gyp, buildDir, nodeDir, vsInfo }, callback) {
108
134
 
109
135
  const json = JSON.stringify(config, boolsToString, 2)
110
136
  log.verbose('build/' + configFilename, 'writing out config file: %s', configPath)
111
- fs.writeFile(configPath, [prefix, json, ''].join('\n'), (err) => {
112
- callback(err, configPath)
113
- })
137
+ await fs.promises.writeFile(configPath, [prefix, json, ''].join('\n'))
138
+
139
+ return configPath
114
140
  }
115
141
 
116
142
  module.exports = createConfigGypi
117
143
  module.exports.test = {
144
+ parseConfigGypi: parseConfigGypi,
118
145
  getCurrentConfigGypi: getCurrentConfigGypi
119
146
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  const log = require('npmlog')
4
4
  const execFile = require('child_process').execFile
5
+ const fs = require('fs')
5
6
  const path = require('path').win32
6
7
  const logWithPrefix = require('./util').logWithPrefix
7
8
  const regSearchKeys = require('./util').regSearchKeys
@@ -257,6 +258,10 @@ VisualStudioFinder.prototype = {
257
258
  ret.versionYear = 2019
258
259
  return ret
259
260
  }
261
+ if (ret.versionMajor === 17) {
262
+ ret.versionYear = 2022
263
+ return ret
264
+ }
260
265
  this.log.silly('- unsupported version:', ret.versionMajor)
261
266
  return {}
262
267
  },
@@ -264,15 +269,20 @@ VisualStudioFinder.prototype = {
264
269
  // Helper - process MSBuild information
265
270
  getMSBuild: function getMSBuild (info, versionYear) {
266
271
  const pkg = 'Microsoft.VisualStudio.VC.MSBuild.Base'
272
+ const msbuildPath = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe')
267
273
  if (info.packages.indexOf(pkg) !== -1) {
268
274
  this.log.silly('- found VC.MSBuild.Base')
269
275
  if (versionYear === 2017) {
270
276
  return path.join(info.path, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe')
271
277
  }
272
278
  if (versionYear === 2019) {
273
- return path.join(info.path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe')
279
+ return msbuildPath
274
280
  }
275
281
  }
282
+ // visual studio 2022 don't has msbuild pkg
283
+ if (fs.existsSync(msbuildPath)) {
284
+ return msbuildPath
285
+ }
276
286
  return null
277
287
  },
278
288
 
@@ -293,6 +303,8 @@ VisualStudioFinder.prototype = {
293
303
  return 'v141'
294
304
  } else if (versionYear === 2019) {
295
305
  return 'v142'
306
+ } else if (versionYear === 2022) {
307
+ return 'v143'
296
308
  }
297
309
  this.log.silly('- invalid versionYear:', versionYear)
298
310
  return null
@@ -75,7 +75,8 @@ proto.configDefs = {
75
75
  'dist-url': String, // 'install'
76
76
  tarball: String, // 'install'
77
77
  jobs: String, // 'build'
78
- thin: String // 'configure'
78
+ thin: String, // 'configure'
79
+ 'force-process-config': Boolean // 'configure'
79
80
  }
80
81
 
81
82
  /**
@@ -11,7 +11,7 @@
11
11
  "bindings",
12
12
  "gyp"
13
13
  ],
14
- "version": "8.3.0",
14
+ "version": "8.4.0",
15
15
  "installVersion": 9,
16
16
  "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",
17
17
  "repository": {
package/dist/pnpm.cjs CHANGED
@@ -3165,7 +3165,7 @@ var require_lib4 = __commonJS({
3165
3165
  var load_json_file_1 = __importDefault(require_load_json_file());
3166
3166
  var defaultManifest = {
3167
3167
  name: "pnpm" != null && true ? "pnpm" : "pnpm",
3168
- version: "6.20.3" != null && true ? "6.20.3" : "0.0.0"
3168
+ version: "6.20.4" != null && true ? "6.20.4" : "0.0.0"
3169
3169
  };
3170
3170
  var pkgJson;
3171
3171
  if (require.main == null) {
@@ -12427,10 +12427,12 @@ var require_err = __commonJS({
12427
12427
  function err(error) {
12428
12428
  if (!global["reporterInitialized"]) {
12429
12429
  console.log(error);
12430
- process.exit(1);
12430
+ process.exitCode = 1;
12431
+ return;
12431
12432
  }
12432
12433
  if (global["reporterInitialized"] === "silent") {
12433
- process.exit(1);
12434
+ process.exitCode = 1;
12435
+ return;
12434
12436
  }
12435
12437
  if (error.name != null && error.name !== "pnpm" && !error.name.startsWith("pnpm:")) {
12436
12438
  error.name = "pnpm";
@@ -103609,7 +103611,7 @@ var require_runLifecycleHooksConcurrently = __commonJS({
103609
103611
  continue;
103610
103612
  await (0, runLifecycleHook_1.default)(stage, manifest, runLifecycleHookOpts);
103611
103613
  }
103612
- if (targetDirs == null)
103614
+ if (targetDirs == null || targetDirs.length === 0)
103613
103615
  return;
103614
103616
  const filesResponse = await (0, directory_fetcher_1.fetchFromDir)(rootDir, {});
103615
103617
  await Promise.all(targetDirs.map((targetDir) => opts.storeController.importPackage(targetDir, {
@@ -129065,7 +129067,7 @@ var require_publish2 = __commonJS({
129065
129067
  await (0, rimraf_1.default)(localNpmrc);
129066
129068
  }
129067
129069
  if (status != null && status !== 0) {
129068
- process.exit(status);
129070
+ return { exitCode: status };
129069
129071
  }
129070
129072
  if (!opts.ignoreScripts) {
129071
129073
  await _runScriptsIfPresent([
@@ -129987,7 +129989,9 @@ var require_exec = __commonJS({
129987
129989
  result.passes++;
129988
129990
  } catch (err) {
129989
129991
  if (!opts.recursive && typeof err.exitCode === "number") {
129990
- process.exit(err.exitCode);
129992
+ return {
129993
+ exitCode: err.exitCode
129994
+ };
129991
129995
  }
129992
129996
  logger_1.default.info(err);
129993
129997
  if (!opts.bail) {
@@ -130002,6 +130006,7 @@ var require_exec = __commonJS({
130002
130006
  err["prefix"] = prefix;
130003
130007
  throw err;
130004
130008
  }
130009
+ return { exitCode: 0 };
130005
130010
  })));
130006
130011
  }
130007
130012
  (0, cli_utils_1.throwOnCommandFail)("pnpm recursive exec", result);
@@ -133774,12 +133779,14 @@ var require_main2 = __commonJS({
133774
133779
  parsedCliArgs = await (0, parseCliArgs_1.default)(inputArgv);
133775
133780
  } catch (err) {
133776
133781
  printError(err.message, err["hint"]);
133777
- process.exit(1);
133782
+ process.exitCode = 1;
133783
+ return;
133778
133784
  }
133779
133785
  const { argv: argv2, params: cliParams, options: cliOptions, cmd, fallbackCommandUsed, unknownOptions, workspaceDir } = parsedCliArgs;
133780
133786
  if (cmd !== null && !cmd_1.default[cmd]) {
133781
133787
  printError(`Unknown command '${cmd}'`, "For help, run: pnpm help");
133782
- process.exit(1);
133788
+ process.exitCode = 1;
133789
+ return;
133783
133790
  }
133784
133791
  if (unknownOptions.size > 0 && !fallbackCommandUsed) {
133785
133792
  const unknownOptionsArray = Array.from(unknownOptions.keys());
@@ -133793,7 +133800,8 @@ var require_main2 = __commonJS({
133793
133800
  console.log(deprecationMsg);
133794
133801
  } else {
133795
133802
  printError((0, formatError_1.formatUnknownOptionsError)(unknownOptions), `For help, run: pnpm help${cmd ? ` ${cmd}` : ""}`);
133796
- process.exit(1);
133803
+ process.exitCode = 1;
133804
+ return;
133797
133805
  }
133798
133806
  }
133799
133807
  process.env["npm_config_argv"] = JSON.stringify(argv2);
@@ -133813,7 +133821,8 @@ var require_main2 = __commonJS({
133813
133821
  } catch (err) {
133814
133822
  const hint = err["hint"] ? err["hint"] : `For help, run: pnpm help${cmd ? ` ${cmd}` : ""}`;
133815
133823
  printError(err.message, hint);
133816
- process.exit(1);
133824
+ process.exitCode = 1;
133825
+ return;
133817
133826
  }
133818
133827
  let write = process.stdout.write.bind(process.stdout);
133819
133828
  if (config.color === "always") {
@@ -133864,7 +133873,8 @@ var require_main2 = __commonJS({
133864
133873
  if (printLogs) {
133865
133874
  console.log(`No projects found in "${wsDir}"`);
133866
133875
  }
133867
- process.exit(0);
133876
+ process.exitCode = 0;
133877
+ return;
133868
133878
  }
133869
133879
  config.filter = (_a = config.filter) !== null && _a !== void 0 ? _a : [];
133870
133880
  config.filterProd = (_b = config.filterProd) !== null && _b !== void 0 ? _b : [];
@@ -133891,7 +133901,8 @@ var require_main2 = __commonJS({
133891
133901
  if (printLogs) {
133892
133902
  console.log(`No projects matched the filters in "${wsDir}"`);
133893
133903
  }
133894
- process.exit(0);
133904
+ process.exitCode = 0;
133905
+ return;
133895
133906
  }
133896
133907
  if (filterResults.unmatchedFilters.length !== 0 && printLogs) {
133897
133908
  console.log(`No projects matched the filters "${filterResults.unmatchedFilters.join(", ")}" in "${wsDir}"`);
@@ -133946,7 +133957,7 @@ var require_main2 = __commonJS({
133946
133957
  }
133947
133958
  if (exitCode) {
133948
133959
  global["writeDebugLogFile"] = false;
133949
- process.exit(exitCode);
133960
+ process.exitCode = exitCode;
133950
133961
  }
133951
133962
  }
133952
133963
  exports2.default = run;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pnpm",
3
3
  "description": "Fast, disk space efficient package manager",
4
- "version": "6.20.3",
4
+ "version": "6.20.4",
5
5
  "bin": {
6
6
  "pnpm": "bin/pnpm.cjs",
7
7
  "pnpx": "bin/pnpx.cjs"
@@ -42,12 +42,12 @@
42
42
  "@pnpm/pick-registry-for-package": "workspace:2.0.5",
43
43
  "@pnpm/plugin-commands-audit": "workspace:5.1.19",
44
44
  "@pnpm/plugin-commands-env": "workspace:1.2.4",
45
- "@pnpm/plugin-commands-installation": "workspace:7.2.1",
45
+ "@pnpm/plugin-commands-installation": "workspace:7.2.2",
46
46
  "@pnpm/plugin-commands-listing": "workspace:4.0.20",
47
47
  "@pnpm/plugin-commands-outdated": "workspace:5.0.26",
48
- "@pnpm/plugin-commands-publishing": "workspace:4.2.22",
49
- "@pnpm/plugin-commands-rebuild": "workspace:5.2.1",
50
- "@pnpm/plugin-commands-script-runners": "workspace:4.3.6",
48
+ "@pnpm/plugin-commands-publishing": "workspace:4.2.23",
49
+ "@pnpm/plugin-commands-rebuild": "workspace:5.2.2",
50
+ "@pnpm/plugin-commands-script-runners": "workspace:4.3.7",
51
51
  "@pnpm/plugin-commands-server": "workspace:3.0.43",
52
52
  "@pnpm/plugin-commands-setup": "workspace:1.1.13",
53
53
  "@pnpm/plugin-commands-store": "workspace:4.0.27",