@ykdz/template 0.0.2 → 0.0.4
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 +1 -1
- package/dist/src/cli.d.ts +2 -0
- package/dist/{cli.js → src/cli.js} +91 -58
- package/dist/{declarations.d.ts → src/declarations.d.ts} +3 -5
- package/dist/{declarations.js → src/declarations.js} +48 -145
- package/dist/src/dependency-catalog.d.ts +18 -0
- package/dist/src/dependency-catalog.js +132 -0
- package/dist/src/devcontainer.d.ts +58 -0
- package/dist/src/devcontainer.js +202 -0
- package/dist/src/editor-customization.d.ts +12 -0
- package/dist/src/editor-customization.js +108 -0
- package/dist/{generation-context.d.ts → src/generation-context.d.ts} +2 -3
- package/dist/{generation-context.js → src/generation-context.js} +4 -1
- package/dist/src/module-graph.d.ts +34 -0
- package/dist/src/module-graph.js +58 -0
- package/dist/{next-step-instructions.d.ts → src/next-step-instructions.d.ts} +2 -4
- package/dist/{next-step-instructions.js → src/next-step-instructions.js} +49 -24
- package/dist/{package-addition.d.ts → src/package-addition.d.ts} +1 -1
- package/dist/src/package-addition.js +343 -0
- package/dist/src/preset-projection.d.ts +66 -0
- package/dist/src/preset-projection.js +7 -0
- package/dist/{project-github.d.ts → src/project-github.d.ts} +3 -9
- package/dist/{project-github.js → src/project-github.js} +27 -42
- package/dist/{renderer.d.ts → src/renderer.d.ts} +16 -2
- package/dist/{renderer.js → src/renderer.js} +95 -12
- package/dist/src/runtime-paths.d.ts +1 -0
- package/dist/src/runtime-paths.js +11 -0
- package/dist/src/template-boundary-check.d.ts +34 -0
- package/dist/src/template-boundary-check.js +448 -0
- package/dist/{toolchain-resolution.d.ts → src/toolchain-resolution.d.ts} +0 -1
- package/dist/{toolchain-resolution.js → src/toolchain-resolution.js} +1 -1
- package/dist/templates/hono-api/projection.d.ts +6 -0
- package/dist/templates/hono-api/projection.js +538 -0
- package/dist/templates/projection-plans.d.ts +7 -0
- package/dist/templates/projection-plans.js +94 -0
- package/dist/templates/registry.d.ts +7 -0
- package/dist/templates/registry.js +42 -0
- package/dist/templates/rust-bin/projection.d.ts +9 -0
- package/dist/templates/rust-bin/projection.js +390 -0
- package/dist/templates/ts-lib/projection.d.ts +6 -0
- package/dist/templates/ts-lib/projection.js +523 -0
- package/dist/templates/vue-app/projection.d.ts +6 -0
- package/dist/templates/vue-app/projection.js +757 -0
- package/dist/templates/vue-hono-app/projection.d.ts +8 -0
- package/dist/templates/vue-hono-app/projection.js +693 -0
- package/package.json +38 -28
- package/pnpm-workspace.yaml +35 -0
- package/templates/hono-api/.github/dependabot.yml +13 -0
- package/templates/rust-bin/.github/dependabot.yml +18 -1
- package/templates/rust-bin/rust-toolchain.toml +3 -0
- package/templates/rust-bin/rustfmt.toml +2 -0
- package/templates/shared/devcontainer/browser-test.Dockerfile +2 -0
- package/templates/shared/devcontainer/node-pnpm.Dockerfile +6 -0
- package/templates/shared/devcontainer/rust.Dockerfile +16 -0
- package/templates/shared/editor-customization/capabilities.json +56 -0
- package/templates/ts-lib/.github/dependabot.yml +13 -0
- package/templates/ts-lib/src/index.ts +5 -1
- package/templates/vue-app/.github/dependabot.yml +13 -0
- package/templates/vue-app/.github/workflows/check.yml +1 -1
- package/templates/vue-app/test/e2e/app.spec.ts +4 -1
- package/templates/vue-hono-app/.github/dependabot.yml +13 -0
- package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/declarations.d.ts.map +0 -1
- package/dist/devcontainer.d.ts +0 -17
- package/dist/devcontainer.d.ts.map +0 -1
- package/dist/devcontainer.js +0 -23
- package/dist/generation-context.d.ts.map +0 -1
- package/dist/hono-api.d.ts +0 -3
- package/dist/hono-api.d.ts.map +0 -1
- package/dist/hono-api.js +0 -210
- package/dist/module-graph.d.ts +0 -45
- package/dist/module-graph.d.ts.map +0 -1
- package/dist/module-graph.js +0 -187
- package/dist/next-step-instructions.d.ts.map +0 -1
- package/dist/package-addition.d.ts.map +0 -1
- package/dist/package-addition.js +0 -560
- package/dist/project-github.d.ts.map +0 -1
- package/dist/renderer.d.ts.map +0 -1
- package/dist/rust-bin.d.ts +0 -8
- package/dist/rust-bin.d.ts.map +0 -1
- package/dist/rust-bin.js +0 -208
- package/dist/toolchain-resolution.d.ts.map +0 -1
- package/dist/ts-lib.d.ts +0 -8
- package/dist/ts-lib.d.ts.map +0 -1
- package/dist/ts-lib.js +0 -214
- package/dist/vue-app.d.ts +0 -3
- package/dist/vue-app.d.ts.map +0 -1
- package/dist/vue-app.js +0 -301
- package/dist/vue-hono-app.d.ts +0 -7
- package/dist/vue-hono-app.d.ts.map +0 -1
- package/dist/vue-hono-app.js +0 -440
- package/templates/shared/oxc/package.json +0 -18
- package/templates/shared/oxc/tsconfig.json +0 -11
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BuiltInPreset, ProjectBlueprint } from "../../src/declarations.js";
|
|
2
|
+
import { type CheckPlan, type FixPlan } from "../../src/module-graph.js";
|
|
3
|
+
import type { PresetBlueprintOptions, PresetProjection } from "../../src/preset-projection.js";
|
|
4
|
+
export declare const rustBinPresetMetadata: BuiltInPreset;
|
|
5
|
+
export declare function planRustBinChecks(): CheckPlan;
|
|
6
|
+
export declare function planRustBinFixes(): FixPlan;
|
|
7
|
+
export declare function rustBinBlueprint(options?: PresetBlueprintOptions): ProjectBlueprint;
|
|
8
|
+
export declare function projectRustBinPackageScripts(): Record<string, string>;
|
|
9
|
+
export declare const rustBinPresetProjection: PresetProjection;
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { collectGeneratedManifestCatalogDependencies, renderGeneratedPnpmWorkspaceYaml, } from "../../src/dependency-catalog.js";
|
|
5
|
+
import { dockerfileFirstRustPnpmDevcontainer, nodePnpmToolLayer, rustToolLayer, } from "../../src/devcontainer.js";
|
|
6
|
+
import { editorCustomizationForCapabilities } from "../../src/editor-customization.js";
|
|
7
|
+
import { renderFixCommand, renderRootCheckCommand, } from "../../src/module-graph.js";
|
|
8
|
+
import { renderNewProject } from "../../src/renderer.js";
|
|
9
|
+
const generatedBy = {
|
|
10
|
+
packageName: "@ykdz/template",
|
|
11
|
+
version: "0.0.0",
|
|
12
|
+
command: "template init --preset rust-bin",
|
|
13
|
+
};
|
|
14
|
+
export const rustBinPresetMetadata = {
|
|
15
|
+
name: "rust-bin",
|
|
16
|
+
title: "Rust binary",
|
|
17
|
+
description: "Rust native binary workspace with rustfmt, clippy, and cargo tests.",
|
|
18
|
+
generation: "supported",
|
|
19
|
+
supportedPackageManagers: ["pnpm"],
|
|
20
|
+
supportedProjectKinds: ["multi-package"],
|
|
21
|
+
features: [
|
|
22
|
+
"root-check",
|
|
23
|
+
"fix-command",
|
|
24
|
+
"devcontainer",
|
|
25
|
+
"github-actions",
|
|
26
|
+
"dependabot",
|
|
27
|
+
"rustfmt-clippy",
|
|
28
|
+
"cargo-test",
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
const rustPackageBoundary = {
|
|
32
|
+
kind: "package-boundary",
|
|
33
|
+
path: ".",
|
|
34
|
+
};
|
|
35
|
+
const rustWorkspacePackageBoundary = {
|
|
36
|
+
kind: "package-boundary",
|
|
37
|
+
path: "packages/*",
|
|
38
|
+
};
|
|
39
|
+
function cargoPackageNameFromProjectName(projectName) {
|
|
40
|
+
const slug = projectName
|
|
41
|
+
.normalize("NFKD")
|
|
42
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
43
|
+
.toLowerCase()
|
|
44
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
45
|
+
.replace(/^-+|-+$/g, "");
|
|
46
|
+
return slug || "rust-bin";
|
|
47
|
+
}
|
|
48
|
+
function projectNameFromDir(targetDir) {
|
|
49
|
+
return path.basename(path.resolve(targetDir));
|
|
50
|
+
}
|
|
51
|
+
function rustWorkspacePackageName(projectName) {
|
|
52
|
+
return `${cargoPackageNameFromProjectName(projectName)}-native`;
|
|
53
|
+
}
|
|
54
|
+
function rustWorkspacePackagePath(projectName) {
|
|
55
|
+
return `packages/${cargoPackageNameFromProjectName(projectName)}`;
|
|
56
|
+
}
|
|
57
|
+
function rustDependencyMaintenancePolicy(projectName) {
|
|
58
|
+
return {
|
|
59
|
+
ecosystems: ["npm", "cargo", "github-actions", "docker", "rust-toolchain"],
|
|
60
|
+
directories: {
|
|
61
|
+
cargo: `/${rustWorkspacePackagePath(projectName)}`,
|
|
62
|
+
},
|
|
63
|
+
interval: "weekly",
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function planRustBinChecks() {
|
|
67
|
+
return {
|
|
68
|
+
components: [
|
|
69
|
+
{ kind: "rustfmt-check", owner: rustPackageBoundary },
|
|
70
|
+
{ kind: "cargo-clippy", owner: rustPackageBoundary },
|
|
71
|
+
{ kind: "cargo-test", owner: rustPackageBoundary },
|
|
72
|
+
],
|
|
73
|
+
environmentNeeds: [],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function planRustBinRootChecks() {
|
|
77
|
+
return {
|
|
78
|
+
components: [
|
|
79
|
+
{ kind: "turbo-package-check", owner: rustWorkspacePackageBoundary },
|
|
80
|
+
],
|
|
81
|
+
environmentNeeds: [],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function planRustBinFixes() {
|
|
85
|
+
return {
|
|
86
|
+
components: [{ kind: "rustfmt-write", owner: rustPackageBoundary }],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function planRustBinRootFixes() {
|
|
90
|
+
return {
|
|
91
|
+
components: [
|
|
92
|
+
{ kind: "turbo-package-fix", owner: rustWorkspacePackageBoundary },
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function rustBinBlueprint(options = { targetDir: process.cwd() }) {
|
|
97
|
+
const projectName = projectNameFromDir(options.targetDir);
|
|
98
|
+
return {
|
|
99
|
+
schemaVersion: 1,
|
|
100
|
+
preset: "rust-bin",
|
|
101
|
+
packageManager: "pnpm",
|
|
102
|
+
projectKind: "multi-package",
|
|
103
|
+
features: [...rustBinPresetMetadata.features],
|
|
104
|
+
packages: [
|
|
105
|
+
{
|
|
106
|
+
name: rustWorkspacePackageName(projectName),
|
|
107
|
+
path: rustWorkspacePackagePath(projectName),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export function projectRustBinPackageScripts() {
|
|
113
|
+
return {
|
|
114
|
+
check: renderRootCheckCommand(planRustBinChecks()),
|
|
115
|
+
fix: renderFixCommand(planRustBinFixes()),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function projectRustBinRootPackageScripts() {
|
|
119
|
+
return {
|
|
120
|
+
check: renderRootCheckCommand(planRustBinRootChecks()),
|
|
121
|
+
fix: renderFixCommand(planRustBinRootFixes()),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function cargoToml(projectName) {
|
|
125
|
+
return [
|
|
126
|
+
"[package]",
|
|
127
|
+
`name = "${projectName}"`,
|
|
128
|
+
'version = "0.1.0"',
|
|
129
|
+
'edition = "2024"',
|
|
130
|
+
"",
|
|
131
|
+
"[dependencies]",
|
|
132
|
+
"",
|
|
133
|
+
"[lints]",
|
|
134
|
+
"workspace = true",
|
|
135
|
+
"",
|
|
136
|
+
"[workspace]",
|
|
137
|
+
'members = ["."]',
|
|
138
|
+
'resolver = "3"',
|
|
139
|
+
"",
|
|
140
|
+
"[workspace.lints.rust]",
|
|
141
|
+
'unsafe_code = "forbid"',
|
|
142
|
+
"",
|
|
143
|
+
"[workspace.lints.clippy]",
|
|
144
|
+
'all = "deny"',
|
|
145
|
+
'pedantic = "deny"',
|
|
146
|
+
'nursery = "deny"',
|
|
147
|
+
"",
|
|
148
|
+
"[profile.release]",
|
|
149
|
+
'strip = "symbols"',
|
|
150
|
+
'lto = "thin"',
|
|
151
|
+
"codegen-units = 1",
|
|
152
|
+
"",
|
|
153
|
+
].join("\n");
|
|
154
|
+
}
|
|
155
|
+
function cargoLock(projectName) {
|
|
156
|
+
return [
|
|
157
|
+
"# This file is automatically @generated by Cargo.",
|
|
158
|
+
"# It is not intended for manual editing.",
|
|
159
|
+
"version = 4",
|
|
160
|
+
"",
|
|
161
|
+
"[[package]]",
|
|
162
|
+
`name = "${projectName}"`,
|
|
163
|
+
'version = "0.1.0"',
|
|
164
|
+
"",
|
|
165
|
+
].join("\n");
|
|
166
|
+
}
|
|
167
|
+
function packageJson(context, projectName, packageScripts) {
|
|
168
|
+
return {
|
|
169
|
+
name: projectName,
|
|
170
|
+
version: "0.0.0",
|
|
171
|
+
private: true,
|
|
172
|
+
scripts: packageScripts,
|
|
173
|
+
devDependencies: {
|
|
174
|
+
turbo: "catalog:",
|
|
175
|
+
},
|
|
176
|
+
engines: {
|
|
177
|
+
node: context.toolchain.nodeLtsMajor.value,
|
|
178
|
+
},
|
|
179
|
+
packageManager: context.toolchain.packageManagerPin.value,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function rustWorkspacePackageJson(context, projectName) {
|
|
183
|
+
return {
|
|
184
|
+
name: rustWorkspacePackageName(projectName),
|
|
185
|
+
version: "0.0.0",
|
|
186
|
+
private: true,
|
|
187
|
+
scripts: projectRustBinPackageScripts(),
|
|
188
|
+
engines: {
|
|
189
|
+
node: context.toolchain.nodeLtsMajor.value,
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function generationRecord(context) {
|
|
194
|
+
return {
|
|
195
|
+
...generatedBy,
|
|
196
|
+
toolchain: {
|
|
197
|
+
nodeLtsMajor: context.toolchain.nodeLtsMajor.value,
|
|
198
|
+
packageManagerPin: context.toolchain.packageManagerPin.value,
|
|
199
|
+
source: context.toolchain.source,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function operationsForRustBin(context, devcontainerName, projectName, packageScripts, checkPlan) {
|
|
204
|
+
const editorCustomization = editorCustomizationForCapabilities([
|
|
205
|
+
"rust-tooling",
|
|
206
|
+
]);
|
|
207
|
+
const rustLayer = rustToolLayer();
|
|
208
|
+
const developmentContainer = dockerfileFirstRustPnpmDevcontainer({
|
|
209
|
+
name: devcontainerName,
|
|
210
|
+
nodeLayer: nodePnpmToolLayer({
|
|
211
|
+
nodeVersion: context.toolchain.nodeLtsMajor.value,
|
|
212
|
+
packageManagerPin: context.toolchain.packageManagerPin.value,
|
|
213
|
+
}),
|
|
214
|
+
rustLayer,
|
|
215
|
+
extensions: editorCustomization.extensions,
|
|
216
|
+
settings: editorCustomization.settings,
|
|
217
|
+
});
|
|
218
|
+
const dockerfileOperation = developmentContainer.dockerfileOperation;
|
|
219
|
+
if (dockerfileOperation === undefined) {
|
|
220
|
+
throw new Error("Rust Development Container Dockerfile must use fragments.");
|
|
221
|
+
}
|
|
222
|
+
const workspacePackagePath = rustWorkspacePackagePath(projectName);
|
|
223
|
+
const rootManifest = packageJson(context, projectName, packageScripts);
|
|
224
|
+
const packageManifest = rustWorkspacePackageJson(context, projectName);
|
|
225
|
+
const dependencyMaintenancePolicy = rustDependencyMaintenancePolicy(projectName);
|
|
226
|
+
return [
|
|
227
|
+
{
|
|
228
|
+
kind: "writeJson",
|
|
229
|
+
to: "package.json",
|
|
230
|
+
value: rootManifest,
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
kind: "writeText",
|
|
234
|
+
to: "pnpm-workspace.yaml",
|
|
235
|
+
text: renderGeneratedPnpmWorkspaceYaml({
|
|
236
|
+
packages: ["packages/*"],
|
|
237
|
+
dependencies: collectGeneratedManifestCatalogDependencies([
|
|
238
|
+
rootManifest,
|
|
239
|
+
packageManifest,
|
|
240
|
+
]),
|
|
241
|
+
}),
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
kind: "writeJson",
|
|
245
|
+
to: "turbo.json",
|
|
246
|
+
value: {
|
|
247
|
+
tasks: {
|
|
248
|
+
check: {},
|
|
249
|
+
fix: {
|
|
250
|
+
cache: false,
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
kind: "writeJson",
|
|
257
|
+
to: `${workspacePackagePath}/package.json`,
|
|
258
|
+
value: packageManifest,
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
kind: "writeText",
|
|
262
|
+
to: `${workspacePackagePath}/Cargo.toml`,
|
|
263
|
+
text: cargoToml(projectName),
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
kind: "writeText",
|
|
267
|
+
to: `${workspacePackagePath}/Cargo.lock`,
|
|
268
|
+
text: cargoLock(projectName),
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
kind: "copyFile",
|
|
272
|
+
from: "rustfmt.toml",
|
|
273
|
+
to: `${workspacePackagePath}/rustfmt.toml`,
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
kind: "writeTextTemplate",
|
|
277
|
+
from: "rust-toolchain.toml",
|
|
278
|
+
to: "rust-toolchain.toml",
|
|
279
|
+
replacements: {
|
|
280
|
+
RUST_TOOLCHAIN: rustLayer.toolchain,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
kind: "writeText",
|
|
285
|
+
to: ".gitignore",
|
|
286
|
+
text: ["target", ".env", ".template/", ".pnpm-store/", ""].join("\n"),
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
kind: "copyFile",
|
|
290
|
+
from: "src/main.rs",
|
|
291
|
+
to: `${workspacePackagePath}/src/main.rs`,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
kind: "writeJson",
|
|
295
|
+
to: ".template/blueprint.json",
|
|
296
|
+
value: context.blueprint,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
kind: "writeJson",
|
|
300
|
+
to: ".template/generated-by.json",
|
|
301
|
+
value: generationRecord(context),
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
kind: "writeJson",
|
|
305
|
+
to: ".devcontainer/devcontainer.json",
|
|
306
|
+
value: developmentContainer.devcontainer,
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
...dockerfileOperation,
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
kind: "writeJson",
|
|
313
|
+
to: ".vscode/extensions.json",
|
|
314
|
+
value: {
|
|
315
|
+
recommendations: editorCustomization.extensions,
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
kind: "writeJson",
|
|
320
|
+
to: ".vscode/settings.json",
|
|
321
|
+
value: editorCustomization.settings,
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
kind: "copyFile",
|
|
325
|
+
from: ".github/workflows/check.yml",
|
|
326
|
+
to: ".github/workflows/check.yml",
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
kind: "writeTextTemplate",
|
|
330
|
+
from: ".github/dependabot.yml",
|
|
331
|
+
to: ".github/dependabot.yml",
|
|
332
|
+
replacements: {
|
|
333
|
+
CARGO_PACKAGE_DIRECTORY: dependencyMaintenancePolicy.directories?.cargo ??
|
|
334
|
+
`/${workspacePackagePath}`,
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
];
|
|
338
|
+
}
|
|
339
|
+
function templateSourceRoot() {
|
|
340
|
+
const projectionDir = path.dirname(fileURLToPath(import.meta.url));
|
|
341
|
+
const publishedTemplateRoot = path.join(projectionDir, "..", "..", "..", "templates", "rust-bin");
|
|
342
|
+
return existsSync(path.join(publishedTemplateRoot, "src", "main.rs"))
|
|
343
|
+
? publishedTemplateRoot
|
|
344
|
+
: projectionDir;
|
|
345
|
+
}
|
|
346
|
+
function sharedDevcontainerSourceRoot() {
|
|
347
|
+
const projectionDir = path.dirname(fileURLToPath(import.meta.url));
|
|
348
|
+
const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "devcontainer");
|
|
349
|
+
return existsSync(path.join(publishedSharedRoot, "node-pnpm.Dockerfile"))
|
|
350
|
+
? publishedSharedRoot
|
|
351
|
+
: path.join(projectionDir, "..", "shared", "devcontainer");
|
|
352
|
+
}
|
|
353
|
+
export const rustBinPresetProjection = {
|
|
354
|
+
metadata: rustBinPresetMetadata,
|
|
355
|
+
blueprint: rustBinBlueprint,
|
|
356
|
+
project(context) {
|
|
357
|
+
const checkPlan = planRustBinRootChecks();
|
|
358
|
+
const fixPlan = planRustBinRootFixes();
|
|
359
|
+
const packageScripts = projectRustBinRootPackageScripts();
|
|
360
|
+
const projectName = cargoPackageNameFromProjectName(context.projectName.value);
|
|
361
|
+
const devcontainerName = context.projectName.value;
|
|
362
|
+
const dependencyMaintenancePolicy = rustDependencyMaintenancePolicy(projectName);
|
|
363
|
+
return {
|
|
364
|
+
sourceRoot: templateSourceRoot(),
|
|
365
|
+
sourceRoots: {
|
|
366
|
+
sharedDevcontainer: sharedDevcontainerSourceRoot(),
|
|
367
|
+
},
|
|
368
|
+
operations: operationsForRustBin(context, devcontainerName, projectName, packageScripts, checkPlan),
|
|
369
|
+
checkPlan,
|
|
370
|
+
fixPlan,
|
|
371
|
+
dependencyMaintenancePolicy,
|
|
372
|
+
packageScripts,
|
|
373
|
+
capabilities: {
|
|
374
|
+
rootCheck: true,
|
|
375
|
+
fixCommand: true,
|
|
376
|
+
githubActions: true,
|
|
377
|
+
dependabot: true,
|
|
378
|
+
devcontainer: true,
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
},
|
|
382
|
+
async render({ targetDir, plan }) {
|
|
383
|
+
await renderNewProject({
|
|
384
|
+
sourceRoot: plan.sourceRoot,
|
|
385
|
+
sourceRoots: plan.sourceRoots,
|
|
386
|
+
targetRoot: targetDir,
|
|
387
|
+
operations: [...plan.operations],
|
|
388
|
+
});
|
|
389
|
+
},
|
|
390
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BuiltInPreset, ProjectBlueprint } from "../../src/declarations.js";
|
|
2
|
+
import type { PresetBlueprintOptions, PresetProjection } from "../../src/preset-projection.js";
|
|
3
|
+
export declare const tsLibPresetMetadata: BuiltInPreset;
|
|
4
|
+
export declare function tsLibBlueprint(options?: PresetBlueprintOptions): ProjectBlueprint;
|
|
5
|
+
export declare function projectTsLibPackageScripts(): Record<string, string>;
|
|
6
|
+
export declare const tsLibPresetProjection: PresetProjection;
|