deplift 1.2.2 → 1.2.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.
@@ -2,12 +2,15 @@
2
2
  'use strict';
3
3
 
4
4
  var path = require('node:path');
5
+ var node_url = require('node:url');
5
6
  var promises = require('node:fs/promises');
6
7
  var node_child_process = require('node:child_process');
7
8
  var fg = require('fast-glob');
8
9
  var yargs = require('yargs');
9
10
  var helpers = require('yargs/helpers');
10
11
 
12
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
13
+ const __dirname$1 = path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
11
14
  const defaultIgnore = ['**/node_modules/**', '**/dist/**', '**/coverage/**', '**/build/**', '**/.next/**', '**/.docusaurus/**'];
12
15
  const depSections = ['dependencies', 'devDependencies'];
13
16
  const stripPrefix = version => version.replace(/^\D+/, '');
@@ -58,7 +61,8 @@ const parseArgs = async () => {
58
61
  version: 'unknown'
59
62
  };
60
63
  try {
61
- pkg = JSON.parse(await promises.readFile(path.resolve(process.cwd(), 'package.json'), 'utf8'));
64
+ pkg = JSON.parse(await promises.readFile(path.resolve(__dirname$1, '../../package.json'), 'utf8'));
65
+ console.log(`[deplift] v${pkg.version}\n`);
62
66
  } catch (_unused2) {}
63
67
  const argv = await yargs(helpers.hideBin(process.argv)).option('major', {
64
68
  type: 'array',
@@ -148,12 +152,12 @@ async function main() {
148
152
  console.log(` ⚠️ [skipped] ${pkg}: current (${current}) version is higher than the latest (${latest})`);
149
153
  continue;
150
154
  }
155
+ const [currentMajor] = extractSemVerParts(current);
151
156
  const [latestMajor] = extractSemVerParts(latest);
152
- if (latestMajor > majorCaps[pkg]) {
157
+ if (currentMajor <= majorCaps[pkg] && latestMajor > majorCaps[pkg]) {
153
158
  console.log(` ⚠️ [skipped] ${pkg}: ${latest} is available, but the major version is capped at v${majorCaps[pkg]}`);
154
159
  continue;
155
160
  }
156
- const [currentMajor] = extractSemVerParts(current);
157
161
  console.log(` ${currentMajor === latestMajor ? '✔' : '🚨[major]'} ${pkg}(${section}): ${rawCurrent} → ^${latest}`);
158
162
  updated = true;
159
163
  if (!dryRun) {
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import path, { resolve } from 'node:path';
2
+ import path, { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
3
4
  import { readFile, writeFile } from 'node:fs/promises';
4
5
  import { execSync } from 'node:child_process';
5
6
  import fg from 'fast-glob';
6
7
  import yargs from 'yargs';
7
8
  import { hideBin } from 'yargs/helpers';
8
9
 
10
+ const __dirname$1 = dirname(fileURLToPath(import.meta.url));
9
11
  const defaultIgnore = ['**/node_modules/**', '**/dist/**', '**/coverage/**', '**/build/**', '**/.next/**', '**/.docusaurus/**'];
10
12
  const depSections = ['dependencies', 'devDependencies'];
11
13
  const stripPrefix = version => version.replace(/^\D+/, '');
@@ -56,7 +58,8 @@ const parseArgs = async () => {
56
58
  version: 'unknown'
57
59
  };
58
60
  try {
59
- pkg = JSON.parse(await readFile(resolve(process.cwd(), 'package.json'), 'utf8'));
61
+ pkg = JSON.parse(await readFile(resolve(__dirname$1, '../../package.json'), 'utf8'));
62
+ console.log(`[deplift] v${pkg.version}\n`);
60
63
  } catch (_unused2) {}
61
64
  const argv = await yargs(hideBin(process.argv)).option('major', {
62
65
  type: 'array',
@@ -146,12 +149,12 @@ async function main() {
146
149
  console.log(` ⚠️ [skipped] ${pkg}: current (${current}) version is higher than the latest (${latest})`);
147
150
  continue;
148
151
  }
152
+ const [currentMajor] = extractSemVerParts(current);
149
153
  const [latestMajor] = extractSemVerParts(latest);
150
- if (latestMajor > majorCaps[pkg]) {
154
+ if (currentMajor <= majorCaps[pkg] && latestMajor > majorCaps[pkg]) {
151
155
  console.log(` ⚠️ [skipped] ${pkg}: ${latest} is available, but the major version is capped at v${majorCaps[pkg]}`);
152
156
  continue;
153
157
  }
154
- const [currentMajor] = extractSemVerParts(current);
155
158
  console.log(` ${currentMajor === latestMajor ? '✔' : '🚨[major]'} ${pkg}(${section}): ${rawCurrent} → ^${latest}`);
156
159
  updated = true;
157
160
  if (!dryRun) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deplift",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "CLI to update deps in monorepos",
5
5
  "author": "Zheng Song",
6
6
  "license": "MIT",
@@ -40,11 +40,11 @@
40
40
  "@babel/preset-typescript": "^7.28.5",
41
41
  "@rollup/plugin-babel": "^6.1.0",
42
42
  "@rollup/plugin-node-resolve": "^16.0.3",
43
- "@types/node": "^25.2.2",
43
+ "@types/node": "^25.3.0",
44
44
  "@types/yargs": "^17.0.35",
45
- "npm-run-all": "^4.1.5",
45
+ "npm-run-all2": "^8.0.4",
46
46
  "prettier": "^3.8.1",
47
- "rollup": "^4.57.1",
47
+ "rollup": "^4.58.0",
48
48
  "typescript": "^5.9.3"
49
49
  },
50
50
  "dependencies": {