ras-stack 2.0.1 → 3.0.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.
- package/README.md +15 -42
- package/dist/changesets/cli.d.ts +1 -0
- package/dist/changesets/cli.js +14 -0
- package/dist/changesets/cli.js.map +1 -0
- package/dist/{policy/changesets.js → changesets/index.js} +1 -1
- package/dist/changesets/index.js.map +1 -0
- package/dist/cli.d.ts +2 -6
- package/dist/cli.js +3 -7
- package/dist/cli.js.map +1 -1
- package/dist/posthog/index.d.ts +0 -2
- package/dist/posthog/index.js +0 -1
- package/dist/posthog/index.js.map +1 -1
- package/dist/posthog/proxy.d.ts +11 -1
- package/dist/posthog/proxy.js +15 -3
- package/dist/posthog/proxy.js.map +1 -1
- package/package.json +12 -39
- package/config/oxlint/application.json +0 -16
- package/config/oxlint/domain.json +0 -29
- package/config/oxlint/layers.json +0 -116
- package/config/oxlint/tanstack.json +0 -4
- package/config/oxlint.json +0 -19
- package/config/typescript/base.json +0 -10
- package/config/typescript/browser.json +0 -8
- package/config/typescript/bundler.json +0 -9
- package/config/typescript/library.json +0 -11
- package/config/typescript/node-bundler.json +0 -9
- package/config/typescript/tanstack.json +0 -6
- package/dist/create/index.d.ts +0 -1
- package/dist/create/index.js +0 -83
- package/dist/create/index.js.map +0 -1
- package/dist/create/template/.env.example +0 -16
- package/dist/create/template/.oxfmtrc.json +0 -7
- package/dist/create/template/Dockerfile +0 -37
- package/dist/create/template/Dockerfile.standalone +0 -29
- package/dist/create/template/centrifugo.json +0 -14
- package/dist/create/template/dockerignore.template +0 -8
- package/dist/create/template/drizzle/0000_production_reference.sql +0 -114
- package/dist/create/template/drizzle/meta/_journal.json +0 -13
- package/dist/create/template/e2e/full-stack.spec.ts +0 -54
- package/dist/create/template/gitignore.template +0 -9
- package/dist/create/template/oxlint.json +0 -4
- package/dist/create/template/package.json +0 -60
- package/dist/create/template/playwright.config.ts +0 -7
- package/dist/create/template/pnpm-workspace.template.yaml +0 -13
- package/dist/create/template/ras-stack.assets.json +0 -4
- package/dist/create/template/scripts/containerRuntime.ts +0 -29
- package/dist/create/template/scripts/database.test.ts +0 -121
- package/dist/create/template/scripts/database.ts +0 -105
- package/dist/create/template/src/client/auth.ts +0 -3
- package/dist/create/template/src/client/queries.ts +0 -4
- package/dist/create/template/src/client/queryClient.ts +0 -1
- package/dist/create/template/src/client/useRealtime.ts +0 -20
- package/dist/create/template/src/posthog.ts +0 -21
- package/dist/create/template/src/routeTree.gen.ts +0 -230
- package/dist/create/template/src/router.tsx +0 -17
- package/dist/create/template/src/routes/__root.tsx +0 -40
- package/dist/create/template/src/routes/api/auth.$.ts +0 -8
- package/dist/create/template/src/routes/api/centrifugo.connect.ts +0 -29
- package/dist/create/template/src/routes/api/health.ts +0 -6
- package/dist/create/template/src/routes/api/live.ts +0 -5
- package/dist/create/template/src/routes/api/ready.ts +0 -30
- package/dist/create/template/src/routes/api/uploads.$id.ts +0 -40
- package/dist/create/template/src/routes/api/uploads.ts +0 -25
- package/dist/create/template/src/routes/index.tsx +0 -189
- package/dist/create/template/src/server/app.test.ts +0 -24
- package/dist/create/template/src/server/app.ts +0 -172
- package/dist/create/template/src/server/auth-flow.test.ts +0 -150
- package/dist/create/template/src/server/auth.ts +0 -56
- package/dist/create/template/src/server/environment.test.ts +0 -43
- package/dist/create/template/src/server/environment.ts +0 -67
- package/dist/create/template/src/server/fns.ts +0 -38
- package/dist/create/template/src/server/messages.test.ts +0 -38
- package/dist/create/template/src/server/messages.ts +0 -28
- package/dist/create/template/src/server/migration.test.ts +0 -34
- package/dist/create/template/src/server/outbox.test.ts +0 -130
- package/dist/create/template/src/server/outbox.ts +0 -110
- package/dist/create/template/src/server/posthog.test.ts +0 -34
- package/dist/create/template/src/server/rate-limit.test.ts +0 -32
- package/dist/create/template/src/server/rate-limit.ts +0 -29
- package/dist/create/template/src/server/rpc.ts +0 -16
- package/dist/create/template/src/server/schema.ts +0 -134
- package/dist/create/template/src/server/session.test.ts +0 -56
- package/dist/create/template/src/server/session.ts +0 -13
- package/dist/create/template/src/server/uploads.test.ts +0 -142
- package/dist/create/template/src/server/uploads.ts +0 -199
- package/dist/create/template/src/start.ts +0 -12
- package/dist/create/template/src/styles.css +0 -42
- package/dist/create/template/tsconfig.json +0 -8
- package/dist/create/template/vite.config.ts +0 -31
- package/dist/create/template/vitest.config.ts +0 -3
- package/dist/policy/changesets.js.map +0 -1
- package/dist/policy/cli.d.ts +0 -1
- package/dist/policy/cli.js +0 -23
- package/dist/policy/cli.js.map +0 -1
- package/dist/policy/index.d.ts +0 -14
- package/dist/policy/index.js +0 -132
- package/dist/policy/index.js.map +0 -1
- package/dist/policy/init-cli.d.ts +0 -12
- package/dist/policy/init-cli.js +0 -75
- package/dist/policy/init-cli.js.map +0 -1
- package/dist/policy/init.d.ts +0 -24
- package/dist/policy/init.js +0 -116
- package/dist/policy/init.js.map +0 -1
- package/dist/posthog/coverage.d.ts +0 -23
- package/dist/posthog/coverage.js +0 -30
- package/dist/posthog/coverage.js.map +0 -1
- package/dist/tanstack/query.d.ts +0 -3
- package/dist/tanstack/query.js +0 -8
- package/dist/tanstack/query.js.map +0 -1
- /package/dist/{policy/changesets.d.ts → changesets/index.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -18,10 +18,11 @@ 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
|
|
21
|
+
It ships as independently versioned packages and 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
|
-
- **
|
|
24
|
+
- **Configuration presets** in the dependency-free `ras-stack-config` package for TypeScript and Oxlint.
|
|
25
|
+
- **Command-line tools** for changeset validation, production assets, preview status, and a local Centrifugo container.
|
|
25
26
|
- **GitHub Actions and reusable workflows** for toolchain setup, checks, browser tests, previews, and Changesets releases.
|
|
26
27
|
- **A separate OCI image** containing verified Caddy and Centrifugo binaries for production images.
|
|
27
28
|
|
|
@@ -48,46 +49,18 @@ Applications still configure every upstream library directly. This table describ
|
|
|
48
49
|
|
|
49
50
|
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.
|
|
50
51
|
|
|
51
|
-
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
|
|
52
|
+
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.
|
|
52
53
|
|
|
53
|
-
##
|
|
54
|
+
## Installation
|
|
54
55
|
|
|
55
|
-
`ras-stack` requires Node 24.
|
|
56
|
+
`ras-stack` requires Node 24. Install the runtime package for application helpers and the configuration package for compiler/linter presets:
|
|
56
57
|
|
|
57
58
|
```sh
|
|
58
59
|
pnpm add ras-stack
|
|
60
|
+
pnpm add -D ras-stack-config
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```sh
|
|
64
|
-
pnpm add nodemailer
|
|
65
|
-
pnpm add centrifuge
|
|
66
|
-
pnpm add tus-js-client
|
|
67
|
-
pnpm add better-auth @better-auth/drizzle-adapter better-sqlite3 drizzle-orm
|
|
68
|
-
pnpm add postgres drizzle-orm
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Start with the narrowest public entrypoint that owns the repeated mechanic:
|
|
72
|
-
|
|
73
|
-
| Need | Entrypoint or command | The application still owns |
|
|
74
|
-
| --------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
75
|
-
| Authentication defaults and browser action state | `ras-stack/auth`, `ras-stack/auth/client`, `ras-stack/auth/react` | Better Auth configuration, forms, policy, and navigation |
|
|
76
|
-
| RPC, mutation-origin, health, and canonical-host handling | `ras-stack/server`, `ras-stack/tanstack/server`, `ras-stack/tanstack/middleware` | Routes, authorization, logging, and health work |
|
|
77
|
-
| SQLite or PostgreSQL lifecycle | `ras-stack/database/*` | Schemas, migrations, repositories, and transactions |
|
|
78
|
-
| Realtime publication and browser lifecycle | `ras-stack/realtime/*` | Channels, tickets, payloads, presence models, and invalidation |
|
|
79
|
-
| Email, uploads, and production assets | `ras-stack/email`, `ras-stack/uploads`, `ras assets` | Templates, metadata, quotas, storage, and asset contents |
|
|
80
|
-
| Production or development realtime runtime | `ras-stack/runtime`, `ras realtime` | Images, ports, secrets, volumes, and distributed policy |
|
|
81
|
-
| Compiler, lint, CI, release, and preview mechanics | `ras-stack/config/*`, `actions/*`, `.github/workflows/*`, `ras-stack/preview/*` | Triggers, permissions, services, deployment, and verification |
|
|
82
|
-
| Generated repository policy files | `ras policy` | Which policies apply and every declared override |
|
|
83
|
-
|
|
84
|
-
To start from the production reference instead of assembling entrypoints individually:
|
|
85
|
-
|
|
86
|
-
```sh
|
|
87
|
-
pnpm create ras-app my-app
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The `create-ras-app` command delegates to the same scaffold implementation available through `pnpm dlx ras-stack create my-app`. The scaffold includes Better Auth, checked-in migrations, durable uploads, SMTP flows, a transactional realtime outbox, production health/lifecycle behavior, and its tests. It remains ordinary application code rather than a second framework API.
|
|
63
|
+
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`.
|
|
91
64
|
|
|
92
65
|
## Dokploy previews 🚀
|
|
93
66
|
|
|
@@ -101,13 +74,13 @@ Applications supply only their package, application prefix, port, environment te
|
|
|
101
74
|
|
|
102
75
|
## Guides 📚
|
|
103
76
|
|
|
104
|
-
| Guide | What it covers
|
|
105
|
-
| ---------------------------------------------------------------------------------------------------------------------- |
|
|
106
|
-
| [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
|
|
107
|
-
| [Repository tooling](https://github.com/richardsolomou/ras-stack/blob/main/docs/repository-tooling.md) | TypeScript and Oxlint configuration,
|
|
108
|
-
| [PostHog integration](https://github.com/richardsolomou/ras-stack/blob/main/docs/posthog.md) | Browser/server setup, identity and session correlation, ingest proxying, shutdown
|
|
109
|
-
| [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
|
|
110
|
-
| [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
|
|
77
|
+
| Guide | What it covers |
|
|
78
|
+
| ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| [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 |
|
|
80
|
+
| [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 |
|
|
81
|
+
| [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 |
|
|
82
|
+
| [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 |
|
|
83
|
+
| [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 |
|
|
111
84
|
|
|
112
85
|
## Development 🛠️
|
|
113
86
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runChangesetsCli(arguments_: string[]): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { checkChangesets } from './index.js';
|
|
2
|
+
export async function runChangesetsCli(arguments_) {
|
|
3
|
+
if (arguments_.length !== 1 || arguments_[0] !== 'check') {
|
|
4
|
+
console.error('usage: ras changesets check');
|
|
5
|
+
process.exitCode = 2;
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const errors = await checkChangesets(process.cwd());
|
|
9
|
+
for (const message of errors)
|
|
10
|
+
console.error(message);
|
|
11
|
+
if (errors.length > 0)
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/changesets/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAoB;IACzD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QACzD,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAC5C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACpB,OAAM;IACR,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IACnD,KAAK,MAAM,OAAO,IAAI,MAAM;QAAE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACpD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;AAC7C,CAAC","sourcesContent":["import { checkChangesets } from './index.js'\n\nexport async function runChangesetsCli(arguments_: string[]): Promise<void> {\n if (arguments_.length !== 1 || arguments_[0] !== 'check') {\n console.error('usage: ras changesets check')\n process.exitCode = 2\n return\n }\n const errors = await checkChangesets(process.cwd())\n for (const message of errors) console.error(message)\n if (errors.length > 0) process.exitCode = 1\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/changesets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAA4B,EAAE,EAAE;QAC3F,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAA;QACtC,MAAM,KAAK,CAAA;IACb,CAAC,CAAC,CAAA;IACF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAA;IAClG,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAA;IAC5C,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;IAC1E,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,cAAc,IAAI,EAAE,CAAA;QACjC,iFAAiF;QACjF,4CAA4C;QAC5C,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;QACzD,IAAI,QAAQ,CAAA;QACZ,IAAI,CAAC;YACH,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAA;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,kCAAkC,CAAC,CAAA;YACtD,SAAQ;QACV,CAAC;QACD,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,QAAQ,EAAE,CAAC;YAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,qBAAqB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACvF,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { parseChangesetFile } from '@changesets/parse'\nimport { getPackages } from '@manypkg/get-packages'\nimport { readdir, readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\n\nexport async function checkChangesets(root: string): Promise<string[]> {\n const files = await readdir(join(root, '.changeset')).catch((error: NodeJS.ErrnoException) => {\n if (error.code === 'ENOENT') return []\n throw error\n })\n const changesets = files.filter((file) => file.endsWith('.md') && file !== 'README.md').toSorted()\n if (changesets.length === 0) return []\n const { packages } = await getPackages(root)\n const names = new Set(packages.map(({ packageJson }) => packageJson.name))\n const errors: string[] = []\n for (const file of changesets) {\n const path = `.changeset/${file}`\n // Read serially so a large changeset directory does not open every file at once.\n // oxlint-disable-next-line no-await-in-loop\n const contents = await readFile(join(root, path), 'utf8')\n let releases\n try {\n releases = parseChangesetFile(contents).releases\n } catch {\n errors.push(`${path}: missing or invalid frontmatter`)\n continue\n }\n for (const { name } of releases) {\n if (!names.has(name)) errors.push(`${path}: unknown package ${JSON.stringify(name)}`)\n }\n }\n return errors\n}\n"]}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { runAssetsCli } from './build/cli.js';
|
|
3
|
-
import {
|
|
4
|
-
import { runInitCli } from './policy/init-cli.js';
|
|
5
|
-
import { runPolicyCli } from './policy/cli.js';
|
|
3
|
+
import { runChangesetsCli } from './changesets/cli.js';
|
|
6
4
|
import { runPreviewCli } from './preview/cli.js';
|
|
7
5
|
import { runRealtimeCli } from './runtime/dev-cli.js';
|
|
8
6
|
declare const commands: {
|
|
9
7
|
readonly assets: typeof runAssetsCli;
|
|
10
|
-
readonly
|
|
11
|
-
readonly init: typeof runInitCli;
|
|
12
|
-
readonly policy: typeof runPolicyCli;
|
|
8
|
+
readonly changesets: typeof runChangesetsCli;
|
|
13
9
|
readonly preview: typeof runPreviewCli;
|
|
14
10
|
readonly realtime: typeof runRealtimeCli;
|
|
15
11
|
};
|
package/dist/cli.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { runAssetsCli } from './build/cli.js';
|
|
3
|
-
import {
|
|
4
|
-
import { runInitCli } from './policy/init-cli.js';
|
|
5
|
-
import { runPolicyCli } from './policy/cli.js';
|
|
3
|
+
import { runChangesetsCli } from './changesets/cli.js';
|
|
6
4
|
import { runPreviewCli } from './preview/cli.js';
|
|
7
5
|
import { runRealtimeCli } from './runtime/dev-cli.js';
|
|
8
6
|
const commands = {
|
|
9
7
|
assets: runAssetsCli,
|
|
10
|
-
|
|
11
|
-
init: runInitCli,
|
|
12
|
-
policy: runPolicyCli,
|
|
8
|
+
changesets: runChangesetsCli,
|
|
13
9
|
preview: runPreviewCli,
|
|
14
10
|
realtime: runRealtimeCli,
|
|
15
11
|
};
|
|
@@ -22,7 +18,7 @@ export function parseRasCommand(arguments_) {
|
|
|
22
18
|
export async function runRasCli(arguments_) {
|
|
23
19
|
const parsed = parseRasCommand(arguments_);
|
|
24
20
|
if (!parsed) {
|
|
25
|
-
console.error('usage: ras <assets|
|
|
21
|
+
console.error('usage: ras <assets|changesets|preview|realtime> [arguments]');
|
|
26
22
|
process.exitCode = 2;
|
|
27
23
|
return;
|
|
28
24
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,gBAAgB;IAC5B,OAAO,EAAE,aAAa;IACtB,QAAQ,EAAE,cAAc;CAChB,CAAA;AAIV,MAAM,UAAU,eAAe,CAAC,UAAoB;IAClD,MAAM,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,GAAG,UAAU,CAAA;IAC9C,IAAI,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAAE,OAAO,SAAS,CAAA;IACpE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAqB,EAAE,CAAA;AACrE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,UAAoB;IAClD,MAAM,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAAA;IAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAA;QAC5E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACpB,OAAM;IACR,CAAC;IACD,MAAM,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AAClD,CAAC;AAED,IAAI,OAAO,IAAI,CAAC,IAAI;IAAE,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA","sourcesContent":["#!/usr/bin/env node\nimport { runAssetsCli } from './build/cli.js'\nimport { runChangesetsCli } from './changesets/cli.js'\nimport { runPreviewCli } from './preview/cli.js'\nimport { runRealtimeCli } from './runtime/dev-cli.js'\n\nconst commands = {\n assets: runAssetsCli,\n changesets: runChangesetsCli,\n preview: runPreviewCli,\n realtime: runRealtimeCli,\n} as const\n\nexport type RasCommand = keyof typeof commands\n\nexport function parseRasCommand(arguments_: string[]): { arguments: string[]; command: RasCommand } | undefined {\n const [command, ...argumentsRest] = arguments_\n if (!(command && Object.hasOwn(commands, command))) return undefined\n return { arguments: argumentsRest, command: command as RasCommand }\n}\n\nexport async function runRasCli(arguments_: string[]): Promise<void> {\n const parsed = parseRasCommand(arguments_)\n if (!parsed) {\n console.error('usage: ras <assets|changesets|preview|realtime> [arguments]')\n process.exitCode = 2\n return\n }\n await commands[parsed.command](parsed.arguments)\n}\n\nif (import.meta.main) await runRasCli(process.argv.slice(2))\n"]}
|
package/dist/posthog/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { postHogEnvironment, postHogHttpUrl } from './config.js';
|
|
2
2
|
export type { PostHogBrowserService, PostHogEnvironment } from './config.js';
|
|
3
|
-
export { definePostHogCoverage } from './coverage.js';
|
|
4
|
-
export type { PostHogCoverage, PostHogCoverageDecision } from './coverage.js';
|
|
5
3
|
export { POSTHOG_DISTINCT_ID_HEADER, POSTHOG_SESSION_ID_HEADER, postHogRequestContext } from './request.js';
|
|
6
4
|
export type { PostHogRequestContext, PostHogRequestContextOptions } from './request.js';
|
package/dist/posthog/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/posthog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEhE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/posthog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEhE,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA","sourcesContent":["export { postHogEnvironment, postHogHttpUrl } from './config.js'\nexport type { PostHogBrowserService, PostHogEnvironment } from './config.js'\nexport { POSTHOG_DISTINCT_ID_HEADER, POSTHOG_SESSION_ID_HEADER, postHogRequestContext } from './request.js'\nexport type { PostHogRequestContext, PostHogRequestContextOptions } from './request.js'\n"]}
|
package/dist/posthog/proxy.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type { PostHogEnvironment } from './config.js';
|
|
2
|
+
type ProxyRequest = {
|
|
3
|
+
removeHeader(name: string): void;
|
|
4
|
+
};
|
|
5
|
+
type ViteProxyServer = {
|
|
6
|
+
on(event: 'proxyReq', listener: (request: ProxyRequest) => void): unknown;
|
|
7
|
+
};
|
|
2
8
|
type ViteProxyTarget = {
|
|
3
9
|
target: string;
|
|
4
10
|
changeOrigin: true;
|
|
5
11
|
rewrite: (path: string) => string;
|
|
12
|
+
configure: (proxy: ViteProxyServer) => void;
|
|
6
13
|
};
|
|
7
14
|
export declare const POSTHOG_DEFAULT_INGEST_PATH = "/t";
|
|
8
15
|
export declare function postHogIngestProxy(input: Pick<PostHogEnvironment, 'host' | 'assetsHost'>, options?: {
|
|
@@ -14,7 +21,10 @@ export declare function postHogIngestProxy(input: Pick<PostHogEnvironment, 'host
|
|
|
14
21
|
};
|
|
15
22
|
nitro: {
|
|
16
23
|
[x: string]: {
|
|
17
|
-
proxy:
|
|
24
|
+
proxy: {
|
|
25
|
+
to: string;
|
|
26
|
+
filterHeaders: ("authorization" | "cookie")[];
|
|
27
|
+
};
|
|
18
28
|
};
|
|
19
29
|
};
|
|
20
30
|
};
|
package/dist/posthog/proxy.js
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { postHogHttpUrl } from './config.js';
|
|
2
|
+
/**
|
|
3
|
+
* A same-origin proxy receives the application's session cookie and any bearer token with every
|
|
4
|
+
* request. PostHog reads neither, and forwarding them would hand a credential to a third party.
|
|
5
|
+
*/
|
|
6
|
+
const PRIVATE_HEADERS = ['cookie', 'authorization'];
|
|
2
7
|
function viteTarget(host, ingestPath) {
|
|
3
8
|
const prefix = new RegExp(`^${escapeRegExp(ingestPath)}`);
|
|
4
9
|
return {
|
|
5
10
|
target: host,
|
|
6
11
|
changeOrigin: true,
|
|
7
12
|
rewrite: (path) => path.replace(prefix, ''),
|
|
13
|
+
configure: (proxy) => proxy.on('proxyReq', (request) => {
|
|
14
|
+
for (const name of PRIVATE_HEADERS)
|
|
15
|
+
request.removeHeader(name);
|
|
16
|
+
}),
|
|
8
17
|
};
|
|
9
18
|
}
|
|
19
|
+
function nitroTarget(to) {
|
|
20
|
+
return { proxy: { to, filterHeaders: [...PRIVATE_HEADERS] } };
|
|
21
|
+
}
|
|
10
22
|
function escapeRegExp(value) {
|
|
11
23
|
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
12
24
|
}
|
|
@@ -32,9 +44,9 @@ export function postHogIngestProxy(input, options = {}) {
|
|
|
32
44
|
[`${segment}(?:/|$)`]: viteTarget(ingestionHost, path),
|
|
33
45
|
},
|
|
34
46
|
nitro: {
|
|
35
|
-
[`${path}/static/**`]:
|
|
36
|
-
[`${path}/array/**`]:
|
|
37
|
-
[`${path}/**`]:
|
|
47
|
+
[`${path}/static/**`]: nitroTarget(`${assetsHost}/static/**`),
|
|
48
|
+
[`${path}/array/**`]: nitroTarget(`${assetsHost}/array/**`),
|
|
49
|
+
[`${path}/**`]: nitroTarget(`${ingestionHost}/**`),
|
|
38
50
|
},
|
|
39
51
|
};
|
|
40
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/posthog/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/posthog/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAG5C;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,eAAe,CAAU,CAAA;AAY5D,SAAS,UAAU,CAAC,IAAY,EAAE,UAAkB;IAClD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IACzD,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3C,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CACnB,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE;YAC/B,KAAK,MAAM,IAAI,IAAI,eAAe;gBAAE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QAChE,CAAC,CAAC;KACL,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EAAU;IAC7B,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,GAAG,eAAe,CAAC,EAAE,EAAE,CAAA;AAC/D,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA;AACrD,CAAC;AAED,8FAA8F;AAC9F,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAA;AAE/C,SAAS,oBAAoB,CAAC,IAAY;IACxC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5F,MAAM,IAAI,KAAK,CAAC,iGAAiG,CAAC,CAAA;IACpH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAsD,EAAE,OAAO,GAAsB,EAAE;IACxH,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACxD,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;IACjE,MAAM,IAAI,GAAG,oBAAoB,CAAC,OAAO,CAAC,IAAI,IAAI,2BAA2B,CAAC,CAAA;IAC9E,8GAA8G;IAC9G,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAA;IACxC,OAAO;QACL,IAAI;QACJ,IAAI,EAAE;YACJ,CAAC,GAAG,OAAO,SAAS,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC;YACnD,CAAC,GAAG,OAAO,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC;YAClD,CAAC,GAAG,OAAO,SAAS,CAAC,EAAE,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC;SACvD;QACD,KAAK,EAAE;YACL,CAAC,GAAG,IAAI,YAAY,CAAC,EAAE,WAAW,CAAC,GAAG,UAAU,YAAY,CAAC;YAC7D,CAAC,GAAG,IAAI,WAAW,CAAC,EAAE,WAAW,CAAC,GAAG,UAAU,WAAW,CAAC;YAC3D,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE,WAAW,CAAC,GAAG,aAAa,KAAK,CAAC;SACnD;KACF,CAAA;AACH,CAAC","sourcesContent":["import { postHogHttpUrl } from './config.js'\nimport type { PostHogEnvironment } from './config.js'\n\n/**\n * A same-origin proxy receives the application's session cookie and any bearer token with every\n * request. PostHog reads neither, and forwarding them would hand a credential to a third party.\n */\nconst PRIVATE_HEADERS = ['cookie', 'authorization'] as const\n\ntype ProxyRequest = { removeHeader(name: string): void }\ntype ViteProxyServer = { on(event: 'proxyReq', listener: (request: ProxyRequest) => void): unknown }\n\ntype ViteProxyTarget = {\n target: string\n changeOrigin: true\n rewrite: (path: string) => string\n configure: (proxy: ViteProxyServer) => void\n}\n\nfunction viteTarget(host: string, ingestPath: string): ViteProxyTarget {\n const prefix = new RegExp(`^${escapeRegExp(ingestPath)}`)\n return {\n target: host,\n changeOrigin: true,\n rewrite: (path) => path.replace(prefix, ''),\n configure: (proxy) =>\n proxy.on('proxyReq', (request) => {\n for (const name of PRIVATE_HEADERS) request.removeHeader(name)\n }),\n }\n}\n\nfunction nitroTarget(to: string) {\n return { proxy: { to, filterHeaders: [...PRIVATE_HEADERS] } }\n}\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n// Ad-blocker lists match the literal `/ingest` segment on any host, so the default avoids it.\nexport const POSTHOG_DEFAULT_INGEST_PATH = '/t'\n\nfunction normalizedIngestPath(path: string): string {\n if (!path.startsWith('/') || path.endsWith('/') || path.includes('?') || path.includes('#')) {\n throw new Error('PostHog ingest path must start with \"/\", have no trailing slash, and carry no query or fragment')\n }\n return path\n}\n\nexport function postHogIngestProxy(input: Pick<PostHogEnvironment, 'host' | 'assetsHost'>, options: { path?: string } = {}) {\n const ingestionHost = postHogHttpUrl(input.host, 'host')\n const assetsHost = postHogHttpUrl(input.assetsHost, 'assetsHost')\n const path = normalizedIngestPath(options.path ?? POSTHOG_DEFAULT_INGEST_PATH)\n // Vite matches string keys as bare prefixes, so a short path needs a regular expression bound to its segment.\n const segment = `^${escapeRegExp(path)}`\n return {\n path,\n vite: {\n [`${segment}/static`]: viteTarget(assetsHost, path),\n [`${segment}/array`]: viteTarget(assetsHost, path),\n [`${segment}(?:/|$)`]: viteTarget(ingestionHost, path),\n },\n nitro: {\n [`${path}/static/**`]: nitroTarget(`${assetsHost}/static/**`),\n [`${path}/array/**`]: nitroTarget(`${assetsHost}/array/**`),\n [`${path}/**`]: nitroTarget(`${ingestionHost}/**`),\n },\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ras-stack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Composable full-stack primitives shared across Richard Solomou's applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"ras": "./dist/cli.js"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
25
|
-
"config"
|
|
24
|
+
"dist"
|
|
26
25
|
],
|
|
27
26
|
"type": "module",
|
|
28
27
|
"sideEffects": false,
|
|
@@ -63,14 +62,6 @@
|
|
|
63
62
|
"types": "./dist/conformance/index.d.ts",
|
|
64
63
|
"default": "./dist/conformance/index.js"
|
|
65
64
|
},
|
|
66
|
-
"./create": {
|
|
67
|
-
"types": "./dist/create/index.d.ts",
|
|
68
|
-
"default": "./dist/create/index.js"
|
|
69
|
-
},
|
|
70
|
-
"./policy": {
|
|
71
|
-
"types": "./dist/policy/index.d.ts",
|
|
72
|
-
"default": "./dist/policy/index.js"
|
|
73
|
-
},
|
|
74
65
|
"./posthog": {
|
|
75
66
|
"types": "./dist/posthog/index.d.ts",
|
|
76
67
|
"default": "./dist/posthog/index.js"
|
|
@@ -119,10 +110,6 @@
|
|
|
119
110
|
"types": "./dist/runtime/index.d.ts",
|
|
120
111
|
"default": "./dist/runtime/index.js"
|
|
121
112
|
},
|
|
122
|
-
"./tanstack/query": {
|
|
123
|
-
"types": "./dist/tanstack/query.d.ts",
|
|
124
|
-
"default": "./dist/tanstack/query.js"
|
|
125
|
-
},
|
|
126
113
|
"./tanstack/middleware": {
|
|
127
114
|
"types": "./dist/tanstack/middleware.d.ts",
|
|
128
115
|
"default": "./dist/tanstack/middleware.js"
|
|
@@ -135,27 +122,17 @@
|
|
|
135
122
|
"types": "./dist/uploads/index.d.ts",
|
|
136
123
|
"default": "./dist/uploads/index.js"
|
|
137
124
|
},
|
|
138
|
-
"./
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"./config/typescript/browser": "./config/typescript/browser.json",
|
|
143
|
-
"./config/typescript/bundler": "./config/typescript/bundler.json",
|
|
144
|
-
"./config/typescript/library": "./config/typescript/library.json",
|
|
145
|
-
"./config/typescript/node-bundler": "./config/typescript/node-bundler.json",
|
|
146
|
-
"./config/typescript/tanstack": "./config/typescript/tanstack.json",
|
|
147
|
-
"./config/oxlint/domain": "./config/oxlint/domain.json",
|
|
148
|
-
"./config/oxlint/layers": "./config/oxlint/layers.json"
|
|
125
|
+
"./changesets": {
|
|
126
|
+
"types": "./dist/changesets/index.d.ts",
|
|
127
|
+
"default": "./dist/changesets/index.js"
|
|
128
|
+
}
|
|
149
129
|
},
|
|
150
130
|
"publishConfig": {
|
|
151
131
|
"access": "public"
|
|
152
132
|
},
|
|
153
133
|
"dependencies": {
|
|
154
134
|
"@changesets/parse": "1.0.0",
|
|
155
|
-
"@
|
|
156
|
-
"@inquirer/select": "^5.2.1",
|
|
157
|
-
"@manypkg/get-packages": "3.1.0",
|
|
158
|
-
"yaml": "^2.8.2"
|
|
135
|
+
"@manypkg/get-packages": "3.1.0"
|
|
159
136
|
},
|
|
160
137
|
"devDependencies": {
|
|
161
138
|
"@opentelemetry/api-logs": "^0.221.0",
|
|
@@ -163,7 +140,6 @@
|
|
|
163
140
|
"@opentelemetry/resources": "^2.10.0",
|
|
164
141
|
"@opentelemetry/sdk-logs": "^0.221.0",
|
|
165
142
|
"@posthog/react": "1.10.6",
|
|
166
|
-
"@tanstack/react-query": "^5.101.4",
|
|
167
143
|
"@tanstack/react-start": "^1.168.32",
|
|
168
144
|
"@types/better-sqlite3": "9.6.0",
|
|
169
145
|
"@types/node": "^26.2.0",
|
|
@@ -186,7 +162,9 @@
|
|
|
186
162
|
"tus-js-client": "^4.3.1",
|
|
187
163
|
"typescript": "^7.0.2",
|
|
188
164
|
"vite": "8.2.1",
|
|
189
|
-
"vitest": "^4.1.10"
|
|
165
|
+
"vitest": "^4.1.10",
|
|
166
|
+
"yaml": "^2.8.2",
|
|
167
|
+
"ras-stack-config": "1.0.0"
|
|
190
168
|
},
|
|
191
169
|
"peerDependencies": {
|
|
192
170
|
"@opentelemetry/api-logs": "^0.221.0",
|
|
@@ -194,7 +172,6 @@
|
|
|
194
172
|
"@opentelemetry/resources": "^2.10.0",
|
|
195
173
|
"@opentelemetry/sdk-logs": "^0.221.0",
|
|
196
174
|
"@posthog/react": ">=1.1 <2",
|
|
197
|
-
"@tanstack/react-query": ">=5.62.8 <6",
|
|
198
175
|
"@tanstack/react-start": ">=1.168.10 <2",
|
|
199
176
|
"better-sqlite3": ">=12 <14",
|
|
200
177
|
"centrifuge": ">=5 <6",
|
|
@@ -222,9 +199,6 @@
|
|
|
222
199
|
"@posthog/react": {
|
|
223
200
|
"optional": true
|
|
224
201
|
},
|
|
225
|
-
"@tanstack/react-query": {
|
|
226
|
-
"optional": true
|
|
227
|
-
},
|
|
228
202
|
"@tanstack/react-start": {
|
|
229
203
|
"optional": true
|
|
230
204
|
},
|
|
@@ -260,8 +234,7 @@
|
|
|
260
234
|
"node": ">=24 <25"
|
|
261
235
|
},
|
|
262
236
|
"scripts": {
|
|
263
|
-
"build": "rm -rf dist && tsc -p tsconfig.build.json
|
|
264
|
-
"config:check": "tsc -p test/config-consumer/tsconfig.json && tsc -p test/config-consumer/tsconfig-bundler.json && tsc -p test/config-consumer/tsconfig-node-bundler.json && tsc -p test/config-consumer/tsconfig-library.json && oxlint --config config/oxlint/application.json --print-config > /dev/null && oxlint --config config/oxlint/tanstack.json --print-config > /dev/null",
|
|
237
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
265
238
|
"typecheck": "tsc --noEmit",
|
|
266
239
|
"lint": "oxlint --type-aware --deny-warnings .",
|
|
267
240
|
"format": "oxfmt --write .",
|
|
@@ -270,6 +243,6 @@
|
|
|
270
243
|
"package:check": "node scripts/checkPackedPackage.mjs",
|
|
271
244
|
"peer:floor": "node scripts/checkPeerFloor.mjs",
|
|
272
245
|
"runtime:pin": "node scripts/checkRuntimePin.mjs",
|
|
273
|
-
"check": "pnpm format:check && pnpm lint && pnpm
|
|
246
|
+
"check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build && pnpm package:check"
|
|
274
247
|
}
|
|
275
248
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"overrides": [
|
|
3
|
-
{
|
|
4
|
-
"files": ["src/core/**", "src/geometry/**"],
|
|
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
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
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
|
-
}
|
package/config/oxlint.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|