sticky-note-cli 3.1.32 → 3.1.33
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/bin/cli.js +22 -7
- package/package.json +1 -1
- package/sticky-server/.wrangler/state/v3/observability/miniflare-wobs-trace-store/a590acd76969f996ec6e4b599c3c09f58c283a76f2d61392b5d3046caf557602.sqlite-shm +0 -0
- package/sticky-server/.wrangler/state/v3/observability/miniflare-wobs-trace-store/a590acd76969f996ec6e4b599c3c09f58c283a76f2d61392b5d3046caf557602.sqlite-wal +0 -0
package/bin/cli.js
CHANGED
|
@@ -4744,27 +4744,42 @@ async function _cmdMigrateDataBranch() {
|
|
|
4744
4744
|
print(" [WARN] Could not commit to data branch: " + err.message);
|
|
4745
4745
|
}
|
|
4746
4746
|
|
|
4747
|
-
// Step 3: Add .sticky-note
|
|
4747
|
+
// Step 3: Add data files to .gitignore — but NOT sticky-note-config.json.
|
|
4748
|
+
// sticky-note-config.json must stay committed so teammates get sticky_url
|
|
4749
|
+
// on git pull (which triggers the API key prompt in `npx sticky-note init`).
|
|
4748
4750
|
print("");
|
|
4749
4751
|
const gitignorePath = path.join(cwd, ".gitignore");
|
|
4750
4752
|
const MARKER = "# sticky-note: data branch migration";
|
|
4751
|
-
|
|
4753
|
+
// Ignore only the data files, not the whole directory.
|
|
4754
|
+
const IGNORE_LINES = [
|
|
4755
|
+
".sticky-note/sticky-note.json",
|
|
4756
|
+
".sticky-note/audit/",
|
|
4757
|
+
".sticky-note/presence/",
|
|
4758
|
+
];
|
|
4752
4759
|
let gitignoreUpdated = false;
|
|
4753
4760
|
if (fs.existsSync(gitignorePath)) {
|
|
4754
4761
|
const existing = fs.readFileSync(gitignorePath, "utf-8");
|
|
4755
4762
|
const gitignoreLines = existing.split(/\r?\n/).map(l => l.trim());
|
|
4756
|
-
if
|
|
4757
|
-
|
|
4763
|
+
// Also clean up the old broad ignore if present from a previous migration run
|
|
4764
|
+
const hasBroad = gitignoreLines.includes(".sticky-note/");
|
|
4765
|
+
const missingLines = IGNORE_LINES.filter(l => !gitignoreLines.includes(l));
|
|
4766
|
+
if (hasBroad) {
|
|
4767
|
+
// Replace the broad ignore with specific lines
|
|
4768
|
+
const replaced = existing.replace(/\.sticky-note\/\n?/, IGNORE_LINES.join("\n") + "\n");
|
|
4769
|
+
fs.writeFileSync(gitignorePath, replaced, "utf-8");
|
|
4770
|
+
gitignoreUpdated = true;
|
|
4771
|
+
} else if (missingLines.length > 0) {
|
|
4772
|
+
fs.appendFileSync(gitignorePath, "\n" + MARKER + "\n" + missingLines.join("\n") + "\n");
|
|
4758
4773
|
gitignoreUpdated = true;
|
|
4759
4774
|
}
|
|
4760
4775
|
} else {
|
|
4761
|
-
fs.writeFileSync(gitignorePath, MARKER + "\n" +
|
|
4776
|
+
fs.writeFileSync(gitignorePath, MARKER + "\n" + IGNORE_LINES.join("\n") + "\n");
|
|
4762
4777
|
gitignoreUpdated = true;
|
|
4763
4778
|
}
|
|
4764
4779
|
if (gitignoreUpdated) {
|
|
4765
|
-
print(" [OK]
|
|
4780
|
+
print(" [OK] .gitignore: ignoring data files only (sticky-note-config.json stays committed)");
|
|
4766
4781
|
} else {
|
|
4767
|
-
print(" [OK] .gitignore already
|
|
4782
|
+
print(" [OK] .gitignore already up to date");
|
|
4768
4783
|
}
|
|
4769
4784
|
|
|
4770
4785
|
// Step 4: Remove sticky-note pre-commit and post-commit hooks
|
package/package.json
CHANGED
|
Binary file
|