screw-up 0.14.0 → 0.15.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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: screw-up
3
- * version: 0.14.0
3
+ * version: 0.15.0
4
4
  * description: Simply package metadata inserter on Vite plugin
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/screw-up.git
8
- * git.commit.hash: f1871df4c43aee9ab389a6ab1b2769b32322793b
8
+ * git.commit.hash: 63679526c0d6c7819c2b3e78d96ac3e2c8fc0d46
9
9
  */
10
10
  import * as fs from "fs";
11
11
  import { existsSync } from "fs";
@@ -1719,7 +1719,7 @@ const findWorkspaceRoot = async (startPath, logger) => {
1719
1719
  }
1720
1720
  return void 0;
1721
1721
  };
1722
- const collectWorkspaceSiblings = async (workspaceRoot, logger) => {
1722
+ const collectWorkspaceSiblings = async (workspaceRoot, checkWorkingDirectoryStatus, alwaysOverrideVersionFromGit, inheritableFields, logger) => {
1723
1723
  const siblings = /* @__PURE__ */ new Map();
1724
1724
  try {
1725
1725
  const rootPackageJsonPath = join(workspaceRoot, "package.json");
@@ -1740,17 +1740,24 @@ const collectWorkspaceSiblings = async (workspaceRoot, logger) => {
1740
1740
  const packageJsonPath = join(workspaceRoot, workspaceDir, "package.json");
1741
1741
  if (existsSync(packageJsonPath)) {
1742
1742
  try {
1743
- const packageContent = await readFile(packageJsonPath, "utf-8");
1744
- const packageJson = lib.parse(packageContent);
1743
+ const packagePath = join(workspaceRoot, workspaceDir);
1744
+ const resolvedPackage = await resolveRawPackageJsonObject(
1745
+ packagePath,
1746
+ checkWorkingDirectoryStatus,
1747
+ alwaysOverrideVersionFromGit,
1748
+ inheritableFields,
1749
+ logger
1750
+ );
1751
+ const packageJson = resolvedPackage.metadata;
1745
1752
  if (packageJson.name && packageJson.version) {
1746
1753
  siblings.set(packageJson.name, {
1747
1754
  name: packageJson.name,
1748
1755
  version: packageJson.version,
1749
- path: join(workspaceRoot, workspaceDir)
1756
+ path: packagePath
1750
1757
  });
1751
1758
  }
1752
1759
  } catch (error) {
1753
- logger.warn(`Failed to read package.json from ${packageJsonPath}: ${error}`);
1760
+ logger.warn(`Failed to resolve package.json from ${packageJsonPath}: ${error}`);
1754
1761
  }
1755
1762
  }
1756
1763
  }
@@ -1912,4 +1919,4 @@ export {
1912
1919
  findWorkspaceRoot as f,
1913
1920
  resolvePackageMetadata as r
1914
1921
  };
1915
- //# sourceMappingURL=internal-BgCvktPU.js.map
1922
+ //# sourceMappingURL=internal-Dy8K0duL.js.map