@forgeax/engine-devkit 0.1.2 → 0.1.3

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/dist/sdk-cli.mjs CHANGED
@@ -4941,10 +4941,11 @@ async function findSdkContext() {
4941
4941
  );
4942
4942
  const defaultTemplate = manifest.templates.find((template2) => template2.default);
4943
4943
  if (defaultTemplate === void 0) throw new Error("sdk-default-template-missing");
4944
+ const store = resolve(cursor, "store", "pnpm");
4944
4945
  return {
4945
4946
  root: cursor,
4946
4947
  manifest,
4947
- store: resolve(cursor, "store", "pnpm"),
4948
+ ...await readable(store) ? { store } : {},
4948
4949
  templates,
4949
4950
  defaultTemplate: defaultTemplate.id
4950
4951
  };
@@ -5276,6 +5277,17 @@ function pnpmSupported(version) {
5276
5277
  const [major = 0, minor = 0] = version.split(".").map(Number);
5277
5278
  return major === 10 && minor >= 33;
5278
5279
  }
5280
+ function sdkInstallArgs(store) {
5281
+ if (store === void 0) return ["install", "--frozen-lockfile"];
5282
+ return [
5283
+ "install",
5284
+ "--offline",
5285
+ "--frozen-lockfile",
5286
+ "--side-effects-cache=false",
5287
+ "--store-dir",
5288
+ store
5289
+ ];
5290
+ }
5279
5291
  async function doctorCommand(options = {}) {
5280
5292
  const facts = await readProjectFacts(options.root);
5281
5293
  if (!facts.ok) return facts;
@@ -5367,14 +5379,7 @@ async function initCommand(options = {}) {
5367
5379
  await installProjectSkills(facts.value.root, sdk.manifest);
5368
5380
  }
5369
5381
  if (options.install === false) return applied;
5370
- const installArgs = sdk === void 0 ? ["install", "--frozen-lockfile=false"] : [
5371
- "install",
5372
- "--offline",
5373
- "--frozen-lockfile",
5374
- "--side-effects-cache=false",
5375
- "--store-dir",
5376
- sdk.store
5377
- ];
5382
+ const installArgs = sdk === void 0 ? ["install", "--frozen-lockfile=false"] : sdkInstallArgs(sdk.store);
5378
5383
  await execFileAsync("pnpm", installArgs, {
5379
5384
  cwd: facts.value.root,
5380
5385
  env: { ...process.env, CI: "true" },
@@ -5469,22 +5474,11 @@ async function newCommand(options = {}) {
5469
5474
  }
5470
5475
  await copySdkSkills(sdk, staging);
5471
5476
  await installProjectSkills(staging, sdk.manifest);
5472
- await execFileAsync(
5473
- "pnpm",
5474
- [
5475
- "install",
5476
- "--offline",
5477
- "--frozen-lockfile",
5478
- "--side-effects-cache=false",
5479
- "--store-dir",
5480
- sdk.store
5481
- ],
5482
- {
5483
- cwd: staging,
5484
- env: { ...process.env, CI: "true" },
5485
- maxBuffer: 16 * 1024 * 1024
5486
- }
5487
- );
5477
+ await execFileAsync("pnpm", sdkInstallArgs(sdk.store), {
5478
+ cwd: staging,
5479
+ env: { ...process.env, CI: "true" },
5480
+ maxBuffer: 16 * 1024 * 1024
5481
+ });
5488
5482
  if (!targetExists) {
5489
5483
  await rename(staging, root2);
5490
5484
  staging = void 0;