semantic-release-lerna 2.2.0 → 2.3.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.
Files changed (2) hide show
  1. package/lib/prepare.js +32 -11
  2. package/package.json +8 -8
package/lib/prepare.js CHANGED
@@ -83,21 +83,42 @@ async function updatePackage(npmrc, pkg, context, currentVersions) {
83
83
  async function updateLockfile(npmrc, pkg, context) {
84
84
  const { env, stdout, stderr, logger } = context;
85
85
 
86
- const lockfile = path.join(pkg.location, "package-lock.json");
87
- if (!existsSync(lockfile)) {
86
+ const packageManagerConfigs = [
87
+ [
88
+ "package-lock.json",
89
+ [
90
+ "npm",
91
+ "install",
92
+ "--package-lock-only",
93
+ "--ignore-scripts",
94
+ "--no-audit",
95
+ "--userconfig",
96
+ npmrc,
97
+ ],
98
+ ],
99
+ [
100
+ "pnpm-lock.yaml",
101
+ ["pnpm", "install", "--lockfile-only", "--ignore-scripts", " --config", npmrc],
102
+ ],
103
+ ["yarn.lock", ["yarn", "install"]],
104
+ ];
105
+
106
+ const packageManagerConfig = packageManagerConfigs.find(([file]) =>
107
+ existsSync(path.join(pkg.location, file)),
108
+ );
109
+
110
+ if (!packageManagerConfig) {
88
111
  return;
89
112
  }
90
113
 
91
- logger.log("Update package-lock.json in %s", pkg.location);
114
+ const [packageFile, [command, ...options]] = packageManagerConfig;
92
115
 
93
- const versionResult = execa(
94
- "npm",
95
- ["install", "--package-lock-only", "--ignore-scripts", "--no-audit", "--userconfig", npmrc],
96
- {
97
- cwd: pkg.location,
98
- env,
99
- },
100
- );
116
+ logger.log("Update %s file in %s", packageFile, pkg.location);
117
+
118
+ const versionResult = execa(command, options, {
119
+ cwd: pkg.location,
120
+ env,
121
+ });
101
122
  versionResult.stdout.pipe(stdout, { end: false });
102
123
  versionResult.stderr.pipe(stderr, { end: false });
103
124
  await versionResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-lerna",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "semantic-release plugin to publish lerna monorepo packages to npm",
5
5
  "keywords": [
6
6
  "npm",
@@ -72,21 +72,21 @@
72
72
  "devDependencies": {
73
73
  "@babel/core": "7.23.9",
74
74
  "@babel/preset-env": "7.23.9",
75
- "@html-validate/eslint-config": "5.12.8",
76
- "@html-validate/eslint-config-jest": "5.12.7",
77
- "@html-validate/prettier-config": "2.4.10",
75
+ "@html-validate/eslint-config": "5.13.0",
76
+ "@html-validate/eslint-config-jest": "5.13.0",
77
+ "@html-validate/prettier-config": "2.4.12",
78
78
  "@semantic-release/npm": "11.0.2",
79
- "@types/jest": "29.5.11",
79
+ "@types/jest": "29.5.12",
80
80
  "@types/npmlog": "7.0.0",
81
81
  "babel-plugin-transform-import-meta": "2.2.1",
82
82
  "codecov": "3.8.3",
83
83
  "fs-extra": "11.2.0",
84
84
  "jest": "29.7.0",
85
- "lerna": "8.0.2",
85
+ "lerna": "8.1.2",
86
86
  "npm-pkg-lint": "2.1.0",
87
- "semantic-release": "23.0.0",
87
+ "semantic-release": "23.0.2",
88
88
  "stream-buffers": "3.0.2",
89
- "verdaccio": "5.29.0"
89
+ "verdaccio": "5.29.1"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@semantic-release/npm": ">= 10",