isolate-package 1.29.0 → 1.30.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.
Files changed (29) hide show
  1. package/dist/index.d.mts +7 -1
  2. package/dist/index.mjs +2 -3
  3. package/dist/index.mjs.map +1 -1
  4. package/dist/{isolate-3GcdAuUK.mjs → isolate-CJy3YyKG.mjs} +261 -64
  5. package/dist/isolate-CJy3YyKG.mjs.map +1 -0
  6. package/dist/isolate-bin.mjs +3 -5
  7. package/dist/isolate-bin.mjs.map +1 -1
  8. package/package.json +21 -20
  9. package/src/get-internal-package-names.test.ts +0 -10
  10. package/src/index.ts +6 -0
  11. package/src/isolate.ts +38 -8
  12. package/src/lib/lockfile/helpers/generate-bun-lockfile.test.ts +619 -0
  13. package/src/lib/lockfile/helpers/generate-bun-lockfile.ts +354 -0
  14. package/src/lib/lockfile/helpers/generate-pnpm-lockfile.test.ts +387 -0
  15. package/src/lib/lockfile/helpers/index.ts +1 -0
  16. package/src/lib/lockfile/helpers/pnpm-map-importer.test.ts +183 -0
  17. package/src/lib/lockfile/process-lockfile.test.ts +238 -0
  18. package/src/lib/lockfile/process-lockfile.ts +6 -6
  19. package/src/lib/manifest/adapt-target-package-manifest.ts +6 -4
  20. package/src/lib/manifest/helpers/adapt-internal-package-manifests.test.ts +49 -0
  21. package/src/lib/manifest/helpers/adapt-internal-package-manifests.ts +15 -3
  22. package/src/lib/manifest/helpers/adopt-pnpm-fields-from-root.test.ts +61 -0
  23. package/src/lib/manifest/helpers/adopt-pnpm-fields-from-root.ts +42 -3
  24. package/src/lib/patches/copy-patches.test.ts +49 -11
  25. package/src/lib/patches/copy-patches.ts +38 -17
  26. package/src/lib/types.ts +5 -0
  27. package/src/lib/utils/filter-patched-dependencies.test.ts +1 -11
  28. package/src/testing/setup.ts +13 -0
  29. package/dist/isolate-3GcdAuUK.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -45,5 +45,11 @@ declare function isolate(config?: IsolateConfig): Promise<string>;
45
45
  */
46
46
  declare function getInternalPackageNames(config?: IsolateConfig): Promise<string[]>;
47
47
  //#endregion
48
- export { type IsolateConfig, type Logger, defineConfig, getInternalPackageNames, isolate };
48
+ //#region src/index.d.ts
49
+ /** Used by firebase-tools-with-isolate to type the dynamic import */
50
+ type IsolateExports = {
51
+ isolate: typeof isolate;
52
+ };
53
+ //#endregion
54
+ export { type IsolateConfig, IsolateExports, type Logger, defineConfig, getInternalPackageNames, isolate };
49
55
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,6 +1,5 @@
1
- import { c as detectPackageManager, i as defineConfig, l as readTypedJson, n as listInternalPackages, o as resolveConfig, r as createPackagesRegistry, s as resolveWorkspacePaths, t as isolate } from "./isolate-3GcdAuUK.mjs";
1
+ import { c as detectPackageManager, i as defineConfig, l as readTypedJson, n as listInternalPackages, o as resolveConfig, r as createPackagesRegistry, s as resolveWorkspacePaths, t as isolate } from "./isolate-CJy3YyKG.mjs";
2
2
  import path from "node:path";
3
-
4
3
  //#region src/get-internal-package-names.ts
5
4
  /**
6
5
  * Get the names of all internal workspace packages that the target package
@@ -16,7 +15,7 @@ async function getInternalPackageNames(config) {
16
15
  detectPackageManager(workspaceRootDir);
17
16
  return listInternalPackages(await readTypedJson(path.join(targetPackageDir, "package.json")), await createPackagesRegistry(workspaceRootDir, resolvedConfig.workspacePackages), { includeDevDependencies: resolvedConfig.includeDevDependencies });
18
17
  }
19
-
20
18
  //#endregion
21
19
  export { defineConfig, getInternalPackageNames, isolate };
20
+
22
21
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/get-internal-package-names.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { IsolateConfig } from \"./lib/config\";\nimport { resolveConfig, resolveWorkspacePaths } from \"./lib/config\";\nimport { detectPackageManager } from \"./lib/package-manager\";\nimport { createPackagesRegistry, listInternalPackages } from \"./lib/registry\";\nimport type { PackageManifest } from \"./lib/types\";\nimport { readTypedJson } from \"./lib/utils\";\n\n/**\n * Get the names of all internal workspace packages that the target package\n * depends on. This is useful for tools like tsup that need a list of internal\n * packages to include in `noExternal`.\n *\n * If no config is passed, it reads from `isolate.config.{ts,js,json}` in the\n * current working directory.\n */\nexport async function getInternalPackageNames(\n config?: IsolateConfig,\n): Promise<string[]> {\n const resolvedConfig = resolveConfig(config);\n const { targetPackageDir, workspaceRootDir } =\n resolveWorkspacePaths(resolvedConfig);\n\n detectPackageManager(workspaceRootDir);\n\n const targetPackageManifest = await readTypedJson<PackageManifest>(\n path.join(targetPackageDir, \"package.json\"),\n );\n\n const packagesRegistry = await createPackagesRegistry(\n workspaceRootDir,\n resolvedConfig.workspacePackages,\n );\n\n return listInternalPackages(targetPackageManifest, packagesRegistry, {\n includeDevDependencies: resolvedConfig.includeDevDependencies,\n });\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,eAAsB,wBACpB,QACmB;CACnB,MAAM,iBAAiB,cAAc,OAAO;CAC5C,MAAM,EAAE,kBAAkB,qBACxB,sBAAsB,eAAe;AAEvC,sBAAqB,iBAAiB;AAWtC,QAAO,qBATuB,MAAM,cAClC,KAAK,KAAK,kBAAkB,eAAe,CAC5C,EAEwB,MAAM,uBAC7B,kBACA,eAAe,kBAChB,EAEoE,EACnE,wBAAwB,eAAe,wBACxC,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/get-internal-package-names.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { IsolateConfig } from \"./lib/config\";\nimport { resolveConfig, resolveWorkspacePaths } from \"./lib/config\";\nimport { detectPackageManager } from \"./lib/package-manager\";\nimport { createPackagesRegistry, listInternalPackages } from \"./lib/registry\";\nimport type { PackageManifest } from \"./lib/types\";\nimport { readTypedJson } from \"./lib/utils\";\n\n/**\n * Get the names of all internal workspace packages that the target package\n * depends on. This is useful for tools like tsup that need a list of internal\n * packages to include in `noExternal`.\n *\n * If no config is passed, it reads from `isolate.config.{ts,js,json}` in the\n * current working directory.\n */\nexport async function getInternalPackageNames(\n config?: IsolateConfig,\n): Promise<string[]> {\n const resolvedConfig = resolveConfig(config);\n const { targetPackageDir, workspaceRootDir } =\n resolveWorkspacePaths(resolvedConfig);\n\n detectPackageManager(workspaceRootDir);\n\n const targetPackageManifest = await readTypedJson<PackageManifest>(\n path.join(targetPackageDir, \"package.json\"),\n );\n\n const packagesRegistry = await createPackagesRegistry(\n workspaceRootDir,\n resolvedConfig.workspacePackages,\n );\n\n return listInternalPackages(targetPackageManifest, packagesRegistry, {\n includeDevDependencies: resolvedConfig.includeDevDependencies,\n });\n}\n"],"mappings":";;;;;;;;;;;AAgBA,eAAsB,wBACpB,QACmB;CACnB,MAAM,iBAAiB,cAAc,OAAO;CAC5C,MAAM,EAAE,kBAAkB,qBACxB,sBAAsB,eAAe;AAEvC,sBAAqB,iBAAiB;AAWtC,QAAO,qBATuB,MAAM,cAClC,KAAK,KAAK,kBAAkB,eAAe,CAC5C,EAEwB,MAAM,uBAC7B,kBACA,eAAe,kBAChB,EAEoE,EACnE,wBAAwB,eAAe,wBACxC,CAAC"}