@jayjiang/byoao 1.0.4 → 1.0.6
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/index.js +30559 -79
- package/dist/lib/cjs-modules.js +61 -50
- package/dist/lib/cjs-modules.js.map +1 -1
- package/package.json +3 -2
package/dist/lib/cjs-modules.js
CHANGED
|
@@ -1,53 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
// ── native Node.js fs replacement ─────────────────────────────────────────────
|
|
2
|
+
import * as nodeFs from "node:fs";
|
|
3
|
+
import * as nodeFsPromises from "node:fs/promises";
|
|
4
|
+
import nodePath from "node:path";
|
|
5
|
+
async function copy(src, dest) {
|
|
6
|
+
await nodeFsPromises.cp(src, dest, { recursive: true });
|
|
7
|
+
}
|
|
8
|
+
async function ensureDir(dirPath) {
|
|
9
|
+
await nodeFsPromises.mkdir(dirPath, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
async function pathExists(filePath) {
|
|
12
|
+
try {
|
|
13
|
+
await nodeFsPromises.access(filePath);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function pathExistsSync(filePath) {
|
|
21
|
+
return nodeFs.existsSync(filePath);
|
|
22
|
+
}
|
|
23
|
+
async function readJson(filePath) {
|
|
24
|
+
return JSON.parse(await nodeFsPromises.readFile(filePath, "utf-8"));
|
|
25
|
+
}
|
|
26
|
+
function readJsonSync(filePath) {
|
|
27
|
+
return JSON.parse(nodeFs.readFileSync(filePath, "utf-8"));
|
|
28
|
+
}
|
|
29
|
+
async function writeJson(filePath, data, options) {
|
|
30
|
+
const indent = options?.spaces ?? 2;
|
|
31
|
+
await nodeFsPromises.mkdir(nodePath.dirname(filePath), { recursive: true });
|
|
32
|
+
await nodeFsPromises.writeFile(filePath, JSON.stringify(data, null, indent));
|
|
33
|
+
}
|
|
34
|
+
function writeJsonSync(filePath, data, options) {
|
|
35
|
+
const indent = options?.spaces ?? 2;
|
|
36
|
+
nodeFs.mkdirSync(nodePath.dirname(filePath), { recursive: true });
|
|
37
|
+
nodeFs.writeFileSync(filePath, JSON.stringify(data, null, indent));
|
|
38
|
+
}
|
|
39
|
+
async function remove(filePath) {
|
|
40
|
+
await nodeFsPromises.rm(filePath, { recursive: true, force: true });
|
|
41
|
+
}
|
|
42
|
+
function removeSync(filePath) {
|
|
43
|
+
nodeFs.rmSync(filePath, { recursive: true, force: true });
|
|
44
|
+
}
|
|
26
45
|
export const fs = {
|
|
27
|
-
existsSync,
|
|
28
|
-
readFileSync,
|
|
29
|
-
readdirSync,
|
|
30
|
-
readFile,
|
|
31
|
-
writeFile,
|
|
32
|
-
readdir,
|
|
33
|
-
|
|
34
|
-
ensureDir,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readJson,
|
|
38
|
-
readJsonSync,
|
|
39
|
-
writeJson,
|
|
40
|
-
writeJsonSync,
|
|
41
|
-
remove,
|
|
42
|
-
removeSync,
|
|
46
|
+
existsSync: nodeFs.existsSync,
|
|
47
|
+
readFileSync: nodeFs.readFileSync,
|
|
48
|
+
readdirSync: nodeFs.readdirSync,
|
|
49
|
+
readFile: nodeFsPromises.readFile,
|
|
50
|
+
writeFile: nodeFsPromises.writeFile,
|
|
51
|
+
readdir: nodeFsPromises.readdir,
|
|
52
|
+
mkdir: nodeFsPromises.mkdir,
|
|
53
|
+
copy, ensureDir, pathExists, pathExistsSync,
|
|
54
|
+
readJson, readJsonSync, writeJson, writeJsonSync,
|
|
55
|
+
remove, removeSync,
|
|
43
56
|
};
|
|
44
|
-
// ── CJS
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
export const
|
|
51
|
-
export const Handlebars = unwrap(_Handlebars);
|
|
52
|
-
export const semver = unwrap(_semver);
|
|
57
|
+
// ── CJS packages — bundled inline by esbuild ─────────────────────────────────
|
|
58
|
+
import _matter from "gray-matter";
|
|
59
|
+
import _Handlebars from "handlebars";
|
|
60
|
+
import * as _semver from "semver";
|
|
61
|
+
export const matter = _matter;
|
|
62
|
+
export const Handlebars = _Handlebars;
|
|
63
|
+
export const semver = _semver;
|
|
53
64
|
//# sourceMappingURL=cjs-modules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cjs-modules.js","sourceRoot":"","sources":["../../src/lib/cjs-modules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cjs-modules.js","sourceRoot":"","sources":["../../src/lib/cjs-modules.ts"],"names":[],"mappings":"AAeA,iFAAiF;AACjF,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,KAAK,UAAU,IAAI,CAAC,GAAW,EAAE,IAAY;IAC3C,MAAM,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1D,CAAC;AACD,KAAK,UAAU,SAAS,CAAC,OAAe;IACtC,MAAM,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3D,CAAC;AACD,KAAK,UAAU,UAAU,CAAC,QAAgB;IACxC,IAAI,CAAC;QAAC,MAAM,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;Q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|
6
6
|
"engines": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"byoao": "dist/cli/cli-program.js"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "
|
|
15
|
+
"build": "node build.mjs",
|
|
16
16
|
"dev": "node --import tsx src/cli/cli-program.ts",
|
|
17
17
|
"test": "vitest run",
|
|
18
18
|
"typecheck": "tsc --noEmit",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"@types/inquirer": "^9.0.0",
|
|
59
59
|
"@types/node": "^20.0.0",
|
|
60
60
|
"@types/semver": "^7.7.1",
|
|
61
|
+
"esbuild": "^0.27.7",
|
|
61
62
|
"tsx": "^4.21.0",
|
|
62
63
|
"typescript": "^5.4.0",
|
|
63
64
|
"vitest": "^4.1.0"
|