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,103 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// ../wp-typia-project-tools/src/runtime/temp-roots.ts
|
|
3
|
-
import fs from "fs";
|
|
4
|
-
import * as fsp from "fs/promises";
|
|
5
|
-
import os from "os";
|
|
6
|
-
import path from "path";
|
|
7
|
-
var WP_TYPIA_TEMP_ROOT_PREFIX = "wp-typia-";
|
|
8
|
-
var STALE_TEMP_ROOT_MAX_AGE_MS = 1000 * 60 * 60 * 24;
|
|
9
|
-
var trackedTempRoots = new Set;
|
|
10
|
-
var cleanupHandlersInstalled = false;
|
|
11
|
-
var staleCleanupRan = false;
|
|
12
|
-
var signalCleanupInProgress = false;
|
|
13
|
-
function getTempDir(tmpDir) {
|
|
14
|
-
return tmpDir ?? os.tmpdir();
|
|
15
|
-
}
|
|
16
|
-
function cleanupTrackedTempRootsSync() {
|
|
17
|
-
for (const tempRoot of [...trackedTempRoots]) {
|
|
18
|
-
trackedTempRoots.delete(tempRoot);
|
|
19
|
-
try {
|
|
20
|
-
fs.rmSync(tempRoot, { force: true, recursive: true });
|
|
21
|
-
} catch {}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function installCleanupHandlers() {
|
|
25
|
-
if (cleanupHandlersInstalled) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
cleanupHandlersInstalled = true;
|
|
29
|
-
process.on("exit", cleanupTrackedTempRootsSync);
|
|
30
|
-
for (const [signal, exitCode] of [
|
|
31
|
-
["SIGHUP", 129],
|
|
32
|
-
["SIGINT", 130],
|
|
33
|
-
["SIGTERM", 143]
|
|
34
|
-
]) {
|
|
35
|
-
process.once(signal, () => {
|
|
36
|
-
if (signalCleanupInProgress) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
signalCleanupInProgress = true;
|
|
40
|
-
cleanupTrackedTempRootsSync();
|
|
41
|
-
process.exitCode = exitCode;
|
|
42
|
-
process.exit();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async function cleanupManagedTempRoot(tempRoot) {
|
|
47
|
-
trackedTempRoots.delete(tempRoot);
|
|
48
|
-
await fsp.rm(tempRoot, { force: true, recursive: true });
|
|
49
|
-
}
|
|
50
|
-
async function cleanupStaleTempRoots({
|
|
51
|
-
maxAgeMs = STALE_TEMP_ROOT_MAX_AGE_MS,
|
|
52
|
-
now = Date.now(),
|
|
53
|
-
tmpDir
|
|
54
|
-
} = {}) {
|
|
55
|
-
const resolvedTmpDir = getTempDir(tmpDir);
|
|
56
|
-
const removedRoots = [];
|
|
57
|
-
const entries = await fsp.readdir(resolvedTmpDir, { withFileTypes: true });
|
|
58
|
-
for (const entry of entries) {
|
|
59
|
-
if (!entry.isDirectory() || !entry.name.startsWith(WP_TYPIA_TEMP_ROOT_PREFIX)) {
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
const tempRoot = path.join(resolvedTmpDir, entry.name);
|
|
63
|
-
if (trackedTempRoots.has(tempRoot)) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
let stats;
|
|
67
|
-
try {
|
|
68
|
-
stats = await fsp.stat(tempRoot);
|
|
69
|
-
} catch {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
if (now - stats.mtimeMs < maxAgeMs) {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
await fsp.rm(tempRoot, { force: true, recursive: true });
|
|
77
|
-
removedRoots.push(tempRoot);
|
|
78
|
-
} catch {
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return removedRoots;
|
|
83
|
-
}
|
|
84
|
-
async function createManagedTempRoot(prefix, options = {}) {
|
|
85
|
-
if (!prefix.startsWith(WP_TYPIA_TEMP_ROOT_PREFIX)) {
|
|
86
|
-
throw new Error(`Managed wp-typia temp roots must use the "${WP_TYPIA_TEMP_ROOT_PREFIX}" prefix.`);
|
|
87
|
-
}
|
|
88
|
-
installCleanupHandlers();
|
|
89
|
-
if (!staleCleanupRan) {
|
|
90
|
-
staleCleanupRan = true;
|
|
91
|
-
await cleanupStaleTempRoots({ tmpDir: options.tmpDir });
|
|
92
|
-
}
|
|
93
|
-
const tempRoot = await fsp.mkdtemp(path.join(getTempDir(options.tmpDir), prefix));
|
|
94
|
-
trackedTempRoots.add(tempRoot);
|
|
95
|
-
return {
|
|
96
|
-
cleanup: async () => cleanupManagedTempRoot(tempRoot),
|
|
97
|
-
path: tempRoot
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export { createManagedTempRoot };
|
|
102
|
-
|
|
103
|
-
//# debugId=2A7A0EBFD7CAC42664756E2164756E21
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
OFFICIAL_WORKSPACE_TEMPLATE_ALIAS,
|
|
4
|
-
OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
|
|
5
|
-
getTemplateById,
|
|
6
|
-
getTemplateSelectOptions,
|
|
7
|
-
getUserFacingTemplateId,
|
|
8
|
-
isBuiltInTemplateId,
|
|
9
|
-
listTemplates
|
|
10
|
-
} from "./cli-8hxf9qw6.js";
|
|
11
|
-
import"./cli-ccax7s0s.js";
|
|
12
|
-
import"./cli-xnn9xjcy.js";
|
|
13
|
-
|
|
14
|
-
// ../wp-typia-project-tools/src/runtime/cli-templates.ts
|
|
15
|
-
function formatTemplateSummary(template) {
|
|
16
|
-
return `${getUserFacingTemplateId(template.id).padEnd(14)} ${template.description}`;
|
|
17
|
-
}
|
|
18
|
-
function formatTemplateFeatures(template) {
|
|
19
|
-
const lines = [` Features: ${template.features.join(" \u2022 ")}`];
|
|
20
|
-
const bestForHint = getTemplateBestForHint(template);
|
|
21
|
-
if (bestForHint) {
|
|
22
|
-
lines.push(` Best for: ${bestForHint}`);
|
|
23
|
-
}
|
|
24
|
-
const capabilityHints = getTemplateCapabilityHints(template);
|
|
25
|
-
if (capabilityHints.length > 0) {
|
|
26
|
-
lines.push(` Supports: ${capabilityHints.join(" \u2022 ")}`);
|
|
27
|
-
}
|
|
28
|
-
const specialNotes = getTemplateSpecialNotes(template);
|
|
29
|
-
if (specialNotes.length > 0) {
|
|
30
|
-
lines.push(` Notes: ${specialNotes.join(" \u2022 ")}`);
|
|
31
|
-
}
|
|
32
|
-
if (template.id === OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE) {
|
|
33
|
-
lines.push(` Alias: ${OFFICIAL_WORKSPACE_TEMPLATE_ALIAS} (\`--template ${OFFICIAL_WORKSPACE_TEMPLATE_ALIAS}\`)`);
|
|
34
|
-
}
|
|
35
|
-
return lines.join(`
|
|
36
|
-
`);
|
|
37
|
-
}
|
|
38
|
-
function formatTemplateDetails(template) {
|
|
39
|
-
const detailLines = [
|
|
40
|
-
getUserFacingTemplateId(template.id),
|
|
41
|
-
`Summary: ${template.description}`,
|
|
42
|
-
`Best for: ${getTemplateBestForHint(template)}`,
|
|
43
|
-
...getTemplateIdentityLines(template),
|
|
44
|
-
`Category: ${template.defaultCategory}`
|
|
45
|
-
];
|
|
46
|
-
const capabilityHints = getTemplateCapabilityHints(template);
|
|
47
|
-
if (capabilityHints.length > 0) {
|
|
48
|
-
detailLines.push("Capabilities:");
|
|
49
|
-
for (const capabilityHint of capabilityHints) {
|
|
50
|
-
detailLines.push(` - ${capabilityHint}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const specialNotes = getTemplateSpecialNotes(template);
|
|
54
|
-
if (specialNotes.length > 0) {
|
|
55
|
-
detailLines.push("Notes:");
|
|
56
|
-
for (const specialNote of specialNotes) {
|
|
57
|
-
detailLines.push(` - ${specialNote}`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
detailLines.push("Logical layers:");
|
|
61
|
-
for (const logicalLayer of getTemplateLogicalLayerSummaries(template)) {
|
|
62
|
-
detailLines.push(` - ${logicalLayer}`);
|
|
63
|
-
}
|
|
64
|
-
detailLines.push(`Features: ${template.features.join(", ")}`);
|
|
65
|
-
return detailLines.join(`
|
|
66
|
-
`);
|
|
67
|
-
}
|
|
68
|
-
function getTemplateBestForHint(template) {
|
|
69
|
-
if (template.id === "basic") {
|
|
70
|
-
return "minimal static-first block scaffolds with Typia validation and the lightest default surface";
|
|
71
|
-
}
|
|
72
|
-
if (template.id === "interactivity") {
|
|
73
|
-
return "interactive single-block experiences that keep client-side state and actions inside one scaffold";
|
|
74
|
-
}
|
|
75
|
-
if (template.id === "persistence") {
|
|
76
|
-
return "typed REST-backed blocks that need persistence-aware reads, writes, and schema refresh workflows";
|
|
77
|
-
}
|
|
78
|
-
if (template.id === "compound") {
|
|
79
|
-
return "parent-and-child block families that own nested authoring conventions and optional persistence wiring";
|
|
80
|
-
}
|
|
81
|
-
if (template.id === "query-loop") {
|
|
82
|
-
return "create-time `core/query` variations with connected starter patterns instead of `add block` families";
|
|
83
|
-
}
|
|
84
|
-
return "official multi-block workspaces that extend through `wp-typia add ...` and workspace doctor flows";
|
|
85
|
-
}
|
|
86
|
-
function getTemplateCapabilityHints(template) {
|
|
87
|
-
if (template.id === "persistence" || template.id === "compound") {
|
|
88
|
-
return [
|
|
89
|
-
"--alternate-render-targets",
|
|
90
|
-
"--data-storage",
|
|
91
|
-
"--persistence-policy",
|
|
92
|
-
"external layers"
|
|
93
|
-
];
|
|
94
|
-
}
|
|
95
|
-
if (template.id === "query-loop") {
|
|
96
|
-
return ["--query-post-type", "external layers"];
|
|
97
|
-
}
|
|
98
|
-
if (isBuiltInTemplateId(template.id)) {
|
|
99
|
-
return ["external layers"];
|
|
100
|
-
}
|
|
101
|
-
return [];
|
|
102
|
-
}
|
|
103
|
-
function getTemplateSpecialNotes(template) {
|
|
104
|
-
if (template.id === "query-loop") {
|
|
105
|
-
return [
|
|
106
|
-
"Create-time variation scaffold only; use `wp-typia create <project-dir> --template query-loop` instead of `wp-typia add block`.",
|
|
107
|
-
"Owns a `core/query` variation, so it does not generate `src/types.ts`, `block.json`, or Typia manifests."
|
|
108
|
-
];
|
|
109
|
-
}
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
function getTemplateIdentityLines(template) {
|
|
113
|
-
if (template.id === OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE) {
|
|
114
|
-
return [
|
|
115
|
-
"Identity:",
|
|
116
|
-
` - User-facing alias: ${OFFICIAL_WORKSPACE_TEMPLATE_ALIAS} (\`--template ${OFFICIAL_WORKSPACE_TEMPLATE_ALIAS}\`)`,
|
|
117
|
-
` - Official package: ${OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE}`,
|
|
118
|
-
"Type: official workspace scaffold"
|
|
119
|
-
];
|
|
120
|
-
}
|
|
121
|
-
if (template.id === "query-loop") {
|
|
122
|
-
return [
|
|
123
|
-
"Identity:",
|
|
124
|
-
" - Built-in template id: query-loop",
|
|
125
|
-
"Type: create-time core/query variation scaffold",
|
|
126
|
-
"Output model: variation-only scaffold; does not generate block.json or Typia manifests"
|
|
127
|
-
];
|
|
128
|
-
}
|
|
129
|
-
return [
|
|
130
|
-
"Identity:",
|
|
131
|
-
` - Built-in template id: ${template.id}`,
|
|
132
|
-
"Type: built-in block scaffold"
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
function getTemplateLogicalLayerSummaries(template) {
|
|
136
|
-
if (!isBuiltInTemplateId(template.id)) {
|
|
137
|
-
return ["workspace package scaffold"];
|
|
138
|
-
}
|
|
139
|
-
if (template.id === "persistence") {
|
|
140
|
-
return [
|
|
141
|
-
"authenticated write policy: shared/base -> rest helpers (shared) -> persistence core -> authenticated write policy -> persistence overlay",
|
|
142
|
-
"public write policy: shared/base -> rest helpers (shared) -> persistence core -> public write policy -> persistence overlay"
|
|
143
|
-
];
|
|
144
|
-
}
|
|
145
|
-
if (template.id === "compound") {
|
|
146
|
-
return [
|
|
147
|
-
"pure block family: shared/base -> compound core -> compound overlay",
|
|
148
|
-
"authenticated persistence: shared/base -> compound core -> rest helpers (shared) -> compound persistence core -> authenticated write policy -> compound overlay",
|
|
149
|
-
"public persistence: shared/base -> compound core -> rest helpers (shared) -> compound persistence core -> public write policy -> compound overlay"
|
|
150
|
-
];
|
|
151
|
-
}
|
|
152
|
-
const overlayName = template.id === "query-loop" ? "query-loop overlay" : `${template.id} overlay`;
|
|
153
|
-
return [
|
|
154
|
-
`shared/base -> ${overlayName}`
|
|
155
|
-
];
|
|
156
|
-
}
|
|
157
|
-
export {
|
|
158
|
-
listTemplates,
|
|
159
|
-
isBuiltInTemplateId,
|
|
160
|
-
getTemplateSelectOptions,
|
|
161
|
-
getTemplateById,
|
|
162
|
-
formatTemplateSummary,
|
|
163
|
-
formatTemplateFeatures,
|
|
164
|
-
formatTemplateDetails
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
//# debugId=F036FFC923A55DB664756E2164756E21
|