teamix-evo 0.18.0 → 0.18.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.
@@ -664,7 +664,9 @@ interface ProjectStateReport {
664
664
  declare function detectProjectState(cwd: string): Promise<ProjectStateReport>;
665
665
 
666
666
  type LifecycleCommand = 'init' | 'migrate' | 'update' | 'graft';
667
- declare function assertCommandPrecondition(command: LifecycleCommand, state: ProjectState): void;
667
+ declare function assertCommandPrecondition(command: LifecycleCommand, state: ProjectState, options?: {
668
+ force?: boolean;
669
+ }): void;
668
670
 
669
671
  /**
670
672
  * The 8 categories of consumer-side files that `teamix-evo init` may
@@ -2739,7 +2739,8 @@ async function detectProjectState2(cwd) {
2739
2739
  const absCwd = path15.resolve(cwd);
2740
2740
  const teamixDir = getTeamixDir(absCwd);
2741
2741
  const hasTeamixDir = await fileExists(teamixDir);
2742
- if (hasTeamixDir) {
2742
+ const hasTeamixConfig = hasTeamixDir && await fileExists(path15.join(teamixDir, "config.json"));
2743
+ if (hasTeamixDir && hasTeamixConfig) {
2743
2744
  return {
2744
2745
  state: "teamix-evo",
2745
2746
  cwd: absCwd,
@@ -2802,7 +2803,7 @@ async function detectProjectState2(cwd) {
2802
2803
  }
2803
2804
  }
2804
2805
  }
2805
- if ("@alifd/next" in allDeps || "@ali/teamix-material" in allDeps) {
2806
+ if ("@alifd/next" in allDeps || "@ali/teamix-material" in allDeps || "@ali/teamix" in allDeps) {
2806
2807
  legacyLib = "fusion";
2807
2808
  } else if ("antd" in allDeps) {
2808
2809
  legacyLib = "antd";
@@ -2855,9 +2856,17 @@ var STATE_TO_COMMAND = {
2855
2856
  "teamix-evo": "update",
2856
2857
  other: "graft"
2857
2858
  };
2858
- function assertCommandPrecondition(command, state) {
2859
+ var FORCE_BYPASSABLE = {
2860
+ init: /* @__PURE__ */ new Set(["shadcn"]),
2861
+ migrate: /* @__PURE__ */ new Set([]),
2862
+ update: /* @__PURE__ */ new Set([]),
2863
+ graft: /* @__PURE__ */ new Set([])
2864
+ };
2865
+ function assertCommandPrecondition(command, state, options) {
2859
2866
  const expected = VALID_STATES[command];
2860
2867
  if (state === expected) return;
2868
+ const canForce = FORCE_BYPASSABLE[command].has(state);
2869
+ if (options?.force && canForce) return;
2861
2870
  const stateLabel = STATE_LABELS[state];
2862
2871
  const commandLabel = COMMAND_LABELS[command];
2863
2872
  logger.error(
@@ -2868,6 +2877,9 @@ function assertCommandPrecondition(command, state) {
2868
2877
  const suggestionLabel = COMMAND_LABELS[suggestion];
2869
2878
  logger.info(`\u5EFA\u8BAE\u4F7F\u7528\uFF1Ateamix-evo ${suggestion}\uFF08${suggestionLabel}\uFF09`);
2870
2879
  }
2880
+ if (!canForce) {
2881
+ logger.info("--force \u4E0D\u80FD\u7ED5\u8FC7\u6B64\u9650\u5236\u3002");
2882
+ }
2871
2883
  process.exitCode = 1;
2872
2884
  }
2873
2885
 
@@ -3980,7 +3992,7 @@ var GITIGNORE_RULES2 = [
3980
3992
  var LEGACY_LIB_META = {
3981
3993
  fusion: {
3982
3994
  displayName: "Fusion Design",
3983
- imports: ["teamix/ui", "@alifd/next", "@ali/teamix-material"]
3995
+ imports: ["teamix/ui", "@alifd/next", "@ali/teamix-material", "@ali/teamix"]
3984
3996
  },
3985
3997
  antd: {
3986
3998
  displayName: "Ant Design",