prizmkit 1.0.90 → 1.0.92
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/bundled/VERSION.json
CHANGED
|
@@ -93,6 +93,13 @@ branch_merge() {
|
|
|
93
93
|
local auto_push="${4:-0}"
|
|
94
94
|
|
|
95
95
|
# Step 1: Checkout original branch
|
|
96
|
+
# First commit any remaining dirty files so checkout is not blocked
|
|
97
|
+
local remaining_dirty
|
|
98
|
+
remaining_dirty=$(git -C "$project_root" status --porcelain 2>/dev/null || true)
|
|
99
|
+
if [[ -n "$remaining_dirty" ]]; then
|
|
100
|
+
git -C "$project_root" add -A 2>/dev/null || true
|
|
101
|
+
git -C "$project_root" commit --no-verify -m "chore: include pipeline state artifacts" 2>/dev/null || true
|
|
102
|
+
fi
|
|
96
103
|
if ! git -C "$project_root" checkout "$original_branch" 2>/dev/null; then
|
|
97
104
|
log_error "Failed to checkout $original_branch for merge"
|
|
98
105
|
return 1
|
package/package.json
CHANGED
package/src/scaffold.js
CHANGED
|
@@ -680,8 +680,9 @@ export async function installPipeline(projectRoot, dryRun, { forceOverwrite = fa
|
|
|
680
680
|
/**
|
|
681
681
|
* 生成 .gitignore
|
|
682
682
|
*/
|
|
683
|
-
async function installGitignore(projectRoot, options, dryRun) {
|
|
683
|
+
export async function installGitignore(projectRoot, options, dryRun) {
|
|
684
684
|
const targetPath = path.join(projectRoot, '.gitignore');
|
|
685
|
+
const MODELS_ENTRY = '.prizmkit/available-models.json';
|
|
685
686
|
|
|
686
687
|
if (dryRun) {
|
|
687
688
|
console.log(chalk.gray(` [dry-run] .gitignore`));
|
|
@@ -689,12 +690,21 @@ async function installGitignore(projectRoot, options, dryRun) {
|
|
|
689
690
|
}
|
|
690
691
|
|
|
691
692
|
if (await fs.pathExists(targetPath)) {
|
|
692
|
-
// 追加 PrizmKit 相关条目
|
|
693
693
|
const existing = await fs.readFile(targetPath, 'utf8');
|
|
694
|
+
|
|
695
|
+
// If .prizmkit/ (whole dir) is already ignored, available-models.json is covered
|
|
694
696
|
if (existing.includes('.prizmkit/')) {
|
|
697
|
+
console.log(chalk.yellow(` ⚠ .gitignore 已包含 .prizmkit/ 条目,跳过`));
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// If the specific entry is already present, nothing to do
|
|
702
|
+
if (existing.includes(MODELS_ENTRY)) {
|
|
695
703
|
console.log(chalk.yellow(` ⚠ .gitignore 已包含 PrizmKit 条目,跳过`));
|
|
696
704
|
return;
|
|
697
705
|
}
|
|
706
|
+
|
|
707
|
+
// No PrizmKit entries at all — append full .prizmkit/ block
|
|
698
708
|
const prizmkitSection = '\n\n# PrizmKit\n.prizmkit/\n';
|
|
699
709
|
await fs.appendFile(targetPath, prizmkitSection);
|
|
700
710
|
console.log(chalk.green(` ✓ .gitignore (追加 PrizmKit 条目)`));
|
package/src/upgrade.js
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
installPrizmkitScripts,
|
|
29
29
|
installGitHook,
|
|
30
30
|
installPostMergeHook,
|
|
31
|
+
installGitignore,
|
|
31
32
|
resolvePipelineFileList,
|
|
32
33
|
} from './scaffold.js';
|
|
33
34
|
|
|
@@ -364,6 +365,10 @@ export async function runUpgrade(directory, options = {}) {
|
|
|
364
365
|
await installGitHook(projectRoot, dryRun);
|
|
365
366
|
await installPostMergeHook(projectRoot, dryRun);
|
|
366
367
|
|
|
368
|
+
// .gitignore
|
|
369
|
+
console.log(chalk.blue(' Gitignore:'));
|
|
370
|
+
await installGitignore(projectRoot, { pipeline }, dryRun);
|
|
371
|
+
|
|
367
372
|
// PrizmKit scripts
|
|
368
373
|
console.log(chalk.blue(' PrizmKit Scripts:'));
|
|
369
374
|
await installPrizmkitScripts(projectRoot, dryRun);
|