create-effect-project 0.1.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/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/dist/bin.js +58245 -0
  4. package/package.json +34 -0
  5. package/templates/_shared/_gitignore +4 -0
  6. package/templates/_shared/config.ts +13 -0
  7. package/templates/_shared/features/_oxlintrc.json +5 -0
  8. package/templates/_shared/features/_vscode.settings.json +6 -0
  9. package/templates/_shared/features/lint.package.json +11 -0
  10. package/templates/_shared/features/lint.tsconfig.json +16 -0
  11. package/templates/_shared/features/observability.noop.ts +9 -0
  12. package/templates/_shared/features/observability.otel.ts +23 -0
  13. package/templates/_shared/features/slop.oxlintrc.json +25 -0
  14. package/templates/_shared/httpapi/api/Api.ts +9 -0
  15. package/templates/_shared/httpapi/api/Notes.ts +25 -0
  16. package/templates/_shared/httpapi/api/System.ts +7 -0
  17. package/templates/_shared/httpapi/client/ApiClient.ts +24 -0
  18. package/templates/_shared/httpapi/server/Notes/http.ts +22 -0
  19. package/templates/_shared/httpapi/server/http.ts +18 -0
  20. package/templates/_shared/notes/Notes.ts +42 -0
  21. package/templates/_shared/notes/domain/Note.ts +19 -0
  22. package/templates/alchemy-http/README.md +79 -0
  23. package/templates/alchemy-http/alchemy.run.ts +22 -0
  24. package/templates/alchemy-http/runtime/bun/_package.json +27 -0
  25. package/templates/alchemy-http/runtime/bun/_tsconfig.json +27 -0
  26. package/templates/alchemy-http/runtime/bun/client.ts +37 -0
  27. package/templates/alchemy-http/runtime/bun/http.test.ts +45 -0
  28. package/templates/alchemy-http/runtime/node/_package.json +28 -0
  29. package/templates/alchemy-http/runtime/node/_tsconfig.json +27 -0
  30. package/templates/alchemy-http/runtime/node/client.ts +37 -0
  31. package/templates/alchemy-http/runtime/node/http.test.ts +48 -0
  32. package/templates/alchemy-http/src/worker.ts +22 -0
  33. package/templates/alchemy-rpc/README.md +83 -0
  34. package/templates/alchemy-rpc/alchemy.run.ts +22 -0
  35. package/templates/alchemy-rpc/runtime/bun/_package.json +27 -0
  36. package/templates/alchemy-rpc/runtime/bun/_tsconfig.json +27 -0
  37. package/templates/alchemy-rpc/runtime/bun/client.ts +43 -0
  38. package/templates/alchemy-rpc/runtime/bun/rpc.test.ts +40 -0
  39. package/templates/alchemy-rpc/runtime/node/_package.json +28 -0
  40. package/templates/alchemy-rpc/runtime/node/_tsconfig.json +27 -0
  41. package/templates/alchemy-rpc/runtime/node/client.ts +43 -0
  42. package/templates/alchemy-rpc/runtime/node/rpc.test.ts +41 -0
  43. package/templates/alchemy-rpc/src/rpc.ts +29 -0
  44. package/templates/alchemy-rpc/src/server/Notes/rpc.ts +17 -0
  45. package/templates/alchemy-rpc/src/worker.ts +24 -0
  46. package/templates/basic/README.md +53 -0
  47. package/templates/basic/runtime/bun/Users.test.ts +31 -0
  48. package/templates/basic/runtime/bun/_package.json +21 -0
  49. package/templates/basic/runtime/bun/_tsconfig.json +10 -0
  50. package/templates/basic/runtime/bun/main.ts +43 -0
  51. package/templates/basic/runtime/node/Users.test.ts +32 -0
  52. package/templates/basic/runtime/node/_package.json +22 -0
  53. package/templates/basic/runtime/node/_tsconfig.json +24 -0
  54. package/templates/basic/runtime/node/main.ts +43 -0
  55. package/templates/basic/src/Users.ts +49 -0
  56. package/templates/basic/src/domain/User.ts +21 -0
  57. package/templates/fullstack/README.md +114 -0
  58. package/templates/fullstack/_gitignore +7 -0
  59. package/templates/fullstack/_package.json +6 -0
  60. package/templates/fullstack/_pnpm-workspace.yaml +2 -0
  61. package/templates/fullstack/_tsconfig.json +9 -0
  62. package/templates/fullstack/apps/api/config.ts +10 -0
  63. package/templates/fullstack/apps/api/http.ts +35 -0
  64. package/templates/fullstack/apps/api/runtime/bun/_package.json +26 -0
  65. package/templates/fullstack/apps/api/runtime/bun/_tsconfig.json +5 -0
  66. package/templates/fullstack/apps/api/runtime/node/_package.json +27 -0
  67. package/templates/fullstack/apps/api/runtime/node/_tsconfig.json +5 -0
  68. package/templates/fullstack/apps/web/runtime/bun/NotesApi.test.ts +65 -0
  69. package/templates/fullstack/apps/web/runtime/bun/_package.json +30 -0
  70. package/templates/fullstack/apps/web/runtime/bun/_tsconfig.json +9 -0
  71. package/templates/fullstack/apps/web/runtime/node/NotesApi.test.ts +65 -0
  72. package/templates/fullstack/apps/web/runtime/node/_package.json +31 -0
  73. package/templates/fullstack/apps/web/runtime/node/_tsconfig.json +9 -0
  74. package/templates/fullstack/apps/web/src/atoms/NotesApi.ts +40 -0
  75. package/templates/fullstack/apps/web/src/router.tsx +64 -0
  76. package/templates/fullstack/apps/web/src/routes/__root.tsx +38 -0
  77. package/templates/fullstack/apps/web/src/routes/index.tsx +97 -0
  78. package/templates/fullstack/apps/web/src/styles.css +40 -0
  79. package/templates/fullstack/apps/web/vite.config.ts +11 -0
  80. package/templates/fullstack/lint.package.json +12 -0
  81. package/templates/http-server/README.md +56 -0
  82. package/templates/http-server/runtime/bun/_package.json +22 -0
  83. package/templates/http-server/runtime/bun/_tsconfig.json +10 -0
  84. package/templates/http-server/runtime/bun/client.ts +40 -0
  85. package/templates/http-server/runtime/bun/http.test.ts +45 -0
  86. package/templates/http-server/runtime/bun/index.ts +25 -0
  87. package/templates/http-server/runtime/node/_package.json +23 -0
  88. package/templates/http-server/runtime/node/_tsconfig.json +24 -0
  89. package/templates/http-server/runtime/node/client.ts +40 -0
  90. package/templates/http-server/runtime/node/http.test.ts +48 -0
  91. package/templates/http-server/runtime/node/index.ts +26 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Michael
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # create-effect-project
2
+
3
+ Scaffolds an [Effect](https://effect.website) v4 project on Node or Bun — an HttpApi server, a
4
+ full-stack app, a plain program, or a Cloudflare Worker.
5
+
6
+ ```bash
7
+ npx create-effect-project
8
+ ```
9
+
10
+ That prompts for everything. Pass flags instead and nothing prompts, so the same command works in
11
+ a terminal and in CI:
12
+
13
+ ```bash
14
+ npx create-effect-project --name my-api --template http-server --runtime bun
15
+ npx create-effect-project --name my-app --template basic --runtime node --no-otel --no-lint
16
+ ```
17
+
18
+ `npm create effect-project` and `yarn create effect-project` work too.
19
+
20
+ ## Templates
21
+
22
+ | `--template` | What you get |
23
+ | --- | --- |
24
+ | `http-server` | A schema-first `HttpApi`. One definition produces the server routes, an OpenAPI document at `/openapi.json`, Scalar docs at `/docs`, and a typed client checked against the server at compile time |
25
+ | `fullstack` | The same `HttpApi` behind both a server and a server-rendered React UI — a workspace whose TanStack Start frontend drives its data through Effect's own reactivity, hydrated from SSR |
26
+ | `basic` | A runnable program: a `Context.Service` with an in-memory layer, a branded id, a typed error, and a `main` that handles it. No server |
27
+ | `alchemy-http` | The same `HttpApi` deployed to a Cloudflare Worker with [Alchemy](https://alchemy.run) — infrastructure as Effects, no `wrangler.toml` |
28
+ | `alchemy-rpc` | The same service exposed as typed RPC on a Worker, so typed errors cross the wire as themselves rather than as status codes |
29
+
30
+ Four of the five serve the same Notes domain from identical source files, so switching template
31
+ changes the transport and nothing else.
32
+
33
+ ## Flags
34
+
35
+ | Flag | Default | Meaning |
36
+ | --- | --- | --- |
37
+ | `--name`, `-n` | prompted | Directory and package name |
38
+ | `--template`, `-t` | prompted | `http-server`, `fullstack`, `basic`, `alchemy-http` or `alchemy-rpc` |
39
+ | `--runtime` | prompted | `node` or `bun` |
40
+ | `--pm` | prompted (node) | `npm`, `pnpm`, `yarn` or `bun`. Bun projects use bun; node projects are asked, with the detected manager pre-selected |
41
+ | `--no-otel` | on | Skip OTLP logs, metrics and traces |
42
+ | `--no-lint` | on | Skip oxlint, the `@effect/tsgo` language service, and `.vscode/settings.json` |
43
+ | `--slop` | off | Add stricter oxlint rules that reject sloppy code (needs `--lint`) |
44
+ | `--no-install` | installs | Skip dependency installation |
45
+ | `--no-git` | initialises | Skip `git init` |
46
+
47
+ ## What you get
48
+
49
+ No build step — Node and Bun both execute TypeScript directly, so there is nothing between editing
50
+ a file and running it. (The `fullstack` template's web app is the exception; Vite builds it.)
51
+
52
+ Every template comes with tests that pass, a typecheck that passes, and a lint that passes, on
53
+ both runtimes. Whichever package manager you choose is used for the install *and* for the commands
54
+ the generated files document, so a pnpm project reads `pnpm run dev`, not `npm run dev`.
55
+
56
+ With `--lint` (the default) you also get the Effect language service, which reports Effect-specific
57
+ mistakes through `tsc` — a floating Effect fails `typecheck` rather than surviving to runtime — plus
58
+ the editor settings that make those diagnostics show up in VS Code.
59
+
60
+ ## Requirements
61
+
62
+ Node 20+ to run the scaffolder. Generated projects ask for more in their own manifests: Node 22.6+
63
+ for native TypeScript execution, or Bun 1.3+.
64
+
65
+ ## Contributing
66
+
67
+ See [docs/internals.md](docs/internals.md) for how the template registry works, how to add a
68
+ template, and how the package is built, tested and released.
69
+
70
+ ## License
71
+
72
+ MIT