openmoneta-dev-kit 2.0.1 → 2.0.2
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/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.2
|
|
@@ -16,6 +16,10 @@ INPUT_JSON=$(cat 2>/dev/null || echo '{}')
|
|
|
16
16
|
register_project_cursor() {
|
|
17
17
|
local ws="$1"
|
|
18
18
|
[[ -n "$ws" && -f "$ws/docs/INDEX.md" ]] || return 0
|
|
19
|
+
# Bỏ qua repo nguồn của chính kit (tránh update --all-projects đè docs bespoke).
|
|
20
|
+
if [[ -f "$ws/package.json" ]] && grep -q '"name": *"openmoneta-dev-kit"' "$ws/package.json" 2>/dev/null; then
|
|
21
|
+
return 0
|
|
22
|
+
fi
|
|
19
23
|
[[ -f "$HOME/.cursor/.openmoneta-version" ]] || return 0
|
|
20
24
|
local reg="$HOME/.cursor/.openmoneta-projects"
|
|
21
25
|
local abs
|
|
@@ -454,6 +454,13 @@ function clearVerifyLoop(root: string) {
|
|
|
454
454
|
function registerProjectOpenCode(root: string) {
|
|
455
455
|
try {
|
|
456
456
|
if (!fs.existsSync(path.join(root, "docs", "INDEX.md"))) return
|
|
457
|
+
// Bỏ qua repo nguồn của chính kit (tránh update --all-projects đè docs bespoke).
|
|
458
|
+
try {
|
|
459
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"))
|
|
460
|
+
if (pkg && pkg.name === "openmoneta-dev-kit") return
|
|
461
|
+
} catch {
|
|
462
|
+
// không có package.json hợp lệ → không phải repo nguồn, tiếp tục
|
|
463
|
+
}
|
|
457
464
|
const home = process.env.HOME || process.env.USERPROFILE || ""
|
|
458
465
|
const xdg = process.env.XDG_CONFIG_HOME || path.join(home, ".config")
|
|
459
466
|
const ocHome = path.join(xdg, "opencode")
|
|
@@ -511,7 +518,7 @@ export const OpenMonetaGuard = async (ctx: GuardContext) => {
|
|
|
511
518
|
{
|
|
512
519
|
loaded_at: new Date().toISOString(),
|
|
513
520
|
root,
|
|
514
|
-
version: "2.0.
|
|
521
|
+
version: "2.0.2",
|
|
515
522
|
load_count: globalState[globalKey],
|
|
516
523
|
},
|
|
517
524
|
null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openmoneta-dev-kit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "OpenMoneta Dev Kit — Biến Cursor IDE / OpenCode thành team developer hoàn chỉnh với quy trình 6 bước, adaptive planning, hooks enforcement, và token-aware doc routing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cursor",
|
package/src/commands/update.js
CHANGED
|
@@ -13,6 +13,18 @@ function isOpenmonetaProject(dir) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// Repo nguồn của chính kit (package.json name == openmoneta-dev-kit). Consumer
|
|
17
|
+
// project không có chữ ký này. Dùng để KHÔNG re-render init lên repo nguồn,
|
|
18
|
+
// tránh đè docs bespoke của kit (docs/INDEX.md, plans/INDEX.md, decisions/).
|
|
19
|
+
function isKitRepo(dir) {
|
|
20
|
+
try {
|
|
21
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(dir, "package.json"), "utf8"))
|
|
22
|
+
return pkg && pkg.name === "openmoneta-dev-kit"
|
|
23
|
+
} catch {
|
|
24
|
+
return false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
function readRegistry() {
|
|
17
29
|
const seen = new Set()
|
|
18
30
|
for (const target of ["cursor", "opencode"]) {
|
|
@@ -49,7 +61,7 @@ function pruneRegistry() {
|
|
|
49
61
|
for (const line of content.split("\n")) {
|
|
50
62
|
const p = line.trim()
|
|
51
63
|
if (!p) continue
|
|
52
|
-
if (isOpenmonetaProject(p)) kept.push(p)
|
|
64
|
+
if (isOpenmonetaProject(p) && !isKitRepo(p)) kept.push(p)
|
|
53
65
|
else pruned++
|
|
54
66
|
}
|
|
55
67
|
fs.writeFileSync(reg, kept.length ? kept.join("\n") + "\n" : "")
|
|
@@ -254,8 +266,8 @@ async function run(args) {
|
|
|
254
266
|
const pruned = pruneRegistry()
|
|
255
267
|
if (pruned > 0) console.log(`\n ℹ Registry: prune ${pruned} entry chết.`)
|
|
256
268
|
|
|
257
|
-
const projects = readRegistry()
|
|
258
|
-
if (isOpenmonetaProject(cwd) && !projects.includes(fs.realpathSync(cwd))) {
|
|
269
|
+
const projects = readRegistry().filter((p) => !isKitRepo(p))
|
|
270
|
+
if (isOpenmonetaProject(cwd) && !isKitRepo(cwd) && !projects.includes(fs.realpathSync(cwd))) {
|
|
259
271
|
projects.push(fs.realpathSync(cwd))
|
|
260
272
|
}
|
|
261
273
|
|
|
@@ -280,9 +292,13 @@ async function run(args) {
|
|
|
280
292
|
} else {
|
|
281
293
|
try {
|
|
282
294
|
fs.accessSync(path.join(cwd, "docs", "INDEX.md"))
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
295
|
+
if (isKitRepo(cwd)) {
|
|
296
|
+
console.log(`\n ℹ Bỏ qua sync: đây là repo nguồn OpenMoneta Dev Kit (không re-render lên chính nó).`)
|
|
297
|
+
} else {
|
|
298
|
+
console.log(`\n ▶ Syncing project: ${path.basename(cwd)}`)
|
|
299
|
+
syncProject(initScript, cwd)
|
|
300
|
+
console.log(`\n ✅ Project synced.`)
|
|
301
|
+
}
|
|
286
302
|
} catch (err) {
|
|
287
303
|
if (isWindows()) {
|
|
288
304
|
console.log(`\n ⚠ Không thể sync project (cần Git Bash). Cài tại: https://git-scm.com/download/win`)
|
|
@@ -294,7 +310,7 @@ async function run(args) {
|
|
|
294
310
|
}
|
|
295
311
|
|
|
296
312
|
const others = readRegistry().filter(
|
|
297
|
-
(p) => isOpenmonetaProject(p) && !(isOpenmonetaProject(cwd) && p === fs.realpathSync(cwd))
|
|
313
|
+
(p) => isOpenmonetaProject(p) && !isKitRepo(p) && !(isOpenmonetaProject(cwd) && p === fs.realpathSync(cwd))
|
|
298
314
|
)
|
|
299
315
|
if (others.length > 0) {
|
|
300
316
|
console.log(`\n ℹ Có ${others.length} project khác trong registry chưa sync. Sync tất cả:`)
|
|
@@ -308,5 +324,5 @@ async function run(args) {
|
|
|
308
324
|
|
|
309
325
|
module.exports = {
|
|
310
326
|
run,
|
|
311
|
-
_internal: { isOpenmonetaProject, readRegistry, pruneRegistry, findProjects, scanSeed },
|
|
327
|
+
_internal: { isOpenmonetaProject, isKitRepo, readRegistry, pruneRegistry, findProjects, scanSeed },
|
|
312
328
|
}
|