joycraft 0.6.6 → 0.6.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/README.md +24 -3
- package/dist/chunk-63OWWRAJ.js +58 -0
- package/dist/chunk-63OWWRAJ.js.map +1 -0
- package/dist/chunk-JVRMYMBC.js +39 -0
- package/dist/chunk-JVRMYMBC.js.map +1 -0
- package/dist/{chunk-74U6FQUQ.js → chunk-PGKFL3PW.js} +104 -143
- package/dist/chunk-PGKFL3PW.js.map +1 -0
- package/dist/cli.js +8 -6
- package/dist/cli.js.map +1 -1
- package/dist/{init-RYO6QGAY.js → init-3A5XYVKQ.js} +18 -9
- package/dist/init-3A5XYVKQ.js.map +1 -0
- package/dist/{init-autofix-LAJ2RQRR.js → init-autofix-O5MGQZ2I.js} +8 -3
- package/dist/init-autofix-O5MGQZ2I.js.map +1 -0
- package/dist/{upgrade-TIHWRVGE.js → upgrade-EZSIL2M2.js} +83 -12
- package/dist/upgrade-EZSIL2M2.js.map +1 -0
- package/dist/version-HEQ42K47.js +20 -0
- package/dist/version-HEQ42K47.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-4ZI7B4IW.js +0 -52
- package/dist/chunk-4ZI7B4IW.js.map +0 -1
- package/dist/chunk-74U6FQUQ.js.map +0 -1
- package/dist/init-RYO6QGAY.js.map +0 -1
- package/dist/init-autofix-LAJ2RQRR.js.map +0 -1
- package/dist/upgrade-TIHWRVGE.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
LEGACY_VERSION_FILE,
|
|
4
|
+
STATE_PATH,
|
|
5
|
+
getLevel,
|
|
6
|
+
hashContent,
|
|
7
|
+
readVersion,
|
|
8
|
+
truncateHash,
|
|
9
|
+
writeVersion
|
|
10
|
+
} from "./chunk-63OWWRAJ.js";
|
|
11
|
+
export {
|
|
12
|
+
LEGACY_VERSION_FILE,
|
|
13
|
+
STATE_PATH,
|
|
14
|
+
getLevel,
|
|
15
|
+
hashContent,
|
|
16
|
+
readVersion,
|
|
17
|
+
truncateHash,
|
|
18
|
+
writeVersion
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=version-HEQ42K47.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
package/dist/chunk-4ZI7B4IW.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/version.ts
|
|
4
|
-
import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
5
|
-
import { join } from "path";
|
|
6
|
-
import { createHash } from "crypto";
|
|
7
|
-
var VERSION_FILE = ".joycraft-version";
|
|
8
|
-
function hashContent(content) {
|
|
9
|
-
return createHash("sha256").update(content).digest("hex");
|
|
10
|
-
}
|
|
11
|
-
function readVersion(dir) {
|
|
12
|
-
const filePath = join(dir, VERSION_FILE);
|
|
13
|
-
if (!existsSync(filePath)) return null;
|
|
14
|
-
try {
|
|
15
|
-
const raw = readFileSync(filePath, "utf-8");
|
|
16
|
-
const parsed = JSON.parse(raw);
|
|
17
|
-
if (typeof parsed.version === "string" && typeof parsed.files === "object") {
|
|
18
|
-
return parsed;
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
} catch {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function writeVersion(dir, version, files) {
|
|
26
|
-
const filePath = join(dir, VERSION_FILE);
|
|
27
|
-
const data = { version, files };
|
|
28
|
-
writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// src/package-version.ts
|
|
32
|
-
import { readFileSync as readFileSync2 } from "fs";
|
|
33
|
-
import { fileURLToPath } from "url";
|
|
34
|
-
import { dirname, join as join2 } from "path";
|
|
35
|
-
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
36
|
-
function getPackageVersion() {
|
|
37
|
-
const pkgPath = join2(__dirname, "..", "package.json");
|
|
38
|
-
const raw = readFileSync2(pkgPath, "utf-8");
|
|
39
|
-
const pkg = JSON.parse(raw);
|
|
40
|
-
if (typeof pkg.version !== "string" || pkg.version.length === 0) {
|
|
41
|
-
throw new Error(`Joycraft package.json at ${pkgPath} is missing a version field`);
|
|
42
|
-
}
|
|
43
|
-
return pkg.version;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export {
|
|
47
|
-
hashContent,
|
|
48
|
-
readVersion,
|
|
49
|
-
writeVersion,
|
|
50
|
-
getPackageVersion
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=chunk-4ZI7B4IW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts","../src/package-version.ts"],"sourcesContent":["import { readFileSync, writeFileSync, existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createHash } from 'node:crypto';\n\nconst VERSION_FILE = '.joycraft-version';\n\nexport interface VersionInfo {\n version: string;\n files: Record<string, string>;\n}\n\nexport function hashContent(content: string): string {\n return createHash('sha256').update(content).digest('hex');\n}\n\nexport function readVersion(dir: string): VersionInfo | null {\n const filePath = join(dir, VERSION_FILE);\n if (!existsSync(filePath)) return null;\n try {\n const raw = readFileSync(filePath, 'utf-8');\n const parsed = JSON.parse(raw);\n if (typeof parsed.version === 'string' && typeof parsed.files === 'object') {\n return parsed as VersionInfo;\n }\n return null;\n } catch {\n return null;\n }\n}\n\nexport function writeVersion(dir: string, version: string, files: Record<string, string>): void {\n const filePath = join(dir, VERSION_FILE);\n const data: VersionInfo = { version, files };\n writeFileSync(filePath, JSON.stringify(data, null, 2) + '\\n', 'utf-8');\n}\n\n/**\n * Detect the current Joycraft harness level for a project directory.\n * Returns 5 if Level 5 artifacts (autofix workflow + External Validation) are present, 4 otherwise.\n */\nexport function getLevel(dir: string): number {\n const hasAutofix = existsSync(join(dir, '.github', 'workflows', 'autofix.yml'));\n if (!hasAutofix) return 4;\n const claudeMdPath = join(dir, 'CLAUDE.md');\n if (!existsSync(claudeMdPath)) return 4;\n const content = readFileSync(claudeMdPath, 'utf-8');\n return content.includes('## External Validation') ? 5 : 4;\n}\n","import { readFileSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { dirname, join } from 'node:path';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport function getPackageVersion(): string {\n const pkgPath = join(__dirname, '..', 'package.json');\n const raw = readFileSync(pkgPath, 'utf-8');\n const pkg = JSON.parse(raw) as { version?: unknown };\n if (typeof pkg.version !== 'string' || pkg.version.length === 0) {\n throw new Error(`Joycraft package.json at ${pkgPath} is missing a version field`);\n }\n return pkg.version;\n}\n"],"mappings":";;;AAAA,SAAS,cAAc,eAAe,kBAAkB;AACxD,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAE3B,IAAM,eAAe;AAOd,SAAS,YAAY,SAAyB;AACnD,SAAO,WAAW,QAAQ,EAAE,OAAO,OAAO,EAAE,OAAO,KAAK;AAC1D;AAEO,SAAS,YAAY,KAAiC;AAC3D,QAAM,WAAW,KAAK,KAAK,YAAY;AACvC,MAAI,CAAC,WAAW,QAAQ,EAAG,QAAO;AAClC,MAAI;AACF,UAAM,MAAM,aAAa,UAAU,OAAO;AAC1C,UAAM,SAAS,KAAK,MAAM,GAAG;AAC7B,QAAI,OAAO,OAAO,YAAY,YAAY,OAAO,OAAO,UAAU,UAAU;AAC1E,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,aAAa,KAAa,SAAiB,OAAqC;AAC9F,QAAM,WAAW,KAAK,KAAK,YAAY;AACvC,QAAM,OAAoB,EAAE,SAAS,MAAM;AAC3C,gBAAc,UAAU,KAAK,UAAU,MAAM,MAAM,CAAC,IAAI,MAAM,OAAO;AACvE;;;AClCA,SAAS,gBAAAA,qBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,QAAAC,aAAY;AAE9B,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAEjD,SAAS,oBAA4B;AAC1C,QAAM,UAAUA,MAAK,WAAW,MAAM,cAAc;AACpD,QAAM,MAAMD,cAAa,SAAS,OAAO;AACzC,QAAM,MAAM,KAAK,MAAM,GAAG;AAC1B,MAAI,OAAO,IAAI,YAAY,YAAY,IAAI,QAAQ,WAAW,GAAG;AAC/D,UAAM,IAAI,MAAM,4BAA4B,OAAO,6BAA6B;AAAA,EAClF;AACA,SAAO,IAAI;AACb;","names":["readFileSync","join"]}
|