@ykdz/template 0.0.0 → 0.0.1

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 (54) hide show
  1. package/dist/cli.js +101 -28
  2. package/dist/hono-api.d.ts.map +1 -1
  3. package/dist/hono-api.js +17 -56
  4. package/dist/package-addition.d.ts.map +1 -1
  5. package/dist/package-addition.js +31 -51
  6. package/dist/post-commands.d.ts +40 -0
  7. package/dist/post-commands.d.ts.map +1 -0
  8. package/dist/post-commands.js +154 -0
  9. package/dist/renderer.d.ts +2 -0
  10. package/dist/renderer.d.ts.map +1 -1
  11. package/dist/renderer.js +7 -1
  12. package/dist/rust-bin.d.ts.map +1 -1
  13. package/dist/rust-bin.js +4 -36
  14. package/dist/ts-lib.d.ts.map +1 -1
  15. package/dist/ts-lib.js +17 -56
  16. package/dist/vue-app.d.ts.map +1 -1
  17. package/dist/vue-app.js +17 -57
  18. package/dist/vue-hono-app.d.ts.map +1 -1
  19. package/dist/vue-hono-app.js +28 -76
  20. package/package.json +23 -16
  21. package/templates/hono-api/.github/dependabot.yml +10 -0
  22. package/templates/hono-api/.github/workflows/check.yml +19 -0
  23. package/templates/hono-api/src/server.ts +3 -2
  24. package/templates/hono-api/vitest.config.ts +5 -4
  25. package/templates/rust-bin/.github/dependabot.yml +10 -0
  26. package/templates/rust-bin/.github/workflows/check.yml +18 -0
  27. package/templates/shared/oxc/node/oxlint.config.ts +9 -0
  28. package/templates/shared/oxc/oxfmt.config.ts +8 -0
  29. package/templates/shared/oxc/package.json +18 -0
  30. package/templates/shared/oxc/tsconfig.json +11 -0
  31. package/templates/shared/oxc/vue/oxlint.config.ts +9 -0
  32. package/templates/ts-lib/.github/dependabot.yml +10 -0
  33. package/templates/ts-lib/.github/workflows/check.yml +19 -0
  34. package/templates/vue-app/.github/dependabot.yml +10 -0
  35. package/templates/vue-app/.github/workflows/check.yml +20 -0
  36. package/templates/vue-app/playwright.config.ts +5 -5
  37. package/templates/vue-app/src/App.vue +15 -5
  38. package/templates/vue-app/src/main.ts +2 -0
  39. package/templates/vue-app/test/app.test.ts +1 -0
  40. package/templates/vue-app/test/e2e/app.spec.ts +3 -1
  41. package/templates/vue-app/vite.config.ts +6 -5
  42. package/templates/vue-app/vitest.config.ts +5 -4
  43. package/templates/vue-hono-app/.github/dependabot.yml +10 -0
  44. package/templates/vue-hono-app/.github/workflows/check.yml +20 -0
  45. package/templates/vue-hono-app/api/src/server.ts +3 -2
  46. package/templates/vue-hono-app/api/vitest.config.ts +2 -2
  47. package/templates/vue-hono-app/web/playwright.config.ts +9 -7
  48. package/templates/vue-hono-app/web/src/App.vue +12 -4
  49. package/templates/vue-hono-app/web/src/api.ts +1 -1
  50. package/templates/vue-hono-app/web/src/main.ts +2 -0
  51. package/templates/vue-hono-app/web/test/app.test.ts +1 -0
  52. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +3 -1
  53. package/templates/vue-hono-app/web/vite.config.ts +13 -10
  54. package/templates/vue-hono-app/web/vitest.config.ts +6 -5
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "oxlint";
2
+
3
+ export default defineConfig({
4
+ categories: {
5
+ correctness: "error",
6
+ suspicious: "error",
7
+ },
8
+ plugins: ["typescript", "oxc"],
9
+ });
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from "oxfmt";
2
+
3
+ export default defineConfig({
4
+ printWidth: 80,
5
+ sortImports: true,
6
+ sortPackageJson: true,
7
+ sortTailwindcss: true,
8
+ });
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@ykdz/template-shared-oxc",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "check": "pnpm run format:check && pnpm run lint && pnpm run typecheck",
7
+ "format:check": "oxfmt --check .",
8
+ "format:write": "oxfmt --write .",
9
+ "lint": "oxlint . --deny-warnings",
10
+ "lint:fix": "oxlint . --fix --deny-warnings",
11
+ "typecheck": "tsc -p tsconfig.json --noEmit"
12
+ },
13
+ "devDependencies": {
14
+ "oxfmt": "^0.56.0",
15
+ "oxlint": "^1.71.0",
16
+ "typescript": "^6.0.3"
17
+ }
18
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "NodeNext",
4
+ "moduleResolution": "NodeNext",
5
+ "noEmitOnError": true,
6
+ "skipLibCheck": false,
7
+ "strict": true,
8
+ "target": "ES2022"
9
+ },
10
+ "include": ["**/*.ts"]
11
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "oxlint";
2
+
3
+ export default defineConfig({
4
+ categories: {
5
+ correctness: "error",
6
+ suspicious: "error",
7
+ },
8
+ plugins: ["typescript", "oxc", "vue"],
9
+ });
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: /
9
+ schedule:
10
+ interval: weekly
@@ -0,0 +1,19 @@
1
+ name: Check
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ check:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - uses: actions/setup-node@v6
15
+ with:
16
+ node-version-file: package.json
17
+ - run: corepack enable
18
+ - run: pnpm install
19
+ - run: pnpm run check
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: /
9
+ schedule:
10
+ interval: weekly
@@ -0,0 +1,20 @@
1
+ name: Check
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ check:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - uses: actions/setup-node@v6
15
+ with:
16
+ node-version-file: package.json
17
+ - run: corepack enable
18
+ - run: pnpm install
19
+ - run: pnpm exec playwright install --with-deps chromium
20
+ - run: pnpm run check
@@ -4,17 +4,17 @@ export default defineConfig({
4
4
  testDir: "./test/e2e",
5
5
  use: {
6
6
  baseURL: "http://127.0.0.1:4173",
7
- trace: "on-first-retry"
7
+ trace: "on-first-retry",
8
8
  },
9
9
  webServer: {
10
10
  command: "pnpm run preview --host 127.0.0.1 --port 4173",
11
11
  reuseExistingServer: !process.env.CI,
12
- url: "http://127.0.0.1:4173"
12
+ url: "http://127.0.0.1:4173",
13
13
  },
14
14
  projects: [
15
15
  {
16
16
  name: "chromium",
17
- use: { ...devices["Desktop Chrome"] }
18
- }
19
- ]
17
+ use: { ...devices["Desktop Chrome"] },
18
+ },
19
+ ],
20
20
  });
@@ -2,6 +2,7 @@
2
2
  import { usePreferredDark } from "@vueuse/core";
3
3
  import { storeToRefs } from "pinia";
4
4
  import { computed } from "vue";
5
+
5
6
  import { useCounterStore } from "@/stores/counter";
6
7
 
7
8
  const counter = useCounterStore();
@@ -12,11 +13,18 @@ const themeLabel = computed(() => (prefersDark.value ? "dark" : "light"));
12
13
 
13
14
  <template>
14
15
  <main class="min-h-screen bg-slate-950 text-white">
15
- <section class="mx-auto flex min-h-screen max-w-3xl flex-col justify-center px-6 py-16">
16
- <p class="text-sm font-medium uppercase tracking-wide text-cyan-300">Vue app preset</p>
17
- <h1 class="mt-4 text-4xl font-semibold">Vue, Vite, Tailwind, and Pinia</h1>
16
+ <section
17
+ class="mx-auto flex min-h-screen max-w-3xl flex-col justify-center px-6 py-16"
18
+ >
19
+ <p class="text-sm font-medium tracking-wide text-cyan-300 uppercase">
20
+ Vue app preset
21
+ </p>
22
+ <h1 class="mt-4 text-4xl font-semibold">
23
+ Vue, Vite, Tailwind, and Pinia
24
+ </h1>
18
25
  <p class="mt-4 text-lg text-slate-300">
19
- This generated app is ready for strict TypeScript checks, unit tests, and Playwright.
26
+ This generated app is ready for strict TypeScript checks, unit tests,
27
+ and Playwright.
20
28
  </p>
21
29
  <div class="mt-8 flex items-center gap-4">
22
30
  <button
@@ -26,7 +34,9 @@ const themeLabel = computed(() => (prefersDark.value ? "dark" : "light"));
26
34
  >
27
35
  Count is {{ count }}
28
36
  </button>
29
- <span class="text-sm text-slate-400">Preferred theme: {{ themeLabel }}</span>
37
+ <span class="text-sm text-slate-400"
38
+ >Preferred theme: {{ themeLabel }}</span
39
+ >
30
40
  </div>
31
41
  </section>
32
42
  </main>
@@ -1,6 +1,8 @@
1
1
  import { createPinia } from "pinia";
2
2
  import { createApp } from "vue";
3
+
3
4
  import App from "./App.vue";
5
+
4
6
  import "./style.css";
5
7
 
6
8
  createApp(App).use(createPinia()).mount("#app");
@@ -1,4 +1,5 @@
1
1
  import { createPinia, setActivePinia } from "pinia";
2
+
2
3
  import { useCounterStore } from "@/stores/counter";
3
4
 
4
5
  describe("counter store", () => {
@@ -3,7 +3,9 @@ import { expect, test } from "@playwright/test";
3
3
  test("renders and updates the counter", async ({ page }) => {
4
4
  await page.goto("/");
5
5
 
6
- await expect(page.getByRole("heading", { name: "Vue, Vite, Tailwind, and Pinia" })).toBeVisible();
6
+ await expect(
7
+ page.getByRole("heading", { name: "Vue, Vite, Tailwind, and Pinia" }),
8
+ ).toBeVisible();
7
9
  await page.getByRole("button", { name: "Count is 0" }).click();
8
10
  await expect(page.getByRole("button", { name: "Count is 1" })).toBeVisible();
9
11
  });
@@ -1,13 +1,14 @@
1
- import vue from "@vitejs/plugin-vue";
2
- import tailwindcss from "@tailwindcss/vite";
3
1
  import { fileURLToPath, URL } from "node:url";
2
+
3
+ import tailwindcss from "@tailwindcss/vite";
4
+ import vue from "@vitejs/plugin-vue";
4
5
  import { defineConfig } from "vite";
5
6
 
6
7
  export default defineConfig({
7
8
  plugins: [vue(), tailwindcss()],
8
9
  resolve: {
9
10
  alias: {
10
- "@": fileURLToPath(new URL("./src", import.meta.url))
11
- }
12
- }
11
+ "@": fileURLToPath(new URL("./src", import.meta.url)),
12
+ },
13
+ },
13
14
  });
@@ -1,14 +1,15 @@
1
1
  import { fileURLToPath, URL } from "node:url";
2
+
2
3
  import { defineConfig } from "vitest/config";
3
4
 
4
5
  export default defineConfig({
5
6
  resolve: {
6
7
  alias: {
7
- "@": fileURLToPath(new URL("./src", import.meta.url))
8
- }
8
+ "@": fileURLToPath(new URL("./src", import.meta.url)),
9
+ },
9
10
  },
10
11
  test: {
11
12
  exclude: ["test/e2e/**", "node_modules/**", "dist/**"],
12
- globals: true
13
- }
13
+ globals: true,
14
+ },
14
15
  });
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: /
9
+ schedule:
10
+ interval: weekly
@@ -0,0 +1,20 @@
1
+ name: Check
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ check:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - uses: actions/setup-node@v6
15
+ with:
16
+ node-version-file: package.json
17
+ - run: corepack enable
18
+ - run: pnpm install
19
+ - run: pnpm --filter ./apps/web exec playwright install --with-deps chromium
20
+ - run: pnpm run check
@@ -1,4 +1,5 @@
1
1
  import { serve } from "@hono/node-server";
2
+
2
3
  import { app } from "./runtime.js";
3
4
 
4
5
  const port = Number(process.env.PORT ?? 3000);
@@ -6,9 +7,9 @@ const port = Number(process.env.PORT ?? 3000);
6
7
  serve(
7
8
  {
8
9
  fetch: app.fetch,
9
- port
10
+ port,
10
11
  },
11
12
  (info) => {
12
13
  console.log(`Hono API listening on http://localhost:${info.port}`);
13
- }
14
+ },
14
15
  );
@@ -2,6 +2,6 @@ import { defineConfig } from "vitest/config";
2
2
 
3
3
  export default defineConfig({
4
4
  test: {
5
- globals: true
6
- }
5
+ globals: true,
6
+ },
7
7
  });
@@ -4,18 +4,20 @@ export default defineConfig({
4
4
  testDir: "./test/e2e",
5
5
  use: {
6
6
  baseURL: "http://localhost:4173",
7
- ...devices["Desktop Chrome"]
7
+ ...devices["Desktop Chrome"],
8
8
  },
9
9
  webServer: [
10
10
  {
11
- command: "pnpm --dir ../api run build && PORT=8787 pnpm --dir ../api run start",
11
+ command:
12
+ "pnpm --dir ../api run build && PORT=8787 pnpm --dir ../api run start",
12
13
  port: 8787,
13
- reuseExistingServer: false
14
+ reuseExistingServer: false,
14
15
  },
15
16
  {
16
- command: "VITE_API_BASE_URL=http://localhost:8787 pnpm run preview -- --host 127.0.0.1",
17
+ command:
18
+ "VITE_API_BASE_URL=http://localhost:8787 pnpm run preview -- --host 127.0.0.1",
17
19
  port: 4173,
18
- reuseExistingServer: false
19
- }
20
- ]
20
+ reuseExistingServer: false,
21
+ },
22
+ ],
21
23
  });
@@ -2,6 +2,7 @@
2
2
  import { usePreferredDark } from "@vueuse/core";
3
3
  import { storeToRefs } from "pinia";
4
4
  import { computed, onMounted, ref } from "vue";
5
+
5
6
  import { api } from "@/api";
6
7
  import { useCounterStore } from "@/stores/counter";
7
8
 
@@ -20,11 +21,16 @@ onMounted(async () => {
20
21
 
21
22
  <template>
22
23
  <main class="min-h-screen bg-slate-950 text-white">
23
- <section class="mx-auto flex min-h-screen max-w-3xl flex-col justify-center px-6 py-16">
24
- <p class="text-sm font-medium uppercase tracking-wide text-cyan-300">Vue Hono app preset</p>
24
+ <section
25
+ class="mx-auto flex min-h-screen max-w-3xl flex-col justify-center px-6 py-16"
26
+ >
27
+ <p class="text-sm font-medium tracking-wide text-cyan-300 uppercase">
28
+ Vue Hono app preset
29
+ </p>
25
30
  <h1 class="mt-4 text-4xl font-semibold">Vue, Hono, and typed RPC</h1>
26
31
  <p class="mt-4 text-lg text-slate-300">
27
- This generated workspace typechecks the web package against the API contract.
32
+ This generated workspace typechecks the web package against the API
33
+ contract.
28
34
  </p>
29
35
  <div class="mt-8 flex flex-wrap items-center gap-4">
30
36
  <button
@@ -34,7 +40,9 @@ onMounted(async () => {
34
40
  >
35
41
  Count is {{ count }}
36
42
  </button>
37
- <span class="text-sm text-slate-400">Preferred theme: {{ themeLabel }}</span>
43
+ <span class="text-sm text-slate-400"
44
+ >Preferred theme: {{ themeLabel }}</span
45
+ >
38
46
  <span class="text-sm text-slate-400">API status: {{ apiStatus }}</span>
39
47
  </div>
40
48
  </section>
@@ -1,6 +1,6 @@
1
- import { hc } from "hono/client";
2
1
  // @template-anchor api-type-import-start
3
2
  import type { AppType } from "__API_PACKAGE__";
3
+ import { hc } from "hono/client";
4
4
  // @template-anchor api-type-import-end
5
5
 
6
6
  const apiBaseUrl = import.meta.env.VITE_API_BASE_URL ?? "/";
@@ -1,6 +1,8 @@
1
1
  import { createPinia } from "pinia";
2
2
  import { createApp } from "vue";
3
+
3
4
  import App from "./App.vue";
5
+
4
6
  import "./style.css";
5
7
 
6
8
  createApp(App).use(createPinia()).mount("#app");
@@ -1,4 +1,5 @@
1
1
  import { createPinia, setActivePinia } from "pinia";
2
+
2
3
  import { useCounterStore } from "@/stores/counter";
3
4
 
4
5
  describe("counter store", () => {
@@ -3,7 +3,9 @@ import { expect, test } from "@playwright/test";
3
3
  test("renders the web app and calls the API", async ({ page }) => {
4
4
  await page.goto("/");
5
5
 
6
- await expect(page.getByRole("heading", { name: "Vue, Hono, and typed RPC" })).toBeVisible();
6
+ await expect(
7
+ page.getByRole("heading", { name: "Vue, Hono, and typed RPC" }),
8
+ ).toBeVisible();
7
9
  await expect(page.getByText("API status: ok")).toBeVisible();
8
10
  await page.getByRole("button", { name: "Count is 0" }).click();
9
11
  await expect(page.getByRole("button", { name: "Count is 1" })).toBeVisible();
@@ -1,29 +1,32 @@
1
- import vue from "@vitejs/plugin-vue";
2
- import tailwindcss from "@tailwindcss/vite";
3
1
  import { fileURLToPath, URL } from "node:url";
2
+
3
+ import tailwindcss from "@tailwindcss/vite";
4
+ import vue from "@vitejs/plugin-vue";
4
5
  import { defineConfig, loadEnv } from "vite";
5
6
 
6
7
  export default defineConfig(({ mode }) => {
7
8
  const env = loadEnv(mode, process.cwd(), "");
8
9
  const apiBaseUrl =
9
- process.env.VITE_API_BASE_URL ?? env.VITE_API_BASE_URL ?? "http://localhost:3000";
10
+ process.env.VITE_API_BASE_URL ??
11
+ env.VITE_API_BASE_URL ??
12
+ "http://localhost:3000";
10
13
 
11
14
  return {
12
15
  plugins: [vue(), tailwindcss()],
13
16
  resolve: {
14
17
  alias: {
15
- "@": fileURLToPath(new URL("./src", import.meta.url))
16
- }
18
+ "@": fileURLToPath(new URL("./src", import.meta.url)),
19
+ },
17
20
  },
18
21
  server: {
19
22
  proxy: {
20
- "/api": apiBaseUrl
21
- }
23
+ "/api": apiBaseUrl,
24
+ },
22
25
  },
23
26
  preview: {
24
27
  proxy: {
25
- "/api": apiBaseUrl
26
- }
27
- }
28
+ "/api": apiBaseUrl,
29
+ },
30
+ },
28
31
  };
29
32
  });
@@ -1,16 +1,17 @@
1
- import vue from "@vitejs/plugin-vue";
2
1
  import { fileURLToPath, URL } from "node:url";
2
+
3
+ import vue from "@vitejs/plugin-vue";
3
4
  import { defineConfig } from "vitest/config";
4
5
 
5
6
  export default defineConfig({
6
7
  plugins: [vue()],
7
8
  resolve: {
8
9
  alias: {
9
- "@": fileURLToPath(new URL("./src", import.meta.url))
10
- }
10
+ "@": fileURLToPath(new URL("./src", import.meta.url)),
11
+ },
11
12
  },
12
13
  test: {
13
14
  exclude: ["test/e2e/**", "node_modules/**", "dist/**"],
14
- globals: true
15
- }
15
+ globals: true,
16
+ },
16
17
  });