mellos-mapping 0.22.1 → 0.23.0
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/README.md +11 -4
- package/README.zh-CN.md +10 -4
- package/dist/hook-session-start.mjs +3 -1
- package/dist/mmap.mjs +1 -1
- package/dist/preview.mjs +41 -2
- package/dist/server.mjs +857 -412
- package/dist/store-paths.mjs +29 -1
- package/dist/terminal-worker.mjs +443 -300
- package/dist/watch.mjs +443 -300
- package/dist/web.mjs +176 -65
- package/docs/codex.md +7 -1
- package/docs/map-api.md +148 -0
- package/lib/domain/context.d.ts +11 -0
- package/lib/domain/context.js +27 -0
- package/lib/domain/text.js +11 -0
- package/lib/domain/types.d.ts +3 -0
- package/lib/store/format.js +18 -3
- package/lib/store/project.d.ts +2 -0
- package/lib/store/project.js +29 -0
- package/lib/store/store.d.ts +6 -1
- package/lib/store/store.js +6 -1
- package/lib/store/transaction.d.ts +12 -0
- package/lib/store/transaction.js +91 -0
- package/package.json +4 -2
- package/scripts/codex-register.mjs +1 -1
- package/scripts/mmap.mjs +1 -1
package/dist/store-paths.mjs
CHANGED
|
@@ -113,6 +113,33 @@ function quitFilePath(defaultFile, pid) {
|
|
|
113
113
|
// src/store/migration.ts
|
|
114
114
|
import { dirname as dirname4, join as join4 } from "node:path";
|
|
115
115
|
var LEGACY_STATE_FILE_RELATIVE_PATH = join4(".claude", "mellos-mapping.json");
|
|
116
|
+
|
|
117
|
+
// src/store/project.ts
|
|
118
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
119
|
+
import { dirname as dirname5, join as join5, resolve } from "node:path";
|
|
120
|
+
import { homedir, tmpdir } from "node:os";
|
|
121
|
+
function resolveProjectDirectory(cwd, stopAt = [homedir(), tmpdir()]) {
|
|
122
|
+
let start = resolve(cwd);
|
|
123
|
+
try {
|
|
124
|
+
start = realpathSync(start);
|
|
125
|
+
} catch {
|
|
126
|
+
}
|
|
127
|
+
let dir = start;
|
|
128
|
+
const boundaries = new Set(stopAt.map((path) => {
|
|
129
|
+
try {
|
|
130
|
+
return realpathSync(path);
|
|
131
|
+
} catch {
|
|
132
|
+
return resolve(path);
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
while (true) {
|
|
136
|
+
if (dir !== start && boundaries.has(dir)) return start;
|
|
137
|
+
if (existsSync(join5(dir, ".git")) || existsSync(join5(dir, ".mellos", "map.json")) || existsSync(join5(dir, ".mellos", "pages"))) return dir;
|
|
138
|
+
const parent = dirname5(dir);
|
|
139
|
+
if (parent === dir) return start;
|
|
140
|
+
dir = parent;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
116
143
|
export {
|
|
117
144
|
FOCUS_FILE_NAME,
|
|
118
145
|
ID_RULE,
|
|
@@ -122,5 +149,6 @@ export {
|
|
|
122
149
|
VIEWERS_DIR_NAME,
|
|
123
150
|
focusFilePath,
|
|
124
151
|
quitFilePath,
|
|
125
|
-
readLiveViewers
|
|
152
|
+
readLiveViewers,
|
|
153
|
+
resolveProjectDirectory
|
|
126
154
|
};
|