wp-typia 0.24.4 → 0.24.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/README.md +8 -6
- package/bin/wp-typia.js +24 -103
- package/{dist-bunli/node-cli.js → dist/cli.js} +5086 -3693
- package/package.json +9 -36
- package/bin/routing-metadata.generated.d.ts +0 -8
- package/bin/routing-metadata.generated.js +0 -93
- package/bin/runtime-routing.d.ts +0 -34
- package/bin/runtime-routing.js +0 -124
- package/dist-bunli/.bunli/commands.gen.js +0 -304441
- package/dist-bunli/.bunli/highlights-eq9cgrbb.scm +0 -604
- package/dist-bunli/.bunli/highlights-ghv9g403.scm +0 -205
- package/dist-bunli/.bunli/highlights-hk7bwhj4.scm +0 -284
- package/dist-bunli/.bunli/highlights-r812a2qc.scm +0 -150
- package/dist-bunli/.bunli/highlights-x6tmsnaa.scm +0 -115
- package/dist-bunli/.bunli/injections-73j83es3.scm +0 -27
- package/dist-bunli/.bunli/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist-bunli/agents-91fpdyyt.js +0 -12
- package/dist-bunli/chunk-bdqvmfwv-f5qmzmxg.js +0 -16825
- package/dist-bunli/cli-03j0axbt.js +0 -163
- package/dist-bunli/cli-1170yyve.js +0 -106
- package/dist-bunli/cli-368d4cgy.js +0 -1235
- package/dist-bunli/cli-377p86mf.js +0 -191
- package/dist-bunli/cli-6v0pcxw6.js +0 -314
- package/dist-bunli/cli-84c7wff4.js +0 -198
- package/dist-bunli/cli-8hxf9qw6.js +0 -198
- package/dist-bunli/cli-9fx0qgb7.js +0 -3680
- package/dist-bunli/cli-ac2ebaf8.js +0 -3
- package/dist-bunli/cli-add-qjd3ba8j.js +0 -10671
- package/dist-bunli/cli-am5x7tb4.js +0 -192
- package/dist-bunli/cli-bajwv85z.js +0 -24
- package/dist-bunli/cli-ccax7s0s.js +0 -34
- package/dist-bunli/cli-cvxvcw7c.js +0 -46
- package/dist-bunli/cli-diagnostics-10drxh34.js +0 -34
- package/dist-bunli/cli-doctor-6fyxq940.js +0 -1446
- package/dist-bunli/cli-e4bwd81c.js +0 -1260
- package/dist-bunli/cli-fv4h3ydt.js +0 -173823
- package/dist-bunli/cli-hv2yedw2.js +0 -74591
- package/dist-bunli/cli-init-7avk42dh.js +0 -880
- package/dist-bunli/cli-kfm9mm68.js +0 -14679
- package/dist-bunli/cli-prompt-ncyg68rn.js +0 -12
- package/dist-bunli/cli-rdcga1bd.js +0 -135
- package/dist-bunli/cli-scaffold-0bb6pr3w.js +0 -538
- package/dist-bunli/cli-t73q5aqz.js +0 -103
- package/dist-bunli/cli-templates-g8t4fm11.js +0 -167
- package/dist-bunli/cli-tj7ajdvf.js +0 -2612
- package/dist-bunli/cli-tq730sqt.js +0 -344
- package/dist-bunli/cli-xnn9xjcy.js +0 -68
- package/dist-bunli/cli-z48frc8t.js +0 -229
- package/dist-bunli/cli.js +0 -2523
- package/dist-bunli/command-list-y3g7e9rb.js +0 -4013
- package/dist-bunli/create-template-validation-4fr851vg.js +0 -16
- package/dist-bunli/migrations-3vngdy51.js +0 -47
- package/dist-bunli/sync-k2k8svyc.js +0 -13
- package/dist-bunli/workspace-project-gmv2a71z.js +0 -22
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
readJsonFileSync
|
|
4
|
-
} from "./cli-ccax7s0s.js";
|
|
5
|
-
|
|
6
|
-
// ../wp-typia-project-tools/src/runtime/package-managers.ts
|
|
7
|
-
import fs from "fs";
|
|
8
|
-
import path from "path";
|
|
9
|
-
var PACKAGE_MANAGER_DATA = [
|
|
10
|
-
{
|
|
11
|
-
id: "bun",
|
|
12
|
-
label: "Bun",
|
|
13
|
-
packageManagerField: "bun@1.3.11",
|
|
14
|
-
installCommand: "bun install",
|
|
15
|
-
frozenInstallCommand: "bun install --frozen-lockfile"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
id: "npm",
|
|
19
|
-
label: "npm",
|
|
20
|
-
packageManagerField: "npm@11.6.1",
|
|
21
|
-
installCommand: "npm install --no-audit",
|
|
22
|
-
frozenInstallCommand: "npm ci"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "pnpm",
|
|
26
|
-
label: "pnpm",
|
|
27
|
-
packageManagerField: "pnpm@8.3.1",
|
|
28
|
-
installCommand: "pnpm install",
|
|
29
|
-
frozenInstallCommand: "pnpm install --frozen-lockfile"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "yarn",
|
|
33
|
-
label: "Yarn",
|
|
34
|
-
packageManagerField: "yarn@3.2.4",
|
|
35
|
-
installCommand: "yarn install",
|
|
36
|
-
frozenInstallCommand: "yarn install --frozen-lockfile"
|
|
37
|
-
}
|
|
38
|
-
];
|
|
39
|
-
var PACKAGE_MANAGER_LOCKFILE_SIGNALS = [
|
|
40
|
-
{ id: "bun", filenames: ["bun.lock", "bun.lockb"] },
|
|
41
|
-
{ id: "pnpm", filenames: ["pnpm-lock.yaml"] },
|
|
42
|
-
{
|
|
43
|
-
id: "yarn",
|
|
44
|
-
filenames: ["yarn.lock", ".pnp.cjs", ".pnp.loader.mjs", ".yarnrc.yml"]
|
|
45
|
-
},
|
|
46
|
-
{ id: "npm", filenames: ["package-lock.json", "npm-shrinkwrap.json"] }
|
|
47
|
-
];
|
|
48
|
-
var PACKAGE_MANAGER_IDS = PACKAGE_MANAGER_DATA.map((manager) => manager.id);
|
|
49
|
-
var PACKAGE_MANAGERS = Object.freeze(Object.fromEntries(PACKAGE_MANAGER_DATA.map((manager) => [manager.id, manager])));
|
|
50
|
-
var DEV_INSTALL_FLAGS = {
|
|
51
|
-
bun: "add -d",
|
|
52
|
-
npm: "install --save-dev",
|
|
53
|
-
pnpm: "add -D",
|
|
54
|
-
yarn: "add -D"
|
|
55
|
-
};
|
|
56
|
-
var STOP_CHARS = new Set([`
|
|
57
|
-
`, "\r", "`", '"', "'", ")", "]", "}", "!", ",", "."]);
|
|
58
|
-
function getPackageManager(id) {
|
|
59
|
-
const manager = PACKAGE_MANAGERS[id];
|
|
60
|
-
if (!manager) {
|
|
61
|
-
throw new Error(`Unknown package manager "${id}". Expected one of: ${PACKAGE_MANAGER_IDS.join(", ")}`);
|
|
62
|
-
}
|
|
63
|
-
return manager;
|
|
64
|
-
}
|
|
65
|
-
function parsePackageManagerField(packageManagerField) {
|
|
66
|
-
const packageManagerId = packageManagerField?.split("@", 1)[0];
|
|
67
|
-
return PACKAGE_MANAGER_IDS.includes(packageManagerId) ? packageManagerId : null;
|
|
68
|
-
}
|
|
69
|
-
function readPackageManagerField(projectDir) {
|
|
70
|
-
try {
|
|
71
|
-
const packageJsonPath = path.join(projectDir, "package.json");
|
|
72
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const manifest = readJsonFileSync(packageJsonPath, {
|
|
76
|
-
context: "package manager manifest"
|
|
77
|
-
});
|
|
78
|
-
return typeof manifest.packageManager === "string" ? manifest.packageManager : undefined;
|
|
79
|
-
} catch {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function inferPackageManagerId(projectDir, packageManagerField) {
|
|
84
|
-
const fieldPackageManager = parsePackageManagerField(packageManagerField) ?? parsePackageManagerField(readPackageManagerField(projectDir));
|
|
85
|
-
if (fieldPackageManager) {
|
|
86
|
-
return fieldPackageManager;
|
|
87
|
-
}
|
|
88
|
-
for (const signal of PACKAGE_MANAGER_LOCKFILE_SIGNALS) {
|
|
89
|
-
if (signal.filenames.some((filename) => fs.existsSync(path.join(projectDir, filename)))) {
|
|
90
|
-
return signal.id;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return "npm";
|
|
94
|
-
}
|
|
95
|
-
function formatRunScript(packageManagerId, scriptName, extraArgs = "") {
|
|
96
|
-
const args = extraArgs.trim();
|
|
97
|
-
if (packageManagerId === "bun") {
|
|
98
|
-
return args ? `bun run ${scriptName} ${args}` : `bun run ${scriptName}`;
|
|
99
|
-
}
|
|
100
|
-
if (packageManagerId === "npm") {
|
|
101
|
-
return args ? `npm run ${scriptName} -- ${args}` : `npm run ${scriptName}`;
|
|
102
|
-
}
|
|
103
|
-
if (packageManagerId === "pnpm") {
|
|
104
|
-
return args ? `pnpm run ${scriptName} ${args}` : `pnpm run ${scriptName}`;
|
|
105
|
-
}
|
|
106
|
-
return args ? `yarn run ${scriptName} ${args}` : `yarn run ${scriptName}`;
|
|
107
|
-
}
|
|
108
|
-
function formatInstallCommand(packageManagerId) {
|
|
109
|
-
return getPackageManager(packageManagerId).installCommand;
|
|
110
|
-
}
|
|
111
|
-
function formatAddDevDependenciesCommand(packageManagerId, packages) {
|
|
112
|
-
if (packages.length === 0) {
|
|
113
|
-
return formatInstallCommand(packageManagerId);
|
|
114
|
-
}
|
|
115
|
-
return `${packageManagerId} ${DEV_INSTALL_FLAGS[packageManagerId]} ${packages.join(" ")}`;
|
|
116
|
-
}
|
|
117
|
-
function formatPackageExecCommand(packageManagerId, packageName, extraArgs = "") {
|
|
118
|
-
const args = extraArgs.trim();
|
|
119
|
-
if (packageManagerId === "bun") {
|
|
120
|
-
return args ? `bunx ${packageName} ${args}` : `bunx ${packageName}`;
|
|
121
|
-
}
|
|
122
|
-
if (packageManagerId === "npm") {
|
|
123
|
-
return args ? `npx --yes ${packageName} ${args}` : `npx --yes ${packageName}`;
|
|
124
|
-
}
|
|
125
|
-
if (packageManagerId === "pnpm") {
|
|
126
|
-
return args ? `pnpm dlx ${packageName} ${args}` : `pnpm dlx ${packageName}`;
|
|
127
|
-
}
|
|
128
|
-
return args ? `yarn dlx ${packageName} ${args}` : `yarn dlx ${packageName}`;
|
|
129
|
-
}
|
|
130
|
-
function consumeCommandArguments(content, startIndex) {
|
|
131
|
-
let cursor = startIndex;
|
|
132
|
-
let args = "";
|
|
133
|
-
while (cursor < content.length) {
|
|
134
|
-
const current = content[cursor];
|
|
135
|
-
if (STOP_CHARS.has(current) || content.startsWith("&&", cursor) || content.startsWith("||", cursor) || current === ";") {
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
args += current;
|
|
139
|
-
cursor += 1;
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
args: args.trim(),
|
|
143
|
-
cursor
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function replaceBunRunCommands(content, packageManagerId) {
|
|
147
|
-
const marker = "bun run ";
|
|
148
|
-
let result = "";
|
|
149
|
-
let cursor = 0;
|
|
150
|
-
while (cursor < content.length) {
|
|
151
|
-
const index = content.indexOf(marker, cursor);
|
|
152
|
-
if (index === -1) {
|
|
153
|
-
result += content.slice(cursor);
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
if (index > 0 && /[A-Za-z0-9_-]/.test(content[index - 1])) {
|
|
157
|
-
result += content.slice(cursor, index + marker.length);
|
|
158
|
-
cursor = index + marker.length;
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
result += content.slice(cursor, index);
|
|
162
|
-
const scriptNameStart = index + marker.length;
|
|
163
|
-
const scriptNameMatch = /^[A-Za-z0-9:_-]+/.exec(content.slice(scriptNameStart));
|
|
164
|
-
if (!scriptNameMatch) {
|
|
165
|
-
result += marker;
|
|
166
|
-
cursor = scriptNameStart;
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
const scriptName = scriptNameMatch[0];
|
|
170
|
-
const argsStart = scriptNameStart + scriptName.length;
|
|
171
|
-
const { args, cursor: nextCursor } = consumeCommandArguments(content, argsStart);
|
|
172
|
-
result += formatRunScript(packageManagerId, scriptName, args);
|
|
173
|
-
cursor = nextCursor;
|
|
174
|
-
}
|
|
175
|
-
return result;
|
|
176
|
-
}
|
|
177
|
-
function replaceDevDependencyInstalls(content, packageManagerId) {
|
|
178
|
-
return content.replace(/\bbun add -d ([^\s&|;`"'()]+)\b/g, (_, packageName) => {
|
|
179
|
-
if (packageManagerId === "bun") {
|
|
180
|
-
return `bun add -d ${packageName}`;
|
|
181
|
-
}
|
|
182
|
-
return `${packageManagerId} ${DEV_INSTALL_FLAGS[packageManagerId]} ${packageName}`;
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
function transformPackageManagerText(content, packageManagerId) {
|
|
186
|
-
const manager = getPackageManager(packageManagerId);
|
|
187
|
-
return replaceDevDependencyInstalls(replaceBunRunCommands(content.replace(/\bbun install --frozen-lockfile\b/g, manager.frozenInstallCommand).replace(/\bbun install\b/g, manager.installCommand), packageManagerId), packageManagerId).replace(/\s*&&\s*/g, " && ").replace(/\s*\|\|\s*/g, " || ");
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export { PACKAGE_MANAGER_IDS, getPackageManager, parsePackageManagerField, inferPackageManagerId, formatRunScript, formatInstallCommand, formatAddDevDependenciesCommand, formatPackageExecCommand, transformPackageManagerText };
|
|
191
|
-
|
|
192
|
-
//# debugId=3287AD727A1EC20664756E2164756E21
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// ../wp-typia-project-tools/src/runtime/cli-add-kind-ids.ts
|
|
3
|
-
var ADD_KIND_IDS = [
|
|
4
|
-
"admin-view",
|
|
5
|
-
"block",
|
|
6
|
-
"integration-env",
|
|
7
|
-
"core-variation",
|
|
8
|
-
"variation",
|
|
9
|
-
"style",
|
|
10
|
-
"transform",
|
|
11
|
-
"pattern",
|
|
12
|
-
"binding-source",
|
|
13
|
-
"contract",
|
|
14
|
-
"rest-resource",
|
|
15
|
-
"post-meta",
|
|
16
|
-
"ability",
|
|
17
|
-
"ai-feature",
|
|
18
|
-
"hooked-block",
|
|
19
|
-
"editor-plugin"
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
export { ADD_KIND_IDS };
|
|
23
|
-
|
|
24
|
-
//# debugId=39A9377B00AF01BA64756E2164756E21
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// ../wp-typia-project-tools/src/runtime/json-utils.ts
|
|
3
|
-
import fs from "fs";
|
|
4
|
-
import { promises as fsp } from "fs";
|
|
5
|
-
function cloneJsonValue(value) {
|
|
6
|
-
return JSON.parse(JSON.stringify(value));
|
|
7
|
-
}
|
|
8
|
-
function formatJsonParseTarget({ context, filePath }) {
|
|
9
|
-
const operation = context?.trim() || "JSON";
|
|
10
|
-
return filePath ? `${operation} at ${filePath}` : operation;
|
|
11
|
-
}
|
|
12
|
-
function safeJsonParse(source, options = {}) {
|
|
13
|
-
try {
|
|
14
|
-
return JSON.parse(source);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
throw new Error(`Failed to parse ${formatJsonParseTarget(options)}: ${error instanceof Error ? error.message : String(error)}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function readJsonFileSync(filePath, options = {}) {
|
|
20
|
-
return safeJsonParse(fs.readFileSync(filePath, "utf8"), {
|
|
21
|
-
...options,
|
|
22
|
-
filePath
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
async function readJsonFile(filePath, options = {}) {
|
|
26
|
-
return safeJsonParse(await fsp.readFile(filePath, "utf8"), {
|
|
27
|
-
...options,
|
|
28
|
-
filePath
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { cloneJsonValue, safeJsonParse, readJsonFileSync, readJsonFile };
|
|
33
|
-
|
|
34
|
-
//# debugId=4CC2BF13AF5DC85A64756E2164756E21
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// ../wp-typia-project-tools/src/runtime/id-suggestions.ts
|
|
3
|
-
function normalizeCloseId(value) {
|
|
4
|
-
return value.trim().toLowerCase();
|
|
5
|
-
}
|
|
6
|
-
function getEditDistance(left, right) {
|
|
7
|
-
const previous = Array.from({ length: right.length + 1 }, (_, index) => index);
|
|
8
|
-
const current = new Array(right.length + 1);
|
|
9
|
-
for (let leftIndex = 0;leftIndex < left.length; leftIndex += 1) {
|
|
10
|
-
current[0] = leftIndex + 1;
|
|
11
|
-
for (let rightIndex = 0;rightIndex < right.length; rightIndex += 1) {
|
|
12
|
-
const substitutionCost = left[leftIndex] === right[rightIndex] ? 0 : 1;
|
|
13
|
-
current[rightIndex + 1] = Math.min(current[rightIndex] + 1, previous[rightIndex + 1] + 1, previous[rightIndex] + substitutionCost);
|
|
14
|
-
}
|
|
15
|
-
for (let index = 0;index < current.length; index += 1) {
|
|
16
|
-
previous[index] = current[index];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return previous[right.length];
|
|
20
|
-
}
|
|
21
|
-
function suggestCloseId(input, candidates, options = {}) {
|
|
22
|
-
const normalize = options.normalize ?? normalizeCloseId;
|
|
23
|
-
const normalizedInput = normalize(input);
|
|
24
|
-
if (normalizedInput.length === 0) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const maxDistance = options.maxDistance ?? 2;
|
|
28
|
-
if (maxDistance < 0) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
let bestCandidate = null;
|
|
32
|
-
for (const candidateId of candidates) {
|
|
33
|
-
const distance = getEditDistance(normalizedInput, normalize(candidateId));
|
|
34
|
-
if (bestCandidate === null || distance < bestCandidate.distance) {
|
|
35
|
-
bestCandidate = {
|
|
36
|
-
distance,
|
|
37
|
-
id: candidateId
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return bestCandidate && bestCandidate.distance <= maxDistance ? bestCandidate.id : null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { suggestCloseId };
|
|
45
|
-
|
|
46
|
-
//# debugId=7EAC7A78B56C749964756E2164756E21
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
CLI_DIAGNOSTIC_CODES,
|
|
4
|
-
CLI_DIAGNOSTIC_CODE_METADATA,
|
|
5
|
-
CliDiagnosticError,
|
|
6
|
-
createCliCommandError,
|
|
7
|
-
createCliDiagnosticCodeError,
|
|
8
|
-
formatCliDiagnosticError,
|
|
9
|
-
formatDoctorCheckLine,
|
|
10
|
-
formatDoctorSummaryLine,
|
|
11
|
-
getCliDiagnosticCodeMetadata,
|
|
12
|
-
getDoctorFailureDetailLines,
|
|
13
|
-
getFailingDoctorChecks,
|
|
14
|
-
isCliDiagnosticError,
|
|
15
|
-
serializeCliDiagnosticError
|
|
16
|
-
} from "./cli-tq730sqt.js";
|
|
17
|
-
import"./cli-xnn9xjcy.js";
|
|
18
|
-
export {
|
|
19
|
-
serializeCliDiagnosticError,
|
|
20
|
-
isCliDiagnosticError,
|
|
21
|
-
getFailingDoctorChecks,
|
|
22
|
-
getDoctorFailureDetailLines,
|
|
23
|
-
getCliDiagnosticCodeMetadata,
|
|
24
|
-
formatDoctorSummaryLine,
|
|
25
|
-
formatDoctorCheckLine,
|
|
26
|
-
formatCliDiagnosticError,
|
|
27
|
-
createCliDiagnosticCodeError,
|
|
28
|
-
createCliCommandError,
|
|
29
|
-
CliDiagnosticError,
|
|
30
|
-
CLI_DIAGNOSTIC_CODE_METADATA,
|
|
31
|
-
CLI_DIAGNOSTIC_CODES
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
//# debugId=C0BB65021DB87CDD64756E2164756E21
|