wp-typia 0.19.0 → 0.20.0
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 +4 -2
- package/dist-bunli/.bunli/commands.gen.js +1843 -1216
- package/dist-bunli/.bunli/commands.gen.js.map +36 -33
- package/dist-bunli/cli-03j0axbt.js +163 -0
- package/dist-bunli/cli-03j0axbt.js.map +11 -0
- package/dist-bunli/{cli-7svz19s1.js → cli-2ybmc22r.js} +370 -86
- package/dist-bunli/{cli-7svz19s1.js.map → cli-2ybmc22r.js.map} +15 -14
- package/dist-bunli/cli-7yg38ht2.js +427 -0
- package/dist-bunli/cli-7yg38ht2.js.map +12 -0
- package/dist-bunli/{cli-yw0mq0wq.js → cli-93wd227r.js} +108 -3
- package/dist-bunli/cli-93wd227r.js.map +10 -0
- package/dist-bunli/{cli-kan7a6db.js → cli-a6dwqnhq.js} +24 -2
- package/dist-bunli/cli-a6dwqnhq.js.map +11 -0
- package/dist-bunli/{cli-add-j2c81sh1.js → cli-add-pq6wm87p.js} +16 -9
- package/dist-bunli/{cli-add-j2c81sh1.js.map → cli-add-pq6wm87p.js.map} +3 -3
- package/dist-bunli/{cli-diagnostics-c65hhyhx.js → cli-diagnostics-e5gxeprp.js} +8 -4
- package/dist-bunli/{cli-diagnostics-c65hhyhx.js.map → cli-diagnostics-e5gxeprp.js.map} +1 -1
- package/dist-bunli/{cli-doctor-hft0wr0e.js → cli-doctor-qk6fwpds.js} +14 -13
- package/dist-bunli/{cli-doctor-hft0wr0e.js.map → cli-doctor-qk6fwpds.js.map} +3 -3
- package/dist-bunli/{cli-572d6g4m.js → cli-hv2yedw2.js} +2 -157
- package/dist-bunli/{cli-572d6g4m.js.map → cli-hv2yedw2.js.map} +4 -6
- package/dist-bunli/{cli-scaffold-vcg6wem5.js → cli-scaffold-s3nhwe7x.js} +9 -7
- package/dist-bunli/cli-scaffold-s3nhwe7x.js.map +10 -0
- package/dist-bunli/cli-t73q5aqz.js +103 -0
- package/dist-bunli/cli-t73q5aqz.js.map +10 -0
- package/dist-bunli/{cli-templates-4qxszbmc.js → cli-templates-j65r4k9v.js} +1 -1
- package/dist-bunli/{cli-wtrvnce5.js → cli-w4r0rr8a.js} +8 -8
- package/dist-bunli/cli-w4r0rr8a.js.map +10 -0
- package/dist-bunli/cli.js +127 -2863
- package/dist-bunli/cli.js.map +5 -56
- package/dist-bunli/command-list-37n1za5q.js +2485 -0
- package/dist-bunli/command-list-37n1za5q.js.map +58 -0
- package/dist-bunli/node-cli.js +432 -323
- package/dist-bunli/node-cli.js.map +11 -10
- package/dist-bunli/{sync-x91y9jtv.js → sync-k2k8svyc.js} +3 -2
- package/dist-bunli/{sync-x91y9jtv.js.map → sync-k2k8svyc.js.map} +1 -1
- package/package.json +6 -3
- package/dist-bunli/cli-kan7a6db.js.map +0 -11
- package/dist-bunli/cli-scaffold-vcg6wem5.js.map +0 -10
- package/dist-bunli/cli-wtrvnce5.js.map +0 -10
- package/dist-bunli/cli-yw0mq0wq.js.map +0 -10
- /package/dist-bunli/{cli-templates-4qxszbmc.js.map → cli-templates-j65r4k9v.js.map} +0 -0
|
@@ -18,26 +18,28 @@ import {
|
|
|
18
18
|
resolvePackageManagerId,
|
|
19
19
|
resolveTemplateId,
|
|
20
20
|
scaffoldProject
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-2ybmc22r.js";
|
|
22
22
|
import"./cli-jmtpd5ft.js";
|
|
23
23
|
import"./cli-bq2v559b.js";
|
|
24
24
|
import {
|
|
25
25
|
formatInstallCommand,
|
|
26
26
|
formatRunScript
|
|
27
27
|
} from "./cli-1b5jx6j9.js";
|
|
28
|
-
import"./cli-
|
|
28
|
+
import"./cli-w4r0rr8a.js";
|
|
29
29
|
import {
|
|
30
30
|
OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
|
|
31
31
|
isBuiltInTemplateId
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-a6dwqnhq.js";
|
|
33
33
|
import"./cli-rg481yks.js";
|
|
34
|
+
import {
|
|
35
|
+
createManagedTempRoot
|
|
36
|
+
} from "./cli-t73q5aqz.js";
|
|
34
37
|
import"./cli-pd5pqgre.js";
|
|
35
38
|
import"./cli-xnn9xjcy.js";
|
|
36
39
|
|
|
37
40
|
// ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
|
|
38
41
|
import fs from "fs";
|
|
39
42
|
import { promises as fsp } from "fs";
|
|
40
|
-
import os from "os";
|
|
41
43
|
import path from "path";
|
|
42
44
|
async function listRelativeProjectFiles(rootDir) {
|
|
43
45
|
const relativeFiles = [];
|
|
@@ -86,7 +88,7 @@ async function buildScaffoldDryRunPlan({
|
|
|
86
88
|
withWpEnv
|
|
87
89
|
}) {
|
|
88
90
|
await assertDryRunTargetDirectoryReady(projectDir, allowExistingDir);
|
|
89
|
-
const tempRoot = await
|
|
91
|
+
const { path: tempRoot, cleanup } = await createManagedTempRoot("wp-typia-scaffold-plan-");
|
|
90
92
|
const previewProjectDir = path.join(tempRoot, "preview-project");
|
|
91
93
|
try {
|
|
92
94
|
const result = await scaffoldProject({
|
|
@@ -119,7 +121,7 @@ async function buildScaffoldDryRunPlan({
|
|
|
119
121
|
result
|
|
120
122
|
};
|
|
121
123
|
} finally {
|
|
122
|
-
await
|
|
124
|
+
await cleanup();
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
function validateCreateProjectInput(projectInput) {
|
|
@@ -546,4 +548,4 @@ export {
|
|
|
546
548
|
getNextSteps
|
|
547
549
|
};
|
|
548
550
|
|
|
549
|
-
//# debugId=
|
|
551
|
+
//# debugId=47C9FBD37EC1603F64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../wp-typia-project-tools/src/runtime/cli-scaffold.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import fs from \"node:fs\";\nimport { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport {\n\tcollectScaffoldAnswers,\n\tDATA_STORAGE_MODES,\n\tPERSISTENCE_POLICIES,\n\tisDataStorageMode,\n\tisPersistencePolicy,\n\tresolvePackageManagerId,\n\tresolveTemplateId,\n\tscaffoldProject,\n} from \"./scaffold.js\";\nimport { parseAlternateRenderTargets } from \"./alternate-render-targets.js\";\nimport { parseCompoundInnerBlocksPreset } from \"./compound-inner-blocks.js\";\nimport {\n\tformatInstallCommand,\n\tformatRunScript,\n} from \"./package-managers.js\";\nimport type {\n\tDataStorageMode,\n\tPersistencePolicy,\n\tScaffoldProgressEvent,\n} from \"./scaffold.js\";\nimport type { PackageManagerId } from \"./package-managers.js\";\nimport { getPrimaryDevelopmentScript } from \"./local-dev-presets.js\";\nimport { createManagedTempRoot } from \"./temp-roots.js\";\nimport {\n\tgetOptionalOnboardingNote,\n\tgetOptionalOnboardingSteps,\n} from \"./scaffold-onboarding.js\";\nimport { formatNonEmptyTargetDirectoryError } from \"./scaffold-bootstrap.js\";\nimport {\n\tOFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,\n\tisBuiltInTemplateId,\n} from \"./template-registry.js\";\nimport {\n\tresolveOptionalInteractiveExternalLayerId,\n\ttype ExternalLayerSelectionOption,\n} from \"./external-layer-selection.js\";\nimport type { TemplateDefinition } from \"./template-registry.js\";\nimport {\n\tassertBuiltInTemplateVariantAllowed,\n\tresolveLocalCliPathOption,\n\tnormalizeOptionalCliString,\n} from \"./cli-validation.js\";\n\ninterface GetNextStepsOptions {\n\tnoInstall: boolean;\n\tpackageManager: PackageManagerId;\n\tprojectDir: string;\n\tprojectInput: string;\n\ttemplateId: string;\n}\n\ninterface GetOptionalOnboardingOptions {\n\tavailableScripts?: string[];\n\tpackageManager: PackageManagerId;\n\ttemplateId: string;\n\tcompoundPersistenceEnabled?: boolean;\n}\n\ninterface OptionalOnboardingGuidance {\n\tnote: string;\n\tsteps: string[];\n}\n\nexport interface ScaffoldDryRunPlan {\n\tdependencyInstall: \"skipped-by-flag\" | \"would-install\";\n\tfiles: string[];\n}\n\ninterface RunScaffoldFlowOptions {\n\tallowExistingDir?: boolean;\n\talternateRenderTargets?: string;\n\tcwd?: string;\n\tdataStorageMode?: string;\n\tdryRun?: boolean;\n\texternalLayerId?: string;\n\texternalLayerSource?: string;\n\tinstallDependencies?: Parameters<typeof scaffoldProject>[0][\"installDependencies\"];\n\tinnerBlocksPreset?: string;\n\tisInteractive?: boolean;\n\tnamespace?: string;\n\tnoInstall?: boolean;\n\tonProgress?: ((event: ScaffoldProgressEvent) => void | Promise<void>) | undefined;\n\tpackageManager?: string;\n\tphpPrefix?: string;\n\tprojectInput: string;\n\tpromptText?: Parameters<typeof collectScaffoldAnswers>[0][\"promptText\"];\n\tqueryPostType?: string;\n\tselectDataStorage?: () => Promise<DataStorageMode>;\n\tselectExternalLayerId?: (\n\t\toptions: ExternalLayerSelectionOption[],\n\t) => Promise<string>;\n\tselectPackageManager?: () => Promise<PackageManagerId>;\n\tselectPersistencePolicy?: () => Promise<PersistencePolicy>;\n\tselectTemplate?: () => Promise<TemplateDefinition[\"id\"]>;\n\tselectWithMigrationUi?: () => Promise<boolean>;\n\tselectWithTestPreset?: () => Promise<boolean>;\n\tselectWithWpEnv?: () => Promise<boolean>;\n\ttemplateId?: string;\n\ttextDomain?: string;\n\tvariant?: string;\n\tpersistencePolicy?: string;\n\twithMigrationUi?: boolean;\n\twithTestPreset?: boolean;\n\twithWpEnv?: boolean;\n\tyes?: boolean;\n}\n\nasync function listRelativeProjectFiles(rootDir: string): Promise<string[]> {\n\tconst relativeFiles: string[] = [];\n\n\tasync function visit(currentDir: string): Promise<void> {\n\t\tconst entries = await fsp.readdir(currentDir, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tconst absolutePath = path.join(currentDir, entry.name);\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tawait visit(absolutePath);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trelativeFiles.push(\n\t\t\t\tpath\n\t\t\t\t\t.relative(rootDir, absolutePath)\n\t\t\t\t\t.replace(path.sep === \"\\\\\" ? /\\\\/gu : /\\//gu, \"/\"),\n\t\t\t);\n\t\t}\n\t}\n\n\tawait visit(rootDir);\n\treturn relativeFiles.sort((left, right) => left.localeCompare(right));\n}\n\nasync function assertDryRunTargetDirectoryReady(\n\tprojectDir: string,\n\tallowExistingDir: boolean,\n): Promise<void> {\n\tif (!fs.existsSync(projectDir) || allowExistingDir) {\n\t\treturn;\n\t}\n\n\tconst entries = await fsp.readdir(projectDir);\n\tif (entries.length > 0) {\n\t\tthrow new Error(formatNonEmptyTargetDirectoryError(projectDir));\n\t}\n}\n\nasync function buildScaffoldDryRunPlan({\n\tallowExistingDir,\n\talternateRenderTargets,\n\tanswers,\n\tcwd,\n\tdataStorageMode,\n\texternalLayerId,\n\texternalLayerSource,\n\texternalLayerSourceLabel,\n\tinstallDependencies,\n\tnoInstall,\n\tonProgress,\n\tpackageManager,\n\tpersistencePolicy,\n\tprojectDir,\n\ttemplateId,\n\tvariant,\n\twithMigrationUi,\n\twithTestPreset,\n\twithWpEnv,\n}: {\n\tallowExistingDir: boolean;\n\talternateRenderTargets?: Parameters<typeof scaffoldProject>[0][\"alternateRenderTargets\"];\n\tanswers: Parameters<typeof scaffoldProject>[0][\"answers\"];\n\tcwd: string;\n\tdataStorageMode?: Parameters<typeof scaffoldProject>[0][\"dataStorageMode\"];\n\texternalLayerId?: string;\n\texternalLayerSource?: string;\n\texternalLayerSourceLabel?: string;\n\tinstallDependencies?: Parameters<typeof scaffoldProject>[0][\"installDependencies\"];\n\tnoInstall: boolean;\n\tonProgress?: RunScaffoldFlowOptions[\"onProgress\"];\n\tpackageManager: PackageManagerId;\n\tpersistencePolicy?: Parameters<typeof scaffoldProject>[0][\"persistencePolicy\"];\n\tprojectDir: string;\n\ttemplateId: string;\n\tvariant?: string;\n\twithMigrationUi: boolean;\n\twithTestPreset: boolean;\n\twithWpEnv: boolean;\n}): Promise<{\n\tplan: ScaffoldDryRunPlan;\n\tresult: Awaited<ReturnType<typeof scaffoldProject>>;\n}> {\n\tawait assertDryRunTargetDirectoryReady(projectDir, allowExistingDir);\n\tconst { path: tempRoot, cleanup } = await createManagedTempRoot(\n\t\t\"wp-typia-scaffold-plan-\",\n\t);\n\tconst previewProjectDir = path.join(tempRoot, \"preview-project\");\n\n\ttry {\n\t\tconst result = await scaffoldProject({\n\t\t\tallowExistingDir: false,\n\t\t\talternateRenderTargets,\n\t\t\tanswers,\n\t\t\tcwd,\n\t\t\tdataStorageMode,\n\t\t\texternalLayerId,\n\t\t\texternalLayerSource,\n\t\t\texternalLayerSourceLabel,\n\t\t\tinstallDependencies,\n\t\t\tnoInstall: true,\n\t\t\tonProgress,\n\t\t\tpackageManager,\n\t\t\tpersistencePolicy,\n\t\t\tprojectDir: previewProjectDir,\n\t\t\ttemplateId,\n\t\t\tvariant,\n\t\t\twithMigrationUi,\n\t\t\twithTestPreset,\n\t\t\twithWpEnv,\n\t\t});\n\t\tconst files = await listRelativeProjectFiles(previewProjectDir);\n\n\t\treturn {\n\t\t\tplan: {\n\t\t\t\tdependencyInstall: noInstall ? \"skipped-by-flag\" : \"would-install\",\n\t\t\t\tfiles,\n\t\t\t},\n\t\t\tresult,\n\t\t};\n\t} finally {\n\t\tawait cleanup();\n\t}\n}\n\nfunction validateCreateProjectInput(projectInput: string) {\n\tconst normalizedProjectInput = projectInput.trim();\n\tif (normalizedProjectInput.length === 0) {\n\t\tthrow new Error(\n\t\t\t\"Project directory is required. Usage: wp-typia create <project-dir> (or wp-typia <project-dir> when <project-dir> is the only positional argument).\",\n\t\t);\n\t}\n\n\tconst normalizedProjectPath =\n\t\tpath.normalize(normalizedProjectInput).replace(/[\\\\/]+$/u, \"\") ||\n\t\tpath.normalize(normalizedProjectInput);\n\tif (normalizedProjectPath === \".\" || normalizedProjectPath === \"..\") {\n\t\tthrow new Error(\n\t\t\t\"`wp-typia create` requires a new project directory. Use an explicit child directory instead of `.` or `..`.\",\n\t\t);\n\t}\n}\n\nfunction collectProjectDirectoryWarnings(projectDir: string): string[] {\n\tconst warnings: string[] = [];\n\tconst projectName = path.basename(projectDir);\n\tif (/\\s/u.test(projectName)) {\n\t\twarnings.push(\n\t\t\t`Project directory \"${projectName}\" contains spaces. The generated next-step commands will be quoted, but a simple kebab-case directory name is usually easier to use with shells and downstream tooling.`,\n\t\t);\n\t}\n\n\tconst shellSensitiveCharacters = Array.from(\n\t\tnew Set(projectName.match(/[^A-Za-z0-9._ -]/gu) ?? []),\n\t);\n\tif (shellSensitiveCharacters.length > 0) {\n\t\twarnings.push(\n\t\t\t`Project directory \"${projectName}\" contains shell-sensitive characters (${shellSensitiveCharacters.join(\", \")}). Prefer letters, numbers, \".\", \"_\" and \"-\" when possible.`,\n\t\t);\n\t}\n\n\treturn warnings;\n}\n\nfunction templateUsesPersistenceSettings(\n\ttemplateId: string,\n\toptions: {\n\t\tdataStorageMode?: string;\n\t\tpersistencePolicy?: string;\n\t},\n): boolean {\n\tif (templateId === \"persistence\") {\n\t\treturn true;\n\t}\n\n\tif (templateId !== \"compound\") {\n\t\treturn false;\n\t}\n\n\treturn Boolean(options.dataStorageMode || options.persistencePolicy);\n}\n\nfunction templateSupportsPersistenceFlags(templateId: string): boolean {\n\treturn templateId === \"persistence\" || templateId === \"compound\";\n}\n\nfunction templateSupportsCompoundInnerBlocksPreset(templateId: string): boolean {\n\treturn templateId === \"compound\";\n}\n\nfunction createTemplateLabel(templateId: string): string {\n\treturn templateId === OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE\n\t\t? \"`--template workspace`\"\n\t\t: `\"${templateId}\"`;\n}\n\nfunction collectTemplateCapabilityWarnings(options: {\n\tqueryPostType?: string;\n\ttemplateId: string;\n\twithMigrationUi?: boolean;\n}): string[] {\n\tconst warnings: string[] = [];\n\tconst trimmedQueryPostType = options.queryPostType?.trim();\n\n\tif (\n\t\ttrimmedQueryPostType &&\n\t\toptions.templateId !== \"query-loop\" &&\n\t\t(isBuiltInTemplateId(options.templateId) ||\n\t\t\toptions.templateId === OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE)\n\t) {\n\t\twarnings.push(\n\t\t\t`\\`--query-post-type\\` only applies to \\`wp-typia create --template query-loop\\`, which scaffolds a create-time \\`core/query\\` variation instead of a standalone block. ${createTemplateLabel(options.templateId)} will ignore \"${trimmedQueryPostType}\".`,\n\t\t);\n\t}\n\n\tif (\n\t\toptions.withMigrationUi === true &&\n\t\t!isBuiltInTemplateId(options.templateId) &&\n\t\toptions.templateId !== OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE\n\t) {\n\t\twarnings.push(\n\t\t\t`\\`--with-migration-ui\\` was ignored for ${createTemplateLabel(options.templateId)}. Migration UI currently scaffolds built-in templates and the official \\`--template workspace\\` flow; external templates still need to opt into that surface explicitly.`,\n\t\t);\n\t}\n\n\treturn warnings;\n}\n\nfunction templateSupportsAlternateRenderTargets(options: {\n\talternateRenderTargets?: string;\n\tdataStorageMode?: string;\n\tpersistencePolicy?: string;\n\ttemplateId: string;\n}): boolean {\n\tif (!options.alternateRenderTargets) {\n\t\treturn false;\n\t}\n\n\tif (options.templateId === \"persistence\") {\n\t\treturn true;\n\t}\n\n\tif (options.templateId !== \"compound\") {\n\t\treturn false;\n\t}\n\n\treturn templateUsesPersistenceSettings(options.templateId, {\n\t\tdataStorageMode: options.dataStorageMode,\n\t\tpersistencePolicy: options.persistencePolicy,\n\t});\n}\n\nfunction validateCreateFlagContract(options: {\n\talternateRenderTargets?: string;\n\tdataStorageMode?: string;\n\tinnerBlocksPreset?: string;\n\tpersistencePolicy?: string;\n\ttemplateId: string;\n\tvariant?: string;\n}) {\n\tconst {\n\t\talternateRenderTargets,\n\t\tdataStorageMode,\n\t\tinnerBlocksPreset,\n\t\tpersistencePolicy,\n\t\ttemplateId,\n\t\tvariant,\n\t} = options;\n\tif (\n\t\t(dataStorageMode || persistencePolicy) &&\n\t\t!templateSupportsPersistenceFlags(templateId)\n\t) {\n\t\tthrow new Error(\n\t\t\t\"`--data-storage` and `--persistence-policy` are supported only for `wp-typia create --template persistence` or `--template compound`.\",\n\t\t);\n\t}\n\tif (\n\t\talternateRenderTargets &&\n\t\t!templateSupportsAlternateRenderTargets({\n\t\t\talternateRenderTargets,\n\t\t\tdataStorageMode,\n\t\t\tpersistencePolicy,\n\t\t\ttemplateId,\n\t\t})\n\t) {\n\t\tif (templateId === \"compound\") {\n\t\t\tthrow new Error(\n\t\t\t\t\"`--alternate-render-targets` on `wp-typia create --template compound` requires the persistence-enabled server render path. Add `--data-storage <post-meta|custom-table>` or `--persistence-policy <authenticated|public>` first.\",\n\t\t\t);\n\t\t}\n\t\tthrow new Error(\n\t\t\t\"`--alternate-render-targets` is supported only for `wp-typia create --template persistence` or persistence-enabled `--template compound` scaffolds.\",\n\t\t);\n\t}\n\tparseAlternateRenderTargets(alternateRenderTargets);\n\tif (\n\t\tinnerBlocksPreset &&\n\t\t!templateSupportsCompoundInnerBlocksPreset(templateId)\n\t) {\n\t\tthrow new Error(\n\t\t\t\"`--inner-blocks-preset` is supported only for `wp-typia create --template compound`.\",\n\t\t);\n\t}\n\tparseCompoundInnerBlocksPreset(innerBlocksPreset);\n\n\tif (isBuiltInTemplateId(templateId)) {\n\t\tassertBuiltInTemplateVariantAllowed({\n\t\t\ttemplateId,\n\t\t\tvariant,\n\t\t});\n\t}\n}\n\nfunction parseSelectableValue<T extends string>(\n\tlabel: string,\n\tvalue: string,\n\tisValue: (input: string) => input is T,\n\tallowedValues: readonly T[],\n): T {\n\tif (isValue(value)) {\n\t\treturn value;\n\t}\n\n\tthrow new Error(\n\t\t`Unsupported ${label} \"${value}\". Expected one of: ${allowedValues.join(\", \")}`,\n\t);\n}\n\nasync function resolveOptionalSelection<T extends string>({\n\tdefaultValue,\n\texplicitValue,\n\tisInteractive,\n\tisValue,\n\tlabel,\n\tallowedValues,\n\tselect,\n\tshouldResolve = true,\n\tyes,\n}: {\n\tdefaultValue: T;\n\texplicitValue?: string;\n\tisInteractive: boolean;\n\tisValue: (input: string) => input is T;\n\tlabel: string;\n\tallowedValues: readonly T[];\n\tselect?: () => Promise<T>;\n\tshouldResolve?: boolean;\n\tyes: boolean;\n}): Promise<T | undefined> {\n\tif (!shouldResolve) {\n\t\treturn undefined;\n\t}\n\n\tif (explicitValue) {\n\t\treturn parseSelectableValue(label, explicitValue, isValue, allowedValues);\n\t}\n\n\tif (yes) {\n\t\treturn defaultValue;\n\t}\n\n\tif (isInteractive && select) {\n\t\treturn select();\n\t}\n\n\treturn defaultValue;\n}\n\nasync function resolveOptionalBooleanFlag({\n\tdefaultValue = false,\n\tdisabled = false,\n\texplicitValue,\n\tisInteractive,\n\tselect,\n\tyes,\n}: {\n\tdefaultValue?: boolean;\n\tdisabled?: boolean;\n\texplicitValue?: boolean;\n\tisInteractive: boolean;\n\tselect?: () => Promise<boolean>;\n\tyes: boolean;\n}): Promise<boolean> {\n\tif (disabled) {\n\t\treturn defaultValue;\n\t}\n\n\tif (typeof explicitValue === \"boolean\") {\n\t\treturn explicitValue;\n\t}\n\n\tif (yes) {\n\t\treturn defaultValue;\n\t}\n\n\tif (isInteractive && select) {\n\t\treturn select();\n\t}\n\n\treturn defaultValue;\n}\n\nfunction quoteShellValue(value: string): string {\n\tif (\n\t\t!value.startsWith(\"-\") &&\n\t\t/^[A-Za-z0-9._/@:-]+(?:\\/[A-Za-z0-9._@:-]+)*$/.test(value)\n\t) {\n\t\treturn value;\n\t}\n\n\treturn `'${value.replace(/'/g, `'\\\"'\\\"'`)}'`;\n}\n\n/**\n * Build the printed next-step commands for a scaffolded project.\n *\n * @param options Project location and package-manager details used to format\n * next-step commands.\n * @returns Ordered shell commands shown after scaffolding succeeds.\n */\nexport function getNextSteps({\n\tprojectInput,\n\tprojectDir,\n\tpackageManager,\n\tnoInstall,\n\ttemplateId,\n}: GetNextStepsOptions): string[] {\n\tconst cdTarget = path.isAbsolute(projectInput) ? projectDir : projectInput;\n\tconst steps = [`cd ${quoteShellValue(cdTarget)}`];\n\n\tif (noInstall) {\n\t\tsteps.push(formatInstallCommand(packageManager));\n\t}\n\n\tsteps.push(formatRunScript(packageManager, getPrimaryDevelopmentScript(templateId)));\n\treturn steps;\n}\n\n/**\n * Compute optional onboarding guidance shown after scaffolding completes.\n *\n * @param options Package-manager and template context for optional guidance.\n * @returns Optional onboarding note and step list.\n */\nexport function getOptionalOnboarding({\n\tavailableScripts,\n\tpackageManager,\n\ttemplateId,\n\tcompoundPersistenceEnabled = false,\n}: GetOptionalOnboardingOptions): OptionalOnboardingGuidance {\n\treturn {\n\t\tnote: getOptionalOnboardingNote(packageManager, templateId, {\n\t\t\tavailableScripts,\n\t\t\tcompoundPersistenceEnabled,\n\t\t}),\n\t\tsteps: getOptionalOnboardingSteps(packageManager, templateId, {\n\t\t\tavailableScripts,\n\t\t\tcompoundPersistenceEnabled,\n\t\t}),\n\t};\n}\n\n/**\n * Resolve scaffold options, prompts, and follow-up steps for one CLI run.\n *\n * @param options CLI/runtime inputs used to collect answers and scaffold a\n * project.\n * @returns The scaffold result together with next-step guidance.\n */\nexport async function runScaffoldFlow({\n\tprojectInput,\n\tcwd = process.cwd(),\n\ttemplateId,\n\talternateRenderTargets,\n\tdataStorageMode,\n\tdryRun = false,\n\texternalLayerId,\n\texternalLayerSource,\n\tinnerBlocksPreset,\n\tpersistencePolicy,\n\tpackageManager,\n\tnamespace,\n\ttextDomain,\n\tphpPrefix,\n\tqueryPostType,\n\tyes = false,\n\tnoInstall = false,\n\tonProgress,\n\tisInteractive = false,\n\tallowExistingDir = false,\n\tselectTemplate,\n\tselectDataStorage,\n\tselectExternalLayerId,\n\tselectPersistencePolicy,\n\tselectPackageManager,\n\tpromptText,\n\tinstallDependencies = undefined,\n\tvariant,\n\tselectWithTestPreset,\n\tselectWithWpEnv,\n\tselectWithMigrationUi,\n\twithMigrationUi,\n\twithTestPreset,\n\twithWpEnv,\n}: RunScaffoldFlowOptions) {\n\tconst normalizedExternalLayerId =\n\t\tnormalizeOptionalCliString(externalLayerId);\n\tconst normalizedExternalLayerSource = resolveLocalCliPathOption({\n\t\tcwd,\n\t\tlabel: \"--external-layer-source\",\n\t\tvalue: externalLayerSource,\n\t});\n\n\tvalidateCreateProjectInput(projectInput);\n\n\tconst resolvedTemplateId = await resolveTemplateId({\n\t\ttemplateId,\n\t\tyes,\n\t\tisInteractive,\n\t\tselectTemplate,\n\t});\n\tvalidateCreateFlagContract({\n\t\talternateRenderTargets,\n\t\tdataStorageMode,\n\t\tinnerBlocksPreset,\n\t\tpersistencePolicy,\n\t\ttemplateId: resolvedTemplateId,\n\t\tvariant,\n\t});\n\tconst resolvedInnerBlocksPreset =\n\t\tparseCompoundInnerBlocksPreset(innerBlocksPreset);\n\tconst resolvedExternalLayerSelection =\n\t\tisBuiltInTemplateId(resolvedTemplateId) && isInteractive\n\t\t\t? await resolveOptionalInteractiveExternalLayerId({\n\t\t\t\t\tcallerCwd: cwd,\n\t\t\t\t\texternalLayerId: normalizedExternalLayerId,\n\t\t\t\t\texternalLayerSource: normalizedExternalLayerSource,\n\t\t\t\t\tselectExternalLayerId,\n\t\t\t\t})\n\t\t\t: {\n\t\t\t\t\texternalLayerId: normalizedExternalLayerId,\n\t\t\t\t\texternalLayerSource: normalizedExternalLayerSource,\n\t\t\t\t};\n\ttry {\n\t\tconst shouldResolvePersistence = templateUsesPersistenceSettings(resolvedTemplateId, {\n\t\t\tdataStorageMode,\n\t\t\tpersistencePolicy,\n\t\t});\n\t\tconst resolvedDataStorage = await resolveOptionalSelection({\n\t\t\tallowedValues: DATA_STORAGE_MODES,\n\t\t\tdefaultValue: \"custom-table\",\n\t\t\texplicitValue: dataStorageMode,\n\t\t\tisInteractive,\n\t\t\tisValue: isDataStorageMode,\n\t\t\tlabel: \"data storage mode\",\n\t\t\tselect: selectDataStorage,\n\t\t\tshouldResolve: shouldResolvePersistence,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedPersistencePolicy = await resolveOptionalSelection({\n\t\t\tallowedValues: PERSISTENCE_POLICIES,\n\t\t\tdefaultValue: \"authenticated\",\n\t\t\texplicitValue: persistencePolicy,\n\t\t\tisInteractive,\n\t\t\tisValue: isPersistencePolicy,\n\t\t\tlabel: \"persistence policy\",\n\t\t\tselect: selectPersistencePolicy,\n\t\t\tshouldResolve: shouldResolvePersistence,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedPackageManager = await resolvePackageManagerId({\n\t\t\tpackageManager,\n\t\t\tyes,\n\t\t\tisInteractive,\n\t\t\tselectPackageManager,\n\t\t});\n\t\tconst resolvedWithWpEnv = await resolveOptionalBooleanFlag({\n\t\t\texplicitValue: withWpEnv,\n\t\t\tisInteractive,\n\t\t\tselect: selectWithWpEnv,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedWithTestPreset = await resolveOptionalBooleanFlag({\n\t\t\texplicitValue: withTestPreset,\n\t\t\tisInteractive,\n\t\t\tselect: selectWithTestPreset,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedWithMigrationUi = await resolveOptionalBooleanFlag({\n\t\t\tdisabled:\n\t\t\t\t!isBuiltInTemplateId(resolvedTemplateId) &&\n\t\t\t\tresolvedTemplateId !== OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,\n\t\t\texplicitValue: withMigrationUi,\n\t\t\tisInteractive,\n\t\t\tselect: selectWithMigrationUi,\n\t\t\tyes,\n\t\t});\n\t\tconst projectDir = path.resolve(cwd, projectInput);\n\t\tconst projectName = path.basename(projectDir);\n\t\tconst answers = await collectScaffoldAnswers({\n\t\t\tdataStorageMode: resolvedDataStorage,\n\t\t\tnamespace,\n\t\t\tpersistencePolicy: resolvedPersistencePolicy,\n\t\t\tphpPrefix,\n\t\t\tprojectName,\n\t\t\tqueryPostType,\n\t\t\ttemplateId: resolvedTemplateId,\n\t\t\ttextDomain,\n\t\t\tyes,\n\t\t\tpromptText,\n\t\t});\n\t\tif (resolvedTemplateId === \"compound\" && resolvedInnerBlocksPreset) {\n\t\t\tanswers.compoundInnerBlocksPreset = resolvedInnerBlocksPreset;\n\t\t}\n\n\t\tconst resolvedResult = dryRun\n\t\t\t? await buildScaffoldDryRunPlan({\n\t\t\t\t\tallowExistingDir,\n\t\t\t\t\talternateRenderTargets,\n\t\t\t\t\tanswers,\n\t\t\t\t\tcwd,\n\t\t\t\t\tdataStorageMode: resolvedDataStorage,\n\t\t\t\t\texternalLayerId: resolvedExternalLayerSelection.externalLayerId,\n\t\t\t\t\texternalLayerSource:\n\t\t\t\t\t\tresolvedExternalLayerSelection.externalLayerSource,\n\t\t\t\t\texternalLayerSourceLabel: normalizedExternalLayerSource,\n\t\t\t\t\tinstallDependencies,\n\t\t\t\t\tnoInstall,\n\t\t\t\t\tonProgress,\n\t\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\t\tpersistencePolicy: resolvedPersistencePolicy,\n\t\t\t\t\tprojectDir,\n\t\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\t\tvariant,\n\t\t\t\t\twithMigrationUi: resolvedWithMigrationUi,\n\t\t\t\t\twithTestPreset: resolvedWithTestPreset,\n\t\t\t\t\twithWpEnv: resolvedWithWpEnv,\n\t\t\t\t})\n\t\t\t: {\n\t\t\t\t\tplan: undefined,\n\t\t\t\t\tresult: await scaffoldProject({\n\t\t\t\t\t\talternateRenderTargets,\n\t\t\t\t\t\tanswers,\n\t\t\t\t\t\tallowExistingDir,\n\t\t\t\t\t\tcwd,\n\t\t\t\t\t\tdataStorageMode: resolvedDataStorage,\n\t\t\t\t\t\texternalLayerId: resolvedExternalLayerSelection.externalLayerId,\n\t\t\t\t\t\texternalLayerSource:\n\t\t\t\t\t\t\tresolvedExternalLayerSelection.externalLayerSource,\n\t\t\t\t\t\texternalLayerSourceLabel: normalizedExternalLayerSource,\n\t\t\t\t\t\tinstallDependencies,\n\t\t\t\t\t\tnoInstall,\n\t\t\t\t\t\tonProgress,\n\t\t\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\t\t\tpersistencePolicy: resolvedPersistencePolicy,\n\t\t\t\t\t\tprojectDir,\n\t\t\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\t\t\tvariant,\n\t\t\t\t\t\twithMigrationUi: resolvedWithMigrationUi,\n\t\t\t\t\t\twithTestPreset: resolvedWithTestPreset,\n\t\t\t\t\t\twithWpEnv: resolvedWithWpEnv,\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\tlet availableScripts: string[] | undefined;\n\t\tif (!dryRun) {\n\t\t\ttry {\n\t\t\t\tconst parsedPackageJson = JSON.parse(\n\t\t\t\t\tfs.readFileSync(path.join(projectDir, \"package.json\"), \"utf8\"),\n\t\t\t\t) as {\n\t\t\t\t\tscripts?: unknown;\n\t\t\t\t};\n\t\t\t\tconst scripts =\n\t\t\t\t\tparsedPackageJson.scripts &&\n\t\t\t\t\ttypeof parsedPackageJson.scripts === \"object\" &&\n\t\t\t\t\t!Array.isArray(parsedPackageJson.scripts)\n\t\t\t\t\t\t? parsedPackageJson.scripts\n\t\t\t\t\t\t: {};\n\t\t\t\tavailableScripts = Object.entries(scripts)\n\t\t\t\t\t.filter(([, value]) => typeof value === \"string\")\n\t\t\t\t\t.map(([scriptName]) => scriptName);\n\t\t\t} catch {\n\t\t\t\tavailableScripts = undefined;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdryRun,\n\t\t\toptionalOnboarding: getOptionalOnboarding({\n\t\t\t\tavailableScripts,\n\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\tcompoundPersistenceEnabled:\n\t\t\t\t\tresolvedResult.result.variables.compoundPersistenceEnabled === \"true\",\n\t\t\t}),\n\t\t\tplan: resolvedResult.plan,\n\t\t\tprojectDir,\n\t\t\tprojectInput,\n\t\t\tpackageManager: resolvedPackageManager,\n\t\t\tnextSteps: getNextSteps({\n\t\t\t\tprojectInput,\n\t\t\t\tprojectDir,\n\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\tnoInstall,\n\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t}),\n\t\t\tresult: {\n\t\t\t\t...resolvedResult.result,\n\t\t\t\twarnings: [\n\t\t\t\t\t...resolvedResult.result.warnings,\n\t\t\t\t\t...collectTemplateCapabilityWarnings({\n\t\t\t\t\t\tqueryPostType,\n\t\t\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\t\t\twithMigrationUi,\n\t\t\t\t\t}),\n\t\t\t\t\t...collectProjectDirectoryWarnings(projectDir),\n\t\t\t\t],\n\t\t\t},\n\t\t};\n\t} finally {\n\t\tawait resolvedExternalLayerSelection.cleanup?.();\n\t}\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,qBAAS;AACT;AA8GA,eAAe,wBAAwB,CAAC,SAAoC;AAAA,EAC3E,MAAM,gBAA0B,CAAC;AAAA,EAEjC,eAAe,KAAK,CAAC,YAAmC;AAAA,IACvD,MAAM,UAAU,MAAM,IAAI,QAAQ,YAAY,EAAE,eAAe,KAAK,CAAC;AAAA,IACrE,WAAW,SAAS,SAAS;AAAA,MAC5B,MAAM,eAAe,KAAK,KAAK,YAAY,MAAM,IAAI;AAAA,MACrD,IAAI,MAAM,YAAY,GAAG;AAAA,QACxB,MAAM,MAAM,YAAY;AAAA,QACxB;AAAA,MACD;AAAA,MAEA,cAAc,KACb,KACE,SAAS,SAAS,YAAY,EAC9B,QAAQ,KAAK,QAAQ,OAAO,SAAS,QAAQ,GAAG,CACnD;AAAA,IACD;AAAA;AAAA,EAGD,MAAM,MAAM,OAAO;AAAA,EACnB,OAAO,cAAc,KAAK,CAAC,MAAM,UAAU,KAAK,cAAc,KAAK,CAAC;AAAA;AAGrE,eAAe,gCAAgC,CAC9C,YACA,kBACgB;AAAA,EAChB,IAAI,CAAC,GAAG,WAAW,UAAU,KAAK,kBAAkB;AAAA,IACnD;AAAA,EACD;AAAA,EAEA,MAAM,UAAU,MAAM,IAAI,QA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D,GAAG,gCAAgC,UAAU;AAAA,QAC9C;AAAA,MACD;AAAA,IACD;AAAA,YACC;AAAA,IACD,MAAM,+BAA+B,UAAU;AAAA;AAAA;",
|
|
8
|
+
"debugId": "47C9FBD37EC1603F64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../wp-typia-project-tools/src/runtime/temp-roots.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import fs from \"node:fs\";\nimport * as fsp from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n/**\n * Required prefix for managed wp-typia temporary directories.\n */\nexport const WP_TYPIA_TEMP_ROOT_PREFIX = \"wp-typia-\";\n\n/**\n * Default age threshold for pruning stale wp-typia temp roots.\n */\nexport const STALE_TEMP_ROOT_MAX_AGE_MS = 1000 * 60 * 60 * 24;\n\nconst trackedTempRoots = new Set<string>();\n\nlet cleanupHandlersInstalled = false;\nlet staleCleanupRan = false;\nlet signalCleanupInProgress = false;\n\ntype TempRootOptions = {\n\tmaxAgeMs?: number;\n\tnow?: number;\n\ttmpDir?: string;\n};\n\nfunction getTempDir(tmpDir?: string): string {\n\treturn tmpDir ?? os.tmpdir();\n}\n\nfunction cleanupTrackedTempRootsSync(): void {\n\tfor (const tempRoot of [...trackedTempRoots]) {\n\t\ttrackedTempRoots.delete(tempRoot);\n\t\ttry {\n\t\t\tfs.rmSync(tempRoot, { force: true, recursive: true });\n\t\t} catch {}\n\t}\n}\n\nfunction installCleanupHandlers(): void {\n\tif (cleanupHandlersInstalled) {\n\t\treturn;\n\t}\n\n\tcleanupHandlersInstalled = true;\n\tprocess.on(\"exit\", cleanupTrackedTempRootsSync);\n\n\tfor (const [signal, exitCode] of [\n\t\t[\"SIGHUP\", 129],\n\t\t[\"SIGINT\", 130],\n\t\t[\"SIGTERM\", 143],\n\t] as const) {\n\t\tprocess.once(signal, () => {\n\t\t\tif (signalCleanupInProgress) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsignalCleanupInProgress = true;\n\t\t\tcleanupTrackedTempRootsSync();\n\t\t\tprocess.exitCode = exitCode;\n\t\t\tprocess.exit();\n\t\t});\n\t}\n}\n\n/**\n * Remove a managed temp root and stop tracking it for process-level cleanup.\n *\n * @param tempRoot Absolute temporary directory path to remove.\n */\nexport async function cleanupManagedTempRoot(tempRoot: string): Promise<void> {\n\ttrackedTempRoots.delete(tempRoot);\n\tawait fsp.rm(tempRoot, { force: true, recursive: true });\n}\n\n/**\n * Remove stale `wp-typia-*` temp directories from the target temp root.\n *\n * @param options Optional temp directory, age threshold, and clock override.\n * @returns Absolute temp-root paths removed during the cleanup pass.\n */\nexport async function cleanupStaleTempRoots({\n\tmaxAgeMs = STALE_TEMP_ROOT_MAX_AGE_MS,\n\tnow = Date.now(),\n\ttmpDir,\n}: TempRootOptions = {}): Promise<string[]> {\n\tconst resolvedTmpDir = getTempDir(tmpDir);\n\tconst removedRoots: string[] = [];\n\tconst entries = await fsp.readdir(resolvedTmpDir, { withFileTypes: true });\n\n\tfor (const entry of entries) {\n\t\tif (\n\t\t\t!entry.isDirectory() ||\n\t\t\t!entry.name.startsWith(WP_TYPIA_TEMP_ROOT_PREFIX)\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst tempRoot = path.join(resolvedTmpDir, entry.name);\n\t\tif (trackedTempRoots.has(tempRoot)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet stats;\n\t\ttry {\n\t\t\tstats = await fsp.stat(tempRoot);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (now - stats.mtimeMs < maxAgeMs) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tawait fsp.rm(tempRoot, { force: true, recursive: true });\n\t\t\tremovedRoots.push(tempRoot);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn removedRoots;\n}\n\n/**\n * Create a managed wp-typia temp root and install process cleanup handlers.\n *\n * @param prefix Temp directory prefix. Must start with `wp-typia-`.\n * @param options Optional temp directory override.\n * @returns The created temp-root path plus an async cleanup helper.\n */\nexport async function createManagedTempRoot(\n\tprefix: string,\n\toptions: Pick<TempRootOptions, \"tmpDir\"> = {},\n): Promise<{\n\tcleanup: () => Promise<void>;\n\tpath: string;\n}> {\n\tif (!prefix.startsWith(WP_TYPIA_TEMP_ROOT_PREFIX)) {\n\t\tthrow new Error(\n\t\t\t`Managed wp-typia temp roots must use the \"${WP_TYPIA_TEMP_ROOT_PREFIX}\" prefix.`,\n\t\t);\n\t}\n\n\tinstallCleanupHandlers();\n\tif (!staleCleanupRan) {\n\t\tstaleCleanupRan = true;\n\t\tawait cleanupStaleTempRoots({ tmpDir: options.tmpDir });\n\t}\n\n\tconst tempRoot = await fsp.mkdtemp(\n\t\tpath.join(getTempDir(options.tmpDir), prefix),\n\t);\n\ttrackedTempRoots.add(tempRoot);\n\n\treturn {\n\t\tcleanup: async () => cleanupManagedTempRoot(tempRoot),\n\t\tpath: tempRoot,\n\t};\n}\n\n/**\n * Snapshot the currently tracked temp roots for diagnostics and tests.\n *\n * @returns Absolute paths for temp roots currently registered for cleanup.\n */\nexport function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,iBAAiB,IAAI,QAAQ;AAAA,EAE7B,OAAO;AAAA,IACN,SAAS,YAAY,uBAAuB,QAAQ;AAAA,IACpD,MAAM;AAAA,EACP;AAAA;",
|
|
8
|
+
"debugId": "2A7A0EBFD7CAC42664756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -8,11 +8,13 @@ import {
|
|
|
8
8
|
SHARED_REST_HELPER_TEMPLATE_ROOT,
|
|
9
9
|
SHARED_WORKSPACE_TEMPLATE_ROOT,
|
|
10
10
|
getTemplateById
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-a6dwqnhq.js";
|
|
12
|
+
import {
|
|
13
|
+
createManagedTempRoot
|
|
14
|
+
} from "./cli-t73q5aqz.js";
|
|
12
15
|
|
|
13
16
|
// ../wp-typia-project-tools/src/runtime/template-builtins.ts
|
|
14
17
|
import fs from "fs";
|
|
15
|
-
import os from "os";
|
|
16
18
|
import path from "path";
|
|
17
19
|
import { promises as fsp } from "fs";
|
|
18
20
|
var BUILT_IN_SHARED_TEMPLATE_LAYERS = Object.freeze([
|
|
@@ -148,7 +150,7 @@ function resolveMaterializedTemplateLayerDirs(templateId, layerDirs) {
|
|
|
148
150
|
async function materializeBuiltInTemplateSource(templateId, layerDirs) {
|
|
149
151
|
const template = getTemplateById(templateId);
|
|
150
152
|
const materializedLayerDirs = resolveMaterializedTemplateLayerDirs(templateId, layerDirs);
|
|
151
|
-
const tempRoot = await
|
|
153
|
+
const { path: tempRoot, cleanup } = await createManagedTempRoot("wp-typia-template-");
|
|
152
154
|
const templateDir = path.join(tempRoot, templateId);
|
|
153
155
|
try {
|
|
154
156
|
await fsp.mkdir(templateDir, { recursive: true });
|
|
@@ -159,7 +161,7 @@ async function materializeBuiltInTemplateSource(templateId, layerDirs) {
|
|
|
159
161
|
});
|
|
160
162
|
}
|
|
161
163
|
} catch (error) {
|
|
162
|
-
await
|
|
164
|
+
await cleanup();
|
|
163
165
|
throw error;
|
|
164
166
|
}
|
|
165
167
|
return {
|
|
@@ -169,9 +171,7 @@ async function materializeBuiltInTemplateSource(templateId, layerDirs) {
|
|
|
169
171
|
features: template.features,
|
|
170
172
|
format: "wp-typia",
|
|
171
173
|
templateDir,
|
|
172
|
-
cleanup
|
|
173
|
-
await fsp.rm(tempRoot, { force: true, recursive: true });
|
|
174
|
-
}
|
|
174
|
+
cleanup
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
async function resolveBuiltInTemplateSourceFromLayerDirs(templateId, layerDirs) {
|
|
@@ -183,4 +183,4 @@ async function resolveBuiltInTemplateSource(templateId, options = {}) {
|
|
|
183
183
|
|
|
184
184
|
export { isBuiltInSharedTemplateLayerId, getBuiltInSharedTemplateLayerDir, getBuiltInTemplateOverlayDir, getBuiltInTemplateSharedLayerDirs, getBuiltInTemplateLayerDirs, isOmittableBuiltInTemplateLayerDir, resolveBuiltInTemplateSourceFromLayerDirs, resolveBuiltInTemplateSource };
|
|
185
185
|
|
|
186
|
-
//# debugId=
|
|
186
|
+
//# debugId=B05DD72780E5C06E64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../wp-typia-project-tools/src/runtime/template-builtins.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { promises as fsp } from \"node:fs\";\n\nimport { createManagedTempRoot } from \"./temp-roots.js\";\nimport {\n\tgetTemplateById,\n\tSHARED_BASE_TEMPLATE_ROOT,\n\tSHARED_COMPOUND_TEMPLATE_ROOT,\n\tSHARED_MIGRATION_UI_TEMPLATE_ROOT,\n\tSHARED_PERSISTENCE_TEMPLATE_ROOT,\n\tSHARED_PRESET_TEMPLATE_ROOT,\n\tSHARED_REST_HELPER_TEMPLATE_ROOT,\n\tSHARED_WORKSPACE_TEMPLATE_ROOT,\n\ttype BuiltInTemplateId,\n} from \"./template-registry.js\";\n\n/**\n * Controls which persistence layer is applied when materializing the built-in\n * `persistence` template.\n */\nexport type BuiltInPersistencePolicy = \"authenticated\" | \"public\";\n\nexport interface BuiltInTemplateVariantOptions {\n\tpersistenceEnabled?: boolean;\n\tpersistencePolicy?: BuiltInPersistencePolicy;\n}\n\nexport interface MaterializedBuiltInTemplateSource {\n\tid: BuiltInTemplateId;\n\tdefaultCategory: string;\n\tdescription: string;\n\tfeatures: string[];\n\tformat: \"wp-typia\";\n\ttemplateDir: string;\n\tcleanup?: () => Promise<void>;\n\tselectedVariant?: string | null;\n\twarnings?: string[];\n}\n\nexport interface BuiltInSharedTemplateLayer {\n\tdir: string;\n\tid: string;\n}\n\nconst BUILT_IN_SHARED_TEMPLATE_LAYERS = Object.freeze<BuiltInSharedTemplateLayer[]>([\n\t{\n\t\tdir: SHARED_BASE_TEMPLATE_ROOT,\n\t\tid: \"builtin:shared/base\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_REST_HELPER_TEMPLATE_ROOT, \"shared\"),\n\t\tid: \"builtin:shared/rest-helpers/shared\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_REST_HELPER_TEMPLATE_ROOT, \"public\"),\n\t\tid: \"builtin:shared/rest-helpers/public\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_REST_HELPER_TEMPLATE_ROOT, \"auth\"),\n\t\tid: \"builtin:shared/rest-helpers/auth\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_PERSISTENCE_TEMPLATE_ROOT, \"core\"),\n\t\tid: \"builtin:shared/persistence/core\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_PERSISTENCE_TEMPLATE_ROOT, \"public\"),\n\t\tid: \"builtin:shared/persistence/public\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_PERSISTENCE_TEMPLATE_ROOT, \"auth\"),\n\t\tid: \"builtin:shared/persistence/auth\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_COMPOUND_TEMPLATE_ROOT, \"core\"),\n\t\tid: \"builtin:shared/compound/core\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_COMPOUND_TEMPLATE_ROOT, \"persistence\"),\n\t\tid: \"builtin:shared/compound/persistence\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_COMPOUND_TEMPLATE_ROOT, \"persistence-public\"),\n\t\tid: \"builtin:shared/compound/persistence-public\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_COMPOUND_TEMPLATE_ROOT, \"persistence-auth\"),\n\t\tid: \"builtin:shared/compound/persistence-auth\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_MIGRATION_UI_TEMPLATE_ROOT, \"common\"),\n\t\tid: \"builtin:shared/migration-ui/common\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_PRESET_TEMPLATE_ROOT, \"wp-env\"),\n\t\tid: \"builtin:shared/presets/wp-env\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_PRESET_TEMPLATE_ROOT, \"test-preset\"),\n\t\tid: \"builtin:shared/presets/test-preset\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_WORKSPACE_TEMPLATE_ROOT, \"persistence-public\"),\n\t\tid: \"builtin:shared/workspace/persistence-public\",\n\t},\n\t{\n\t\tdir: path.join(SHARED_WORKSPACE_TEMPLATE_ROOT, \"persistence-auth\"),\n\t\tid: \"builtin:shared/workspace/persistence-auth\",\n\t},\n]);\n\nconst BUILT_IN_SHARED_TEMPLATE_LAYER_DIRS = new Map(\n\tBUILT_IN_SHARED_TEMPLATE_LAYERS.map((layer) => [layer.id, layer.dir] as const),\n);\n\nconst OMITTABLE_BUILT_IN_OVERLAY_TEMPLATE_IDS = new Set<BuiltInTemplateId>([\n\t\"basic\",\n\t\"persistence\",\n\t\"compound\",\n]);\n\nexport function listBuiltInSharedTemplateLayers(): readonly BuiltInSharedTemplateLayer[] {\n\treturn BUILT_IN_SHARED_TEMPLATE_LAYERS;\n}\n\nexport function isBuiltInSharedTemplateLayerId(layerId: string): boolean {\n\treturn BUILT_IN_SHARED_TEMPLATE_LAYER_DIRS.has(layerId);\n}\n\nexport function getBuiltInSharedTemplateLayerDir(layerId: string): string {\n\tconst layerDir = BUILT_IN_SHARED_TEMPLATE_LAYER_DIRS.get(layerId);\n\tif (!layerDir) {\n\t\tthrow new Error(`Unknown built-in shared template layer id: ${layerId}`);\n\t}\n\treturn layerDir;\n}\n\nexport function getBuiltInTemplateOverlayDir(templateId: BuiltInTemplateId): string {\n\treturn getTemplateById(templateId).templateDir;\n}\n\nexport function getBuiltInTemplateSharedLayerDirs(\n\ttemplateId: BuiltInTemplateId,\n\t{\n\t\tpersistenceEnabled = false,\n\t\tpersistencePolicy = \"authenticated\",\n\t}: BuiltInTemplateVariantOptions = {},\n): string[] {\n\tif (templateId === \"persistence\") {\n\t\treturn [\n\t\t\tSHARED_BASE_TEMPLATE_ROOT,\n\t\t\tpath.join(SHARED_REST_HELPER_TEMPLATE_ROOT, \"shared\"),\n\t\t\tpath.join(SHARED_PERSISTENCE_TEMPLATE_ROOT, \"core\"),\n\t\t\tpath.join(\n\t\t\t\tSHARED_REST_HELPER_TEMPLATE_ROOT,\n\t\t\t\tpersistencePolicy === \"public\" ? \"public\" : \"auth\",\n\t\t\t),\n\t\t\tpath.join(\n\t\t\t\tSHARED_PERSISTENCE_TEMPLATE_ROOT,\n\t\t\t\tpersistencePolicy === \"public\" ? \"public\" : \"auth\",\n\t\t\t),\n\t\t];\n\t}\n\n\tif (templateId === \"compound\") {\n\t\tconst layers = [\n\t\t\tSHARED_BASE_TEMPLATE_ROOT,\n\t\t\tpath.join(SHARED_COMPOUND_TEMPLATE_ROOT, \"core\"),\n\t\t];\n\n\t\tif (persistenceEnabled) {\n\t\t\tlayers.push(\n\t\t\t\tpath.join(SHARED_REST_HELPER_TEMPLATE_ROOT, \"shared\"),\n\t\t\t\tpath.join(SHARED_COMPOUND_TEMPLATE_ROOT, \"persistence\"),\n\t\t\t\tpath.join(\n\t\t\t\t\tSHARED_REST_HELPER_TEMPLATE_ROOT,\n\t\t\t\t\tpersistencePolicy === \"public\" ? \"public\" : \"auth\",\n\t\t\t\t),\n\t\t\t\tpath.join(\n\t\t\t\t\tSHARED_COMPOUND_TEMPLATE_ROOT,\n\t\t\t\t\tpersistencePolicy === \"public\" ? \"persistence-public\" : \"persistence-auth\",\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn layers;\n\t}\n\n\treturn [SHARED_BASE_TEMPLATE_ROOT];\n}\n\n/**\n * Returns the ordered overlay directories for a built-in template.\n *\n * Persistence templates include the shared base, the persistence core layer,\n * the selected policy layer, and the thin template overlay. All other built-ins\n * resolve to the shared base plus their own template directory.\n */\nexport function getBuiltInTemplateLayerDirs(\n\ttemplateId: BuiltInTemplateId,\n\toptions: BuiltInTemplateVariantOptions = {},\n): string[] {\n\treturn [\n\t\t...getBuiltInTemplateSharedLayerDirs(templateId, options),\n\t\tgetBuiltInTemplateOverlayDir(templateId),\n\t];\n}\n\n/**\n * Returns whether a missing built-in overlay directory is expected because the\n * template family no longer ships any Mustache assets in that layer.\n *\n * @param templateId Built-in template family being resolved.\n * @param layerDir Candidate overlay directory for that family.\n * @returns True when the missing layer can be skipped safely.\n */\nexport function isOmittableBuiltInTemplateLayerDir(\n\ttemplateId: BuiltInTemplateId,\n\tlayerDir: string,\n): boolean {\n\treturn (\n\t\tOMITTABLE_BUILT_IN_OVERLAY_TEMPLATE_IDS.has(templateId) &&\n\t\tlayerDir === getTemplateById(templateId).templateDir\n\t);\n}\n\nfunction resolveMaterializedTemplateLayerDirs(\n\ttemplateId: BuiltInTemplateId,\n\tlayerDirs: readonly string[],\n): string[] {\n\treturn layerDirs.flatMap((layerDir) => {\n\t\tif (fs.existsSync(layerDir)) {\n\t\t\treturn [layerDir];\n\t\t}\n\n\t\tif (isOmittableBuiltInTemplateLayerDir(templateId, layerDir)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tthrow new Error(`Built-in template layer is missing: ${layerDir}`);\n\t});\n}\n\nasync function materializeBuiltInTemplateSource(\n\ttemplateId: BuiltInTemplateId,\n\tlayerDirs: readonly string[],\n): Promise<MaterializedBuiltInTemplateSource> {\n\tconst template = getTemplateById(templateId);\n\tconst materializedLayerDirs = resolveMaterializedTemplateLayerDirs(\n\t\ttemplateId,\n\t\tlayerDirs,\n\t);\n\tconst { path: tempRoot, cleanup } = await createManagedTempRoot(\n\t\t\"wp-typia-template-\",\n\t);\n\tconst templateDir = path.join(tempRoot, templateId);\n\n\ttry {\n\t\tawait fsp.mkdir(templateDir, { recursive: true });\n\n\t\tfor (const layerDir of materializedLayerDirs) {\n\t\t\tawait fsp.cp(layerDir, templateDir, {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true,\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tawait cleanup();\n\t\tthrow error;\n\t}\n\n\treturn {\n\t\tid: templateId,\n\t\tdefaultCategory: template.defaultCategory,\n\t\tdescription: template.description,\n\t\tfeatures: template.features,\n\t\tformat: \"wp-typia\",\n\t\ttemplateDir,\n\t\tcleanup,\n\t};\n}\n\nexport async function resolveBuiltInTemplateSourceFromLayerDirs(\n\ttemplateId: BuiltInTemplateId,\n\tlayerDirs: readonly string[],\n): Promise<MaterializedBuiltInTemplateSource> {\n\treturn materializeBuiltInTemplateSource(templateId, layerDirs);\n}\n\n/**\n * Materializes a built-in template into a temporary directory by copying each\n * resolved layer in order.\n *\n * Callers should invoke the returned `cleanup` function when they no longer\n * need the materialized directory. If copying fails, the temporary directory is\n * removed before the error is rethrown.\n */\nexport async function resolveBuiltInTemplateSource(\n\ttemplateId: BuiltInTemplateId,\n\toptions: BuiltInTemplateVariantOptions = {},\n): Promise<MaterializedBuiltInTemplateSource> {\n\treturn materializeBuiltInTemplateSource(\n\t\ttemplateId,\n\t\tgetBuiltInTemplateLayerDirs(templateId, options),\n\t);\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AACA;AACA,qBAAS;AA2CT,IAAM,kCAAkC,OAAO,OAAqC;AAAA,EACnF;AAAA,IACC,KAA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