@ykdz/template 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{src/cli.js → cli.js} +26 -14
- package/node_modules/@ykdz/template-builtin-source/dist/src/index.d.ts +22 -0
- package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +92 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.d.ts +6 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +230 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.d.ts +7 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.js +94 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +15 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.d.ts +9 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +103 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.d.ts +6 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +214 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.d.ts +6 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +353 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.d.ts +8 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +203 -0
- package/node_modules/@ykdz/template-builtin-source/package.json +46 -0
- package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/oxc/node/oxlint.config.ts +3 -0
- package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/oxc/vue/oxlint.config.ts +3 -0
- package/{dist/src → node_modules/@ykdz/template-core/dist}/declarations.d.ts +7 -4
- package/{dist/src → node_modules/@ykdz/template-core/dist}/declarations.js +11 -13
- package/{dist/src → node_modules/@ykdz/template-core/dist}/dependency-catalog.js +2 -0
- package/{dist/src → node_modules/@ykdz/template-core/dist}/editor-customization.js +3 -1
- package/{dist/src → node_modules/@ykdz/template-core/dist}/generated-scenarios.d.ts +2 -0
- package/{dist/src → node_modules/@ykdz/template-core/dist}/generated-scenarios.js +16 -5
- package/node_modules/@ykdz/template-core/dist/package-addition.d.ts +12 -0
- package/{dist/src → node_modules/@ykdz/template-core/dist}/package-addition.js +11 -10
- package/{pnpm-workspace.yaml → node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml} +3 -1
- package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-source.d.ts +1 -3
- package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-source.js +13 -29
- package/{dist/src → node_modules/@ykdz/template-core/dist}/projection-capabilities.d.ts +10 -2
- package/{dist/src → node_modules/@ykdz/template-core/dist}/projection-capabilities.js +22 -49
- package/{dist/src → node_modules/@ykdz/template-core/dist}/renderer.js +12 -4
- package/{dist/src → node_modules/@ykdz/template-core/dist}/runtime-paths.js +2 -0
- package/{dist/src → node_modules/@ykdz/template-core/dist}/toolchain-resolution.js +1 -1
- package/node_modules/@ykdz/template-core/package.json +27 -0
- package/package.json +14 -34
- package/README.md +0 -35
- package/dist/src/package-addition.d.ts +0 -8
- /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/.github/dependabot.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/.github/workflows/check.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/src/app.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/src/server.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/test/app.test.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/vitest.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/preset-source.json +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/.github/dependabot.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/.github/workflows/check.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/rust-toolchain.toml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/rustfmt.toml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/src/main.rs +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/devcontainer/browser-test.Dockerfile +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/devcontainer/node-pnpm.Dockerfile +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/devcontainer/rust.Dockerfile +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/editor-customization/capabilities.json +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/oxc/oxfmt.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/.github/dependabot.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/.github/workflows/check.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/src/index.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/src/name-schema.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/.github/dependabot.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/.github/workflows/check.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/env.d.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/index.html +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/playwright.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/playwright.package-addition.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/App.vue +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/main.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/stores/counter.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/style.css +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/test/app.test.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/test/e2e/app.spec.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/vite.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/vitest.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/.github/dependabot.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/.github/workflows/check.yml +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/src/index.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/src/runtime.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/src/server.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/test/app.test.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/vitest.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/env.d.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/index.html +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/playwright.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/App.vue +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/api.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/main.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/stores/counter.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/style.css +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/test/app.test.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/test/e2e/app.spec.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/vite.config.ts +0 -0
- /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/vitest.config.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/dependency-catalog.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/devcontainer.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/devcontainer.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/editor-customization.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/generation-context.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/generation-context.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/module-graph.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/module-graph.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/next-step-instructions.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/next-step-instructions.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-addition-support.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-addition-support.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-linking.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-linking.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-projection.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-projection.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/project-github.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/project-github.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/renderer.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/runtime-paths.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/template-boundary-check.d.ts +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/template-boundary-check.js +0 -0
- /package/{dist/src → node_modules/@ykdz/template-core/dist}/toolchain-resolution.d.ts +0 -0
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync, realpathSync, statSync, } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
3
|
import * as v from "valibot";
|
|
5
4
|
import { loadTemplateDependencyCatalog, } from "./dependency-catalog.js";
|
|
6
5
|
import { PackageAdditionSupport } from "./package-addition-support.js";
|
|
7
6
|
import { normalizePresetProjectionDeclaration, projectionCapabilityIssues, } from "./projection-capabilities.js";
|
|
8
|
-
import { packageTemplateRoot } from "./runtime-paths.js";
|
|
9
7
|
const featureNames = [
|
|
10
8
|
"pnpm-catalog",
|
|
11
9
|
"oxc-format-lint",
|
|
@@ -402,34 +400,34 @@ function formatIssuePath(issue) {
|
|
|
402
400
|
if (!issue.path || issue.path.length === 0) {
|
|
403
401
|
return "$";
|
|
404
402
|
}
|
|
405
|
-
return issue.path.reduce((
|
|
403
|
+
return issue.path.reduce((issuePath, item) => {
|
|
406
404
|
if (typeof item.key === "number") {
|
|
407
|
-
return `${
|
|
405
|
+
return `${issuePath}[${item.key}]`;
|
|
408
406
|
}
|
|
409
|
-
return `${
|
|
407
|
+
return `${issuePath}.${String(item.key)}`;
|
|
410
408
|
}, "$");
|
|
411
409
|
}
|
|
412
410
|
function shapeIssues(issues) {
|
|
413
411
|
return issues.map((issue) => {
|
|
414
|
-
const
|
|
415
|
-
const missingPresetMetadata =
|
|
412
|
+
const validationPath = formatIssuePath(issue);
|
|
413
|
+
const missingPresetMetadata = validationPath.match(/^\$\.presets\[\d+\]\.(.+)$/);
|
|
416
414
|
if (missingPresetMetadata && issue.message.includes("received undefined")) {
|
|
417
415
|
return {
|
|
418
|
-
path,
|
|
416
|
+
path: validationPath,
|
|
419
417
|
message: `Preset metadata is missing required field: ${missingPresetMetadata[1]}`,
|
|
420
418
|
};
|
|
421
419
|
}
|
|
422
420
|
if (issue.message.startsWith("Invalid key:") &&
|
|
423
|
-
/\.(body|content|text)$/.test(
|
|
424
|
-
const key =
|
|
421
|
+
/\.(body|content|text)$/.test(validationPath)) {
|
|
422
|
+
const key = validationPath.split(".").at(-1);
|
|
425
423
|
return {
|
|
426
|
-
path,
|
|
424
|
+
path: validationPath,
|
|
427
425
|
message: `Preset Source Manifests must reference Generated Repository file bodies by path, not inline ${key}`,
|
|
428
426
|
};
|
|
429
427
|
}
|
|
430
428
|
return {
|
|
431
|
-
path,
|
|
432
|
-
message:
|
|
429
|
+
path: validationPath,
|
|
430
|
+
message: validationPath.match(/^\$\.presets\[\d+\]\.packageAdditionSupport$/)
|
|
433
431
|
? "Package Addition Support must be one of: supported, unsupported"
|
|
434
432
|
: issue.message,
|
|
435
433
|
};
|
|
@@ -449,7 +447,7 @@ function duplicatePresetNameIssues(presets) {
|
|
|
449
447
|
message: `Duplicate Preset name: ${name}`,
|
|
450
448
|
}));
|
|
451
449
|
}
|
|
452
|
-
function duplicateValueIssues(values,
|
|
450
|
+
function duplicateValueIssues(values, validationPath) {
|
|
453
451
|
const seen = new Set();
|
|
454
452
|
const duplicates = new Set();
|
|
455
453
|
for (const value of values) {
|
|
@@ -459,7 +457,7 @@ function duplicateValueIssues(values, path) {
|
|
|
459
457
|
seen.add(value);
|
|
460
458
|
}
|
|
461
459
|
return [...duplicates].map((value) => ({
|
|
462
|
-
path,
|
|
460
|
+
path: validationPath,
|
|
463
461
|
message: `Duplicate value: ${value}`,
|
|
464
462
|
}));
|
|
465
463
|
}
|
|
@@ -921,20 +919,6 @@ export function loadPresetSourceManifestFile(filePath) {
|
|
|
921
919
|
}
|
|
922
920
|
return result.value;
|
|
923
921
|
}
|
|
924
|
-
export function loadBuiltInPresetSourceManifest() {
|
|
925
|
-
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
926
|
-
const filePath = packageTemplateRoot(moduleDir, "preset-source.json");
|
|
927
|
-
const result = validateBuiltInPresetSourceManifest(JSON.parse(readFileSync(filePath, "utf8")), { sourceRoot: path.dirname(filePath) });
|
|
928
|
-
if (!result.ok) {
|
|
929
|
-
throw new Error(`Built-in Preset Source Manifest is invalid:\n${result.issues
|
|
930
|
-
.map((issue) => ` - ${issue.path}: ${issue.message}`)
|
|
931
|
-
.join("\n")}`);
|
|
932
|
-
}
|
|
933
|
-
return result.value;
|
|
934
|
-
}
|
|
935
922
|
export function findPresetSourceManifestPreset(manifest, presetName) {
|
|
936
923
|
return manifest.presets.find((preset) => preset.name === presetName);
|
|
937
924
|
}
|
|
938
|
-
export function findBuiltInPresetSourceManifestPreset(presetName) {
|
|
939
|
-
return findPresetSourceManifestPreset(loadBuiltInPresetSourceManifest(), presetName);
|
|
940
|
-
}
|
|
@@ -46,6 +46,12 @@ export type ProjectionCapabilityDeclaration = WorkspaceLibraryPackageCapabilityD
|
|
|
46
46
|
export type PresetProjectionDeclaration = {
|
|
47
47
|
readonly capabilities: readonly ProjectionCapabilityDeclaration[];
|
|
48
48
|
};
|
|
49
|
+
export type ProjectionSourcePreset = "hono-api" | "rust-bin" | "ts-lib" | "vue-app" | "vue-hono-app";
|
|
50
|
+
export type PresetProjectionSourceRoots = {
|
|
51
|
+
readonly preset: (sourcePreset: ProjectionSourcePreset) => string;
|
|
52
|
+
readonly sharedOxc: () => string;
|
|
53
|
+
readonly sharedDevcontainer: () => string;
|
|
54
|
+
};
|
|
49
55
|
export declare function validateProjectionCapabilities(input: unknown): ValidationResult<PresetProjectionDeclaration>;
|
|
50
56
|
export declare function projectionCapabilityIssues(presets: readonly PresetSourceManifestPreset[]): ValidationIssue[];
|
|
51
57
|
export declare function normalizePresetProjectionDeclaration(declaration: PresetProjectionDeclaration): PresetProjectionDeclaration;
|
|
@@ -53,15 +59,17 @@ export declare function interpretPresetProjectionDeclaration(options: {
|
|
|
53
59
|
readonly preset: PresetSourceManifestPreset;
|
|
54
60
|
readonly declaration: PresetProjectionDeclaration;
|
|
55
61
|
readonly context: GenerationContext;
|
|
62
|
+
readonly sourceRoots: PresetProjectionSourceRoots;
|
|
56
63
|
}): PresetProjectionPlan;
|
|
57
64
|
export declare function blueprintForPresetSourcePreset(preset: PresetSourceManifestPreset, options?: PresetBlueprintOptions): ProjectBlueprint;
|
|
58
65
|
export declare function projectPresetSourcePreset(options: {
|
|
59
66
|
readonly preset: PresetSourceManifestPreset;
|
|
60
67
|
readonly context: GenerationContext;
|
|
68
|
+
readonly sourceRoots: PresetProjectionSourceRoots;
|
|
61
69
|
}): PresetProjectionPlan;
|
|
62
70
|
export declare function planPresetSourcePackageAddition(options: {
|
|
63
71
|
readonly preset: PresetSourceManifestPreset;
|
|
64
72
|
readonly addition: PresetPackageAdditionOptions;
|
|
73
|
+
readonly sourceRoots: PresetProjectionSourceRoots;
|
|
65
74
|
}): Promise<PresetPackageAdditionPlan>;
|
|
66
|
-
export declare function defaultPackagePathForPresetSourcePackageAddition(preset: PresetSourceManifestPreset, packageLeafName: string): string;
|
|
67
|
-
export declare function loadBuiltInPresetProjectionDeclaration(presetName: string): PresetProjectionDeclaration;
|
|
75
|
+
export declare function defaultPackagePathForPresetSourcePackageAddition(preset: PresetSourceManifestPreset, packageLeafName: string, sourceRoots: PresetProjectionSourceRoots): string;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
1
|
import { readFile } from "node:fs/promises";
|
|
3
2
|
import path from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
3
|
import { collectGeneratedManifestCatalogDependencies, collectGeneratedManifestCatalogReferences, renderGeneratedPnpmWorkspaceYaml, } from "./dependency-catalog.js";
|
|
6
4
|
import { browserTestToolLayer, checkedDockerfileFirstNodePnpmDevcontainer, dockerfileFirstRustPnpmDevcontainer, nodePnpmToolLayer, rustToolLayer, } from "./devcontainer.js";
|
|
7
5
|
import { editorCustomizationForCapabilities, } from "./editor-customization.js";
|
|
8
6
|
import { renderFixCommand, renderRootCheckCommand, } from "./module-graph.js";
|
|
9
7
|
import { packageManifestExposureFields, planPackageLinks, } from "./package-linking.js";
|
|
10
|
-
import { packageTemplateRoot } from "./runtime-paths.js";
|
|
11
8
|
const projectionCapabilityKinds = [
|
|
12
9
|
"workspace-library-package",
|
|
13
10
|
"workspace-node-packages",
|
|
@@ -26,10 +23,6 @@ const workspacePackageBoundary = {
|
|
|
26
23
|
kind: "package-boundary",
|
|
27
24
|
path: ".",
|
|
28
25
|
};
|
|
29
|
-
const workspacePackageCollectionBoundary = {
|
|
30
|
-
kind: "package-boundary",
|
|
31
|
-
path: "packages/*",
|
|
32
|
-
};
|
|
33
26
|
const requiredPlanCapabilityProviders = [
|
|
34
27
|
{
|
|
35
28
|
flag: "rootCheck",
|
|
@@ -83,7 +76,7 @@ const capabilityInterpreters = {
|
|
|
83
76
|
kind: "workspace-library-package",
|
|
84
77
|
contribute({ capability, state }) {
|
|
85
78
|
state.package = capability;
|
|
86
|
-
state.sourceRoot = templateSourceRoot(capability.packageSourcePreset);
|
|
79
|
+
state.sourceRoot = templateSourceRoot(state, capability.packageSourcePreset);
|
|
87
80
|
state.packageDependencies.add("valibot");
|
|
88
81
|
state.operationFactories.push(workspaceLibraryPackageOperations);
|
|
89
82
|
},
|
|
@@ -92,7 +85,7 @@ const capabilityInterpreters = {
|
|
|
92
85
|
kind: "workspace-node-packages",
|
|
93
86
|
contribute({ capability, state }) {
|
|
94
87
|
state.nodeWorkspace = capability;
|
|
95
|
-
state.sourceRoot = templateSourceRootForPreset(sourceRootPreset(capability));
|
|
88
|
+
state.sourceRoot = templateSourceRootForPreset(state, sourceRootPreset(capability));
|
|
96
89
|
state.operationFactories.push(workspaceNodePackagesOperations);
|
|
97
90
|
if (capability.packages.length > 1) {
|
|
98
91
|
state.rootScriptFragments.dev = "turbo run dev --parallel";
|
|
@@ -112,8 +105,9 @@ const capabilityInterpreters = {
|
|
|
112
105
|
kind: "rust-binary-workspace",
|
|
113
106
|
contribute({ capability, state }) {
|
|
114
107
|
state.rustWorkspace = capability;
|
|
115
|
-
state.sourceRoot = templateSourceRootForPreset("rust-bin");
|
|
116
|
-
state.sourceRoots.sharedDevcontainer =
|
|
108
|
+
state.sourceRoot = templateSourceRootForPreset(state, "rust-bin");
|
|
109
|
+
state.sourceRoots.sharedDevcontainer =
|
|
110
|
+
state.projectionSourceRoots.sharedDevcontainer();
|
|
117
111
|
state.rootCheckComponents.push({
|
|
118
112
|
kind: "turbo-package-check",
|
|
119
113
|
owner: workspaceGlobBoundary(capability.workspacePackageGlob),
|
|
@@ -186,7 +180,7 @@ const capabilityInterpreters = {
|
|
|
186
180
|
"oxc-format-lint": {
|
|
187
181
|
kind: "oxc-format-lint",
|
|
188
182
|
contribute({ state }) {
|
|
189
|
-
state.sourceRoots.sharedOxc =
|
|
183
|
+
state.sourceRoots.sharedOxc = state.projectionSourceRoots.sharedOxc();
|
|
190
184
|
state.rootCheckComponents.unshift({
|
|
191
185
|
kind: "oxc-format-check",
|
|
192
186
|
owner: strictTypescriptRootBoundary,
|
|
@@ -234,7 +228,8 @@ const capabilityInterpreters = {
|
|
|
234
228
|
"node-pnpm-devcontainer": {
|
|
235
229
|
kind: "node-pnpm-devcontainer",
|
|
236
230
|
contribute({ state }) {
|
|
237
|
-
state.sourceRoots.sharedDevcontainer =
|
|
231
|
+
state.sourceRoots.sharedDevcontainer =
|
|
232
|
+
state.projectionSourceRoots.sharedDevcontainer();
|
|
238
233
|
state.flags.devcontainer = true;
|
|
239
234
|
state.operationFactories.push(nodePnpmDevcontainerOperations);
|
|
240
235
|
},
|
|
@@ -361,7 +356,7 @@ export function interpretPresetProjectionDeclaration(options) {
|
|
|
361
356
|
.map((issue) => ` - ${issue.path}: ${issue.message}`)
|
|
362
357
|
.join("\n")}`);
|
|
363
358
|
}
|
|
364
|
-
const state = createProjectionCompositionState();
|
|
359
|
+
const state = createProjectionCompositionState(options.sourceRoots);
|
|
365
360
|
for (const capability of validation.value.capabilities) {
|
|
366
361
|
capabilityInterpreters[capability.kind].contribute({
|
|
367
362
|
capability: capability,
|
|
@@ -437,13 +432,14 @@ export function projectPresetSourcePreset(options) {
|
|
|
437
432
|
preset: options.preset,
|
|
438
433
|
declaration: options.preset.projection,
|
|
439
434
|
context: options.context,
|
|
435
|
+
sourceRoots: options.sourceRoots,
|
|
440
436
|
});
|
|
441
437
|
}
|
|
442
438
|
export async function planPresetSourcePackageAddition(options) {
|
|
443
439
|
if (options.preset.projection === undefined) {
|
|
444
440
|
throw new Error(`Preset ${options.preset.name} declares Package Addition support but has no Projection Declaration`);
|
|
445
441
|
}
|
|
446
|
-
const state = stateForProjectionDeclaration(options.preset.projection);
|
|
442
|
+
const state = stateForProjectionDeclaration(options.preset.projection, options.sourceRoots);
|
|
447
443
|
const additionCapability = packageAdditionCapabilityForState(options.preset.name, state);
|
|
448
444
|
return {
|
|
449
445
|
packagePath: options.addition.packagePath,
|
|
@@ -451,7 +447,7 @@ export async function planPresetSourcePackageAddition(options) {
|
|
|
451
447
|
workspaceMembershipGlob: `${packageCollectionFromPackagePath(options.addition.packagePath)}/*`,
|
|
452
448
|
packageRole: additionCapability.packageRole,
|
|
453
449
|
packageSourcePreset: additionCapability.packageSourcePreset,
|
|
454
|
-
sourceRoot: templateSourceRootForPreset(additionCapability.sourcePreset),
|
|
450
|
+
sourceRoot: templateSourceRootForPreset(state, additionCapability.sourcePreset),
|
|
455
451
|
sourceRoots: state.sourceRoots,
|
|
456
452
|
operations: [
|
|
457
453
|
...packageAdditionOperationsForCapability({
|
|
@@ -475,34 +471,17 @@ export async function planPresetSourcePackageAddition(options) {
|
|
|
475
471
|
],
|
|
476
472
|
};
|
|
477
473
|
}
|
|
478
|
-
export function defaultPackagePathForPresetSourcePackageAddition(preset, packageLeafName) {
|
|
474
|
+
export function defaultPackagePathForPresetSourcePackageAddition(preset, packageLeafName, sourceRoots) {
|
|
479
475
|
if (preset.projection === undefined) {
|
|
480
476
|
throw new Error(`Preset ${preset.name} declares Package Addition support but has no Projection Declaration`);
|
|
481
477
|
}
|
|
482
|
-
const state = stateForProjectionDeclaration(preset.projection);
|
|
478
|
+
const state = stateForProjectionDeclaration(preset.projection, sourceRoots);
|
|
483
479
|
const additionCapability = packageAdditionCapabilityForState(preset.name, state);
|
|
484
480
|
return `${packageCollection(additionCapability.workspacePackageGlob)}/${packageLeafName}`;
|
|
485
481
|
}
|
|
486
|
-
|
|
487
|
-
const manifestPath = path.join(packageTemplateRoot(path.dirname(fileURLToPath(import.meta.url))), "preset-source.json");
|
|
488
|
-
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
489
|
-
if (!isRecord(manifest) || !Array.isArray(manifest.presets)) {
|
|
490
|
-
throw new Error("Built-in Preset Source Manifest must declare presets");
|
|
491
|
-
}
|
|
492
|
-
const preset = manifest.presets.find((candidate) => isRecord(candidate) && candidate.name === presetName);
|
|
493
|
-
if (!isRecord(preset) || preset.projection === undefined) {
|
|
494
|
-
throw new Error(`Built-in Preset ${presetName} must declare a Projection Declaration`);
|
|
495
|
-
}
|
|
496
|
-
const result = validateProjectionCapabilities(preset.projection);
|
|
497
|
-
if (!result.ok) {
|
|
498
|
-
throw new Error(`Built-in Preset ${presetName} Projection Declaration is invalid:\n${result.issues
|
|
499
|
-
.map((issue) => ` - ${issue.path}: ${issue.message}`)
|
|
500
|
-
.join("\n")}`);
|
|
501
|
-
}
|
|
502
|
-
return result.value;
|
|
503
|
-
}
|
|
504
|
-
function createProjectionCompositionState() {
|
|
482
|
+
function createProjectionCompositionState(sourceRoots) {
|
|
505
483
|
return {
|
|
484
|
+
projectionSourceRoots: sourceRoots,
|
|
506
485
|
sourceRoots: {},
|
|
507
486
|
rootCheckComponents: [],
|
|
508
487
|
rootCheckEnvironmentNeeds: [],
|
|
@@ -860,14 +839,14 @@ function blueprintPackagesForCapabilities(capabilities, packageScope, projectNam
|
|
|
860
839
|
return [];
|
|
861
840
|
});
|
|
862
841
|
}
|
|
863
|
-
function stateForProjectionDeclaration(declaration) {
|
|
842
|
+
function stateForProjectionDeclaration(declaration, sourceRoots) {
|
|
864
843
|
const validation = validateProjectionCapabilities(declaration);
|
|
865
844
|
if (!validation.ok) {
|
|
866
845
|
throw new Error(`Projection Declaration is invalid:\n${validation.issues
|
|
867
846
|
.map((issue) => ` - ${issue.path}: ${issue.message}`)
|
|
868
847
|
.join("\n")}`);
|
|
869
848
|
}
|
|
870
|
-
const state = createProjectionCompositionState();
|
|
849
|
+
const state = createProjectionCompositionState(sourceRoots);
|
|
871
850
|
for (const capability of validation.value.capabilities) {
|
|
872
851
|
capabilityInterpreters[capability.kind].contribute({
|
|
873
852
|
capability: capability,
|
|
@@ -2193,15 +2172,9 @@ function githubMaintenanceOperations() {
|
|
|
2193
2172
|
},
|
|
2194
2173
|
];
|
|
2195
2174
|
}
|
|
2196
|
-
function templateSourceRoot(sourcePreset) {
|
|
2197
|
-
return templateSourceRootForPreset(sourcePreset);
|
|
2198
|
-
}
|
|
2199
|
-
function templateSourceRootForPreset(sourcePreset) {
|
|
2200
|
-
return packageTemplateRoot(path.dirname(fileURLToPath(import.meta.url)), sourcePreset);
|
|
2201
|
-
}
|
|
2202
|
-
function sharedOxcSourceRoot() {
|
|
2203
|
-
return packageTemplateRoot(path.dirname(fileURLToPath(import.meta.url)), "shared", "oxc");
|
|
2175
|
+
function templateSourceRoot(state, sourcePreset) {
|
|
2176
|
+
return templateSourceRootForPreset(state, sourcePreset);
|
|
2204
2177
|
}
|
|
2205
|
-
function
|
|
2206
|
-
return
|
|
2178
|
+
function templateSourceRootForPreset(state, sourcePreset) {
|
|
2179
|
+
return state.projectionSourceRoots.preset(sourcePreset);
|
|
2207
2180
|
}
|
|
@@ -380,7 +380,9 @@ async function copyGeneratedFile(from, to) {
|
|
|
380
380
|
}
|
|
381
381
|
catch (error) {
|
|
382
382
|
if (isNodeError(error) && error.code === "EEXIST") {
|
|
383
|
-
throw new Error(`Refusing to overwrite existing file: ${to}
|
|
383
|
+
throw new Error(`Refusing to overwrite existing file: ${to}`, {
|
|
384
|
+
cause: error,
|
|
385
|
+
});
|
|
384
386
|
}
|
|
385
387
|
throw error;
|
|
386
388
|
}
|
|
@@ -394,7 +396,9 @@ async function writeGeneratedFile(to, text, overwrite = false) {
|
|
|
394
396
|
}
|
|
395
397
|
catch (error) {
|
|
396
398
|
if (isNodeError(error) && error.code === "EEXIST") {
|
|
397
|
-
throw new Error(`Refusing to overwrite existing file: ${to}
|
|
399
|
+
throw new Error(`Refusing to overwrite existing file: ${to}`, {
|
|
400
|
+
cause: error,
|
|
401
|
+
});
|
|
398
402
|
}
|
|
399
403
|
throw error;
|
|
400
404
|
}
|
|
@@ -447,7 +451,9 @@ async function commitStagedProject(stagingRoot, targetRoot) {
|
|
|
447
451
|
// The target disappeared between the emptiness check and commit.
|
|
448
452
|
}
|
|
449
453
|
else if (isNodeError(error) && error.code === "ENOTEMPTY") {
|
|
450
|
-
throw new Error(`Target directory is not empty: ${targetRoot}
|
|
454
|
+
throw new Error(`Target directory is not empty: ${targetRoot}`, {
|
|
455
|
+
cause: error,
|
|
456
|
+
});
|
|
451
457
|
}
|
|
452
458
|
else {
|
|
453
459
|
throw error;
|
|
@@ -460,7 +466,9 @@ async function commitStagedProject(stagingRoot, targetRoot) {
|
|
|
460
466
|
catch (error) {
|
|
461
467
|
if (isNodeError(error) &&
|
|
462
468
|
["EEXIST", "ENOTEMPTY", "ENOTDIR", "EISDIR"].includes(error.code ?? "")) {
|
|
463
|
-
throw new Error(`Refusing to overwrite existing target: ${targetRoot}
|
|
469
|
+
throw new Error(`Refusing to overwrite existing target: ${targetRoot}`, {
|
|
470
|
+
cause: error,
|
|
471
|
+
});
|
|
464
472
|
}
|
|
465
473
|
throw error;
|
|
466
474
|
}
|
|
@@ -2,6 +2,8 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
export function packageTemplateRoot(moduleDir, ...segments) {
|
|
4
4
|
const candidates = [
|
|
5
|
+
path.join(moduleDir, "..", "..", "builtin-source", "templates", ...segments),
|
|
6
|
+
path.join(moduleDir, "..", "..", "template-builtin-source", "templates", ...segments),
|
|
5
7
|
path.join(moduleDir, "..", "..", "templates", ...segments),
|
|
6
8
|
path.join(moduleDir, "..", "templates", ...segments),
|
|
7
9
|
path.join(moduleDir, "..", "..", "..", "templates", ...segments),
|
|
@@ -53,7 +53,7 @@ async function contractPhase(phase, operation) {
|
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
55
|
const message = error instanceof Error ? error.message : String(error);
|
|
56
|
-
throw new Error(`Online toolchain resolution contract failed during ${phase}: ${message}`,
|
|
56
|
+
throw new Error(`Online toolchain resolution contract failed during ${phase}: ${message}`, { cause: error });
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
function fallbackResult(diagnostics) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ykdz/template-core",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"private": true,
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./*": {
|
|
11
|
+
"types": "./dist/*.d.ts",
|
|
12
|
+
"default": "./dist/*.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && cp ../../pnpm-workspace.yaml dist/pnpm-workspace.yaml",
|
|
17
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"typescript": "catalog:",
|
|
21
|
+
"valibot": "catalog:"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "catalog:",
|
|
25
|
+
"execa": "catalog:"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ykdz/template",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Project template generator for YKDZ starter projects.",
|
|
6
6
|
"keywords": [
|
|
@@ -18,17 +18,13 @@
|
|
|
18
18
|
"url": "git+https://github.com/YKDZ/template.git"
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
|
-
"template": "dist/
|
|
21
|
+
"template": "dist/cli.js"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"!templates/projection-plans.ts",
|
|
29
|
-
"!templates/*/projection.ts",
|
|
30
|
-
"!templates/shared/oxc/tsconfig.json",
|
|
31
|
-
"!templates/**/node_modules"
|
|
25
|
+
"node_modules/@ykdz/template-core",
|
|
26
|
+
"node_modules/@ykdz/template-builtin-source",
|
|
27
|
+
"!**/node_modules/**/node_modules"
|
|
32
28
|
],
|
|
33
29
|
"type": "module",
|
|
34
30
|
"publishConfig": {
|
|
@@ -36,38 +32,22 @@
|
|
|
36
32
|
},
|
|
37
33
|
"dependencies": {
|
|
38
34
|
"typescript": "^6.0.3",
|
|
39
|
-
"valibot": "^1.4.2"
|
|
35
|
+
"valibot": "^1.4.2",
|
|
36
|
+
"@ykdz/template-builtin-source": "0.0.8",
|
|
37
|
+
"@ykdz/template-core": "0.0.8"
|
|
40
38
|
},
|
|
41
39
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^24.0.0"
|
|
43
|
-
"execa": "^9.6.1",
|
|
44
|
-
"oxfmt": "^0.57.0",
|
|
45
|
-
"oxlint": "^1.72.0",
|
|
46
|
-
"oxlint-tsgolint": "^0.24.0",
|
|
47
|
-
"tsx": "^4.22.4",
|
|
48
|
-
"vitest": "^4.1.9",
|
|
49
|
-
"yaml": "^2.9.0"
|
|
40
|
+
"@types/node": "^24.0.0"
|
|
50
41
|
},
|
|
42
|
+
"bundledDependencies": [
|
|
43
|
+
"@ykdz/template-builtin-source",
|
|
44
|
+
"@ykdz/template-core"
|
|
45
|
+
],
|
|
51
46
|
"engines": {
|
|
52
47
|
"node": ">=24.0.0"
|
|
53
48
|
},
|
|
54
49
|
"scripts": {
|
|
55
50
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
56
|
-
"
|
|
57
|
-
"check:format": "oxfmt --check --config templates/shared/oxc/oxfmt.config.ts --ignore-path .oxfmtignore .",
|
|
58
|
-
"check:fixtures": "tsx scripts/check-fixtures.ts",
|
|
59
|
-
"check:generated": "tsx scripts/check-generated.ts",
|
|
60
|
-
"check:templates": "pnpm run check:templates:shared-oxc && pnpm run check:templates:github-yaml && pnpm run check:templates:boundary && pnpm run check:templates:static-source",
|
|
61
|
-
"check:toolchain:online": "tsx scripts/check-online-toolchain-resolution-contract.ts",
|
|
62
|
-
"check:templates:boundary": "tsx scripts/check-template-boundary.ts",
|
|
63
|
-
"check:templates:github-yaml": "tsx scripts/check-template-github-yaml.ts",
|
|
64
|
-
"check:templates:shared-oxc": "pnpm run check:templates:shared-oxc:format && pnpm run check:templates:shared-oxc:lint && pnpm run check:templates:shared-oxc:typecheck",
|
|
65
|
-
"check:templates:shared-oxc:format": "oxfmt --check templates/shared/oxc",
|
|
66
|
-
"check:templates:shared-oxc:lint": "oxlint templates/shared/oxc --deny-warnings",
|
|
67
|
-
"check:templates:shared-oxc:typecheck": "tsc -p templates/shared/oxc/tsconfig.json --noEmit",
|
|
68
|
-
"check:templates:static-source": "rustfmt --check templates/rust-bin/src/main.rs",
|
|
69
|
-
"fix": "pnpm run build",
|
|
70
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
71
|
-
"test": "vitest run"
|
|
51
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
72
52
|
}
|
|
73
53
|
}
|
package/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# @ykdz/template
|
|
2
|
-
|
|
3
|
-
Project template generator for YKDZ starter projects.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
pnpm dlx @ykdz/template init my-project --preset ts-lib --yes
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Available commands:
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
template init <dir> --preset <name> --yes
|
|
15
|
-
template add package --preset <name> --name <name> [--path <package-path>]
|
|
16
|
-
template presets
|
|
17
|
-
template schema preset
|
|
18
|
-
template schema blueprint
|
|
19
|
-
template preset validate <path>
|
|
20
|
-
template blueprint validate <path>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Supported presets are `ts-lib`, `hono-api`, `vue-app`, `vue-hono-app`, and
|
|
24
|
-
`rust-bin`.
|
|
25
|
-
|
|
26
|
-
## Publishing
|
|
27
|
-
|
|
28
|
-
This package is intended to publish through npm Trusted Publishing from the
|
|
29
|
-
GitHub Actions release workflow. Maintainers should complete
|
|
30
|
-
[the Trusted Publishing checklist](docs/npm-trusted-publishing.md) before the
|
|
31
|
-
first public release.
|
|
32
|
-
|
|
33
|
-
## License
|
|
34
|
-
|
|
35
|
-
MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/src/app.ts
RENAMED
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/src/server.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/preset-source.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/rustfmt.toml
RENAMED
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/src/main.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/src/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/env.d.ts
RENAMED
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/index.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/App.vue
RENAMED
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/main.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/style.css
RENAMED
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/test/app.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/vite.config.ts
RENAMED
|
File without changes
|
/package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/vitest.config.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|