ras-stack 5.0.0-next.0 → 5.0.0-next.2
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.
- package/README.md +36 -91
- package/config/vite.mjs +3 -0
- package/dist/changesets/index.js +31 -12064
- package/dist/changesets/index.js.map +1 -7
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +4 -1
- package/dist/cli.js.map +1 -1
- package/dist/managed/catalog.d.ts +4 -3
- package/dist/managed/catalog.js +31 -23
- package/dist/managed/catalog.js.map +1 -1
- package/dist/managed/cli.js +2 -1
- package/dist/managed/cli.js.map +1 -1
- package/dist/managed/environment.d.ts +2 -2
- package/dist/managed/environment.js +15 -24
- package/dist/managed/environment.js.map +1 -1
- package/dist/managed/install.d.ts +1 -1
- package/dist/managed/install.js +9 -15
- package/dist/managed/install.js.map +1 -1
- package/dist/managed/model.d.ts +2 -1
- package/dist/managed/model.js +7 -4
- package/dist/managed/model.js.map +1 -1
- package/dist/managed/plan.d.ts +1 -0
- package/dist/managed/plan.js +34 -11
- package/dist/managed/plan.js.map +1 -1
- package/dist/managed/sync.d.ts +6 -0
- package/dist/managed/sync.js +144 -0
- package/dist/managed/sync.js.map +1 -0
- package/dist/managed/tools.d.ts +1 -0
- package/dist/managed/tools.js +7 -0
- package/dist/managed/tools.js.map +1 -0
- package/dist/vite/config.js +8 -6
- package/dist/vite/config.js.map +1 -1
- package/package.json +83 -10
- package/config/oxlint/tanstack.json +0 -4
- package/dist/managed/pnpm.d.ts +0 -22
- package/dist/managed/pnpm.js +0 -75
- package/dist/managed/pnpm.js.map +0 -1
- package/pnpmfile.cjs +0 -1
- /package/config/typescript/{tanstack.json → vite.json} +0 -0
package/README.md
CHANGED
|
@@ -1,114 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ras-stack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Opt into a tested TypeScript stack. RAS supplies compatible dependency versions, configured tools, and shared runtime helpers. Applications keep upstream imports and their own product behavior.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[npm](https://www.npmjs.com/package/ras-stack) · [Documentation](https://github.com/richardsolomou/ras-stack/blob/main/docs/README.md) · [Full-stack example](https://github.com/richardsolomou/ras-stack/tree/main/examples/full-stack)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## How it works
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Select integrations and tools in a typed `ras.config.ts`. Run `ras sync` to write their exact versions into ordinary `dependencies` and `devDependencies`, generate committed compiler/linter configuration, and install with pnpm.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The resulting application uses normal pnpm installs. Only selected integrations and their dependencies are installed. Application code can still import `@tanstack/react-query`, `better-auth`, or another selected upstream library directly.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
| Task | Command |
|
|
14
|
+
| ----------------------------------------------- | -------------------------------- |
|
|
15
|
+
| Install a clone | `pnpm install --frozen-lockfile` |
|
|
16
|
+
| Apply changed selections | `pnpm exec ras sync` |
|
|
17
|
+
| Check that selections and committed files agree | `pnpm exec ras sync --check` |
|
|
18
|
+
| Upgrade RAS and the selected stack together | `pnpm exec ras update` |
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
These docs describe RAS 5, which includes the former `ras-stack-config` presets in the main package. During the v5 prerelease, bootstrap with `ras-stack@next` and use `ras update next` for candidate upgrades. See [installation](https://github.com/richardsolomou/ras-stack/blob/main/docs/managed-installation.md) and [migration from v4](https://github.com/richardsolomou/ras-stack/blob/main/docs/upgrades.md#migrate-from-v4) before changing an existing application.
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
## What RAS owns
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
| RAS | Application |
|
|
25
|
+
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
26
|
+
| Tested direct versions for opted-in integrations | Plain libraries, custom integrations, and application-specific dependencies |
|
|
27
|
+
| React/Vite, Start, Nitro, Tailwind, and PostHog build defaults when selected | Routes, entrypoints, providers, credentials, and application-specific plugin options |
|
|
28
|
+
| Versioned TypeScript and Oxlint presets | Local compiler options, lint exceptions, and repository boundaries |
|
|
29
|
+
| Authentication, database, Query, realtime, email, upload, and telemetry helpers | Schemas, migrations, authorization, cache policy, product events, and UI |
|
|
30
|
+
| CLI commands, reusable Actions, preview mechanics, and runtime binaries | Deployment topology, secrets, storage, release policy, and product hooks |
|
|
20
31
|
|
|
21
|
-
The
|
|
32
|
+
The consumer manifest remains explicit. `ras.managedDependencies` records the generated list of package names RAS owns so opt-outs can remove them safely. It does not duplicate configuration or dependency versions. Consumer lockfiles pin transitives; RAS does not impose a shared lockfile.
|
|
22
33
|
|
|
23
|
-
|
|
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.
|
|
26
|
-
- **Command-line tools** for changeset validation, production assets, preview status, and a local Centrifugo container.
|
|
27
|
-
- **GitHub Actions and reusable workflows** for toolchain setup, checks, browser tests, previews, and Changesets releases.
|
|
28
|
-
- **A separate OCI image** containing verified Caddy and Centrifugo binaries for production images.
|
|
34
|
+
## Documentation
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
Start at the [documentation index](https://github.com/richardsolomou/ras-stack/blob/main/docs/README.md).
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
- [Installation](https://github.com/richardsolomou/ras-stack/blob/main/docs/managed-installation.md): first sync, committed files, workspaces, CI, and production installs.
|
|
39
|
+
- [Configuration](https://github.com/richardsolomou/ras-stack/blob/main/docs/configuration.md): integration catalogue, tool presets, build overrides, and custom descriptors.
|
|
40
|
+
- [Upgrades and dependency ownership](https://github.com/richardsolomou/ras-stack/blob/main/docs/upgrades.md): updates, opt-outs, Dependabot, failure recovery, and v4 migration.
|
|
41
|
+
- [Application primitives](https://github.com/richardsolomou/ras-stack/blob/main/docs/application-primitives.md): native runtime helpers and the behavior applications still own.
|
|
42
|
+
- [PostHog](https://github.com/richardsolomou/ras-stack/blob/main/docs/posthog.md): providers, identity, telemetry, proxying, and configured source maps.
|
|
43
|
+
- [Repository tooling](https://github.com/richardsolomou/ras-stack/blob/main/docs/repository-tooling.md): assets, Actions, previews, releases, and runtime binaries.
|
|
44
|
+
- [Full-stack example](https://github.com/richardsolomou/ras-stack/blob/main/docs/full-stack-example.md) and [production operations](https://github.com/richardsolomou/ras-stack/blob/main/docs/production-reference-operations.md): the executable reference and its operating procedures.
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
| ------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
36
|
-
| Runtime and tooling | Node, ESM TypeScript, pnpm, Just, Oxlint | Setup actions and version synchronization |
|
|
37
|
-
| Web application | TanStack Start, React | Request binding, mutation-origin checks, canonical hosts, health handlers, and conformance checks |
|
|
38
|
-
| Authentication | Better Auth | Secure option builders, origins, secrets, redirects, failure classification, and React action state |
|
|
39
|
-
| Data | Drizzle, `better-sqlite3`, libsql, Postgres.js | Connection lifecycle, safety defaults, migrations, target selection, and conformance checks |
|
|
40
|
-
| Realtime | Centrifuge, Centrifugo, Caddy | Publishing, tokens, browser/React lifecycle, proxy configuration, binaries, and supervision |
|
|
41
|
-
| Realtime database | SpacetimeDB | Server calls, migration-planned module publishing, environment headers, and binding checks |
|
|
42
|
-
| Email and uploads | Nodemailer, `tus-js-client` | SMTP configuration/delivery, auth callbacks, and promise-based resumable uploads |
|
|
43
|
-
| Observability | PostHog JS, React, Node, and OpenTelemetry | Analytics, replay, errors, logs, metrics, tracing, correlation, proxying, and shutdown |
|
|
44
|
-
| Delivery | GitHub Actions, Changesets, Dokploy, Docker | Checks, releases, preview lifecycle/status, production assets, and runtime binaries |
|
|
46
|
+
Runtime imports use narrow paths such as `ras-stack/query`, `ras-stack/auth`, and `ras-stack/database/sqlite`. The separately released OCI image contains verified Caddy and Centrifugo binaries; installing the npm package does not install that image or provision services.
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
## Contributing
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`ras-stack` owns mechanics that should behave the same everywhere: safe database startup, mutation-origin checks, realtime tokens, process supervision, and preview status.
|
|
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.
|
|
53
|
-
|
|
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.
|
|
55
|
-
|
|
56
|
-
## Installation
|
|
57
|
-
|
|
58
|
-
`ras-stack` requires Node 24. Managed installation requires pnpm 11 or newer:
|
|
59
|
-
|
|
60
|
-
```sh
|
|
61
|
-
pnpm add ras-stack
|
|
62
|
-
```
|
|
63
|
-
|
|
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.
|
|
80
|
-
|
|
81
|
-
## Dokploy previews 🚀
|
|
82
|
-
|
|
83
|
-
Three reusable workflows provide the standard pull-request preview lifecycle:
|
|
84
|
-
|
|
85
|
-
- `build-dokploy-preview.yml` builds commit-specific images without exposing secrets to forks.
|
|
86
|
-
- `deploy-dokploy-preview.yml` publishes, resolves, deploys, reports, and removes previews.
|
|
87
|
-
- `prune-dokploy-previews.yml` cleans up applications and images left behind by interrupted runs.
|
|
88
|
-
|
|
89
|
-
Applications supply only their package, application prefix, port, environment template, and optional product hook. They can provide a custom HTTPS domain, optionally manage a prefixed Cloudflare-proxied record for origins that reject direct traffic, or let Dokploy generate an HTTP `sslip.io` address. The shared `DOKPLOY_URL`, `DOKPLOY_API_KEY`, and staging-only `DOKPLOY_ENVIRONMENT_ID` secrets can be configured once at organization level. See [Repository tooling](https://github.com/richardsolomou/ras-stack/blob/main/docs/repository-tooling.md) for the caller contract, private-registry options, and lifecycle hooks.
|
|
90
|
-
|
|
91
|
-
## Guides 📚
|
|
92
|
-
|
|
93
|
-
| Guide | What it covers |
|
|
94
|
-
| ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
-
| [Application primitives](https://github.com/richardsolomou/ras-stack/blob/main/docs/application-primitives.md) | Authentication, request security, databases, realtime clients, email, uploads, and stateful development resources |
|
|
96
|
-
| [Repository tooling](https://github.com/richardsolomou/ras-stack/blob/main/docs/repository-tooling.md) | TypeScript and Oxlint configuration, changeset validation, GitHub Actions, previews, releases, and production runtime composition |
|
|
97
|
-
| [PostHog integration](https://github.com/richardsolomou/ras-stack/blob/main/docs/posthog.md) | Browser/server setup, identity and session correlation, ingest proxying, shutdown and source-map responsibility |
|
|
98
|
-
| [Full-stack example](https://github.com/richardsolomou/ras-stack/blob/main/docs/full-stack-example.md) | The `workspace:*` integration contract, local development, production container, and two-browser journey |
|
|
99
|
-
| [Production operations](https://github.com/richardsolomou/ras-stack/blob/main/docs/production-reference-operations.md) | Migration, backup/restore, rollback, configuration, proxy, shutdown, and supply-chain boundaries |
|
|
100
|
-
|
|
101
|
-
## Development 🛠️
|
|
102
|
-
|
|
103
|
-
Development requires Node 24, pnpm 11.15.0, and Just 1.58.0.
|
|
50
|
+
The RAS workspace uses Node 24, pnpm 11.15.0, and Just 1.58.0:
|
|
104
51
|
|
|
105
52
|
```sh
|
|
106
53
|
just install
|
|
107
54
|
just check
|
|
108
55
|
```
|
|
109
56
|
|
|
110
|
-
See [CONTRIBUTING.md](https://github.com/richardsolomou/ras-stack/blob/main/CONTRIBUTING.md) for
|
|
111
|
-
|
|
112
|
-
## License
|
|
57
|
+
See [CONTRIBUTING.md](https://github.com/richardsolomou/ras-stack/blob/main/CONTRIBUTING.md) for development and releases, and [SECURITY.md](https://github.com/richardsolomou/ras-stack/blob/main/SECURITY.md) for private vulnerability reports.
|
|
113
58
|
|
|
114
|
-
[MIT](https://github.com/richardsolomou/ras-stack/blob/main/packages/ras-stack/LICENSE).
|
|
59
|
+
[MIT license](https://github.com/richardsolomou/ras-stack/blob/main/packages/ras-stack/LICENSE).
|
package/config/vite.mjs
ADDED