ziku 0.21.3 → 0.22.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/hash-BeQ4-IoO.mjs +3 -0
- package/dist/index.mjs +231 -30
- package/dist/merge-DtLUiQDW.mjs +3 -0
- package/dist/modules-BN0Qb_wy.mjs +3 -0
- package/dist/patterns-BKEQ73qt.mjs +3 -0
- package/dist/template-BmUA_WdM.mjs +3 -0
- package/package.json +2 -1
- package/dist/hash-CjblHutQ.mjs +0 -3
- package/dist/merge-CPx9nRrL.mjs +0 -3
- package/dist/modules-DlNMFNLz.mjs +0 -3
- package/dist/patterns-CxgZLnrY.mjs +0 -3
- package/dist/template-CPgSJ67F.mjs +0 -3
package/dist/index.mjs
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import * as p from "@clack/prompts";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
|
-
import { copyFileSync, existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { accessSync, constants, copyFileSync, existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
7
7
|
import { dirname, join, resolve } from "pathe";
|
|
8
|
+
import * as YAML from "yaml";
|
|
8
9
|
import { parse, stringify } from "yaml";
|
|
9
10
|
import { z } from "zod";
|
|
10
11
|
import { downloadTemplate } from "giget";
|
|
@@ -13,10 +14,12 @@ import { applyPatch, createPatch, diffWords, structuredPatch } from "diff";
|
|
|
13
14
|
import pc, { default as pc$1 } from "picocolors";
|
|
14
15
|
import ignore from "ignore";
|
|
15
16
|
import { glob, globSync } from "tinyglobby";
|
|
17
|
+
import { homedir, tmpdir } from "node:os";
|
|
16
18
|
import { match } from "ts-pattern";
|
|
17
19
|
import { execFileSync } from "node:child_process";
|
|
18
20
|
import { Octokit } from "@octokit/rest";
|
|
19
21
|
import { createHash } from "node:crypto";
|
|
22
|
+
import * as TOML from "smol-toml";
|
|
20
23
|
import { z as z$1 } from "zod/v4";
|
|
21
24
|
|
|
22
25
|
//#region rolldown:runtime
|
|
@@ -24,7 +27,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
24
27
|
|
|
25
28
|
//#endregion
|
|
26
29
|
//#region package.json
|
|
27
|
-
var version$2 = "0.
|
|
30
|
+
var version$2 = "0.22.1";
|
|
28
31
|
|
|
29
32
|
//#endregion
|
|
30
33
|
//#region src/modules/schemas.ts
|
|
@@ -870,7 +873,7 @@ function getEffectivePatterns(_moduleId, modulePatterns, config) {
|
|
|
870
873
|
*
|
|
871
874
|
* 削除条件: ziku が別の UI フレームワーク(ink 等)に移行する場合。
|
|
872
875
|
*/
|
|
873
|
-
const version$1 = "0.
|
|
876
|
+
const version$1 = "0.22.1";
|
|
874
877
|
/** CLI の開始表示 */
|
|
875
878
|
function intro(command) {
|
|
876
879
|
const title = command ? `ziku ${command}` : "ziku";
|
|
@@ -1168,6 +1171,28 @@ function applyWordDiffAndColorize(lines) {
|
|
|
1168
1171
|
//#region src/utils/template.ts
|
|
1169
1172
|
const TEMPLATE_SOURCE = "gh:tktcorporation/.github";
|
|
1170
1173
|
/**
|
|
1174
|
+
* giget のキャッシュディレクトリが書き込み可能か確認し、不可能なら XDG_CACHE_HOME を
|
|
1175
|
+
* 書き込み可能な一時ディレクトリにフォールバックさせる。
|
|
1176
|
+
*
|
|
1177
|
+
* 背景: giget は内部で homedir()/.cache/giget にキャッシュを作成するが、
|
|
1178
|
+
* Codespaces 等の環境で homedir のキャッシュディレクトリに書き込み権限がない場合に
|
|
1179
|
+
* EACCES エラーが発生する。XDG_CACHE_HOME が設定済みなら giget はそちらを使うため、
|
|
1180
|
+
* フォールバック先として tmpdir を設定する。
|
|
1181
|
+
*
|
|
1182
|
+
* 呼び出し元: downloadTemplateToTemp(), fetchTemplates()
|
|
1183
|
+
* giget が XDG_CACHE_HOME 対応をやめれば不要になる。
|
|
1184
|
+
*/
|
|
1185
|
+
function ensureGigetCacheDir() {
|
|
1186
|
+
if (process.env.XDG_CACHE_HOME) return;
|
|
1187
|
+
const defaultCacheDir = resolve(homedir(), ".cache");
|
|
1188
|
+
try {
|
|
1189
|
+
if (!existsSync(defaultCacheDir)) mkdirSync(defaultCacheDir, { recursive: true });
|
|
1190
|
+
accessSync(defaultCacheDir, constants.W_OK);
|
|
1191
|
+
} catch {
|
|
1192
|
+
process.env.XDG_CACHE_HOME = resolve(tmpdir(), "giget-cache");
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1171
1196
|
* DevEnvConfig の source フィールドから giget 用のテンプレートソース文字列を構築する。
|
|
1172
1197
|
*
|
|
1173
1198
|
* 背景: giget は "gh:owner/repo" または "gh:owner/repo#ref" 形式を期待する。
|
|
@@ -1186,6 +1211,7 @@ function buildTemplateSource(source) {
|
|
|
1186
1211
|
*/
|
|
1187
1212
|
async function downloadTemplateToTemp(targetDir, source) {
|
|
1188
1213
|
const tempDir = join(targetDir, ".devenv-temp");
|
|
1214
|
+
ensureGigetCacheDir();
|
|
1189
1215
|
const { dir: templateDir } = await downloadTemplate(source ?? TEMPLATE_SOURCE, {
|
|
1190
1216
|
dir: tempDir,
|
|
1191
1217
|
force: true
|
|
@@ -1252,11 +1278,13 @@ async function fetchTemplates(options) {
|
|
|
1252
1278
|
const tempDir = join(targetDir, ".devenv-temp");
|
|
1253
1279
|
let templateDir;
|
|
1254
1280
|
try {
|
|
1255
|
-
if (shouldDownload)
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1281
|
+
if (shouldDownload) {
|
|
1282
|
+
ensureGigetCacheDir();
|
|
1283
|
+
templateDir = (await downloadTemplate(TEMPLATE_SOURCE, {
|
|
1284
|
+
dir: tempDir,
|
|
1285
|
+
force: true
|
|
1286
|
+
})).dir;
|
|
1287
|
+
} else templateDir = preDownloadedDir;
|
|
1260
1288
|
const gitignore = await loadMergedGitignore([targetDir, templateDir]);
|
|
1261
1289
|
for (const moduleId of modules) {
|
|
1262
1290
|
const moduleDef = moduleList ? moduleList.find((m) => m.id === moduleId) : getModuleById(moduleId);
|
|
@@ -2038,7 +2066,7 @@ async function hashFiles(dir, patterns) {
|
|
|
2038
2066
|
|
|
2039
2067
|
//#endregion
|
|
2040
2068
|
//#region src/commands/init.ts
|
|
2041
|
-
const version = "0.
|
|
2069
|
+
const version = "0.22.1";
|
|
2042
2070
|
const initCommand = defineCommand({
|
|
2043
2071
|
meta: {
|
|
2044
2072
|
name: "ziku",
|
|
@@ -2396,7 +2424,15 @@ function threeWayMerge({ base, local, template, filePath }) {
|
|
|
2396
2424
|
const jsonResult = mergeJsonContent(base, local, template);
|
|
2397
2425
|
if (jsonResult !== null) return jsonResult;
|
|
2398
2426
|
}
|
|
2399
|
-
|
|
2427
|
+
if (filePath && isTomlFile(filePath)) {
|
|
2428
|
+
const tomlResult = mergeTomlContent(base, local, template);
|
|
2429
|
+
if (tomlResult !== null) return tomlResult;
|
|
2430
|
+
}
|
|
2431
|
+
if (filePath && isYamlFile(filePath)) {
|
|
2432
|
+
const yamlResult = mergeYamlContent(base, local, template);
|
|
2433
|
+
if (yamlResult !== null) return yamlResult;
|
|
2434
|
+
}
|
|
2435
|
+
return textThreeWayMerge(base, local, template, filePath);
|
|
2400
2436
|
}
|
|
2401
2437
|
/**
|
|
2402
2438
|
* JSON/JSONC ファイルをキーレベルで 3-way マージする。
|
|
@@ -2528,10 +2564,164 @@ function deepEqual(a, b) {
|
|
|
2528
2564
|
if (aKeys.length !== bKeys.length) return false;
|
|
2529
2565
|
return aKeys.every((key) => key in bObj && deepEqual(aObj[key], bObj[key]));
|
|
2530
2566
|
}
|
|
2567
|
+
/**
|
|
2568
|
+
* TOML ファイルをキーレベルで 3-way マージする。
|
|
2569
|
+
*
|
|
2570
|
+
* 背景: TOML ファイルにコンフリクトマーカーを挿入するとパーサーが壊れるため、
|
|
2571
|
+
* JSON マージと同様にキーレベルで変更を検出し、非コンフリクト部分を自動マージする。
|
|
2572
|
+
* コンフリクトがあるキーはローカル値を採用し、conflictDetails で報告する。
|
|
2573
|
+
*
|
|
2574
|
+
* 制約: smol-toml の stringify はコメントを保持しないため、マージ結果では
|
|
2575
|
+
* ローカルのコメントが失われる。ただし、壊れた TOML を出力するよりも
|
|
2576
|
+
* 正しい TOML を出力することを優先する。
|
|
2577
|
+
*
|
|
2578
|
+
* @returns マージ結果。TOML パースに失敗した場合は null(テキストマージにフォールバック)。
|
|
2579
|
+
*/
|
|
2580
|
+
function mergeTomlContent(base, local, template) {
|
|
2581
|
+
let baseObj;
|
|
2582
|
+
let localObj;
|
|
2583
|
+
let templateObj;
|
|
2584
|
+
try {
|
|
2585
|
+
baseObj = TOML.parse(base);
|
|
2586
|
+
localObj = TOML.parse(local);
|
|
2587
|
+
templateObj = TOML.parse(template);
|
|
2588
|
+
} catch {
|
|
2589
|
+
return null;
|
|
2590
|
+
}
|
|
2591
|
+
const templateDiffs = getJsonDiffs(baseObj, templateObj);
|
|
2592
|
+
const localDiffs = getJsonDiffs(baseObj, localObj);
|
|
2593
|
+
const mergedObj = structuredClone(localObj);
|
|
2594
|
+
const conflictDetails = [];
|
|
2595
|
+
for (const diff of templateDiffs) {
|
|
2596
|
+
if (localDiffs.some((ld) => pathsOverlap(ld.path, diff.path))) {
|
|
2597
|
+
const localVal = getValueAtPath(localObj, diff.path);
|
|
2598
|
+
const templateVal = diff.type === "remove" ? void 0 : diff.value;
|
|
2599
|
+
if (deepEqual(localVal, templateVal)) continue;
|
|
2600
|
+
conflictDetails.push({
|
|
2601
|
+
path: diff.path,
|
|
2602
|
+
localValue: localVal,
|
|
2603
|
+
templateValue: templateVal
|
|
2604
|
+
});
|
|
2605
|
+
continue;
|
|
2606
|
+
}
|
|
2607
|
+
if (diff.type === "remove") deleteAtPath(mergedObj, diff.path);
|
|
2608
|
+
else setAtPath(mergedObj, diff.path, diff.value);
|
|
2609
|
+
}
|
|
2610
|
+
return {
|
|
2611
|
+
content: TOML.stringify(mergedObj),
|
|
2612
|
+
hasConflicts: conflictDetails.length > 0,
|
|
2613
|
+
conflictDetails
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2616
|
+
/**
|
|
2617
|
+
* YAML ファイルをキーレベルで 3-way マージする。
|
|
2618
|
+
*
|
|
2619
|
+
* 背景: YAML ファイルもインデントベースの構造を持ち、テキストマージで
|
|
2620
|
+
* 壊れることがある。JSON/TOML と同様にキーレベルでマージする。
|
|
2621
|
+
*
|
|
2622
|
+
* @returns マージ結果。YAML パースに失敗した場合は null(テキストマージにフォールバック)。
|
|
2623
|
+
*/
|
|
2624
|
+
function mergeYamlContent(base, local, template) {
|
|
2625
|
+
let baseObj;
|
|
2626
|
+
let localObj;
|
|
2627
|
+
let templateObj;
|
|
2628
|
+
try {
|
|
2629
|
+
baseObj = YAML.parse(base);
|
|
2630
|
+
localObj = YAML.parse(local);
|
|
2631
|
+
templateObj = YAML.parse(template);
|
|
2632
|
+
} catch {
|
|
2633
|
+
return null;
|
|
2634
|
+
}
|
|
2635
|
+
if (baseObj == null || localObj == null || templateObj == null) return null;
|
|
2636
|
+
if (typeof baseObj !== "object" || typeof localObj !== "object" || typeof templateObj !== "object") return null;
|
|
2637
|
+
const templateDiffs = getJsonDiffs(baseObj, templateObj);
|
|
2638
|
+
const localDiffs = getJsonDiffs(baseObj, localObj);
|
|
2639
|
+
const mergedObj = structuredClone(localObj);
|
|
2640
|
+
const conflictDetails = [];
|
|
2641
|
+
for (const diff of templateDiffs) {
|
|
2642
|
+
if (localDiffs.some((ld) => pathsOverlap(ld.path, diff.path))) {
|
|
2643
|
+
const localVal = getValueAtPath(localObj, diff.path);
|
|
2644
|
+
const templateVal = diff.type === "remove" ? void 0 : diff.value;
|
|
2645
|
+
if (deepEqual(localVal, templateVal)) continue;
|
|
2646
|
+
conflictDetails.push({
|
|
2647
|
+
path: diff.path,
|
|
2648
|
+
localValue: localVal,
|
|
2649
|
+
templateValue: templateVal
|
|
2650
|
+
});
|
|
2651
|
+
continue;
|
|
2652
|
+
}
|
|
2653
|
+
if (diff.type === "remove") deleteAtPath(mergedObj, diff.path);
|
|
2654
|
+
else setAtPath(mergedObj, diff.path, diff.value);
|
|
2655
|
+
}
|
|
2656
|
+
return {
|
|
2657
|
+
content: YAML.stringify(mergedObj),
|
|
2658
|
+
hasConflicts: conflictDetails.length > 0,
|
|
2659
|
+
conflictDetails
|
|
2660
|
+
};
|
|
2661
|
+
}
|
|
2662
|
+
/**
|
|
2663
|
+
* ネストされたオブジェクトのパスに値を設定する。
|
|
2664
|
+
* 中間オブジェクトが存在しない場合は自動的に作成する。
|
|
2665
|
+
*/
|
|
2666
|
+
function setAtPath(obj, path, value) {
|
|
2667
|
+
let current = obj;
|
|
2668
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
2669
|
+
const key = path[i];
|
|
2670
|
+
if (current == null || typeof current !== "object") return;
|
|
2671
|
+
const record = current;
|
|
2672
|
+
if (!(key in record) || record[key] == null || typeof record[key] !== "object") record[key] = {};
|
|
2673
|
+
current = record[key];
|
|
2674
|
+
}
|
|
2675
|
+
if (current != null && typeof current === "object") current[path[path.length - 1]] = value;
|
|
2676
|
+
}
|
|
2677
|
+
/**
|
|
2678
|
+
* ネストされたオブジェクトのパスにあるキーを削除する。
|
|
2679
|
+
*/
|
|
2680
|
+
function deleteAtPath(obj, path) {
|
|
2681
|
+
let current = obj;
|
|
2682
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
2683
|
+
const key = path[i];
|
|
2684
|
+
if (current == null || typeof current !== "object") return;
|
|
2685
|
+
current = current[key];
|
|
2686
|
+
}
|
|
2687
|
+
if (current != null && typeof current === "object") delete current[path[path.length - 1]];
|
|
2688
|
+
}
|
|
2531
2689
|
function isJsonFile(filePath) {
|
|
2532
2690
|
const lower = filePath.toLowerCase();
|
|
2533
2691
|
return lower.endsWith(".json") || lower.endsWith(".jsonc");
|
|
2534
2692
|
}
|
|
2693
|
+
function isTomlFile(filePath) {
|
|
2694
|
+
return filePath.toLowerCase().endsWith(".toml");
|
|
2695
|
+
}
|
|
2696
|
+
function isYamlFile(filePath) {
|
|
2697
|
+
const lower = filePath.toLowerCase();
|
|
2698
|
+
return lower.endsWith(".yml") || lower.endsWith(".yaml");
|
|
2699
|
+
}
|
|
2700
|
+
/**
|
|
2701
|
+
* 構造ファイル(TOML/YAML)のマージ結果をパースして妥当性を検証する。
|
|
2702
|
+
*
|
|
2703
|
+
* 背景: テキストベースの diff/patch は行レベルでマージするため、
|
|
2704
|
+
* fuzz factor でパッチが「成功」しても、TOML のセクション重複や
|
|
2705
|
+
* YAML のインデント崩れ等、構造的に壊れた出力を生むことがある。
|
|
2706
|
+
* git の merge がこのような破損を出さないのに対し、patch ベースの
|
|
2707
|
+
* マージはこの検証が必要。パース失敗時はコンフリクトマーカーに
|
|
2708
|
+
* フォールバックすることで、壊れたファイルの生成を防ぐ。
|
|
2709
|
+
*/
|
|
2710
|
+
function validateStructuredContent(content, filePath) {
|
|
2711
|
+
if (isTomlFile(filePath)) try {
|
|
2712
|
+
TOML.parse(content);
|
|
2713
|
+
return true;
|
|
2714
|
+
} catch {
|
|
2715
|
+
return false;
|
|
2716
|
+
}
|
|
2717
|
+
if (isYamlFile(filePath)) try {
|
|
2718
|
+
YAML.parse(content);
|
|
2719
|
+
return true;
|
|
2720
|
+
} catch {
|
|
2721
|
+
return false;
|
|
2722
|
+
}
|
|
2723
|
+
return true;
|
|
2724
|
+
}
|
|
2535
2725
|
/**
|
|
2536
2726
|
* テキストファイルの 3-way マージ。fuzz factor によるパッチ適用と
|
|
2537
2727
|
* hunk 単位のコンフリクトマーカーで、従来のファイル全体マーカーを改善。
|
|
@@ -2539,25 +2729,36 @@ function isJsonFile(filePath) {
|
|
|
2539
2729
|
* 背景: TOML 等の構造ファイルにファイル全体のコンフリクトマーカーを入れると
|
|
2540
2730
|
* パーサーが壊れる。hunk 単位にすることで影響範囲を最小化する。
|
|
2541
2731
|
*
|
|
2732
|
+
* filePath が渡された場合、パッチ適用後に構造ファイルの妥当性を検証する。
|
|
2733
|
+
* fuzz factor でパッチが「成功」しても、TOML のセクション重複等で
|
|
2734
|
+
* 壊れたファイルが生成されることがあるため、パース検証で検出して
|
|
2735
|
+
* コンフリクトマーカーにフォールバックする。
|
|
2736
|
+
*
|
|
2542
2737
|
* 戦略:
|
|
2543
|
-
* 1. 標準パッチ適用(fuzz=0
|
|
2544
|
-
* 2. fuzz factor を上げてリトライ(fuzz=2
|
|
2738
|
+
* 1. 標準パッチ適用(fuzz=0)+ 構造検証
|
|
2739
|
+
* 2. fuzz factor を上げてリトライ(fuzz=2)+ 構造検証
|
|
2545
2740
|
* 3. 失敗時: hunk 単位で適用を試み、失敗した hunk のみにマーカーを付与
|
|
2546
2741
|
*/
|
|
2547
|
-
function textThreeWayMerge(base, local, template) {
|
|
2742
|
+
function textThreeWayMerge(base, local, template, filePath) {
|
|
2548
2743
|
const patch = createPatch("file", base, template);
|
|
2549
2744
|
const result = applyPatch(local, patch);
|
|
2550
|
-
if (typeof result === "string")
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2745
|
+
if (typeof result === "string") {
|
|
2746
|
+
if (filePath && !validateStructuredContent(result, filePath)) return mergeWithPerHunkMarkers(base, local, template);
|
|
2747
|
+
return {
|
|
2748
|
+
content: result,
|
|
2749
|
+
hasConflicts: false,
|
|
2750
|
+
conflictDetails: []
|
|
2751
|
+
};
|
|
2752
|
+
}
|
|
2555
2753
|
const resultFuzzy = applyPatch(local, patch, { fuzzFactor: 2 });
|
|
2556
|
-
if (typeof resultFuzzy === "string")
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2754
|
+
if (typeof resultFuzzy === "string") {
|
|
2755
|
+
if (filePath && !validateStructuredContent(resultFuzzy, filePath)) return mergeWithPerHunkMarkers(base, local, template);
|
|
2756
|
+
return {
|
|
2757
|
+
content: resultFuzzy,
|
|
2758
|
+
hasConflicts: false,
|
|
2759
|
+
conflictDetails: []
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2561
2762
|
return mergeWithPerHunkMarkers(base, local, template);
|
|
2562
2763
|
}
|
|
2563
2764
|
/**
|
|
@@ -3364,10 +3565,10 @@ const pushCommand = defineCommand({
|
|
|
3364
3565
|
const mergedContents = /* @__PURE__ */ new Map();
|
|
3365
3566
|
let pushableFilePaths = /* @__PURE__ */ new Set();
|
|
3366
3567
|
{
|
|
3367
|
-
const { hashFiles: hashFiles$1 } = await import("./hash-
|
|
3368
|
-
const { classifyFiles: classifyFiles$1 } = await import("./merge-
|
|
3369
|
-
const { getModuleById: getModuleById$1 } = await import("./modules-
|
|
3370
|
-
const { getEffectivePatterns: getEffectivePatterns$1 } = await import("./patterns-
|
|
3568
|
+
const { hashFiles: hashFiles$1 } = await import("./hash-BeQ4-IoO.mjs");
|
|
3569
|
+
const { classifyFiles: classifyFiles$1 } = await import("./merge-DtLUiQDW.mjs");
|
|
3570
|
+
const { getModuleById: getModuleById$1 } = await import("./modules-BN0Qb_wy.mjs");
|
|
3571
|
+
const { getEffectivePatterns: getEffectivePatterns$1 } = await import("./patterns-BKEQ73qt.mjs");
|
|
3371
3572
|
const allPatterns = [];
|
|
3372
3573
|
for (const moduleId of effectiveModuleIds) {
|
|
3373
3574
|
const mod = getModuleById$1(moduleId, moduleList);
|
|
@@ -3390,14 +3591,14 @@ const pushCommand = defineCommand({
|
|
|
3390
3591
|
for (const file of classification.autoUpdate) log.message(` ${pc$1.dim("↓")} ${pc$1.dim(file)}`);
|
|
3391
3592
|
}
|
|
3392
3593
|
if (classification.conflicts.length > 0) {
|
|
3393
|
-
const { threeWayMerge: threeWayMerge$1, asBaseContent: asBaseContent$1, asLocalContent: asLocalContent$1, asTemplateContent: asTemplateContent$1 } = await import("./merge-
|
|
3594
|
+
const { threeWayMerge: threeWayMerge$1, asBaseContent: asBaseContent$1, asLocalContent: asLocalContent$1, asTemplateContent: asTemplateContent$1 } = await import("./merge-DtLUiQDW.mjs");
|
|
3394
3595
|
const baseInfo = config.baseRef ? `since ${pc$1.bold(config.baseRef.slice(0, 7))} (your last sync)` : "since your last pull/init";
|
|
3395
3596
|
log.warn(`Template updated ${baseInfo} — ${classification.conflicts.length} conflict(s) detected, attempting auto-merge...`);
|
|
3396
3597
|
let baseTemplateDir;
|
|
3397
3598
|
let baseCleanup;
|
|
3398
3599
|
if (config.baseRef) try {
|
|
3399
3600
|
log.info(`Downloading base version (${config.baseRef.slice(0, 7)}...) for merge...`);
|
|
3400
|
-
const { downloadTemplateToTemp: downloadBase } = await import("./template-
|
|
3601
|
+
const { downloadTemplateToTemp: downloadBase } = await import("./template-BmUA_WdM.mjs");
|
|
3401
3602
|
const baseResult = await downloadBase(targetDir, `gh:${config.source.owner}/${config.source.repo}#${config.baseRef}`);
|
|
3402
3603
|
baseTemplateDir = baseResult.templateDir;
|
|
3403
3604
|
baseCleanup = baseResult.cleanup;
|
|
@@ -3822,4 +4023,4 @@ async function run() {
|
|
|
3822
4023
|
run();
|
|
3823
4024
|
|
|
3824
4025
|
//#endregion
|
|
3825
|
-
export {
|
|
4026
|
+
export { getPatternsByModuleIds as C, loadModulesFile as D, getModulesFilePath as E, modulesFileExists as O, getModuleById as S, addPatternToModulesFileWithCreate as T, writeFileWithStrategy as _, hasConflictMarkers as a, resolvePatterns as b, mergeYamlContent as c, hashFiles as d, TEMPLATE_SOURCE as f, fetchTemplates as g, downloadTemplateToTemp as h, classifyFiles as i, saveModulesFile as k, threeWayMerge as l, copyFile as m, asLocalContent as n, mergeJsonContent as o, buildTemplateSource as p, asTemplateContent as r, mergeTomlContent as s, asBaseContent as t, hashContent as u, getEffectivePatterns as v, addPatternToModulesFile as w, defaultModules as x, matchesPatterns as y };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as hasConflictMarkers, c as mergeYamlContent, i as classifyFiles, l as threeWayMerge, n as asLocalContent, o as mergeJsonContent, r as asTemplateContent, s as mergeTomlContent, t as asBaseContent } from "./index.mjs";
|
|
2
|
+
|
|
3
|
+
export { asBaseContent, asLocalContent, asTemplateContent, classifyFiles, threeWayMerge };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { C as getPatternsByModuleIds, D as loadModulesFile, E as getModulesFilePath, O as modulesFileExists, S as getModuleById, T as addPatternToModulesFileWithCreate, k as saveModulesFile, w as addPatternToModulesFile, x as defaultModules } from "./index.mjs";
|
|
2
|
+
|
|
3
|
+
export { getModuleById };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziku",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "Interactive CLI to scaffold development environment templates",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"jsonc-parser": "^3.3.1",
|
|
31
31
|
"pathe": "^2.0.3",
|
|
32
32
|
"picocolors": "^1.1.1",
|
|
33
|
+
"smol-toml": "^1.6.0",
|
|
33
34
|
"tinyglobby": "^0.2.15",
|
|
34
35
|
"ts-pattern": "^5.9.0",
|
|
35
36
|
"yaml": "^2.8.2",
|
package/dist/hash-CjblHutQ.mjs
DELETED
package/dist/merge-CPx9nRrL.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { a as hasConflictMarkers, i as classifyFiles, n as asLocalContent, o as mergeJsonContent, r as asTemplateContent, s as threeWayMerge, t as asBaseContent } from "./index.mjs";
|
|
2
|
-
|
|
3
|
-
export { asBaseContent, asLocalContent, asTemplateContent, classifyFiles, threeWayMerge };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { C as addPatternToModulesFileWithCreate, D as saveModulesFile, E as modulesFileExists, S as addPatternToModulesFile, T as loadModulesFile, b as getModuleById, w as getModulesFilePath, x as getPatternsByModuleIds, y as defaultModules } from "./index.mjs";
|
|
2
|
-
|
|
3
|
-
export { getModuleById };
|