@fenglimg/fabric-shared 2.2.0-rc.4 → 2.2.0-rc.8
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/chunk-2GLIAZ5M.js +251 -0
- package/dist/{chunk-355LUDLW.js → chunk-5AKCRBKJ.js} +474 -418
- package/dist/{chunk-KUYCTRFI.js → chunk-B2N3I7UX.js} +390 -532
- package/dist/chunk-BDJQIOQO.js +206 -0
- package/dist/{chunk-4N6DMOOW.js → chunk-C7WZPYZE.js} +2 -1
- package/dist/{chunk-VDSM73PK.js → chunk-O6GIHZF3.js} +6 -0
- package/dist/errors/index.d.ts +6 -1
- package/dist/errors/index.js +5 -3
- package/dist/i18n/index.d.ts +29 -23
- package/dist/i18n/index.js +7 -3
- package/dist/{index-BqA89S9q.d.ts → index-SrmixArL.d.ts} +83 -28
- package/dist/index.d.ts +490 -549
- package/dist/index.js +1277 -1026
- package/dist/node/atomic-write.js +1 -1
- package/dist/node/mcp-payload-guard.js +1 -1
- package/dist/node.d.ts +10 -1
- package/dist/node.js +32 -1
- package/dist/schemas/api-contracts.d.ts +163 -113
- package/dist/schemas/api-contracts.js +3 -3
- package/dist/templates/bootstrap-canonical.d.ts +50 -23
- package/dist/templates/bootstrap-canonical.js +12 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/types-qg4xXVuT.d.ts +8 -0
- package/package.json +3 -2
- package/dist/chunk-AFT7DB4P.js +0 -103
package/dist/node.d.ts
CHANGED
|
@@ -11,4 +11,13 @@ type FrameworkInfo = {
|
|
|
11
11
|
type TechProfile = FrameworkInfo;
|
|
12
12
|
declare function detectFramework(root: string): FrameworkInfo;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface ServeLockState {
|
|
15
|
+
pid: number;
|
|
16
|
+
acquiredAt: number;
|
|
17
|
+
host?: string;
|
|
18
|
+
}
|
|
19
|
+
declare function serveLockPath(projectRoot: string): string;
|
|
20
|
+
declare function isAlive(pid: number): boolean;
|
|
21
|
+
declare function readServeLockState(projectRoot: string): ServeLockState | null;
|
|
22
|
+
|
|
23
|
+
export { type FrameworkInfo, type ServeLockState, type TechProfile, detectFramework, isAlive, readServeLockState, serveLockPath };
|
package/dist/node.js
CHANGED
|
@@ -170,6 +170,37 @@ function collectProjectFileEvidence(root, relativePaths) {
|
|
|
170
170
|
function compactStrings(values) {
|
|
171
171
|
return [...new Set(values.filter((value) => value !== null && value !== void 0 && value.length > 0))];
|
|
172
172
|
}
|
|
173
|
+
|
|
174
|
+
// src/node/serve-lock.ts
|
|
175
|
+
import fs from "fs";
|
|
176
|
+
import path from "path";
|
|
177
|
+
var SERVE_LOCK_FILENAME = ".serve.lock";
|
|
178
|
+
function serveLockPath(projectRoot) {
|
|
179
|
+
return path.join(projectRoot, ".fabric", SERVE_LOCK_FILENAME);
|
|
180
|
+
}
|
|
181
|
+
function isAlive(pid) {
|
|
182
|
+
try {
|
|
183
|
+
process.kill(pid, 0);
|
|
184
|
+
return true;
|
|
185
|
+
} catch (e) {
|
|
186
|
+
const err = e;
|
|
187
|
+
if (err.code === "ESRCH") return false;
|
|
188
|
+
if (err.code === "EPERM") return true;
|
|
189
|
+
throw e;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function readServeLockState(projectRoot) {
|
|
193
|
+
const p = serveLockPath(projectRoot);
|
|
194
|
+
if (!fs.existsSync(p)) return null;
|
|
195
|
+
try {
|
|
196
|
+
return JSON.parse(fs.readFileSync(p, "utf8"));
|
|
197
|
+
} catch {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
173
201
|
export {
|
|
174
|
-
detectFramework
|
|
202
|
+
detectFramework,
|
|
203
|
+
isAlive,
|
|
204
|
+
readServeLockState,
|
|
205
|
+
serveLockPath
|
|
175
206
|
};
|