@ykdz/template 0.0.1 → 0.0.3

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.
Files changed (101) hide show
  1. package/dist/src/cli.d.ts.map +1 -0
  2. package/dist/{cli.js → src/cli.js} +126 -128
  3. package/dist/{declarations.d.ts → src/declarations.d.ts} +1 -2
  4. package/dist/src/declarations.d.ts.map +1 -0
  5. package/dist/{declarations.js → src/declarations.js} +2 -109
  6. package/dist/src/dependency-catalog.d.ts +10 -0
  7. package/dist/src/dependency-catalog.d.ts.map +1 -0
  8. package/dist/src/dependency-catalog.js +63 -0
  9. package/dist/src/devcontainer.d.ts +18 -0
  10. package/dist/src/devcontainer.d.ts.map +1 -0
  11. package/dist/src/devcontainer.js +24 -0
  12. package/dist/src/editor-customization.d.ts +13 -0
  13. package/dist/src/editor-customization.d.ts.map +1 -0
  14. package/dist/src/editor-customization.js +101 -0
  15. package/dist/src/generation-context.d.ts +24 -0
  16. package/dist/src/generation-context.d.ts.map +1 -0
  17. package/dist/src/generation-context.js +12 -0
  18. package/dist/src/module-graph.d.ts +31 -0
  19. package/dist/src/module-graph.d.ts.map +1 -0
  20. package/dist/src/module-graph.js +48 -0
  21. package/dist/src/next-step-instructions.d.ts +21 -0
  22. package/dist/src/next-step-instructions.d.ts.map +1 -0
  23. package/dist/src/next-step-instructions.js +89 -0
  24. package/dist/src/package-addition.d.ts.map +1 -0
  25. package/dist/src/package-addition.js +188 -0
  26. package/dist/src/preset-projection.d.ts +66 -0
  27. package/dist/src/preset-projection.d.ts.map +1 -0
  28. package/dist/src/preset-projection.js +7 -0
  29. package/dist/src/project-github.d.ts +29 -0
  30. package/dist/src/project-github.d.ts.map +1 -0
  31. package/dist/src/project-github.js +63 -0
  32. package/dist/src/renderer.d.ts.map +1 -0
  33. package/dist/{renderer.js → src/renderer.js} +0 -3
  34. package/dist/src/runtime-paths.d.ts +2 -0
  35. package/dist/src/runtime-paths.d.ts.map +1 -0
  36. package/dist/src/runtime-paths.js +11 -0
  37. package/dist/src/toolchain-resolution.d.ts +35 -0
  38. package/dist/src/toolchain-resolution.d.ts.map +1 -0
  39. package/dist/src/toolchain-resolution.js +192 -0
  40. package/dist/templates/hono-api/projection.d.ts +7 -0
  41. package/dist/templates/hono-api/projection.d.ts.map +1 -0
  42. package/dist/templates/hono-api/projection.js +377 -0
  43. package/dist/templates/projection-plans.d.ts +8 -0
  44. package/dist/templates/projection-plans.d.ts.map +1 -0
  45. package/dist/templates/projection-plans.js +94 -0
  46. package/dist/templates/registry.d.ts +8 -0
  47. package/dist/templates/registry.d.ts.map +1 -0
  48. package/dist/templates/registry.js +42 -0
  49. package/dist/templates/rust-bin/projection.d.ts +10 -0
  50. package/dist/templates/rust-bin/projection.d.ts.map +1 -0
  51. package/dist/templates/rust-bin/projection.js +282 -0
  52. package/dist/templates/ts-lib/projection.d.ts +7 -0
  53. package/dist/templates/ts-lib/projection.d.ts.map +1 -0
  54. package/dist/templates/ts-lib/projection.js +372 -0
  55. package/dist/templates/vue-app/projection.d.ts +7 -0
  56. package/dist/templates/vue-app/projection.d.ts.map +1 -0
  57. package/dist/templates/vue-app/projection.js +594 -0
  58. package/dist/templates/vue-hono-app/projection.d.ts +9 -0
  59. package/dist/templates/vue-hono-app/projection.d.ts.map +1 -0
  60. package/dist/templates/vue-hono-app/projection.js +589 -0
  61. package/package.json +30 -24
  62. package/pnpm-workspace.yaml +34 -0
  63. package/templates/hono-api/projection.ts +453 -0
  64. package/templates/projection-plans.ts +135 -0
  65. package/templates/registry.ts +59 -0
  66. package/templates/rust-bin/.github/dependabot.yml +4 -0
  67. package/templates/rust-bin/.github/workflows/check.yml +6 -1
  68. package/templates/rust-bin/projection.ts +346 -0
  69. package/templates/ts-lib/projection.ts +454 -0
  70. package/templates/vue-app/projection.ts +687 -0
  71. package/templates/vue-app/test/e2e/app.spec.ts +4 -1
  72. package/templates/vue-hono-app/projection.ts +669 -0
  73. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
  74. package/dist/cli.d.ts.map +0 -1
  75. package/dist/declarations.d.ts.map +0 -1
  76. package/dist/hono-api.d.ts +0 -2
  77. package/dist/hono-api.d.ts.map +0 -1
  78. package/dist/hono-api.js +0 -208
  79. package/dist/package-addition.d.ts.map +0 -1
  80. package/dist/package-addition.js +0 -560
  81. package/dist/post-commands.d.ts +0 -40
  82. package/dist/post-commands.d.ts.map +0 -1
  83. package/dist/post-commands.js +0 -154
  84. package/dist/renderer.d.ts.map +0 -1
  85. package/dist/rust-bin.d.ts +0 -2
  86. package/dist/rust-bin.d.ts.map +0 -1
  87. package/dist/rust-bin.js +0 -174
  88. package/dist/ts-lib.d.ts +0 -2
  89. package/dist/ts-lib.d.ts.map +0 -1
  90. package/dist/ts-lib.js +0 -181
  91. package/dist/vue-app.d.ts +0 -2
  92. package/dist/vue-app.d.ts.map +0 -1
  93. package/dist/vue-app.js +0 -299
  94. package/dist/vue-hono-app.d.ts +0 -4
  95. package/dist/vue-hono-app.d.ts.map +0 -1
  96. package/dist/vue-hono-app.js +0 -436
  97. package/templates/shared/oxc/package.json +0 -18
  98. package/templates/shared/oxc/tsconfig.json +0 -11
  99. /package/dist/{cli.d.ts → src/cli.d.ts} +0 -0
  100. /package/dist/{package-addition.d.ts → src/package-addition.d.ts} +0 -0
  101. /package/dist/{renderer.d.ts → src/renderer.d.ts} +0 -0
@@ -1,154 +0,0 @@
1
- import { spawn } from "node:child_process";
2
- import path from "node:path";
3
- const postCommandPlanBrand = Symbol("PostCommandPlan");
4
- const packageManagerPin = "pnpm@10.0.0";
5
- const nodeReadyCommands = [
6
- {
7
- id: "node-enable-corepack",
8
- label: "Enable Corepack",
9
- command: "corepack",
10
- args: ["enable"]
11
- },
12
- {
13
- id: "node-refresh-package-manager-pin",
14
- label: "Refresh Package Manager Pin and Install Dependencies",
15
- command: "corepack",
16
- args: ["use", packageManagerPin]
17
- },
18
- {
19
- id: "node-run-fix",
20
- label: "Run Fix Command",
21
- command: "pnpm",
22
- args: ["run", "fix"]
23
- }
24
- ];
25
- const vueReadyCommand = {
26
- id: "vue-install-playwright-browsers",
27
- label: "Install Playwright browser assets",
28
- command: "pnpm",
29
- args: ["exec", "playwright", "install", "chromium"]
30
- };
31
- const vueHonoReadyCommand = {
32
- id: "vue-hono-install-playwright-browsers",
33
- label: "Install Playwright browser assets for web workspace",
34
- command: "pnpm",
35
- args: ["--filter", "./apps/web", "exec", "playwright", "install", "chromium"]
36
- };
37
- function postCommandsForPreset(options) {
38
- if (options.preset !== "ts-lib" &&
39
- options.preset !== "hono-api" &&
40
- options.preset !== "vue-app" &&
41
- options.preset !== "vue-hono-app") {
42
- return [];
43
- }
44
- const commands = [...nodeReadyCommands];
45
- if (options.preset === "vue-app") {
46
- commands.push(vueReadyCommand);
47
- }
48
- if (options.preset === "vue-hono-app") {
49
- commands.push(vueHonoReadyCommand);
50
- }
51
- return commands.map((command) => ({
52
- ...command,
53
- cwd: options.targetDir
54
- }));
55
- }
56
- export function planPostCommands(options) {
57
- const targetDir = path.resolve(options.targetDir);
58
- const commands = postCommandsForPreset({
59
- preset: options.preset,
60
- targetDir
61
- }).map((command) => Object.freeze(command));
62
- return Object.freeze({
63
- preset: options.preset,
64
- targetDir,
65
- commands: Object.freeze(commands),
66
- [postCommandPlanBrand]: true
67
- });
68
- }
69
- async function defaultExecutor(command) {
70
- return await new Promise((resolve, reject) => {
71
- const child = spawn(command.command, [...command.args], {
72
- cwd: command.cwd,
73
- stdio: "ignore"
74
- });
75
- child.once("error", reject);
76
- child.once("close", (exitCode) => {
77
- resolve({ exitCode: exitCode ?? 1 });
78
- });
79
- });
80
- }
81
- function isWithinDirectory(parentDir, childPath) {
82
- const relativePath = path.relative(path.resolve(parentDir), path.resolve(childPath));
83
- return (relativePath === "" ||
84
- (!relativePath.startsWith("..") && !path.isAbsolute(relativePath)));
85
- }
86
- function sameCommand(left, right) {
87
- return (left.id === right.id &&
88
- left.label === right.label &&
89
- left.command === right.command &&
90
- left.args.length === right.args.length &&
91
- left.args.every((arg, index) => arg === right.args[index]) &&
92
- path.resolve(left.cwd) === path.resolve(right.cwd));
93
- }
94
- function validatePostCommandPlan(plan) {
95
- const expectedCommands = postCommandsForPreset({
96
- preset: plan.preset,
97
- targetDir: path.resolve(plan.targetDir)
98
- });
99
- const expectedCommandIds = new Set(expectedCommands.map((command) => command.id));
100
- for (const command of plan.commands) {
101
- if (!isWithinDirectory(plan.targetDir, command.cwd)) {
102
- throw new Error(`Post Command cwd must stay within the target directory: ${command.id}`);
103
- }
104
- if (!expectedCommandIds.has(command.id)) {
105
- throw new Error(`Unplanned Post Command: ${command.id}`);
106
- }
107
- }
108
- if (plan.commands.length !== expectedCommands.length) {
109
- throw new Error("Post Command plan must match the complete planned sequence");
110
- }
111
- for (const [index, command] of plan.commands.entries()) {
112
- const expectedCommand = expectedCommands[index];
113
- if (!expectedCommand || command.id !== expectedCommand.id) {
114
- throw new Error("Post Command plan must match the complete planned sequence");
115
- }
116
- if (!sameCommand(command, expectedCommand)) {
117
- throw new Error(`Post Command does not match the planned template command: ${command.id}`);
118
- }
119
- }
120
- }
121
- export async function runPostCommands(options) {
122
- const executor = options.executor ?? defaultExecutor;
123
- const results = [];
124
- validatePostCommandPlan(options.plan);
125
- for (const command of options.plan.commands) {
126
- try {
127
- const result = await executor(command);
128
- if (result.exitCode !== 0) {
129
- results.push({
130
- command,
131
- status: "failed",
132
- exitCode: result.exitCode,
133
- error: `Post Command failed with exit code ${result.exitCode}: ${command.id}`
134
- });
135
- break;
136
- }
137
- results.push({ command, status: "run", exitCode: 0 });
138
- }
139
- catch (error) {
140
- const exitCode = error instanceof Error && "exitCode" in error && typeof error.exitCode === "number"
141
- ? error.exitCode
142
- : null;
143
- const message = error instanceof Error ? error.message : String(error);
144
- results.push({
145
- command,
146
- status: "failed",
147
- exitCode,
148
- error: `Post Command failed: ${command.id}: ${message}`
149
- });
150
- break;
151
- }
152
- }
153
- return results;
154
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAgBA,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,sBAAsB,GACtB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC;AAufF,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkChF;AAiCD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBnF"}
@@ -1,2 +0,0 @@
1
- export declare function initRustBinProject(targetDir: string): Promise<void>;
2
- //# sourceMappingURL=rust-bin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rust-bin.d.ts","sourceRoot":"","sources":["../src/rust-bin.ts"],"names":[],"mappings":"AAgLA,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE"}
package/dist/rust-bin.js DELETED
@@ -1,174 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import { renderNewProject } from "./renderer.js";
4
- const features = [
5
- "root-check",
6
- "fix-command",
7
- "devcontainer",
8
- "github-actions",
9
- "dependabot",
10
- "rustfmt-clippy",
11
- "cargo-test"
12
- ];
13
- const generatedBy = {
14
- packageName: "@ykdz/template",
15
- version: "0.0.0",
16
- command: "template init --preset rust-bin"
17
- };
18
- function cargoPackageNameFromDir(targetDir) {
19
- const directoryName = path.basename(path.resolve(targetDir));
20
- const slug = directoryName
21
- .normalize("NFKD")
22
- .replace(/[\u0300-\u036f]/g, "")
23
- .toLowerCase()
24
- .replace(/[^a-z0-9]+/g, "-")
25
- .replace(/^-+|-+$/g, "");
26
- return slug || "rust-bin";
27
- }
28
- function cargoToml(projectName) {
29
- return [
30
- "[package]",
31
- `name = "${projectName}"`,
32
- 'version = "0.1.0"',
33
- 'edition = "2024"',
34
- "",
35
- "[dependencies]",
36
- "",
37
- "[lints]",
38
- "workspace = true",
39
- "",
40
- "[workspace]",
41
- 'members = ["."]',
42
- 'resolver = "3"',
43
- "",
44
- "[workspace.lints.rust]",
45
- 'unsafe_code = "forbid"',
46
- "",
47
- "[workspace.lints.clippy]",
48
- 'all = "deny"',
49
- 'pedantic = "deny"',
50
- 'nursery = "deny"',
51
- "",
52
- "[profile.release]",
53
- 'strip = "symbols"',
54
- 'lto = "thin"',
55
- "codegen-units = 1",
56
- ""
57
- ].join("\n");
58
- }
59
- function cargoLock(projectName) {
60
- return [
61
- "# This file is automatically @generated by Cargo.",
62
- "# It is not intended for manual editing.",
63
- "version = 4",
64
- "",
65
- "[[package]]",
66
- `name = "${projectName}"`,
67
- 'version = "0.1.0"',
68
- ""
69
- ].join("\n");
70
- }
71
- function operationsForRustBin(projectName) {
72
- return [
73
- {
74
- kind: "writeText",
75
- to: "Cargo.toml",
76
- text: cargoToml(projectName)
77
- },
78
- {
79
- kind: "writeText",
80
- to: "Cargo.lock",
81
- text: cargoLock(projectName)
82
- },
83
- {
84
- kind: "writeText",
85
- to: "rustfmt.toml",
86
- text: ['edition = "2024"', "max_width = 100", ""].join("\n")
87
- },
88
- {
89
- kind: "writeText",
90
- to: ".gitignore",
91
- text: ["target", ".env", ""].join("\n")
92
- },
93
- {
94
- kind: "copyFile",
95
- from: "src/main.rs",
96
- to: "src/main.rs"
97
- },
98
- {
99
- kind: "writeText",
100
- to: "scripts/check",
101
- text: [
102
- "#!/usr/bin/env sh",
103
- "set -eu",
104
- "",
105
- "echo cargo fmt --all -- --check",
106
- "cargo fmt --all -- --check",
107
- "echo cargo clippy --workspace --all-targets -- -D warnings",
108
- "cargo clippy --workspace --all-targets -- -D warnings",
109
- "echo cargo test --workspace",
110
- "cargo test --workspace",
111
- ""
112
- ].join("\n")
113
- },
114
- {
115
- kind: "setExecutable",
116
- path: "scripts/check",
117
- executable: true
118
- },
119
- {
120
- kind: "writeJson",
121
- to: ".project-kit/blueprint.json",
122
- value: {
123
- schemaVersion: 1,
124
- preset: "rust-bin",
125
- projectKind: "single-package",
126
- features
127
- }
128
- },
129
- {
130
- kind: "writeJson",
131
- to: ".project-kit/generated-by.json",
132
- value: generatedBy
133
- },
134
- {
135
- kind: "writeJson",
136
- to: ".devcontainer/devcontainer.json",
137
- value: {
138
- name: `${projectName} Rust development`,
139
- image: "mcr.microsoft.com/devcontainers/rust:1",
140
- mounts: [
141
- "source=${localWorkspaceFolderBasename}-cargo-registry,target=/usr/local/cargo/registry,type=volume",
142
- "source=${localWorkspaceFolderBasename}-cargo-git,target=/usr/local/cargo/git,type=volume",
143
- "source=${localWorkspaceFolderBasename}-target,target=${containerWorkspaceFolder}/target,type=volume"
144
- ],
145
- postCreateCommand: "rustup component add rustfmt clippy && cargo fetch",
146
- customizations: {
147
- vscode: {
148
- extensions: ["rust-lang.rust-analyzer", "tamasfe.even-better-toml"]
149
- }
150
- }
151
- }
152
- },
153
- {
154
- kind: "copyFile",
155
- from: ".github/workflows/check.yml",
156
- to: ".github/workflows/check.yml",
157
- },
158
- {
159
- kind: "copyFile",
160
- from: ".github/dependabot.yml",
161
- to: ".github/dependabot.yml",
162
- }
163
- ];
164
- }
165
- function templateSourceRoot() {
166
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "rust-bin");
167
- }
168
- export async function initRustBinProject(targetDir) {
169
- await renderNewProject({
170
- sourceRoot: templateSourceRoot(),
171
- targetRoot: targetDir,
172
- operations: operationsForRustBin(cargoPackageNameFromDir(targetDir))
173
- });
174
- }
package/dist/ts-lib.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function initTsLibProject(targetDir: string): Promise<void>;
2
- //# sourceMappingURL=ts-lib.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts-lib.d.ts","sourceRoot":"","sources":["../src/ts-lib.ts"],"names":[],"mappings":"AAoLA,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvE"}
package/dist/ts-lib.js DELETED
@@ -1,181 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import { renderNewProject } from "./renderer.js";
4
- const generatedBy = {
5
- packageName: "@ykdz/template",
6
- version: "0.0.0",
7
- command: "template init --preset ts-lib"
8
- };
9
- function projectNameFromDir(targetDir) {
10
- return path.basename(path.resolve(targetDir));
11
- }
12
- function packageJson(projectName) {
13
- return {
14
- name: projectName,
15
- version: "0.0.0",
16
- private: true,
17
- files: ["dist"],
18
- type: "module",
19
- exports: {
20
- ".": {
21
- default: "./dist/index.js",
22
- types: "./dist/index.d.ts"
23
- }
24
- },
25
- scripts: {
26
- build: "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
27
- check: "pnpm run typecheck && pnpm run lint && pnpm run format:check",
28
- fix: "pnpm run format:write && pnpm run lint:fix",
29
- "format:check": "oxfmt --check .",
30
- "format:write": "oxfmt --write .",
31
- lint: "oxlint . --deny-warnings",
32
- "lint:fix": "oxlint . --fix --deny-warnings",
33
- typecheck: "tsc -p tsconfig.json --noEmit"
34
- },
35
- devDependencies: {
36
- "@types/node": "catalog:",
37
- oxfmt: "catalog:",
38
- oxlint: "catalog:",
39
- "tsc-alias": "catalog:",
40
- typescript: "catalog:"
41
- },
42
- engines: {
43
- node: "22"
44
- },
45
- packageManager: "pnpm@10.0.0"
46
- };
47
- }
48
- function operationsForTsLib(projectName) {
49
- return [
50
- {
51
- kind: "writeJson",
52
- to: "package.json",
53
- value: packageJson(projectName),
54
- multilineArrays: ["files"]
55
- },
56
- {
57
- kind: "writeText",
58
- to: "pnpm-workspace.yaml",
59
- text: [
60
- "packages:",
61
- " - .",
62
- "",
63
- "catalog:",
64
- ' "@types/node": ^24.0.0',
65
- " oxfmt: ^0.56.0",
66
- " oxlint: ^1.71.0",
67
- " tsc-alias: ^1.8.17",
68
- " typescript: ^5.8.0",
69
- ""
70
- ].join("\n")
71
- },
72
- {
73
- kind: "writeJson",
74
- to: "tsconfig.json",
75
- value: {
76
- compilerOptions: {
77
- declaration: true,
78
- declarationMap: true,
79
- module: "NodeNext",
80
- moduleResolution: "NodeNext",
81
- noEmitOnError: true,
82
- outDir: "dist",
83
- paths: {
84
- "@/*": ["./src/*"]
85
- },
86
- rootDir: "src",
87
- skipLibCheck: false,
88
- strict: true,
89
- target: "ES2022",
90
- types: ["node"]
91
- },
92
- include: ["src/**/*.ts"]
93
- }
94
- },
95
- {
96
- kind: "copyFile",
97
- sourceRoot: "sharedOxc",
98
- from: "node/oxlint.config.ts",
99
- to: "oxlint.config.ts"
100
- },
101
- {
102
- kind: "copyFile",
103
- sourceRoot: "sharedOxc",
104
- from: "oxfmt.config.ts",
105
- to: "oxfmt.config.ts"
106
- },
107
- {
108
- kind: "writeText",
109
- to: ".gitignore",
110
- text: ["node_modules", "dist", ".env", ""].join("\n")
111
- },
112
- {
113
- kind: "copyFile",
114
- from: "src/index.ts",
115
- to: "src/index.ts"
116
- },
117
- {
118
- kind: "writeJson",
119
- to: ".project-kit/blueprint.json",
120
- value: {
121
- schemaVersion: 1,
122
- preset: "ts-lib",
123
- packageManager: "pnpm",
124
- projectKind: "single-package",
125
- features: [
126
- "pnpm-catalog",
127
- "oxc-format-lint",
128
- "strict-typescript",
129
- "root-check",
130
- "fix-command",
131
- "devcontainer",
132
- "github-actions",
133
- "dependabot"
134
- ]
135
- }
136
- },
137
- {
138
- kind: "writeJson",
139
- to: ".project-kit/generated-by.json",
140
- value: generatedBy
141
- },
142
- {
143
- kind: "writeJson",
144
- to: ".devcontainer/devcontainer.json",
145
- value: {
146
- name: `${projectName} development`,
147
- image: "mcr.microsoft.com/devcontainers/typescript-node:22",
148
- postCreateCommand: "corepack enable && pnpm install",
149
- customizations: {
150
- vscode: {
151
- extensions: ["oxc.oxc-vscode"]
152
- }
153
- }
154
- }
155
- },
156
- {
157
- kind: "copyFile",
158
- from: ".github/workflows/check.yml",
159
- to: ".github/workflows/check.yml",
160
- },
161
- {
162
- kind: "copyFile",
163
- from: ".github/dependabot.yml",
164
- to: ".github/dependabot.yml",
165
- }
166
- ];
167
- }
168
- function templateSourceRoot() {
169
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "ts-lib");
170
- }
171
- function sharedOxcSourceRoot() {
172
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "shared", "oxc");
173
- }
174
- export async function initTsLibProject(targetDir) {
175
- await renderNewProject({
176
- sourceRoot: templateSourceRoot(),
177
- sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
178
- targetRoot: targetDir,
179
- operations: operationsForTsLib(projectNameFromDir(targetDir))
180
- });
181
- }
package/dist/vue-app.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function initVueAppProject(targetDir: string): Promise<void>;
2
- //# sourceMappingURL=vue-app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vue-app.d.ts","sourceRoot":"","sources":["../src/vue-app.ts"],"names":[],"mappings":"AA4SA,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxE"}