Add versioning and harden deploy caching (v0.2.0)
Versioning: - package.json is the single source of the version (0.2.0); the build injects it into the landing page and Storybook via src/version.ts - Add CHANGELOG.md and a release section in the README Deploy: - Refuse to deploy uncommitted work unless --allow-dirty is passed - Stamp each deploy with version.json and verify the live stamp - Serve HTML and JSON with Cache-Control: no-cache and cache only the content-hashed assets/ folders long-term - Return 404 for missing assets instead of index.html, which blanked the Storybook canvas for browsers holding a stale page - Always restore the hardened .htaccess, even when a step fails - Make the post-deploy PHP-off check real, build Storybook before checking for its index, and stop logging the session token
This commit is contained in:
1 parent
9d406d6d2a
commit
dc5e6ff800
10 files changed
+224
-52
No files matched your search
@@ -19,7 +19,7 @@ Every part ships with:
|
||||
- **Its states.** Error, disabled, loading and required are part of the component, and each has its own story.
|
||||
- **Tokens, not hex codes.** Colours come from a 50–900 palette ramp, so switching the palette re-themes every part without a code change.
|
||||
|
||||
> **Status:** pre-release (v0.2). Tansy UI is not published to npm yet. It is developed in this repository, with a landing page and a Storybook workshop as its showcase.
|
||||
> **Status:** pre-release (v0.2.0). Tansy UI is not published to npm yet. It is developed in this repository, with a landing page and a Storybook workshop as its showcase.
|
||||
|
||||
## Components
|
||||
|
||||
@@ -95,6 +95,23 @@ npm run build-storybook # workshop -> storybook-static/
|
||||
3. Read colours from the palette ramps (`bg-primary-500`) so the palette switcher reaches it.
|
||||
4. Run `npm run build-storybook && python3 scripts/gen_catalogue.py --patch` to refresh the landing page catalogue.
|
||||
|
||||
## Versioning
|
||||
|
||||
Tansy UI follows [Semantic Versioning](https://semver.org). While the version is `0.x`, a minor release may include breaking changes.
|
||||
|
||||
- `package.json` holds the version. The build injects it into the landing page and Storybook through `src/version.ts`, so it is never typed by hand.
|
||||
- Every release gets an entry in [`CHANGELOG.md`](CHANGELOG.md) and an annotated git tag such as `v0.2.0`.
|
||||
- Every deploy publishes `/version.json`, which records the version and commit that are live.
|
||||
|
||||
To cut a release:
|
||||
|
||||
```bash
|
||||
# 1. Move the [Unreleased] notes in CHANGELOG.md under the new version, then:
|
||||
npm version minor -m "Release v%s" # or patch / major; bumps package.json, commits and tags
|
||||
git push origin main --follow-tags
|
||||
python3 scripts/deploy.py # builds that commit and deploys it
|
||||
```
|
||||
|
||||
## Project structure
|
||||
|
||||
```text
|
||||
@@ -103,6 +120,7 @@ src/
|
||||
├── components/ # Components, their tokens and their stories
|
||||
├── data/catalogue.ts # Landing page catalogue (regenerated by scripts/gen_catalogue.py)
|
||||
├── theme/ # Palettes and applyPalette()
|
||||
├── version.ts # VERSION, injected from package.json
|
||||
├── Welcome.mdx # Storybook welcome page
|
||||
├── App.tsx # Landing page, built only from Tansy components
|
||||
└── index.css # Tailwind entry, palette tokens, landing styles
|
||||
|
||||
Reference in new issue
Block a user