@jskit-ai/release 0.1.0 → 0.1.1

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/package.json +1 -1
  2. package/src/release.mjs +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/release",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Selective npm release preparation, publication and dependency pinning for package repositories.",
5
5
  "type": "module",
6
6
  "files": [
package/src/release.mjs CHANGED
@@ -474,11 +474,18 @@ async function prepareRelease({ cwd: repoRoot, dryRun, registry, report = false
474
474
  }
475
475
  });
476
476
  const before = await snapshotFiles(source);
477
- if (await fileExists(path.join(repoRoot, "node_modules"))) {
478
- await symlink(path.join(repoRoot, "node_modules"), path.join(source, "node_modules"), "dir");
479
- }
480
477
  const config = await releaseConfig(source);
481
478
  const staged = await discoverReleasePackages(source);
479
+ if (await fileExists(path.join(repoRoot, "node_modules"))) {
480
+ // A custom pack command builds from this copy. Linking node_modules would
481
+ // resolve workspace links and dependencies outside the copy and change
482
+ // the build, so it gets a real copy (workspace links stay relative).
483
+ if (staged.some(record => record.packageJson.jskitRelease?.pack)) {
484
+ await cp(path.join(repoRoot, "node_modules"), path.join(source, "node_modules"), { recursive: true, verbatimSymlinks: true });
485
+ } else {
486
+ await symlink(path.join(repoRoot, "node_modules"), path.join(source, "node_modules"), "dir");
487
+ }
488
+ }
482
489
  if (!staged.length) throw new Error(`No publishable packages found in ${repoRoot}.`);
483
490
  hydrateLocalDependencies(staged);
484
491
  topologicalPublishOrder(staged);