@tonalisk-labs/kit 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +7 -80
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,92 +1,19 @@
1
1
  # kit
2
2
 
3
- The shared base of the [tonalisk-labs](https://github.com/tonalisk-labs) sites. It's opinionated
4
- and built for those repos, but it's MIT-licensed and versioned with semver, so anyone can use it.
5
-
6
- | Entry | What it gives |
7
- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
8
- | `@tonalisk-labs/kit/testing` | A Playwright harness and its config: a Docker stack per run, accessibility, SEO and layout checks, budgets, visual baselines |
9
- | `@tonalisk-labs/kit/astro` | For an `astro.config`: the site's font, its colour themes, Starlight's CSP and scrollable tables, the sitemap's dates |
10
- | `@tonalisk-labs/kit/theme` | For pages and scripts: the UI classes, the colour themes and their menu, JSON-LD and Starlight's head |
11
- | `@tonalisk-labs/kit/theme.css` | The Tailwind base, with `starlight.css` and `themes/<id>.css` beside it |
12
- | `@tonalisk-labs/kit/script` | For a repo's scripts: how one stops on SIGINT or SIGTERM, steps in turn or in a pool, JSON read without casts |
13
- | `@tonalisk-labs/kit/components/*.astro` | `Search`, `ThemeSelect`, `StarlightHead` and `BodyFont` |
14
- | `@tonalisk-labs/kit/tsconfig.json` | The TypeScript settings. The oxlint, oxfmt, ruff, SwiftLint and Vale settings are in `rules/` |
15
- | `kit-lint-styles`, `kit-seo` | The style lint and the SEO check over the repo's sites |
16
- | `kit-test`, `kit-test-rust` | `node --test` and `cargo llvm-cov`, each held to its coverage floors |
17
- | crate `kit-server` | For Rust backends: typed configuration, a Stripe client, rate limits, problem details, the stop signal, the OpenAPI export |
18
- | `uvx copier copy gh:tonalisk-labs/kit` | A new repo set up the same way. A private one gets gitleaks and its own hooks in place of a licence, releases and CI |
19
-
20
- ## Use
3
+ The shared base of the [tonalisk-labs](https://github.com/tonalisk-labs) sites. It's built for
4
+ those repos, but it's MIT-licensed and follows semver, so anyone can use it.
21
5
 
22
6
  ```sh
23
7
  npm i -D @tonalisk-labs/kit
24
8
  ```
25
9
 
10
+ Most repos start with two things. Their `tsconfig.json` extends `@tonalisk-labs/kit/tsconfig.json`,
11
+ and their Playwright config runs every test across browsers, screens and networks:
12
+
26
13
  ```ts
27
- // playwright.config.ts: each site and app in the repo, on every row of the device matrix
28
14
  import { defineTests } from '@tonalisk-labs/kit/testing';
29
-
30
15
  export default defineTests();
31
16
  ```
32
17
 
33
- ```jsonc
34
- // tsconfig.json
35
- { "extends": "@tonalisk-labs/kit/tsconfig.json" }
36
- ```
37
-
38
- ```toml
39
- # Cargo.toml
40
- kit-server = { git = "https://github.com/tonalisk-labs/kit", tag = "v1.0.0" }
41
- ```
42
-
43
- ```yaml
44
- # .github/workflows/ci.yml
45
- jobs:
46
- checks:
47
- uses: tonalisk-labs/kit/.github/workflows/checks.yml@v1.0.0
48
- ```
49
-
50
- Renovate keeps all three on the same version through the preset `github>tonalisk-labs/kit`.
51
-
52
- ## Develop
53
-
54
- ```sh
55
- mise install && npm ci
56
- mise run check
57
- ```
58
-
59
- To try a change in a site before releasing it, run `npm run build` here, then
60
- `npm install --no-save ../kit` in the site.
61
-
62
- ## Workflows
63
-
64
- kit is public, so its Actions minutes are free. Every action is pinned to a commit.
65
-
66
- | Workflow | Runs on | What it does |
67
- | ------------- | -------------------------------------------- | --------------------------------------------------------------- |
68
- | `ci.yml` | each pull request | `mise run check` and the title. On the release PR, `downstream` |
69
- | `publish.yml` | each push to `main` | `release.yml` with npm |
70
- | `checks.yml` | called by the public sites' CI | `mise run check` and the title |
71
- | `e2e.yml` | called by the public sites' CI | the journeys, and at release the screens on arm64 |
72
- | `release.yml` | called by `publish.yml` and the public sites | release-please, then the release, attested |
73
-
74
- A release builds with a read token only. The files are attested and attached in a job that runs
75
- nothing from the repo, and npm takes the package in another, through
76
- [trusted publishing](https://docs.npmjs.com/trusted-publishers), with no npm token. The
77
- package's provenance names the run that published it.
78
-
79
- To set npm up once:
80
-
81
- 1. Publish a first version by hand, since npm attaches a trusted publisher only to a package that
82
- exists.
83
- 2. In the package's settings on npmjs.com, add GitHub Actions as its trusted publisher:
84
- `tonalisk-labs/kit`, workflow `publish.yml`, environment `npm`.
85
- 3. Under publishing access, require two-factor authentication and disallow tokens.
86
-
87
- A private repo runs its checks locally, where `mise run downstream` also checks this build in
88
- each site checked out beside kit.
89
-
90
- ## Licence
91
-
92
- [MIT](LICENSE)
18
+ The rest (Astro and the theme, the Rust crate `kit-server`, the CI workflows and the repo
19
+ template) is in [the docs](docs/README.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonalisk-labs/kit",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "The shared base of the tonalisk-labs sites: the E2E harness, the theme, and the rules every repo extends.",
5
5
  "keywords": [
6
6
  "astro",