ras-stack 6.0.0 → 6.0.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 CHANGED
@@ -1,17 +1,25 @@
1
1
  # ras-stack
2
2
 
3
- RAS is how Richard Solomou's applications are built: from [recipes](https://github.com/richardsolomou/ras-stack/blob/main/recipes/README.md), working code an application copies once and then owns, with the decisions behind it written down. The [`ras-recipes` skill](https://github.com/richardsolomou/ras-stack/blob/main/skills/ras-recipes/SKILL.md) adds recipes to an application, merges later recipe changes into its copy, and reports drift. The [stacks](https://github.com/richardsolomou/ras-stack/tree/main/stacks) are complete applications assembled from recipes and checked in CI.
3
+ Compiler and lint presets, and the preview deployment tooling, for applications built from [ras-stack recipes](https://github.com/richardsolomou/ras-stack#readme).
4
4
 
5
- This npm package holds the few things applications share instead of copying:
5
+ [Recipes](https://github.com/richardsolomou/ras-stack/blob/main/recipes/README.md) · [Documentation](https://github.com/richardsolomou/ras-stack/blob/main/docs/README.md) · [Changelog](https://github.com/richardsolomou/ras-stack/blob/main/packages/ras-stack/CHANGELOG.md) · [Migrate from v5](https://github.com/richardsolomou/ras-stack/blob/main/docs/upgrades.md)
6
6
 
7
- - TypeScript and Oxlint presets, which the `tooling` recipe extends.
8
- - The `ras preview` command and the `ras-stack/preview/dokploy` export, which the shared Dokploy preview workflows run.
7
+ Applications built from recipes copy and own their code: the app shell, accounts, databases, email, realtime, uploads, analytics, and deploys. This package holds the two things they share instead:
9
8
 
10
- [npm](https://www.npmjs.com/package/ras-stack) · [Documentation](https://github.com/richardsolomou/ras-stack/blob/main/docs/README.md) · [Recipes](https://github.com/richardsolomou/ras-stack/blob/main/recipes/README.md) · [Migrate from v5](https://github.com/richardsolomou/ras-stack/blob/main/docs/upgrades.md)
9
+ - **Presets** for TypeScript and Oxlint, which the [`tooling` recipe](https://github.com/richardsolomou/ras-stack/tree/main/recipes/tooling) extends.
10
+ - **Preview tooling**: the `ras preview` command and the `ras-stack/preview/dokploy` export, which the shared Dokploy preview workflows run.
11
+
12
+ It publishes `config/` (the presets), `dist/` (the `ras` command and the preview export), this README, and the license. Requires Node 24.
11
13
 
12
14
  ## Presets
13
15
 
14
- Install `ras-stack` as a development dependency and extend the presets by file path, which works with any module resolution setting:
16
+ Install the package as a development dependency:
17
+
18
+ ```sh
19
+ pnpm add -D ras-stack
20
+ ```
21
+
22
+ Extend the presets by file path, which works with any module resolution setting:
15
23
 
16
24
  ```json
17
25
  {
@@ -33,6 +41,7 @@ Install `ras-stack` as a development dependency and extend the presets by file p
33
41
  | `typescript/browser.json` | Browser code without Vite. |
34
42
  | `typescript/bundler.json` | Bundled code without the DOM, such as a Convex or SpacetimeDB module. |
35
43
  | `typescript/library.json` | Node libraries and tools compiled with `NodeNext`. |
44
+ | `typescript/base.json` | The strict compiler options the other TypeScript presets share. |
36
45
  | `oxlint/application.json` | Application lint rules. |
37
46
  | `oxlint/domain.json` | Keeps `src/core/**` free of Node builtins, framework and persistence packages, and application layers. |
38
47
  | `oxlint/layers.json` | Restricts imports between `src/client`, `server`, `adapters`, `db`, `contracts`, and `routes`. |
@@ -41,17 +50,35 @@ The boundary presets hold only their import restrictions, so list them after `ap
41
50
 
42
51
  ## Previews
43
52
 
44
- The [Dokploy preview workflows](https://github.com/richardsolomou/ras-stack/blob/main/docs/repository-tooling.md#dokploy-previews) run `pnpm exec ras preview` from the application's install. An application with its own preview resources writes a deploy script on `ras-stack/preview/dokploy`.
53
+ The [Dokploy preview workflows](https://github.com/richardsolomou/ras-stack/blob/main/docs/repository-tooling.md#dokploy-previews) deploy each pull request to Dokploy and report its status on the pull request. They run the `ras` command from the application's install, so keep `ras-stack` as a development dependency.
45
54
 
46
- ## Contributing
55
+ | Command | Does |
56
+ | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
57
+ | `ras preview dokploy <deploy\|delete\|prune>` | Deploys a pull request's image, deletes its preview, or removes previews of closed pull requests. |
58
+ | `ras preview <awaiting\|building\|ready\|failed\|deleted>` | Updates the pull request's preview comment and check run. |
47
59
 
48
- The workspace uses Node 24, pnpm 11.15.0, and Just 1.58.0:
60
+ Both read their configuration from environment variables the workflows set; the [repository tooling guide](https://github.com/richardsolomou/ras-stack/blob/main/docs/repository-tooling.md#dokploy-previews) lists them.
49
61
 
50
- ```sh
51
- just install
52
- just check
62
+ An application with its own preview resources, such as a tenant to provision, points the workflow's `deploy-script` at a script built on `ras-stack/preview/dokploy`:
63
+
64
+ ```ts
65
+ import { dokployPreviewFromEnvironment } from 'ras-stack/preview/dokploy'
66
+
67
+ const { manager } = dokployPreviewFromEnvironment()
68
+ await manager.deploy({
69
+ prNumber: process.env.PR_NUMBER!,
70
+ image: process.env.PREVIEW_IMAGE!,
71
+ environment: ({ url }) => `APP_URL=${url}\n`,
72
+ configure: async ({ applicationId, url }) => provisionTenantFor(applicationId, url),
73
+ })
53
74
  ```
54
75
 
55
- 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.
76
+ The export also provides `DokployClient` for the raw Dokploy API, `loadPreviewAppSecrets` to copy allowlisted keys of the `PREVIEW_APP_SECRETS` secret into the environment, and `pullRequestNumber`.
77
+
78
+ ## Everything else
79
+
80
+ Runtime code is not in this package. Copy it from the [recipes](https://github.com/richardsolomou/ras-stack#readme) with the [`ras-recipes` skill](https://github.com/richardsolomou/ras-stack/blob/main/skills/ras-recipes/SKILL.md), which also merges later recipe changes into your copy.
81
+
82
+ See [CONTRIBUTING.md](https://github.com/richardsolomou/ras-stack/blob/main/CONTRIBUTING.md) to work on the package, and [SECURITY.md](https://github.com/richardsolomou/ras-stack/blob/main/SECURITY.md) for private vulnerability reports.
56
83
 
57
- [MIT license](https://github.com/richardsolomou/ras-stack/blob/main/packages/ras-stack/LICENSE).
84
+ [MIT license](https://github.com/richardsolomou/ras-stack/blob/main/packages/ras-stack/LICENSE)
@@ -10,6 +10,7 @@
10
10
  "react/react-in-jsx-scope": "off",
11
11
  "typescript/consistent-return": "off",
12
12
  "typescript/no-unsafe-type-assertion": "off",
13
+ "unicorn/no-useless-spread": "off",
13
14
  "unicorn/filename-case": "off",
14
15
  "vitest/require-mock-type-parameters": "off"
15
16
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ras-stack",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "Compiler and lint presets and preview deployment tooling for applications built from RAS recipes.",
5
5
  "keywords": [
6
6
  "dokploy",
@@ -39,7 +39,7 @@
39
39
  "@vitest/coverage-v8": "^4.1.12",
40
40
  "oxfmt": "^0.75.0",
41
41
  "oxlint": "^1.90.0",
42
- "oxlint-tsgolint": "^7.0.2005",
42
+ "oxlint-tsgolint": "^7.0.2006",
43
43
  "typescript": "^7.0.2",
44
44
  "vitest": "^4.1.12",
45
45
  "yaml": "^2.9.1"