create-pyro 0.1.0 → 0.2.0

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 (91) hide show
  1. package/README.md +32 -11
  2. package/dist/index.js +150 -30
  3. package/dist/scaffold.js +106 -0
  4. package/package.json +7 -7
  5. package/template/.dockerignore +30 -0
  6. package/template/.env.example +23 -0
  7. package/template/.gitattributes +2 -0
  8. package/template/.github/workflows/ci.yml +43 -0
  9. package/template/.vscode/extensions.json +3 -0
  10. package/template/.vscode/settings.json +8 -0
  11. package/template/README.md +57 -4
  12. package/template/apps/api/Dockerfile +46 -0
  13. package/template/apps/api/package.json +43 -0
  14. package/template/apps/api/src/app.test.ts +44 -0
  15. package/template/apps/api/src/app.ts +54 -0
  16. package/template/apps/api/src/index.ts +13 -0
  17. package/template/apps/api/src/lib/auth.ts +46 -0
  18. package/template/apps/api/src/lib/response.ts +28 -0
  19. package/template/apps/api/src/lib/session.ts +22 -0
  20. package/template/apps/api/src/middleware/auth.ts +34 -0
  21. package/template/apps/api/src/routes/auth.ts +9 -0
  22. package/template/apps/api/src/routes/index.ts +8 -0
  23. package/template/apps/api/src/routes/me.test.ts +45 -0
  24. package/template/apps/api/src/routes/me.ts +29 -0
  25. package/template/apps/api/src/test/database-url.ts +23 -0
  26. package/template/apps/api/src/test/global-setup.ts +36 -0
  27. package/template/apps/api/src/test/setup.ts +8 -0
  28. package/template/apps/api/src/types/context.ts +8 -0
  29. package/template/apps/api/tsconfig.build.json +8 -0
  30. package/template/apps/api/tsconfig.json +9 -0
  31. package/template/apps/api/tsdown.config.ts +13 -0
  32. package/template/apps/api/vitest.config.ts +11 -0
  33. package/template/apps/web/Dockerfile +49 -0
  34. package/template/apps/web/app/app.css +29 -0
  35. package/template/apps/web/app/lib/api.server.ts +13 -0
  36. package/template/apps/web/app/lib/api.test.ts +28 -0
  37. package/template/apps/web/app/lib/api.ts +47 -0
  38. package/template/apps/web/app/lib/auth-client.ts +13 -0
  39. package/template/apps/web/app/lib/env.server.ts +11 -0
  40. package/template/apps/web/app/lib/public-env.ts +17 -0
  41. package/template/apps/web/app/lib/session.server.ts +31 -0
  42. package/template/apps/web/app/lib/utils.ts +6 -0
  43. package/template/apps/web/app/root.tsx +86 -0
  44. package/template/apps/web/app/routes/dashboard.tsx +81 -0
  45. package/template/apps/web/app/routes/home.tsx +161 -0
  46. package/template/apps/web/app/routes.ts +6 -0
  47. package/template/apps/web/package.json +41 -0
  48. package/template/apps/web/public/favicon.svg +5 -0
  49. package/template/apps/web/react-router.config.ts +6 -0
  50. package/template/apps/web/tsconfig.json +23 -0
  51. package/template/apps/web/vite.config.ts +19 -0
  52. package/template/apps/web/vitest.config.ts +13 -0
  53. package/template/biome.json +53 -0
  54. package/template/compose.dev.yml +26 -0
  55. package/template/compose.yml +75 -0
  56. package/template/gitignore +32 -1
  57. package/template/infra/nginx/default.conf +33 -0
  58. package/template/package.json +23 -1
  59. package/template/packages/config/package.json +31 -0
  60. package/template/packages/config/src/index.test.ts +100 -0
  61. package/template/packages/config/src/index.ts +100 -0
  62. package/template/packages/config/tsconfig.build.json +8 -0
  63. package/template/packages/config/tsconfig.json +9 -0
  64. package/template/packages/config/tsdown.config.ts +12 -0
  65. package/template/packages/db/Dockerfile +22 -0
  66. package/template/packages/db/drizzle/0000_init.sql +53 -0
  67. package/template/packages/db/drizzle/meta/0000_snapshot.json +376 -0
  68. package/template/packages/db/drizzle/meta/_journal.json +13 -0
  69. package/template/packages/db/drizzle.config.ts +12 -0
  70. package/template/packages/db/package.json +38 -0
  71. package/template/packages/db/src/client.ts +12 -0
  72. package/template/packages/db/src/index.ts +2 -0
  73. package/template/packages/db/src/schema/auth.ts +96 -0
  74. package/template/packages/db/src/schema/index.ts +1 -0
  75. package/template/packages/db/tsconfig.build.json +7 -0
  76. package/template/packages/db/tsconfig.json +9 -0
  77. package/template/packages/db/tsdown.config.ts +12 -0
  78. package/template/packages/shared/package.json +32 -0
  79. package/template/packages/shared/src/index.ts +2 -0
  80. package/template/packages/shared/src/schemas/auth.test.ts +32 -0
  81. package/template/packages/shared/src/schemas/auth.ts +22 -0
  82. package/template/packages/shared/src/schemas/index.ts +1 -0
  83. package/template/packages/shared/src/types/api.ts +15 -0
  84. package/template/packages/shared/src/types/index.ts +2 -0
  85. package/template/packages/shared/src/types/user.ts +10 -0
  86. package/template/packages/shared/tsconfig.build.json +8 -0
  87. package/template/packages/shared/tsconfig.json +9 -0
  88. package/template/packages/shared/tsdown.config.ts +12 -0
  89. package/template/pnpm-workspace.yaml +25 -0
  90. package/template/tsconfig.json +19 -0
  91. package/template/turbo.json +27 -0
@@ -0,0 +1,15 @@
1
+ export type ApiSuccess<T> = {
2
+ success: true;
3
+ data: T;
4
+ };
5
+
6
+ export type ApiError = {
7
+ success: false;
8
+ error: {
9
+ code: string;
10
+ message: string;
11
+ details?: unknown;
12
+ };
13
+ };
14
+
15
+ export type ApiResponse<T> = ApiSuccess<T> | ApiError;
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./user";
@@ -0,0 +1,10 @@
1
+ /** A user as the api returns it over JSON (dates arrive as ISO strings). */
2
+ export type User = {
3
+ id: string;
4
+ name: string;
5
+ email: string;
6
+ emailVerified: boolean;
7
+ image: string | null;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": false,
5
+ "noEmit": false
6
+ },
7
+ "exclude": ["src/**/*.test.ts"]
8
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "rootDir": "src",
6
+ "types": ["node"]
7
+ },
8
+ "include": ["src"]
9
+ }
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from "tsdown";
2
+
3
+ export default defineConfig({
4
+ tsconfig: "tsconfig.build.json",
5
+ entry: ["src/index.ts"],
6
+ format: ["esm"],
7
+ dts: true,
8
+ sourcemap: true,
9
+ clean: true,
10
+ treeshake: true,
11
+ target: false,
12
+ });
@@ -0,0 +1,25 @@
1
+ packages:
2
+ - "apps/*"
3
+ - "packages/*"
4
+ allowBuilds:
5
+ esbuild: true
6
+ catalog:
7
+ "@better-auth/drizzle-adapter": ^1.7.13
8
+ "@dotenv-run/cli": ^1.3.6
9
+ "@hono/node-server": ^2.1.5
10
+ "@paralleldrive/cuid2": ^3.3.0
11
+ "@types/node": ^26.6.5
12
+ "@types/pg": ^8.23.1
13
+ "@types/react": ^19.3.0
14
+ "@types/react-dom": ^19.3.0
15
+ better-auth: ^1.7.13
16
+ drizzle-orm: ^0.45.4
17
+ hono: ^4.13.14
18
+ pg: ^8.23.1
19
+ react: ^19.3.1
20
+ react-dom: ^19.3.1
21
+ tsdown: 0.23.1
22
+ tsx: ^4.23.15
23
+ typescript: ^7.0.2
24
+ vitest: ^5.0.5
25
+ zod: ^4.6.7
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2024",
4
+ "lib": ["es2024"],
5
+ "module": "esnext",
6
+ "moduleResolution": "bundler",
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "noEmit": true
10
+ },
11
+ "files": [],
12
+ "references": [
13
+ { "path": "./apps/api" },
14
+ { "path": "./apps/web" },
15
+ { "path": "./packages/config" },
16
+ { "path": "./packages/db" },
17
+ { "path": "./packages/shared" }
18
+ ]
19
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://turbo.build/schema.json",
3
+ "tasks": {
4
+ "build": {
5
+ "dependsOn": ["^build"],
6
+ "outputs": ["dist/**"]
7
+ },
8
+ "start": {
9
+ "dependsOn": ["build"],
10
+ "cache": false
11
+ },
12
+ "dev": {
13
+ "dependsOn": ["^build"],
14
+ "persistent": true,
15
+ "cache": false
16
+ },
17
+ "test": {
18
+ "dependsOn": ["^build"],
19
+ "inputs": ["src/**", "app/**", "drizzle/**", "vitest.config.ts"],
20
+ "passThroughEnv": ["DATABASE_URL", "TEST_DATABASE_URL"]
21
+ },
22
+ "typecheck": {
23
+ "dependsOn": ["^build"],
24
+ "cache": false
25
+ }
26
+ }
27
+ }