teamix-evo 0.18.3 → 0.18.4

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.js CHANGED
@@ -9318,7 +9318,8 @@ import {
9318
9318
  findPreset,
9319
9319
  listPresetIds,
9320
9320
  detectPackageManager as detectPackageManager2,
9321
- gitInit
9321
+ gitInit,
9322
+ PACKAGE_VERSIONS
9322
9323
  } from "create-teamix-evo/scaffold";
9323
9324
 
9324
9325
  // src/commands/_shared/step-icon.ts
@@ -9335,14 +9336,10 @@ function resolvePresetId(variant) {
9335
9336
  const preset = findPreset(variant);
9336
9337
  if (preset) return preset.id;
9337
9338
  const fallback = presetIds[0] ?? "opentrek";
9338
- logger.warn(
9339
- `\u672A\u8BC6\u522B\u7684 variant "${variant}"\uFF0C\u56DE\u9000\u5230\u9ED8\u8BA4 preset "${fallback}"`
9340
- );
9339
+ logger.warn(`\u672A\u8BC6\u522B\u7684 variant "${variant}"\uFF0C\u56DE\u9000\u5230\u9ED8\u8BA4 preset "${fallback}"`);
9341
9340
  return fallback;
9342
9341
  }
9343
- var initCommand5 = new Command36("init").description(
9344
- "\u521D\u59CB\u5316 Teamix Evo \u5957\u4EF6\uFF08\u7A7A\u76EE\u5F55\uFF1A\u811A\u624B\u67B6 + \u5168\u91CF init pipeline\uFF09"
9345
- ).option("--cwd <dir>", "\u6307\u5B9A\u5DE5\u7A0B\u6839\u76EE\u5F55\uFF08\u9ED8\u8BA4\uFF1A\u5F53\u524D\u76EE\u5F55\uFF09").option("-y, --yes", "\u8DF3\u8FC7\u4EA4\u4E92\uFF0C\u5168\u90E8\u4F7F\u7528\u63A8\u8350\u9ED8\u8BA4\u503C\uFF08\u9700\u642D\u914D --variant\uFF09").option("--dry-run", "\u53EA\u8F93\u51FA\u6267\u884C\u8BA1\u5212\uFF0C\u4E0D\u5199\u4EFB\u4F55\u6587\u4EF6").option("--variant <name>", "tokens variant\uFF08\u8986\u76D6 wizard \u8BE2\u95EE\uFF09").option("--force", "\u8DF3\u8FC7\u524D\u7F6E\u68C0\u67E5\uFF0C\u5F3A\u5236\u6267\u884C").option("--pm <name>", "\u5305\u7BA1\u7406\u5668\uFF1Apnpm | npm | yarn").option("--no-git", "\u8DF3\u8FC7 git init").option("--no-install", "\u8DF3\u8FC7\u4F9D\u8D56\u5B89\u88C5").action(async (opts) => {
9342
+ var initCommand5 = new Command36("init").description("\u521D\u59CB\u5316 Teamix Evo \u5957\u4EF6\uFF08\u7A7A\u76EE\u5F55\uFF1A\u811A\u624B\u67B6 + \u5168\u91CF init pipeline\uFF09").option("--cwd <dir>", "\u6307\u5B9A\u5DE5\u7A0B\u6839\u76EE\u5F55\uFF08\u9ED8\u8BA4\uFF1A\u5F53\u524D\u76EE\u5F55\uFF09").option("-y, --yes", "\u8DF3\u8FC7\u4EA4\u4E92\uFF0C\u5168\u90E8\u4F7F\u7528\u63A8\u8350\u9ED8\u8BA4\u503C\uFF08\u9700\u642D\u914D --variant\uFF09").option("--dry-run", "\u53EA\u8F93\u51FA\u6267\u884C\u8BA1\u5212\uFF0C\u4E0D\u5199\u4EFB\u4F55\u6587\u4EF6").option("--variant <name>", "tokens variant\uFF08\u8986\u76D6 wizard \u8BE2\u95EE\uFF09").option("--force", "\u8DF3\u8FC7\u524D\u7F6E\u68C0\u67E5\uFF0C\u5F3A\u5236\u6267\u884C").option("--pm <name>", "\u5305\u7BA1\u7406\u5668\uFF1Apnpm | npm | yarn").option("--no-git", "\u8DF3\u8FC7 git init").option("--no-install", "\u8DF3\u8FC7\u4F9D\u8D56\u5B89\u88C5").action(async (opts) => {
9346
9343
  const cwd = path39.resolve(opts.cwd ?? process.cwd());
9347
9344
  try {
9348
9345
  const state = await detectProjectState(cwd);
@@ -9350,9 +9347,7 @@ var initCommand5 = new Command36("init").description(
9350
9347
  logger.info(
9351
9348
  "\u5F53\u524D\u76EE\u5F55\u5DF2\u68C0\u6D4B\u5230 .teamix-evo/ \u2014 \u518D\u6B21\u8FD0\u884C init \u4F1A\u81EA\u52A8\u8DF3\u8FC7\u5DF2\u5B8C\u6210\u6B65\u9AA4\uFF08\u5E42\u7B49\u91CD\u8DD1\uFF09\u3002"
9352
9349
  );
9353
- logger.info(
9354
- "\u5982\u9700\u5347\u7EA7\u5DF2\u5B89\u88C5\u8D44\u4EA7\u5230\u65B0\u7248\u672C\uFF0C\u8BF7\u4F7F\u7528 teamix-evo update\u3002"
9355
- );
9350
+ logger.info("\u5982\u9700\u5347\u7EA7\u5DF2\u5B89\u88C5\u8D44\u4EA7\u5230\u65B0\u7248\u672C\uFF0C\u8BF7\u4F7F\u7528 teamix-evo update\u3002");
9356
9351
  } else if (state.state !== "empty") {
9357
9352
  assertCommandPrecondition("init", state.state, { force: opts.force });
9358
9353
  if (process.exitCode) return;
@@ -9442,7 +9437,7 @@ var initCommand5 = new Command36("init").description(
9442
9437
  });
9443
9438
  async function runScaffoldPhase(cwd, variant, opts) {
9444
9439
  const presetId = resolvePresetId(variant);
9445
- const pm = opts.pm ?? void 0;
9440
+ const pm = opts.pm ?? "pnpm";
9446
9441
  const shouldInstall = opts.install !== false;
9447
9442
  const shouldGit = opts.git !== false;
9448
9443
  logger.info("");
@@ -9453,7 +9448,16 @@ async function runScaffoldPhase(cwd, variant, opts) {
9453
9448
  variant,
9454
9449
  projectName: path39.basename(cwd)
9455
9450
  });
9456
- logger.info(` \u2714 \u6A21\u677F ${result.preset.displayName}\uFF08variant: ${result.variant}\uFF09`);
9451
+ if (pm === "pnpm") {
9452
+ const fs34 = await import("fs/promises");
9453
+ const pkgPath = path39.join(cwd, "package.json");
9454
+ const pkg = JSON.parse(await fs34.readFile(pkgPath, "utf-8"));
9455
+ pkg.packageManager = `pnpm@${PACKAGE_VERSIONS.pnpm}`;
9456
+ await fs34.writeFile(pkgPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
9457
+ }
9458
+ logger.info(
9459
+ ` \u2714 \u6A21\u677F ${result.preset.displayName}\uFF08variant: ${result.variant}\uFF09`
9460
+ );
9457
9461
  if (shouldInstall) {
9458
9462
  const pmInfo = detectPackageManager2(pm);
9459
9463
  logger.info(` \u27F3 \u5B89\u88C5\u4F9D\u8D56\uFF08${pmInfo.installCommand}\uFF09\u2026`);
@@ -9461,9 +9465,7 @@ async function runScaffoldPhase(cwd, variant, opts) {
9461
9465
  await execa2(pmInfo.name, pmInfo.install, { cwd, stdio: "inherit" });
9462
9466
  logger.info(" \u2714 \u4F9D\u8D56\u5DF2\u5B89\u88C5");
9463
9467
  } catch {
9464
- logger.warn(
9465
- ` \u2716 \u4F9D\u8D56\u5B89\u88C5\u5931\u8D25 \u2014 \u53EF\u624B\u52A8\u6267\u884C\uFF1A${pmInfo.installCommand}`
9466
- );
9468
+ logger.warn(` \u2716 \u4F9D\u8D56\u5B89\u88C5\u5931\u8D25 \u2014 \u53EF\u624B\u52A8\u6267\u884C\uFF1A${pmInfo.installCommand}`);
9467
9469
  }
9468
9470
  }
9469
9471
  if (shouldGit) {