Skip to content

Commit 6021b77

Browse files
committed
docs: productionize website for v1
1 parent ec7f451 commit 6021b77

42 files changed

Lines changed: 3416 additions & 616 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DOCSEARCH_APP_ID=
2+
DOCSEARCH_API_KEY=
3+
DOCSEARCH_INDEX_NAME=

.github/workflows/test-deploy.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: Test deployment
1+
name: Validate website
22

33
on:
44
pull_request:
55
branches:
66
- main
77

88
jobs:
9-
test-deploy:
10-
name: Test deployment
9+
quality:
10+
name: Typecheck, lint, and build
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -23,5 +23,37 @@ jobs:
2323
- name: Install dependencies
2424
run: npm ci
2525

26-
- name: Test build website
26+
- name: Typecheck
27+
run: npm run typecheck
28+
29+
- name: Lint docs
30+
run: npm run lint:docs
31+
32+
- name: Spellcheck
33+
run: npm run spellcheck
34+
35+
- name: Build website
2736
run: npm run build
37+
38+
smoke:
39+
name: Browser smoke and accessibility
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0
46+
47+
- uses: actions/setup-node@v4
48+
with:
49+
node-version: 20
50+
cache: npm
51+
52+
- name: Install dependencies
53+
run: npm ci
54+
55+
- name: Install Playwright browser
56+
run: npx playwright install --with-deps chromium
57+
58+
- name: Run smoke and accessibility checks
59+
run: npm run test:smoke

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@
1111
# Misc
1212
.DS_Store
1313
.env.local
14+
.env
1415
.env.development.local
1516
.env.test.local
1617
.env.production.local
1718

1819
npm-debug.log*
1920
yarn-debug.log*
2021
yarn-error.log*
22+
23+
# Test output
24+
/playwright-report
25+
/test-results

.markdownlint-cli2.jsonc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"config": {
3+
"default": true,
4+
"line-length": false,
5+
"first-line-heading": false,
6+
"no-inline-html": false
7+
},
8+
"ignores": [
9+
"node_modules/**",
10+
"build/**",
11+
".docusaurus/**",
12+
"playwright-report/**",
13+
"test-results/**"
14+
]
15+
}

README.md

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,66 @@
11
# Soundscript Website
22

3-
This repository uses Docusaurus for both the public marketing page and the developer docs.
3+
This repository hosts the public Soundscript website with a single Docusaurus stack:
4+
5+
- `/` for the marketing homepage
6+
- `/docs` for developer-facing documentation
7+
- future product surfaces like `/playground` as custom pages in the same site
48

59
## Local development
610

711
```bash
812
npm install
9-
npm start
13+
npm run dev
1014
```
1115

12-
## Build
16+
## Quality checks
1317

1418
```bash
19+
npm run typecheck
1520
npm run build
21+
npm run lint:docs
22+
npm run spellcheck
23+
npm run test:smoke
1624
```
1725

18-
## Typecheck
26+
`test:smoke` builds the site, serves the production output locally, and runs Playwright smoke plus
27+
accessibility checks.
28+
29+
## Search
30+
31+
The site is wired for Algolia DocSearch through environment variables:
1932

2033
```bash
21-
npm run typecheck
34+
cp .env.example .env.local
2235
```
2336

24-
## Structure
37+
Then set:
38+
39+
- `DOCSEARCH_APP_ID`
40+
- `DOCSEARCH_API_KEY`
41+
- `DOCSEARCH_INDEX_NAME`
42+
43+
If those variables are absent, the site still builds and runs, but the DocSearch UI is not shown.
44+
45+
## Docs ownership
46+
47+
The website repo owns:
48+
49+
- homepage content
50+
- onboarding and adoption docs
51+
- task-oriented guides
52+
53+
The Soundscript repo remains the canonical source for normative language and tooling references such
54+
as annotations, diagnostics, builtin contracts, machine numerics, and macro semantics. The website
55+
mirrors those references with a canonical-source note at the top of each relevant page.
56+
57+
## Versioning
58+
59+
Docs versioning is prepared in the site configuration, but the first frozen version should be cut
60+
only at the real v1 tag:
61+
62+
```bash
63+
npm run docs:version:v1
64+
```
2565

26-
- `/` is the marketing homepage
27-
- `/docs` is the developer documentation
28-
- future product surfaces like `/playground` can be added as custom Docusaurus pages
66+
Run that at the actual `1.0.0` release point, then rebuild and deploy the site.

cspell.config.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: '0.2'
2+
language: en
3+
dictionaries:
4+
- softwareTerms
5+
- html
6+
- css
7+
ignorePaths:
8+
- node_modules
9+
- build
10+
- .docusaurus
11+
words:
12+
- algolia
13+
- builtin
14+
- builtins
15+
- cspell
16+
- docsearch
17+
- inout
18+
- interop
19+
- macros
20+
- metaprogramming
21+
- newtype
22+
- newtypes
23+
- nullness
24+
- numerics
25+
- overclaimed
26+
- overclaiming
27+
- playwright
28+
- soundscript
29+
- soundness
30+
- stdlib
31+
- stdio
32+
- stringifying
33+
- subclassing
34+
- sublabel
35+
- sublist
36+
- thenables
37+
- tsconfig
38+
- typecheck
39+
- typeclasses
40+
- unlisted
41+
- userland
42+
- wasi
43+
- wordmark
44+
- valueclass
45+
- wasm

docs/concepts/runtime-and-builtins.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: Runtime and Builtins
33
description: How the v1 runtime story, JS target, and compiler-owned builtin modules fit together.
44
---
55

6+
Use this page when you want the runtime story that ties together JS output, builtin modules, and
7+
the conservative v1 deployment model.
8+
69
The stable v1 runtime story is deliberately conservative.
710

811
## The stable target story
@@ -96,3 +99,9 @@ an ecosystem fork.
9699
Macro-related builtin surfaces such as `sts:macros` are part of the supported language surface, but
97100
they still belong later in the docs. They are advanced capabilities, not the default on-ramp for a
98101
regular TypeScript team.
102+
103+
## See also
104+
105+
- [Tooling and JS Target](../guides/tooling-and-js-target.md)
106+
- [Builtin Modules](../reference/builtin-modules.md)
107+
- [Stable v1 Support Matrix](../reference/stable-v1-support-matrix.md)

docs/concepts/soundness-model.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: Soundness Model
33
description: What Soundscript is actually claiming, and what it is intentionally not claiming.
44
---
55

6+
Use this page when you need the conceptual contract behind the language rules, not just a list of
7+
forbidden constructs.
8+
69
Soundscript is not trying to prove “all of TypeScript is sound.”
710

811
It creates a smaller, explicit contract for `.sts` modules inside the existing JS/TS ecosystem.
@@ -105,3 +108,9 @@ The main practical change is not “more theory.” It is better local reasoning
105108
- a reviewer can see where trust enters the module
106109
- a maintainer can tell whether an assumption was checked or only asserted
107110
- a boundary-heavy module can become meaningfully safer without converting the entire repo
111+
112+
## See also
113+
114+
- [Soundscript vs TypeScript](../getting-started/soundscript-vs-typescript.md)
115+
- [Interop Boundaries](../guides/interop-boundaries.md)
116+
- [Banned and Restricted Surface](../reference/banned-and-restricted.md)
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: Adopt in Existing TypeScript Apps
3+
slug: /getting-started/adopt-in-existing-typescript-apps
4+
description: The practical migration path for teams adopting Soundscript inside a working TypeScript application.
5+
---
6+
7+
Use this page when you are planning a real rollout in an existing TypeScript codebase. The point is
8+
not to “convert the repo.” The point is to start where stronger guarantees pay for themselves and
9+
expand only when the new boundary is earning its keep.
10+
11+
## Start with modules that already act like trust boundaries
12+
13+
Good first targets are usually:
14+
15+
- request and queue handlers
16+
- decoders, parsers, and validation layers
17+
- auth and permission checks
18+
- package entrypoints or app service boundaries
19+
- code that already wraps risky legacy or third-party behavior
20+
21+
Avoid broad utility folders or heavily shared framework glue as your first migration target.
22+
23+
## A practical first week
24+
25+
1. Install `soundscript` locally and run `soundscript init --mode existing`.
26+
2. Pick one boundary-heavy module and rename it to `.sts`.
27+
3. Mark every ordinary `.ts`, `.js`, or declaration-only import with `// #[interop]`.
28+
4. Remove unchecked escapes like `any`, `as`, and non-null assertions.
29+
5. Normalize foreign throws and make local conditions explicit.
30+
6. Add `soundscript check` to package scripts and CI.
31+
32+
That is enough to learn the model without turning the adoption into a rewrite project.
33+
34+
## Example migration boundary
35+
36+
```ts title="src/payments/charge.sts"
37+
// #[interop]
38+
import {chargeCard} from '../legacy/payments.ts';
39+
import {normalizeThrown} from 'sts:failures';
40+
41+
export async function runCharge(request: ChargeRequest): Promise<ChargeReceipt> {
42+
try {
43+
const receipt = await chargeCard(request);
44+
if (receipt.status !== 'ok') {
45+
throw new Error('Charge failed.');
46+
}
47+
return receipt;
48+
} catch (error) {
49+
throw normalizeThrown(error);
50+
}
51+
}
52+
```
53+
54+
This is a good first migration because:
55+
56+
- the boundary to legacy code is obvious
57+
- the failure path matters
58+
- the module already sits on an application seam
59+
60+
## What usually changes first
61+
62+
The first `.sts` modules rarely need advanced features. Most early fixes are just:
63+
64+
- explicit `undefined` and `null` checks
65+
- replacing assertion-based typing with validation or narrowing
66+
- local `Error` discipline
67+
- visible interop boundaries
68+
69+
That is exactly what you want. It means the adoption is paying off before you reach for machine
70+
numerics, macros, or advanced variance work.
71+
72+
## What not to migrate first
73+
74+
Defer these until the team is comfortable with the basics:
75+
76+
- dense UI glue code
77+
- broad helper libraries with unclear ownership
78+
- reflection-heavy adapters
79+
- low-value leaf utilities with little boundary risk
80+
- framework internals where the team is still experimenting with architecture
81+
82+
## Signs a module is a bad first target
83+
84+
It is probably not a good first migration if:
85+
86+
- most of the file is framework ceremony
87+
- the file is shared everywhere but trusted nowhere
88+
- it relies on metaprogramming or very loose ambient assumptions
89+
- the team cannot yet explain what the runtime boundary actually is
90+
91+
## When this page matters
92+
93+
Use this guide when you need to:
94+
95+
- choose the first `.sts` modules
96+
- explain the rollout strategy to the team
97+
- decide what belongs in the first CI gate
98+
- keep the adoption scoped and realistic
99+
100+
## See also
101+
102+
- [Quick Start](./quick-start.md)
103+
- [Soundscript vs TypeScript](./soundscript-vs-typescript.md)
104+
- [Interop Boundaries](../guides/interop-boundaries.md)

docs/getting-started/adoption-faq.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: Adoption FAQ
33
description: Common first-pass questions from TypeScript teams evaluating Soundscript.
44
---
55

6+
Use this page when you want short answers to the questions that come up in the first evaluation
7+
conversation.
8+
69
## Is Soundscript a different language from TypeScript?
710

811
It is a different **checked contract**, not a different parser language.
@@ -109,3 +112,9 @@ It does **not** claim:
109112

110113
The main claim is narrower and more useful: checked code should stay closer to what the runtime
111114
actually guarantees, and trust boundaries should be explicit.
115+
116+
## See also
117+
118+
- [Quick Start](./quick-start.md)
119+
- [Soundscript vs TypeScript](./soundscript-vs-typescript.md)
120+
- [Adopt in Existing TypeScript Apps](./adopt-in-existing-typescript-apps.md)

0 commit comments

Comments
 (0)