teamix-evo 0.18.0 → 0.18.1
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/core/index.d.ts +3 -1
- package/dist/core/index.js +12 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.js +28 -16
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/core/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
package/dist/core/index.js
CHANGED
|
@@ -2855,9 +2855,17 @@ var STATE_TO_COMMAND = {
|
|
|
2855
2855
|
"teamix-evo": "update",
|
|
2856
2856
|
other: "graft"
|
|
2857
2857
|
};
|
|
2858
|
-
|
|
2858
|
+
var FORCE_BYPASSABLE = {
|
|
2859
|
+
init: /* @__PURE__ */ new Set(["shadcn"]),
|
|
2860
|
+
migrate: /* @__PURE__ */ new Set([]),
|
|
2861
|
+
update: /* @__PURE__ */ new Set([]),
|
|
2862
|
+
graft: /* @__PURE__ */ new Set([])
|
|
2863
|
+
};
|
|
2864
|
+
function assertCommandPrecondition(command, state, options) {
|
|
2859
2865
|
const expected = VALID_STATES[command];
|
|
2860
2866
|
if (state === expected) return;
|
|
2867
|
+
const canForce = FORCE_BYPASSABLE[command].has(state);
|
|
2868
|
+
if (options?.force && canForce) return;
|
|
2861
2869
|
const stateLabel = STATE_LABELS[state];
|
|
2862
2870
|
const commandLabel = COMMAND_LABELS[command];
|
|
2863
2871
|
logger.error(
|
|
@@ -2868,6 +2876,9 @@ function assertCommandPrecondition(command, state) {
|
|
|
2868
2876
|
const suggestionLabel = COMMAND_LABELS[suggestion];
|
|
2869
2877
|
logger.info(`\u5EFA\u8BAE\u4F7F\u7528\uFF1Ateamix-evo ${suggestion}\uFF08${suggestionLabel}\uFF09`);
|
|
2870
2878
|
}
|
|
2879
|
+
if (!canForce) {
|
|
2880
|
+
logger.info("--force \u4E0D\u80FD\u7ED5\u8FC7\u6B64\u9650\u5236\u3002");
|
|
2881
|
+
}
|
|
2871
2882
|
process.exitCode = 1;
|
|
2872
2883
|
}
|
|
2873
2884
|
|