offline-npm-manager 1.0.5 → 1.0.7

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/README.md CHANGED
@@ -274,6 +274,23 @@ offline-npm add express --deps
274
274
 
275
275
  ---
276
276
 
277
+ ## Changelog
278
+
279
+ ### Version 1.0.7 (Latest)
280
+
281
+ **🐛 Bug Fixes:**
282
+
283
+ - **Fixed dependency version format in package.json** - When using `offline-npm install <package> --save`, dependencies are now correctly written with semver format (e.g., `"axios": "^1.1.0"`) instead of local file paths (e.g., `"axios": "file:demo/axios"`)
284
+ - **Fixed package-lock.json resolved URLs** - Package lock file now properly references npm registry URLs (`https://registry.npmjs.org/...`) instead of local cache paths
285
+
286
+ **Impact:**
287
+
288
+ - Package.json files are now production-ready with proper version numbers
289
+ - Package-lock.json correctly points to official npm registry
290
+ - No more manual editing required after offline installations
291
+
292
+ ---
293
+
277
294
  ## License
278
295
 
279
296
  MIT
package/dist/cli.cjs CHANGED
@@ -359,9 +359,7 @@ var require_install = __commonJS({
359
359
  packageName = parts[0];
360
360
  version2 = parts[1];
361
361
  }
362
- const baseName = packageName.includes("/") ? packageName.split("/").pop() : packageName;
363
- const tarballName = `${baseName}-${version2}.tgz`;
364
- return `https://registry.npmjs.org/${packageName}/-/${tarballName}`;
362
+ return `https://registry.npmjs.org/${packageName}/-/${packageName.includes("/") ? packageName.split("/").pop() : packageName}-${version2}.tgz`;
365
363
  }
366
364
  function sanitizePackageLock() {
367
365
  const lockFile = path.resolve("package-lock.json");
@@ -409,9 +407,8 @@ var require_install = __commonJS({
409
407
  pkgJson[section] = {};
410
408
  const current = pkgJson[section][name];
411
409
  if (typeof current === "string" && current.startsWith("file:")) {
412
- pkgJson[section][name] = version2;
410
+ pkgJson[section][name] = `^${version2}`;
413
411
  }
414
- console.log({ pkgJson });
415
412
  fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2), "utf-8");
416
413
  } catch (err) {
417
414
  log.warn(`Could not sanitize package.json (${name}): ${err.message}`);
@@ -624,7 +621,7 @@ var require_package = __commonJS({
624
621
  "package.json"(exports2, module2) {
625
622
  module2.exports = {
626
623
  name: "offline-npm-manager",
627
- version: "1.0.5",
624
+ version: "1.0.7",
628
625
  description: "Download npm packages online, install them offline later",
629
626
  bin: {
630
627
  "offline-npm": "./dist/cli.cjs"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offline-npm-manager",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Download npm packages online, install them offline later",
5
5
  "bin": {
6
6
  "offline-npm": "./dist/cli.cjs"