deplift 1.0.1 → 1.1.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.
@@ -10,6 +10,7 @@ const defaultIgnore = ["**/node_modules/**", "**/dist/**", "**/coverage/**", "**
10
10
  const depSections = ["dependencies", "devDependencies"];
11
11
  const args = process.argv.slice(2);
12
12
  const dryRun = args.includes("--dry-run");
13
+ const noInstall = args.includes("--no-install");
13
14
  if (dryRun) console.log("💡 Dry run enabled — no files will be changed or installed.");
14
15
  const stripPrefix = version => version.replace(/^[^0-9]*/, "");
15
16
  const isStableRelease = version => /^\d+\.\d+\.\d+$/.test(version);
@@ -116,16 +117,17 @@ async function main() {
116
117
  pkgData[section][pkg] = `^${latest}`;
117
118
  }
118
119
  }
119
- if (!updated) {
120
+ if (updated) {
121
+ await promises.writeFile(packageJsonPath, JSON.stringify(pkgData, null, 2) + "\n");
122
+ console.log(` 💾 ${packageJson} updated.`);
123
+ } else {
120
124
  console.log(` ✅ No changes needed for ${packageJson}.`);
121
- continue;
122
125
  }
126
+ if (noInstall) continue;
123
127
  if (dryRun) {
124
128
  console.log(` 📥 [Dry run] "npm install" for ${packageJson}.`);
125
129
  continue;
126
130
  }
127
- await promises.writeFile(packageJsonPath, JSON.stringify(pkgData, null, 2) + "\n");
128
- console.log(` 💾 ${packageJson} updated.`);
129
131
  try {
130
132
  const targetDir = path.dirname(packageJsonPath);
131
133
  console.log(" 📥 Installing...");
@@ -133,6 +135,10 @@ async function main() {
133
135
  stdio: "inherit",
134
136
  cwd: targetDir
135
137
  });
138
+ node_child_process.execSync("npm audit fix", {
139
+ stdio: "inherit",
140
+ cwd: targetDir
141
+ });
136
142
  } catch (err) {
137
143
  console.error(` ❌ Failed to install in ${packageJson}: ${err.message}`);
138
144
  }
@@ -8,6 +8,7 @@ const defaultIgnore = ["**/node_modules/**", "**/dist/**", "**/coverage/**", "**
8
8
  const depSections = ["dependencies", "devDependencies"];
9
9
  const args = process.argv.slice(2);
10
10
  const dryRun = args.includes("--dry-run");
11
+ const noInstall = args.includes("--no-install");
11
12
  if (dryRun) console.log("💡 Dry run enabled — no files will be changed or installed.");
12
13
  const stripPrefix = version => version.replace(/^[^0-9]*/, "");
13
14
  const isStableRelease = version => /^\d+\.\d+\.\d+$/.test(version);
@@ -114,16 +115,17 @@ async function main() {
114
115
  pkgData[section][pkg] = `^${latest}`;
115
116
  }
116
117
  }
117
- if (!updated) {
118
+ if (updated) {
119
+ await writeFile(packageJsonPath, JSON.stringify(pkgData, null, 2) + "\n");
120
+ console.log(` 💾 ${packageJson} updated.`);
121
+ } else {
118
122
  console.log(` ✅ No changes needed for ${packageJson}.`);
119
- continue;
120
123
  }
124
+ if (noInstall) continue;
121
125
  if (dryRun) {
122
126
  console.log(` 📥 [Dry run] "npm install" for ${packageJson}.`);
123
127
  continue;
124
128
  }
125
- await writeFile(packageJsonPath, JSON.stringify(pkgData, null, 2) + "\n");
126
- console.log(` 💾 ${packageJson} updated.`);
127
129
  try {
128
130
  const targetDir = path.dirname(packageJsonPath);
129
131
  console.log(" 📥 Installing...");
@@ -131,6 +133,10 @@ async function main() {
131
133
  stdio: "inherit",
132
134
  cwd: targetDir
133
135
  });
136
+ execSync("npm audit fix", {
137
+ stdio: "inherit",
138
+ cwd: targetDir
139
+ });
134
140
  } catch (err) {
135
141
  console.error(` ❌ Failed to install in ${packageJson}: ${err.message}`);
136
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deplift",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "CLI to update deps in monorepos",
5
5
  "author": "Zheng Song",
6
6
  "license": "MIT",
@@ -33,15 +33,15 @@
33
33
  "deplift:dry-run": "node ./dist/cjs/index.cjs --dry-run"
34
34
  },
35
35
  "devDependencies": {
36
- "@babel/core": "^7.27.4",
37
- "@babel/preset-env": "^7.27.2",
38
- "@babel/preset-typescript": "^7.27.1",
39
- "@rollup/plugin-babel": "^6.0.4",
40
- "@rollup/plugin-node-resolve": "^16.0.1",
41
- "@types/node": "^22.15.29",
36
+ "@babel/core": "^7.28.5",
37
+ "@babel/preset-env": "^7.28.5",
38
+ "@babel/preset-typescript": "^7.28.5",
39
+ "@rollup/plugin-babel": "^6.1.0",
40
+ "@rollup/plugin-node-resolve": "^16.0.3",
41
+ "@types/node": "^25.0.5",
42
42
  "npm-run-all": "^4.1.5",
43
- "rollup": "^4.41.1",
44
- "typescript": "^5.8.3"
43
+ "rollup": "^4.55.1",
44
+ "typescript": "^5.9.3"
45
45
  },
46
46
  "dependencies": {
47
47
  "fast-glob": "^3.3.3"