@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/index.mjs CHANGED
@@ -1782,10 +1782,11 @@ async function findSdkContext() {
1782
1782
  );
1783
1783
  const defaultTemplate = manifest.templates.find((template) => template.default);
1784
1784
  if (defaultTemplate === void 0) throw new Error("sdk-default-template-missing");
1785
+ const store = resolve(cursor, "store", "pnpm");
1785
1786
  return {
1786
1787
  root: cursor,
1787
1788
  manifest,
1788
- store: resolve(cursor, "store", "pnpm"),
1789
+ ...await readable(store) ? { store } : {},
1789
1790
  templates,
1790
1791
  defaultTemplate: defaultTemplate.id
1791
1792
  };
@@ -2176,6 +2177,17 @@ function pnpmSupported(version) {
2176
2177
  const [major = 0, minor = 0] = version.split(".").map(Number);
2177
2178
  return major === 10 && minor >= 33;
2178
2179
  }
2180
+ function sdkInstallArgs(store) {
2181
+ if (store === void 0) return ["install", "--frozen-lockfile"];
2182
+ return [
2183
+ "install",
2184
+ "--offline",
2185
+ "--frozen-lockfile",
2186
+ "--side-effects-cache=false",
2187
+ "--store-dir",
2188
+ store
2189
+ ];
2190
+ }
2179
2191
  async function doctorCommand(options = {}) {
2180
2192
  const facts = await readProjectFacts(options.root);
2181
2193
  if (!facts.ok) return facts;
@@ -2267,14 +2279,7 @@ async function initCommand(options = {}) {
2267
2279
  await installProjectSkills(facts.value.root, sdk.manifest);
2268
2280
  }
2269
2281
  if (options.install === false) return applied;
2270
- const installArgs = sdk === void 0 ? ["install", "--frozen-lockfile=false"] : [
2271
- "install",
2272
- "--offline",
2273
- "--frozen-lockfile",
2274
- "--side-effects-cache=false",
2275
- "--store-dir",
2276
- sdk.store
2277
- ];
2282
+ const installArgs = sdk === void 0 ? ["install", "--frozen-lockfile=false"] : sdkInstallArgs(sdk.store);
2278
2283
  await execFileAsync("pnpm", installArgs, {
2279
2284
  cwd: facts.value.root,
2280
2285
  env: { ...process.env, CI: "true" },
@@ -2369,22 +2374,11 @@ async function newCommand(options = {}) {
2369
2374
  }
2370
2375
  await copySdkSkills(sdk, staging);
2371
2376
  await installProjectSkills(staging, sdk.manifest);
2372
- await execFileAsync(
2373
- "pnpm",
2374
- [
2375
- "install",
2376
- "--offline",
2377
- "--frozen-lockfile",
2378
- "--side-effects-cache=false",
2379
- "--store-dir",
2380
- sdk.store
2381
- ],
2382
- {
2383
- cwd: staging,
2384
- env: { ...process.env, CI: "true" },
2385
- maxBuffer: 16 * 1024 * 1024
2386
- }
2387
- );
2377
+ await execFileAsync("pnpm", sdkInstallArgs(sdk.store), {
2378
+ cwd: staging,
2379
+ env: { ...process.env, CI: "true" },
2380
+ maxBuffer: 16 * 1024 * 1024
2381
+ });
2388
2382
  if (!targetExists) {
2389
2383
  await rename(staging, root);
2390
2384
  staging = void 0;