@ykdz/template 0.0.11 → 0.0.12

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.
@@ -74,9 +74,6 @@ function planVueHonoRootChecks() {
74
74
  { kind: "oxc-format-check", owner: rootBoundary },
75
75
  { kind: "oxc-lint", owner: rootBoundary },
76
76
  { kind: "typescript-typecheck", owner: rootBoundary },
77
- { kind: "turbo-package-typecheck", owner: workspacePackageBoundary },
78
- { kind: "turbo-package-build", owner: workspacePackageBoundary },
79
- { kind: "turbo-package-test", owner: workspacePackageBoundary },
80
77
  { kind: "turbo-package-check", owner: workspacePackageBoundary },
81
78
  ],
82
79
  environmentNeeds: [
@@ -143,10 +140,10 @@ export function projectVueHonoRootPackageScripts() {
143
140
  check: renderRootCheckCommand(planVueHonoRootChecks()),
144
141
  dev: "turbo run dev --parallel",
145
142
  fix: renderFixCommand(planVueHonoRootFixes()),
146
- "format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
147
- "format:write": "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
148
- lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts",
149
- "lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix",
143
+ "format:check": "oxfmt --check oxlint.config.ts oxfmt.config.ts",
144
+ "format:write": "oxfmt --write oxlint.config.ts oxfmt.config.ts",
145
+ lint: "oxlint oxlint.config.ts oxfmt.config.ts",
146
+ "lint:fix": "oxlint oxlint.config.ts oxfmt.config.ts --fix",
150
147
  typecheck: "tsc -p tsconfig.config.json --noEmit",
151
148
  };
152
149
  }
@@ -5,6 +5,7 @@ import { defineConfig } from "vitest/config";
5
5
  export default defineConfig({
6
6
  resolve: {
7
7
  alias: {
8
+ "#": fileURLToPath(new URL("./src", import.meta.url)),
8
9
  "@": fileURLToPath(new URL("./src", import.meta.url)),
9
10
  },
10
11
  },
@@ -1,6 +1,13 @@
1
+ import { fileURLToPath, URL } from "node:url";
2
+
1
3
  import { defineConfig } from "vitest/config";
2
4
 
3
5
  export default defineConfig({
6
+ resolve: {
7
+ alias: {
8
+ "#": fileURLToPath(new URL("./src", import.meta.url)),
9
+ },
10
+ },
4
11
  test: {
5
12
  globals: true,
6
13
  },
@@ -1,22 +1,38 @@
1
1
  import { defineConfig, devices } from "@playwright/test";
2
2
 
3
+ function workspacePortOffset(): number {
4
+ let hash = 0;
5
+
6
+ for (const character of process.cwd()) {
7
+ hash = (hash * 31 + character.charCodeAt(0)) % 5_000;
8
+ }
9
+
10
+ return hash * 2;
11
+ }
12
+
13
+ const fallbackApiPort = 43_000 + workspacePortOffset();
14
+ const fallbackWebPort = fallbackApiPort + 1;
15
+ const apiPort = Number(process.env.PLAYWRIGHT_API_PORT ?? fallbackApiPort);
16
+ const webPort = Number(process.env.PLAYWRIGHT_WEB_PORT ?? fallbackWebPort);
17
+ const apiBaseUrl = `http://127.0.0.1:${apiPort}`;
18
+ const apiHealthUrl = `${apiBaseUrl}/api/health`;
19
+ const webBaseUrl = `http://127.0.0.1:${webPort}`;
20
+
3
21
  export default defineConfig({
4
22
  testDir: "./test/e2e",
5
23
  use: {
6
- baseURL: "http://localhost:4173",
24
+ baseURL: webBaseUrl,
7
25
  ...devices["Desktop Chrome"],
8
26
  },
9
27
  webServer: [
10
28
  {
11
- command:
12
- "pnpm --dir ../api run build && PORT=8787 pnpm --dir ../api run start",
13
- port: 8787,
29
+ command: `pnpm --dir ../api run build && PORT=${apiPort} pnpm --dir ../api run start`,
30
+ url: apiHealthUrl,
14
31
  reuseExistingServer: false,
15
32
  },
16
33
  {
17
- command:
18
- "VITE_API_BASE_URL=http://localhost:8787 pnpm run preview -- --host 127.0.0.1",
19
- port: 4173,
34
+ command: `VITE_API_BASE_URL=${apiBaseUrl} pnpm run preview --host 127.0.0.1 --port ${webPort}`,
35
+ url: webBaseUrl,
20
36
  reuseExistingServer: false,
21
37
  },
22
38
  ],
@@ -407,21 +407,6 @@ function rootScriptWithTurboPackageTask(script, task, workspacePackageGlobs) {
407
407
  commands[turboCommandIndex] = turboPackageTaskCommand(task, workspacePackageGlobs);
408
408
  return commands.join(" && ");
409
409
  }
410
- function turboTaskNamesForPackageManifests(manifests) {
411
- const taskNames = [];
412
- for (const taskName of [
413
- "typecheck",
414
- "build",
415
- "test",
416
- "test:e2e",
417
- "check",
418
- ]) {
419
- if (manifests.some((manifest) => typeof manifest.scripts?.[taskName] === "string")) {
420
- taskNames.push(taskName);
421
- }
422
- }
423
- return taskNames;
424
- }
425
410
  function rootScriptWithTurboPackageTasks(options) {
426
411
  const rootCommands = options.script
427
412
  .split(" && ")
@@ -429,11 +414,9 @@ function rootScriptWithTurboPackageTasks(options) {
429
414
  const turboCommands = options.taskNames.map((taskName) => turboPackageTaskCommand(taskName, options.workspacePackageGlobs));
430
415
  return [...rootCommands, ...turboCommands].join(" && ");
431
416
  }
432
- function rootPackageJsonWithPackageTaskFilters(input, blueprint, packageManifests) {
417
+ function rootPackageJsonWithPackageTaskFilters(input, blueprint) {
433
418
  assertRootPackageJson(input);
434
419
  const workspacePackageGlobs = workspacePackageGlobsFromBlueprint(blueprint);
435
- const taskNames = turboTaskNamesForPackageManifests(packageManifests);
436
- const rootCheckTaskNames = taskNames.filter((taskName) => taskName !== "test:e2e");
437
420
  const checkScript = input.scripts.check;
438
421
  const fixScript = input.scripts.fix;
439
422
  if (checkScript === undefined || fixScript === undefined) {
@@ -445,7 +428,7 @@ function rootPackageJsonWithPackageTaskFilters(input, blueprint, packageManifest
445
428
  ...input.scripts,
446
429
  check: rootScriptWithTurboPackageTasks({
447
430
  script: checkScript,
448
- taskNames: rootCheckTaskNames,
431
+ taskNames: ["check"],
449
432
  workspacePackageGlobs,
450
433
  }),
451
434
  fix: rootScriptWithTurboPackageTask(fixScript, "fix", workspacePackageGlobs),
@@ -539,7 +522,7 @@ async function planRootUpdates(root, blueprint, packageName, packagePath, packag
539
522
  manifestOverrides,
540
523
  });
541
524
  const workspaceText = pnpmWorkspaceYamlWithCatalogDependencies(workspaceTextWithPackageGlob(await readFile(path.join(root, "pnpm-workspace.yaml"), "utf8"), workspacePackageGlob), catalogDependenciesWithSharedOxcRuntimeDependencies(catalogDependencies, requiresSharedOxcConfiguration));
542
- const rootPackageJson = rootPackageJsonWithPackageTaskFilters(await readJson(path.join(root, "package.json")), nextBlueprint, packageManifests);
525
+ const rootPackageJson = rootPackageJsonWithPackageTaskFilters(await readJson(path.join(root, "package.json")), nextBlueprint);
543
526
  return {
544
527
  blueprint: nextBlueprint,
545
528
  rootPackageJson: rootPackageJsonWithSharedOxcRuntimeDependencies(rootPackageJson, requiresSharedOxcConfiguration),
@@ -130,20 +130,6 @@ const capabilityInterpreters = {
130
130
  owner: strictTypescriptRootBoundary,
131
131
  });
132
132
  const workspaceBoundary = workspaceBoundaryForState(state);
133
- state.rootCheckComponents.push({
134
- kind: "turbo-package-typecheck",
135
- owner: workspaceBoundary,
136
- });
137
- if (state.nodeWorkspace !== undefined) {
138
- state.rootCheckComponents.push({
139
- kind: "turbo-package-build",
140
- owner: workspaceBoundary,
141
- });
142
- state.rootCheckComponents.push({
143
- kind: "turbo-package-test",
144
- owner: workspaceBoundary,
145
- });
146
- }
147
133
  state.rootCheckComponents.push({
148
134
  kind: "turbo-package-check",
149
135
  owner: workspaceBoundary,
@@ -187,13 +173,13 @@ const capabilityInterpreters = {
187
173
  });
188
174
  state.packageFixComponents.push({ kind: "oxc-format-write", owner: workspacePackageBoundary }, { kind: "oxc-lint-fix", owner: workspacePackageBoundary });
189
175
  state.rootScriptFragments["format:check"] =
190
- "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts";
176
+ "oxfmt --check oxlint.config.ts oxfmt.config.ts";
191
177
  state.rootScriptFragments["format:write"] =
192
- "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts";
178
+ "oxfmt --write oxlint.config.ts oxfmt.config.ts";
193
179
  state.rootScriptFragments.lint =
194
- "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts";
180
+ "oxlint oxlint.config.ts oxfmt.config.ts";
195
181
  state.rootScriptFragments["lint:fix"] =
196
- "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix";
182
+ "oxlint oxlint.config.ts oxfmt.config.ts --fix";
197
183
  state.packageScriptFragments["format:check"] =
198
184
  "oxfmt --check --config ../../oxfmt.config.ts .";
199
185
  state.packageScriptFragments["format:write"] =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [