ras-stack 0.7.0 → 0.8.1
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 +24 -3
- package/config/oxlint/application.json +16 -0
- package/config/oxlint/tanstack.json +4 -0
- package/config/typescript/base.json +10 -0
- package/config/typescript/browser.json +2 -9
- package/config/typescript/bundler.json +9 -0
- package/config/typescript/library.json +2 -4
- package/config/typescript/node-bundler.json +9 -0
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -93,15 +93,14 @@ Only enable `trustForwardedHeaders` behind a proxy that replaces incoming forwar
|
|
|
93
93
|
Applications choose their channel names, authorize subscriptions, and define payloads. `ras-stack` handles Centrifugo's HTTP publication, signed tokens, and repeated browser lifecycle mechanics:
|
|
94
94
|
|
|
95
95
|
```ts
|
|
96
|
+
import { CentrifugoPublisher, signRealtimeToken } from 'ras-stack/realtime'
|
|
96
97
|
import {
|
|
97
|
-
CentrifugoPublisher,
|
|
98
98
|
connectRealtimeClient,
|
|
99
99
|
createSameOriginRealtimeClient,
|
|
100
100
|
openRealtimeSubscription,
|
|
101
101
|
requestRealtimeTicket,
|
|
102
|
-
signRealtimeToken,
|
|
103
102
|
watchSubscriptionPresence,
|
|
104
|
-
} from 'ras-stack/realtime'
|
|
103
|
+
} from 'ras-stack/realtime/client'
|
|
105
104
|
|
|
106
105
|
const publisher = new CentrifugoPublisher({
|
|
107
106
|
apiUrl,
|
|
@@ -182,6 +181,28 @@ Extend the supplied configuration and override anything specific to the applicat
|
|
|
182
181
|
|
|
183
182
|
TypeScript bases are also available at `ras-stack/config/typescript/browser` and `ras-stack/config/typescript/library`.
|
|
184
183
|
|
|
184
|
+
The TypeScript configs compose by runtime role:
|
|
185
|
+
|
|
186
|
+
- `base` contains runtime-neutral strictness and module-safety options.
|
|
187
|
+
- `bundler` adds ESM bundler resolution without assuming DOM or Node globals.
|
|
188
|
+
- `browser` adds DOM, JSX, and no-emit defaults.
|
|
189
|
+
- `tanstack` adds Vite and Node types to the browser role.
|
|
190
|
+
- `node-bundler` targets bundled Node 24 workers and scripts.
|
|
191
|
+
- `library` uses NodeNext resolution and declaration-friendly strictness.
|
|
192
|
+
|
|
193
|
+
Oxlint applications can extend the strict default plus independent layers for shared application preferences and generated TanStack files:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"extends": ["./node_modules/ras-stack/config/oxlint/application.json", "./node_modules/ras-stack/config/oxlint/tanstack.json"],
|
|
198
|
+
"rules": {
|
|
199
|
+
"application-specific-rule": "off"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
These configs do not set include paths, aliases, generated directories outside TanStack's route tree, or framework-specific worker globals. Keep those differences in the consuming repository.
|
|
205
|
+
|
|
185
206
|
## Repository policy
|
|
186
207
|
|
|
187
208
|
Policy files which cannot inherit can stay committed while being checked against the shared source. Select only the policies a repository wants in `ras-stack.policy.json`:
|
|
@@ -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
|
+
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "./bundler.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"noUncheckedIndexedAccess": true,
|
|
5
|
-
"esModuleInterop": true,
|
|
6
4
|
"jsx": "react-jsx",
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"moduleResolution": "Bundler",
|
|
9
|
-
"target": "ES2023",
|
|
10
5
|
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
11
|
-
"
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"verbatimModuleSyntax": true
|
|
6
|
+
"noEmit": true
|
|
14
7
|
}
|
|
15
8
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "./base.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"noUncheckedIndexedAccess": true,
|
|
5
4
|
"exactOptionalPropertyTypes": true,
|
|
6
5
|
"module": "NodeNext",
|
|
7
6
|
"moduleResolution": "NodeNext",
|
|
8
7
|
"target": "ES2024",
|
|
9
8
|
"lib": ["ES2024", "DOM", "DOM.Iterable"],
|
|
10
|
-
"skipLibCheck": true
|
|
11
|
-
"verbatimModuleSyntax": true
|
|
9
|
+
"skipLibCheck": true
|
|
12
10
|
}
|
|
13
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ras-stack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Composable full-stack primitives shared across Richard Solomou's applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"types": "./dist/realtime/index.d.ts",
|
|
43
43
|
"default": "./dist/realtime/index.js"
|
|
44
44
|
},
|
|
45
|
+
"./realtime/client": {
|
|
46
|
+
"types": "./dist/realtime/client.d.ts",
|
|
47
|
+
"default": "./dist/realtime/client.js"
|
|
48
|
+
},
|
|
45
49
|
"./server": {
|
|
46
50
|
"types": "./dist/server/index.d.ts",
|
|
47
51
|
"default": "./dist/server/index.js"
|
|
@@ -59,8 +63,13 @@
|
|
|
59
63
|
"default": "./dist/uploads/index.js"
|
|
60
64
|
},
|
|
61
65
|
"./config/oxlint": "./config/oxlint.json",
|
|
66
|
+
"./config/oxlint/application": "./config/oxlint/application.json",
|
|
67
|
+
"./config/oxlint/tanstack": "./config/oxlint/tanstack.json",
|
|
68
|
+
"./config/typescript/base": "./config/typescript/base.json",
|
|
62
69
|
"./config/typescript/browser": "./config/typescript/browser.json",
|
|
70
|
+
"./config/typescript/bundler": "./config/typescript/bundler.json",
|
|
63
71
|
"./config/typescript/library": "./config/typescript/library.json",
|
|
72
|
+
"./config/typescript/node-bundler": "./config/typescript/node-bundler.json",
|
|
64
73
|
"./config/typescript/tanstack": "./config/typescript/tanstack.json"
|
|
65
74
|
},
|
|
66
75
|
"publishConfig": {
|
|
@@ -68,7 +77,7 @@
|
|
|
68
77
|
},
|
|
69
78
|
"scripts": {
|
|
70
79
|
"build": "tsc -p tsconfig.build.json",
|
|
71
|
-
"config:check": "tsc -p test/config-consumer/tsconfig.json",
|
|
80
|
+
"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",
|
|
72
81
|
"typecheck": "tsc --noEmit",
|
|
73
82
|
"lint": "oxlint --type-aware --deny-warnings .",
|
|
74
83
|
"format": "oxfmt --write .",
|