ras-stack 4.4.1 → 5.0.0-next.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 (57) hide show
  1. package/README.md +23 -8
  2. package/config/oxlint/application.json +16 -0
  3. package/config/oxlint/domain.json +29 -0
  4. package/config/oxlint/layers.json +116 -0
  5. package/config/oxlint/tanstack.json +4 -0
  6. package/config/oxlint.json +19 -0
  7. package/config/typescript/base.json +10 -0
  8. package/config/typescript/browser.json +8 -0
  9. package/config/typescript/bundler.json +9 -0
  10. package/config/typescript/library.json +11 -0
  11. package/config/typescript/tanstack.json +6 -0
  12. package/dist/changesets/index.js +12064 -31
  13. package/dist/changesets/index.js.map +7 -1
  14. package/dist/cli.d.ts +9 -0
  15. package/dist/cli.js +11 -1
  16. package/dist/cli.js.map +1 -1
  17. package/dist/config.d.ts +3 -0
  18. package/dist/config.js +3 -0
  19. package/dist/config.js.map +1 -0
  20. package/dist/managed/catalog.d.ts +39 -0
  21. package/dist/managed/catalog.js +106 -0
  22. package/dist/managed/catalog.js.map +1 -0
  23. package/dist/managed/cli.d.ts +1 -0
  24. package/dist/managed/cli.js +49 -0
  25. package/dist/managed/cli.js.map +1 -0
  26. package/dist/managed/environment.d.ts +4 -0
  27. package/dist/managed/environment.js +43 -0
  28. package/dist/managed/environment.js.map +1 -0
  29. package/dist/managed/files.d.ts +4 -0
  30. package/dist/managed/files.js +30 -0
  31. package/dist/managed/files.js.map +1 -0
  32. package/dist/managed/install.d.ts +4 -0
  33. package/dist/managed/install.js +63 -0
  34. package/dist/managed/install.js.map +1 -0
  35. package/dist/managed/model.d.ts +23 -0
  36. package/dist/managed/model.js +27 -0
  37. package/dist/managed/model.js.map +1 -0
  38. package/dist/managed/plan.d.ts +12 -0
  39. package/dist/managed/plan.js +76 -0
  40. package/dist/managed/plan.js.map +1 -0
  41. package/dist/managed/pnpm.d.ts +22 -0
  42. package/dist/managed/pnpm.js +75 -0
  43. package/dist/managed/pnpm.js.map +1 -0
  44. package/dist/managed/process.d.ts +4 -0
  45. package/dist/managed/process.js +23 -0
  46. package/dist/managed/process.js.map +1 -0
  47. package/dist/query/index.d.ts +8 -0
  48. package/dist/query/index.js +16 -0
  49. package/dist/query/index.js.map +1 -0
  50. package/dist/vite/config.d.ts +18 -0
  51. package/dist/vite/config.js +85 -0
  52. package/dist/vite/config.js.map +1 -0
  53. package/dist/vite/index.d.ts +2 -0
  54. package/dist/vite/index.js +2 -0
  55. package/dist/vite/index.js.map +1 -0
  56. package/package.json +30 -81
  57. package/pnpmfile.cjs +1 -0
package/README.md CHANGED
@@ -18,15 +18,16 @@ A helper belongs here when it removes a repeated decision or failure mode withou
18
18
 
19
19
  ## What you get 📦
20
20
 
21
- It ships as independently versioned packages and deployment tooling:
21
+ The stack ships as one npm package with deployment tooling:
22
22
 
23
23
  - **TypeScript modules** under narrow import paths such as `ras-stack/database/sqlite`, `ras-stack/realtime/react`, and `ras-stack/tanstack/server`.
24
- - **Configuration presets** in the dependency-free `ras-stack-config` package for TypeScript and Oxlint.
24
+ - **Managed integrations and tooling** selected with typed descriptors from `ras-stack/config`, installed into one pnpm dependency graph.
25
+ - **Configuration presets** bundled with `ras-stack` for its selected TypeScript and Oxlint tools.
25
26
  - **Command-line tools** for changeset validation, production assets, preview status, and a local Centrifugo container.
26
27
  - **GitHub Actions and reusable workflows** for toolchain setup, checks, browser tests, previews, and Changesets releases.
27
28
  - **A separate OCI image** containing verified Caddy and Centrifugo binaries for production images.
28
29
 
29
- An application can use one surface without adopting the others. The npm package has no runtime dependency on the web, database, email, or realtime libraries; those integrations are optional peers.
30
+ Applications select the integrations and tools they use through managed installation. RAS owns their versions, and application code keeps the original upstream imports.
30
31
 
31
32
  ## The stack 🧰
32
33
 
@@ -38,7 +39,7 @@ An application can use one surface without adopting the others. The npm package
38
39
  | Data | Drizzle, `better-sqlite3`, libsql, Postgres.js | Connection lifecycle, safety defaults, migrations, target selection, and conformance checks |
39
40
  | Realtime | Centrifuge, Centrifugo, Caddy | Publishing, tokens, browser/React lifecycle, proxy configuration, binaries, and supervision |
40
41
  | Realtime database | SpacetimeDB | Server calls, migration-planned module publishing, environment headers, and binding checks |
41
- | Email and uploads | Nodemailer 9/10, `tus-js-client` | SMTP configuration/delivery, auth callbacks, and promise-based resumable uploads |
42
+ | Email and uploads | Nodemailer, `tus-js-client` | SMTP configuration/delivery, auth callbacks, and promise-based resumable uploads |
42
43
  | Observability | PostHog JS, React, Node, and OpenTelemetry | Analytics, replay, errors, logs, metrics, tracing, correlation, proxying, and shutdown |
43
44
  | Delivery | GitHub Actions, Changesets, Dokploy, Docker | Checks, releases, preview lifecycle/status, production assets, and runtime binaries |
44
45
 
@@ -50,18 +51,32 @@ Applications still configure every upstream library directly. This table describ
50
51
 
51
52
  The application keeps schemas, migrations, repositories, routes, authorization, templates, upload rules, realtime payloads, storage, deployment topology, and UI. There is no shared application factory or giant configuration object.
52
53
 
53
- The [`examples/full-stack`](https://github.com/richardsolomou/ras-stack/tree/main/examples/full-stack) workspace shows the boundaries together and tests them through `workspace:*`. It is the repository's integration fixture; applications own their integration code and dependency versions.
54
+ The [`examples/full-stack`](https://github.com/richardsolomou/ras-stack/tree/main/examples/full-stack) workspace shows the boundaries together and tests them through `workspace:*`. It is the repository's integration fixture; applications own their integration code and choose whether RAS manages upstream dependency versions.
54
55
 
55
56
  ## Installation
56
57
 
57
- `ras-stack` requires Node 24. Install the runtime package for application helpers and the configuration package for compiler/linter presets:
58
+ `ras-stack` requires Node 24. Managed installation requires pnpm 11 or newer:
58
59
 
59
60
  ```sh
60
61
  pnpm add ras-stack
61
- pnpm add -D ras-stack-config
62
62
  ```
63
63
 
64
- Import helpers from their narrow entrypoints and install the upstream peer libraries required by the integrations you use. Configuration-only repositories need just `ras-stack-config`.
64
+ Create `ras.config.ts`:
65
+
66
+ ```ts
67
+ import { defineConfig, tanstackQuery, typescript, oxlint, vite } from 'ras-stack/config'
68
+
69
+ export default defineConfig({
70
+ integrations: [tanstackQuery],
71
+ tooling: [typescript.browser, oxlint.application, vite],
72
+ })
73
+ ```
74
+
75
+ Declare `ras-stack` under `configDependencies` in `pnpm-workspace.yaml` and set `pnpmfile` to `node_modules/.pnpm-config/ras-stack/pnpmfile.cjs`. Run `pnpm install` (pnpm 12.12+). RAS selects exact versions and installs only the selected integrations and their dependencies. Keep upstream imports such as `@tanstack/react-query`. Commit the workspace configuration and `pnpm-lock.yaml`; ignore `.ras/`. Upgrade with `pnpm update ras-stack`, followed by `pnpm install`.
76
+
77
+ Use `ras typecheck`, `ras lint`, `ras dev`, `ras build`, and the other selected tooling commands. Applications retain their own compiler/linter overrides. See [Managed installation](https://github.com/richardsolomou/ras-stack/blob/main/docs/managed-installation.md) for presets, migration, CI, upgrades, and ownership boundaries.
78
+
79
+ Version 5 requires managed installation. Remove `ras-stack-config` and any directly declared packages selected in `ras.config.ts`, then point compiler and linter overrides at `.ras`. Direct peer installation and the separate configuration package are no longer supported; see the migration guide before upgrading.
65
80
 
66
81
  ## Dokploy previews 🚀
67
82
 
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": ["../oxlint.json"],
3
+ "rules": {
4
+ "no-console": "off",
5
+ "no-await-in-loop": "off",
6
+ "no-underscore-dangle": "off",
7
+ "unicorn/require-post-message-target-origin": "off",
8
+ "vitest/require-to-throw-message": "off",
9
+ "vitest/no-conditional-expect": "off",
10
+ "unicorn/no-array-sort": "off",
11
+ "oxc/no-map-spread": "off",
12
+ "unicorn/consistent-function-scoping": "off",
13
+ "unicorn/prefer-add-event-listener": "off",
14
+ "typescript/no-unnecessary-type-parameters": "off"
15
+ }
16
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "overrides": [
3
+ {
4
+ "files": ["src/core/**"],
5
+ "rules": {
6
+ "no-restricted-imports": [
7
+ "error",
8
+ {
9
+ "patterns": [
10
+ {
11
+ "regex": "^(?:node:|(?:assert|async_hooks|buffer|child_process|cluster|console|constants|crypto|dgram|diagnostics_channel|dns|domain|events|fs|http|http2|https|inspector|module|net|os|path|perf_hooks|process|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|trace_events|tty|url|util|v8|vm|wasi|worker_threads|zlib)(?:/|$))",
12
+ "message": "Domain modules must not import Node builtins."
13
+ },
14
+ {
15
+ "regex": "^(@tanstack/|react(?:/|-|$)|@testing-library/|drizzle-orm(?:/|$)|postgres(?:/|$)|iovalkey(?:/|$)|ioredis(?:/|$)|@electric-sql/|better-auth(?:/|$)|cheerio(?:/|$)|html-to-text(?:/|$)|centrifuge(?:/|$)|posthog-(?:js|node)(?:/|$))",
16
+ "message": "Domain modules must not import framework or persistence dependencies."
17
+ },
18
+ {
19
+ "regex": "^(?:(?:\\.\\.?/)+|@/)(?:adapters|client|components|db|lib|routes|server)/",
20
+ "message": "Domain modules must not import application layers."
21
+ }
22
+ ]
23
+ }
24
+ ]
25
+ },
26
+ "excludeFiles": ["**/*.test.*", "**/*.spec.*"]
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "overrides": [
3
+ {
4
+ "files": ["src/routes/**"],
5
+ "rules": {
6
+ "no-restricted-imports": [
7
+ "error",
8
+ {
9
+ "patterns": [
10
+ {
11
+ "regex": "^(?:\\./[^.]|(?:\\.\\./)+routes/|@/routes/)",
12
+ "message": "Route modules must not import sibling route modules."
13
+ }
14
+ ]
15
+ }
16
+ ]
17
+ },
18
+ "excludeFiles": ["**/*.test.*", "**/*.spec.*"]
19
+ },
20
+ {
21
+ "files": ["src/server/**"],
22
+ "rules": {
23
+ "no-restricted-imports": [
24
+ "error",
25
+ {
26
+ "patterns": [
27
+ {
28
+ "regex": "^(?:(?:\\.\\.?/)+|@/)(?:client|routes)/",
29
+ "message": "Server modules must not import client or route modules."
30
+ }
31
+ ]
32
+ }
33
+ ]
34
+ },
35
+ "excludeFiles": ["**/*.test.*", "**/*.spec.*"]
36
+ },
37
+ {
38
+ "files": ["src/client/**"],
39
+ "rules": {
40
+ "no-restricted-imports": [
41
+ "error",
42
+ {
43
+ "patterns": [
44
+ {
45
+ "group": [
46
+ "**/adapters/**",
47
+ "**/db/**",
48
+ "**/routes/**",
49
+ "**/server/**",
50
+ "!**/server/functions",
51
+ "!**/server/functions.*",
52
+ "!**/server/functions/**",
53
+ "!**/server/fns",
54
+ "!**/server/fns.*"
55
+ ],
56
+ "message": "Client modules may import server functions, but not server implementations."
57
+ }
58
+ ]
59
+ }
60
+ ]
61
+ },
62
+ "excludeFiles": ["**/*.test.*", "**/*.spec.*"]
63
+ },
64
+ {
65
+ "files": ["src/contracts/**"],
66
+ "rules": {
67
+ "no-restricted-imports": [
68
+ "error",
69
+ {
70
+ "patterns": [
71
+ {
72
+ "regex": "^(?:(?:\\.\\.?/)+|@/)(?:adapters|client|components|db|lib|routes|server)/",
73
+ "message": "Shared contracts must not import application layers."
74
+ }
75
+ ]
76
+ }
77
+ ]
78
+ },
79
+ "excludeFiles": ["**/*.test.*", "**/*.spec.*"]
80
+ },
81
+ {
82
+ "files": ["src/adapters/**"],
83
+ "rules": {
84
+ "no-restricted-imports": [
85
+ "error",
86
+ {
87
+ "patterns": [
88
+ {
89
+ "regex": "^(?:(?:\\.\\.?/)+|@/)(?:client|db|routes|server)/",
90
+ "message": "Adapters must not import application layers."
91
+ }
92
+ ]
93
+ }
94
+ ]
95
+ },
96
+ "excludeFiles": ["**/*.test.*", "**/*.spec.*"]
97
+ },
98
+ {
99
+ "files": ["src/db/**"],
100
+ "rules": {
101
+ "no-restricted-imports": [
102
+ "error",
103
+ {
104
+ "patterns": [
105
+ {
106
+ "regex": "^(?:(?:\\.\\.?/)+|@/)(?:adapters|client|routes|server)/",
107
+ "message": "Database modules must not import application layers."
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ },
113
+ "excludeFiles": ["**/*.test.*", "**/*.spec.*"]
114
+ }
115
+ ]
116
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["../oxlint.json"],
3
+ "ignorePatterns": ["src/routeTree.gen.ts", ".output/**", "node_modules/**"]
4
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "plugins": ["typescript", "unicorn", "oxc", "react", "jsx-a11y", "import", "vitest"],
3
+ "categories": {
4
+ "correctness": "error",
5
+ "suspicious": "warn",
6
+ "perf": "warn"
7
+ },
8
+ "rules": {
9
+ "import/no-unassigned-import": "off",
10
+ "react/react-in-jsx-scope": "off",
11
+ "typescript/consistent-return": "off",
12
+ "typescript/no-unsafe-type-assertion": "off",
13
+ "unicorn/filename-case": "off",
14
+ "vitest/require-mock-type-parameters": "off"
15
+ },
16
+ "env": {
17
+ "builtin": true
18
+ }
19
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "noUncheckedIndexedAccess": true,
5
+ "esModuleInterop": true,
6
+ "skipLibCheck": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "verbatimModuleSyntax": true
9
+ }
10
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./bundler.json",
3
+ "compilerOptions": {
4
+ "jsx": "react-jsx",
5
+ "lib": ["ES2023", "DOM", "DOM.Iterable"],
6
+ "noEmit": true
7
+ }
8
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./base.json",
3
+ "compilerOptions": {
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "target": "ES2023",
7
+ "lib": ["ES2023"]
8
+ }
9
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "./base.json",
3
+ "compilerOptions": {
4
+ "exactOptionalPropertyTypes": true,
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "target": "ES2024",
8
+ "lib": ["ES2024", "DOM", "DOM.Iterable"],
9
+ "skipLibCheck": true
10
+ }
11
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "./browser.json",
3
+ "compilerOptions": {
4
+ "types": ["vite/client", "node"]
5
+ }
6
+ }