@wp-typia/project-tools 0.16.8 → 0.16.9
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 +14 -4
- package/dist/runtime/block-generator-service.d.ts +5 -1
- package/dist/runtime/block-generator-service.js +7 -3
- package/dist/runtime/built-in-block-artifacts.js +171 -423
- package/dist/runtime/built-in-block-code-artifacts.js +96 -46
- package/dist/runtime/built-in-block-code-templates.d.ts +36 -0
- package/dist/runtime/built-in-block-code-templates.js +2233 -0
- package/dist/runtime/cli-add-block.d.ts +2 -1
- package/dist/runtime/cli-add-block.js +163 -25
- package/dist/runtime/cli-add-shared.d.ts +7 -0
- package/dist/runtime/cli-add-shared.js +4 -6
- package/dist/runtime/cli-add-workspace.js +56 -17
- package/dist/runtime/cli-core.d.ts +4 -0
- package/dist/runtime/cli-core.js +3 -0
- package/dist/runtime/cli-diagnostics.d.ts +58 -0
- package/dist/runtime/cli-diagnostics.js +101 -0
- package/dist/runtime/cli-doctor.d.ts +2 -1
- package/dist/runtime/cli-doctor.js +16 -5
- package/dist/runtime/cli-help.js +4 -4
- package/dist/runtime/cli-scaffold.d.ts +5 -1
- package/dist/runtime/cli-scaffold.js +138 -111
- package/dist/runtime/external-layer-selection.d.ts +14 -0
- package/dist/runtime/external-layer-selection.js +35 -0
- package/dist/runtime/index.d.ts +2 -2
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/migration-render.d.ts +23 -1
- package/dist/runtime/migration-render.js +58 -10
- package/dist/runtime/migration-ui-capability.js +17 -8
- package/dist/runtime/migration-utils.d.ts +7 -6
- package/dist/runtime/migration-utils.js +76 -73
- package/dist/runtime/migrations.js +2 -2
- package/dist/runtime/object-utils.d.ts +8 -1
- package/dist/runtime/object-utils.js +21 -1
- package/dist/runtime/scaffold-apply-utils.d.ts +14 -2
- package/dist/runtime/scaffold-apply-utils.js +19 -6
- package/dist/runtime/scaffold-repository-reference.d.ts +22 -0
- package/dist/runtime/scaffold-repository-reference.js +119 -0
- package/dist/runtime/scaffold.d.ts +5 -1
- package/dist/runtime/scaffold.js +15 -37
- package/dist/runtime/template-layers.d.ts +6 -0
- package/dist/runtime/template-layers.js +20 -7
- package/dist/runtime/template-render.d.ts +13 -2
- package/dist/runtime/template-render.js +102 -71
- package/dist/runtime/template-source.d.ts +6 -5
- package/dist/runtime/template-source.js +284 -217
- package/package.json +8 -3
- package/templates/_shared/base/src/validator-toolkit.ts.mustache +2 -2
- package/templates/_shared/compound/core/scripts/add-compound-child.ts.mustache +58 -12
- package/templates/_shared/migration-ui/common/src/migrations/helpers.ts +19 -47
- package/templates/_shared/migration-ui/common/src/migrations/index.ts +40 -11
package/README.md
CHANGED
|
@@ -51,6 +51,15 @@ files and starter `typia.manifest.json` now come from the emitter path, while
|
|
|
51
51
|
project bootstrap/package-manager files, sync scripts, shared REST helpers, and
|
|
52
52
|
the remaining non-block assets still come from Mustache-backed template copy.
|
|
53
53
|
|
|
54
|
+
Generated projects now consume JSON artifacts through typed wrapper modules
|
|
55
|
+
instead of local casts:
|
|
56
|
+
|
|
57
|
+
- `block-metadata.ts` for `block.json`
|
|
58
|
+
- `manifest-document.ts` for editor and migration consumers of
|
|
59
|
+
`typia.manifest.json`
|
|
60
|
+
- `manifest-defaults-document.ts` for validator/defaults consumers of
|
|
61
|
+
`typia.manifest.json`
|
|
62
|
+
|
|
54
63
|
The higher-level generator architecture record, including the current phase map
|
|
55
64
|
and the non-mutating `plan -> validate -> render -> apply` tool-facing usage
|
|
56
65
|
model, lives in
|
|
@@ -59,10 +68,11 @@ The public non-mutating controller/tool contract now lives in
|
|
|
59
68
|
[`docs/block-generator-tool-contract.md`](../../docs/block-generator-tool-contract.md).
|
|
60
69
|
|
|
61
70
|
Reusable external layer packages on top of the built-in shared scaffold model
|
|
62
|
-
are now available
|
|
63
|
-
`
|
|
64
|
-
`
|
|
65
|
-
|
|
71
|
+
are now available through the canonical built-in CLI flags
|
|
72
|
+
`wp-typia create --external-layer-source ... [--external-layer-id ...]`,
|
|
73
|
+
`wp-typia add block --external-layer-source ... [--external-layer-id ...]`,
|
|
74
|
+
and programmatically through `scaffoldProject(...)`, `BlockGeneratorService`,
|
|
75
|
+
and `inspectBlockGeneration(...)`. The layer contract record lives in
|
|
66
76
|
[`docs/external-template-layer-composition.md`](../../docs/external-template-layer-composition.md).
|
|
67
77
|
|
|
68
78
|
If you need metadata sync, editor helpers, validation helpers, or other generated-project runtime utilities, import them directly from `@wp-typia/block-runtime/*`.
|
|
@@ -43,9 +43,11 @@ export interface BlockGenerationTarget {
|
|
|
43
43
|
cwd: string;
|
|
44
44
|
externalLayerId?: string;
|
|
45
45
|
externalLayerSource?: string;
|
|
46
|
+
externalLayerSourceLabel?: string;
|
|
46
47
|
noInstall: boolean;
|
|
47
48
|
packageManager: PackageManagerId;
|
|
48
49
|
projectDir: string;
|
|
50
|
+
repositoryReference?: string;
|
|
49
51
|
variant?: string;
|
|
50
52
|
}
|
|
51
53
|
export interface PlanBlockInput {
|
|
@@ -55,10 +57,12 @@ export interface PlanBlockInput {
|
|
|
55
57
|
dataStorageMode?: DataStorageMode;
|
|
56
58
|
externalLayerId?: string;
|
|
57
59
|
externalLayerSource?: string;
|
|
60
|
+
externalLayerSourceLabel?: string;
|
|
58
61
|
noInstall?: boolean;
|
|
59
62
|
packageManager: PackageManagerId;
|
|
60
63
|
persistencePolicy?: PersistencePolicy;
|
|
61
64
|
projectDir: string;
|
|
65
|
+
repositoryReference?: string;
|
|
62
66
|
templateId: BuiltInTemplateId;
|
|
63
67
|
variant?: string;
|
|
64
68
|
withMigrationUi?: boolean;
|
|
@@ -99,7 +103,7 @@ export interface ApplyBlockInput {
|
|
|
99
103
|
export declare function createBuiltInBlockSpec({ answers, dataStorageMode, persistencePolicy, templateId, withMigrationUi, withTestPreset, withWpEnv, }: Omit<PlanBlockInput, "allowExistingDir" | "cwd" | "noInstall" | "packageManager" | "projectDir" | "variant">): BlockSpec;
|
|
100
104
|
export declare function buildTemplateVariablesFromBlockSpec(spec: BlockSpec): ScaffoldTemplateVariables;
|
|
101
105
|
export declare class BlockGeneratorService {
|
|
102
|
-
plan({ allowExistingDir, answers, cwd, dataStorageMode, externalLayerId, externalLayerSource, noInstall, packageManager, persistencePolicy, projectDir, templateId, variant, withMigrationUi, withTestPreset, withWpEnv, }: PlanBlockInput): Promise<PlanBlockResult>;
|
|
106
|
+
plan({ allowExistingDir, answers, cwd, dataStorageMode, externalLayerId, externalLayerSource, externalLayerSourceLabel, noInstall, packageManager, persistencePolicy, projectDir, repositoryReference, templateId, variant, withMigrationUi, withTestPreset, withWpEnv, }: PlanBlockInput): Promise<PlanBlockResult>;
|
|
103
107
|
validate({ plan }: ValidateBlockInput): Promise<ValidateBlockResult>;
|
|
104
108
|
render({ validated }: RenderBlockInput): Promise<RenderBlockResult>;
|
|
105
109
|
apply({ rendered, installDependencies, }: ApplyBlockInput): Promise<ScaffoldProjectResult>;
|
|
@@ -7,13 +7,14 @@ import { applyBuiltInScaffoldProjectFiles, buildGitignore, buildReadme, } from "
|
|
|
7
7
|
import { buildBlockCssClassName, buildFrontendCssClassName, resolveScaffoldIdentifiers, } from "./scaffold-identifiers.js";
|
|
8
8
|
import { buildBuiltInBlockArtifacts, } from "./built-in-block-artifacts.js";
|
|
9
9
|
import { buildBuiltInCodeArtifacts, } from "./built-in-block-code-artifacts.js";
|
|
10
|
+
import { stableJsonStringify } from "./object-utils.js";
|
|
10
11
|
import { getStarterManifestFiles } from "./starter-manifests.js";
|
|
11
12
|
import { resolveTemplateSeed, parseTemplateLocator } from "./template-source.js";
|
|
12
13
|
import { assertExternalTemplateLayersDoNotWriteProtectedOutputs, resolveExternalTemplateLayers, } from "./template-layers.js";
|
|
13
14
|
import { getBuiltInTemplateOverlayDir, getBuiltInTemplateSharedLayerDirs, resolveBuiltInTemplateSourceFromLayerDirs, } from "./template-builtins.js";
|
|
14
15
|
const renderedArtifactCache = new WeakMap();
|
|
15
16
|
function createVariablesFingerprint(variables) {
|
|
16
|
-
return
|
|
17
|
+
return stableJsonStringify(variables);
|
|
17
18
|
}
|
|
18
19
|
function buildProtectedTemplateOutputPaths({ codeArtifacts, spec, variables, artifacts, }) {
|
|
19
20
|
const protectedOutputs = new Set([
|
|
@@ -198,7 +199,7 @@ export function buildTemplateVariablesFromBlockSpec(spec) {
|
|
|
198
199
|
};
|
|
199
200
|
}
|
|
200
201
|
export class BlockGeneratorService {
|
|
201
|
-
async plan({ allowExistingDir = false, answers, cwd = process.cwd(), dataStorageMode, externalLayerId, externalLayerSource, noInstall = false, packageManager, persistencePolicy, projectDir, templateId, variant, withMigrationUi = false, withTestPreset = false, withWpEnv = false, }) {
|
|
202
|
+
async plan({ allowExistingDir = false, answers, cwd = process.cwd(), dataStorageMode, externalLayerId, externalLayerSource, externalLayerSourceLabel, noInstall = false, packageManager, persistencePolicy, projectDir, repositoryReference, templateId, variant, withMigrationUi = false, withTestPreset = false, withWpEnv = false, }) {
|
|
202
203
|
return {
|
|
203
204
|
spec: createBuiltInBlockSpec({
|
|
204
205
|
answers,
|
|
@@ -214,9 +215,11 @@ export class BlockGeneratorService {
|
|
|
214
215
|
cwd,
|
|
215
216
|
externalLayerId,
|
|
216
217
|
externalLayerSource,
|
|
218
|
+
externalLayerSourceLabel,
|
|
217
219
|
noInstall,
|
|
218
220
|
packageManager,
|
|
219
221
|
projectDir,
|
|
222
|
+
repositoryReference,
|
|
220
223
|
variant,
|
|
221
224
|
},
|
|
222
225
|
};
|
|
@@ -298,7 +301,7 @@ export class BlockGeneratorService {
|
|
|
298
301
|
].join("\n"));
|
|
299
302
|
}
|
|
300
303
|
};
|
|
301
|
-
warnings.push(`Applied external layer "${resolvedLayers.selectedLayerId}" from "${validated.target.externalLayerSource}".`);
|
|
304
|
+
warnings.push(`Applied external layer "${resolvedLayers.selectedLayerId}" from "${validated.target.externalLayerSourceLabel ?? validated.target.externalLayerSource}".`);
|
|
302
305
|
}
|
|
303
306
|
catch (error) {
|
|
304
307
|
await templateSource.cleanup?.();
|
|
@@ -360,6 +363,7 @@ export class BlockGeneratorService {
|
|
|
360
363
|
noInstall: rendered.target.noInstall,
|
|
361
364
|
packageManager: rendered.target.packageManager,
|
|
362
365
|
projectDir: rendered.target.projectDir,
|
|
366
|
+
repositoryReference: rendered.target.repositoryReference,
|
|
363
367
|
gitignoreContent: rendered.gitignoreContent,
|
|
364
368
|
readmeContent: rendered.readmeContent,
|
|
365
369
|
templateDir: rendered.templateDir,
|