mirror of
https://github.com/tabler/tabler.git
synced 2026-10-11 20:56:57 +04:00
Name the package scripts one way (#2937)
This commit is contained in:
1 parent
d2c127122b
commit
c52d971ca9
21 files changed
+83
-83
No files matched your search
@@ -27,7 +27,7 @@ A `shared/` change shows up in both preview and docs. Verify in the package the
|
||||
|
||||
## 2. Full dev vs. astro-only
|
||||
|
||||
Each package's `dev` script is `astro dev` plus its asset watchers (`concurrently`), and turbo runs `dev-prepare` first so `tmp-assets/` and `public/` exist:
|
||||
Each package's `dev` script is `astro dev` plus its asset watchers (`concurrently`), and turbo runs `dev:prepare` first so `tmp-assets/` and `public/` exist:
|
||||
|
||||
- **SCSS or `core/` touched → use the full `dev` script.** `astro dev` alone will not rebuild the stylesheets.
|
||||
- **Only `.astro` / `.mdx` / `shared/lib` touched → `astro dev --background` inside the package is enough** and faster, provided the assets have been built before. Manage it with `astro dev status`, `astro dev logs`, `astro dev stop`; the log file is `.astro/dev.log` in the package. Add `--force` to replace a server that is already running.
|
||||
@@ -55,17 +55,17 @@ Each package's `dev` script is `astro dev` plus its asset watchers (`concurrentl
|
||||
In order:
|
||||
|
||||
- **CSS did not change** — the SCSS watcher is not running. Restart with the full `dev` script rather than `astro dev`.
|
||||
- **Assets 404 after a restart** — `public/preview` (or `docs/public`) was wiped by a build or a `clean`. Run `pnpm --dir <pkg> run dev-prepare`, then start dev again.
|
||||
- **Assets 404 after a restart** — `public/preview` (or `docs/public`) was wiped by a build or a `clean`. Run `pnpm --dir <pkg> run dev:prepare`, then start dev again.
|
||||
- **A `public/` file changed but the browser did not reload** — Astro does not watch `public/`; the `copyAssets` integration reloads the listed dirs, everything else needs a manual refresh.
|
||||
- **`shared/` change not picked up** — the file is aliased, not watched through `node_modules`; confirm the import uses `@shared`/`@ui`, not a path into `node_modules`.
|
||||
- Still wrong: `pnpm --dir <pkg> run clean`, then `dev-prepare`, then `dev`.
|
||||
- Still wrong: `pnpm --dir <pkg> run clean`, then `dev:prepare`, then `dev`.
|
||||
|
||||
## 6. Gates before handing work back
|
||||
|
||||
Run at the repo root and read the **full** output — a tail hides TypeScript errors:
|
||||
|
||||
```bash
|
||||
pnpm run type-check && pnpm run format-prettier && pnpm run lint
|
||||
pnpm run type-check && pnpm run format:prettier && pnpm run lint
|
||||
```
|
||||
|
||||
`type-check` is `astro check` per package, so it covers `.astro` frontmatter and templates. For a markup refactor that should not change output at all, also run the `html-diff` skill.
|
||||
@@ -77,4 +77,4 @@ pnpm run type-check && pnpm run format-prettier && pnpm run lint
|
||||
- [ ] No build started while a dev server was running
|
||||
- [ ] Page opened, console clean, interaction exercised
|
||||
- [ ] Screenshot for visual changes
|
||||
- [ ] Repo-level `type-check` / `format-prettier` / `lint` clean, full output read
|
||||
- [ ] Repo-level `type-check` / `format:prettier` / `lint` clean, full output read
|
||||
@@ -119,4 +119,4 @@ An inline script that throws leaves the page looking fine but dead. Never hand o
|
||||
- [ ] Instance stored in a `window.tabler_*` registry keyed by id
|
||||
- [ ] Library present in `core/libs.json` and declared via `pageLibs` / `docs-libs`
|
||||
- [ ] Two instances on one page still work
|
||||
- [ ] Console clean in the browser; `pnpm run format-prettier` and `pnpm run type-check` clean
|
||||
- [ ] Console clean in the browser; `pnpm run format:prettier` and `pnpm run type-check` clean
|
||||
@@ -18,9 +18,9 @@ Astro only renders pages. Every stylesheet, script, font and image on a page arr
|
||||
|
||||
| Directory | Written by | Notes |
|
||||
| --- | --- | --- |
|
||||
| `core/dist/` | `@tabler/core` (`css-build`, `js-build`, `copy`) | the framework: css, js, fonts, img, vendored libs |
|
||||
| `core/dist/` | `@tabler/core` (`css:dev`, `js:build`, `copy`) | the framework: css, js, fonts, img, vendored libs |
|
||||
| `preview/tmp-assets/` | `preview` `assets` (`build-css.ts` + vite/terser) | demo css/js, isolated from Astro's output |
|
||||
| `docs/tmp-assets/css/` | `docs` `css` / `watch-css` (sass) | docs stylesheets |
|
||||
| `docs/tmp-assets/css/` | `docs` `css` / `watch:css` (build-css, `--no-prefix`) | docs stylesheets |
|
||||
| `<pkg>/public/` | **`copy-assets` only** | fully generated, wiped and rebuilt on every Astro start |
|
||||
| `<pkg>/dist/` | `astro build` | the shipped site |
|
||||
|
||||
@@ -35,11 +35,11 @@ An Astro integration, configured per package in `astro.config.mjs`:
|
||||
- In dev it watches `syncDirs` and copies changed files into `public/`, then sends one coalesced `full-reload` (250 ms window, `.map` files ride along with their source file). `reloadDirs` are directories a watcher already writes into directly — those only get the reload.
|
||||
- `allowDestinationFallback` keeps the existing copy when the source vanishes mid-copy — `@tabler/core` cleaning `dist/` while `turbo dev` starts the dependents.
|
||||
|
||||
**Rule for watchers:** because `public/` is wiped at startup, a watcher writing straight into it (preview's `watch-css` / `watch-js`) only works when `dev-prepare` has produced the same output into `tmp-assets` first, so the startup copy seeds it. The safer arrangement is docs': the watcher writes into `tmp-assets/css` and `copy-assets` syncs it to `public/css`. Prefer that for anything new.
|
||||
**Rule for watchers:** because `public/` is wiped at startup, a watcher writing straight into it (preview's `watch:css` / `watch:js`) only works when `dev:prepare` has produced the same output into `tmp-assets` first, so the startup copy seeds it. The safer arrangement is docs': the watcher writes into `tmp-assets/css` and `copy-assets` syncs it to `public/css`. Prefer that for anything new.
|
||||
|
||||
## 3. Ordering
|
||||
|
||||
`turbo.json` encodes the graph: `@tabler/core#dev-prepare` → `@tabler/preview#dev-prepare` → the `dev` tasks (docs depends on both). `dev-prepare` is what guarantees `core/dist` and `preview/tmp-assets` exist before a dependent package's `copy-assets` runs. If you add a package or an asset dependency, add the edge here too — inside a package, ordering comes from Astro's own lifecycle, not from a pre-script.
|
||||
`turbo.json` encodes the graph: `@tabler/core#dev:prepare` → `@tabler/preview#dev:prepare` → the `dev` tasks (docs depends on both). `dev:prepare` is what guarantees `core/dist` and `preview/tmp-assets` exist before a dependent package's `copy-assets` runs. If you add a package or an asset dependency, add the edge here too — inside a package, ordering comes from Astro's own lifecycle, not from a pre-script.
|
||||
|
||||
## 4. Traps already paid for
|
||||
|
||||
@@ -54,10 +54,10 @@ Do not undo these; each has a comment at the site:
|
||||
|
||||
Work down this list; each step is cheap:
|
||||
|
||||
1. **404 on `/dist/css/tabler.css` or `/preview/css/demo.css`** — the source was never built. `pnpm --dir core run dev-prepare`, then `pnpm --dir preview run dev-prepare`.
|
||||
1. **404 on `/dist/css/tabler.css` or `/preview/css/demo.css`** — the source was never built. `pnpm --dir core run dev:prepare`, then `pnpm --dir preview run dev:prepare`.
|
||||
2. **Assets vanished after restarting dev** — something wrote into `public/` that `copy-assets` does not know about; it was wiped at startup. Add it to the manifest, or write it into `tmp-assets` instead.
|
||||
3. **CSS/JS edits do not appear** — the watcher is not running (started `astro dev` alone instead of the package's `dev` script), or its output dir is not in `syncDirs`/`reloadDirs`.
|
||||
4. **Stale content that survives a rebuild** — `pnpm --dir <pkg> run clean`, then `dev-prepare`.
|
||||
4. **Stale content that survives a rebuild** — `pnpm --dir <pkg> run clean`, then `dev:prepare`.
|
||||
5. **`dist/` grows between identical builds** — an output dir is nested inside another copy step (see the first trap).
|
||||
6. **CI type-check fails on missing assets** — something made `copy-assets` run for the `sync` command; keep the early return.
|
||||
|
||||
|
||||
@@ -94,6 +94,6 @@ Prefer a small dependency-free implementation over pulling a package in: every k
|
||||
- [ ] Bootstrap-port changes stay close to upstream and come with a `js/tests/unit` spec
|
||||
- [ ] `js-docs-*` markers intact and self-contained
|
||||
- [ ] `pnpm --filter @tabler/core test` (js + scss) clean
|
||||
- [ ] `pnpm run type-check` and `pnpm run lint-prettier` clean
|
||||
- [ ] `pnpm run type-check` and `pnpm run lint:prettier` clean
|
||||
- [ ] `pnpm run bundlewatch` within budget, or the new limit justified in the PR
|
||||
- [ ] Docs page updated and changeset written
|
||||
@@ -99,14 +99,14 @@ Add a test when you write a mixin whose output is easy to break silently — the
|
||||
|
||||
```bash
|
||||
pnpm --filter @tabler/core lint:scss # stylelint (twbs config; prettier owns formatting)
|
||||
pnpm run lint-scss # + find-unused-sass-variables (`lint:scss:vars` in core)
|
||||
pnpm run generate-tokens:check # shared/lib/tokens.ts must match the Sass maps
|
||||
pnpm run lint-prettier # formatting
|
||||
pnpm run lint:scss # + find-unused-sass-variables (`lint:scss:vars` in core)
|
||||
pnpm run check:tokens # shared/lib/tokens.ts must match the Sass maps
|
||||
pnpm run lint:prettier # formatting
|
||||
pnpm run bundlewatch # size budgets (tabler.css 80 kB, tabler.min.css 75 kB)
|
||||
```
|
||||
|
||||
- A new entry in `$theme-colors`, `$avatar-sizes` and friends must be regenerated into `shared/lib/tokens.ts` with `pnpm run generate-tokens` — the check gate fails otherwise.
|
||||
- An unused Sass variable fails `lint-scss`; delete it or use it.
|
||||
- An unused Sass variable fails `lint:scss`; delete it or use it.
|
||||
- Growth past a bundlewatch limit is a decision, not an accident: raise the number in `core/package.json` deliberately and say so in the PR.
|
||||
|
||||
## 9. Checklist
|
||||
@@ -117,5 +117,5 @@ pnpm run bundlewatch # size budgets (tabler.css 80 kB, tab
|
||||
- [ ] Dark mode via `light-dark()` or all three dark selectors, behind `$enable-dark-mode`
|
||||
- [ ] Logical properties, or `--dir` + `/* rtl:ignore */`; no hand-written RTL
|
||||
- [ ] sass-true test for a mixin that can break silently
|
||||
- [ ] `lint-scss`, `generate-tokens:check`, `lint-prettier`, `test:scss` clean
|
||||
- [ ] `lint:scss`, `check:tokens`, `lint:prettier`, `test:scss` clean
|
||||
- [ ] Docs page and class table updated (`write-docs`, `class-reference`), changeset written
|
||||
@@ -56,7 +56,7 @@ Anything to the right of the title goes in the `page-header-actions` slot, as a
|
||||
```
|
||||
|
||||
- **Docs link:** `path` is the page's path under `docs/content/**` without the extension — `docs/content/ui/components/badge.mdx` → `/ui/components/badge`. Add one whenever a matching docs page exists.
|
||||
- **Check the path with `pnpm run check-docs-links`.** It resolves every `<DocsLink path="…">` against `docs/content/**` and fails on a typo, so you do not need a browser for this.
|
||||
- **Check the path with `pnpm run check:docs-links`.** It resolves every `<DocsLink path="…">` against `docs/content/**` and fails on a typo, so you do not need a browser for this.
|
||||
- If you do open the link, use `docs-dev.tabler.io`, which serves `dev`. `docs.tabler.io` serves the last release and still has the pre-content-collection urls, so a valid page can 404 there. A 404 on production alone is never a reason to change a path.
|
||||
- **Prebuilt action groups** (`HeaderActionsButtons`, `HeaderActionsPrint`, `HeaderActionsPhotos`, …) live in `shared/components/layout/` and go in the same slot: `<HeaderActionsButtons slot="page-header-actions" />`. There is no `actions="buttons"` prop any more.
|
||||
|
||||
@@ -113,10 +113,10 @@ A demo page should show exactly one `h1` and then `h2`s — no `h3` in the card
|
||||
## 9. Quality checklist
|
||||
|
||||
- [ ] `title` and `description` set; no `pageHeader` repeating the title
|
||||
- [ ] `DocsLink` present when a docs page exists; `pnpm run check-docs-links` passes
|
||||
- [ ] `DocsLink` present when a docs page exists; `pnpm run check:docs-links` passes
|
||||
- [ ] One card per variant; `CardTitle` + `CardSubtitle` on each
|
||||
- [ ] No raw `card-title` / `card-subtitle` / `page-title` markup
|
||||
- [ ] List wrappers instead of per-item margins
|
||||
- [ ] `pnpm run format-prettier` and `pnpm run type-check` clean (repo root, not a tail-filtered subset)
|
||||
- [ ] `pnpm run format:prettier` and `pnpm run type-check` clean (repo root, not a tail-filtered subset)
|
||||
- [ ] Page opened in the browser, console clean, heading order checked
|
||||
- [ ] Changeset written with the `generate-changeset` skill
|
||||
@@ -69,7 +69,7 @@ Update in the same pass: `shared/data/docs.json`, any `related:` front matter po
|
||||
## 4. Verify with the link gate
|
||||
|
||||
```bash
|
||||
pnpm run check-docs-links
|
||||
pnpm run check:docs-links
|
||||
```
|
||||
|
||||
It resolves, from source and without a build: markdown links and `related:` in `docs/content/**/*.mdx`, menu and link URLs in `shared/data/docs.json`, redirect destinations from `docs/astro.config.mjs`, `href` literals in docs components, `<DocsLink path="…">` and `getDocsUrl('…')` in the demo site, plus asset paths that really render. Anchors are checked against real heading slugs.
|
||||
@@ -82,5 +82,5 @@ It does **not** check `menu.json`: a wrong preview URL or a `pageMenu` key that
|
||||
- [ ] New docs page added to `docs.json` at the right depth, url absolute and extension-free
|
||||
- [ ] Renamed or removed docs URL has a 301 in `docs/astro.config.mjs`
|
||||
- [ ] `related:` entries and `<DocsLink path="…">` updated to the new path
|
||||
- [ ] `pnpm run check-docs-links` clean
|
||||
- [ ] `pnpm run check:docs-links` clean
|
||||
- [ ] Menu highlighting checked in the browser
|
||||
@@ -83,4 +83,4 @@ Every package extends `astro/tsconfigs/strictest`, so indexing an array yields `
|
||||
- [ ] Sibling `*.test.ts` covering the branches, not just the happy path
|
||||
- [ ] Deterministic: `pseudo-random.ts`, no `Math.random()`, no unseeded dates
|
||||
- [ ] JSON cast once in the lib module, `requireIndex` for trusted indexing
|
||||
- [ ] `pnpm --filter @tabler/shared test`, repo-level `type-check` and `format-prettier` clean
|
||||
- [ ] `pnpm --filter @tabler/shared test`, repo-level `type-check` and `format:prettier` clean
|
||||
@@ -141,5 +141,5 @@ A new component is not done until it is visible and documented:
|
||||
- [ ] `class: className` merged last, `...rest` forwarded
|
||||
- [ ] Accessible: semantic element, `ariaLabel` where the content is an icon
|
||||
- [ ] Logic in `shared/lib` with a test, not in the frontmatter
|
||||
- [ ] `pnpm run format-prettier` and `pnpm run type-check` clean at the repo root (full output, not a tail)
|
||||
- [ ] `pnpm run format:prettier` and `pnpm run type-check` clean at the repo root (full output, not a tail)
|
||||
- [ ] Demo page + docs page + changeset
|
||||
@@ -4,7 +4,7 @@
|
||||
// truth. Values are read through the real Sass compiler (after every merge and
|
||||
// !default), not by parsing the source text.
|
||||
// Run: pnpm run generate-tokens — (re)write the file
|
||||
// pnpm run generate-tokens:check — fail when the committed file is stale
|
||||
// pnpm run check:tokens — fail when the committed file is stale
|
||||
import { readFileSync, writeFileSync, existsSync } from 'node:fs'
|
||||
import { join, dirname, relative } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
run: pnpm exec playwright install --with-deps chromium
|
||||
|
||||
- name: Check rendered html
|
||||
run: pnpm run check-html preview/dist docs/dist --quiet
|
||||
run: pnpm run check:html preview/dist docs/dist --quiet
|
||||
|
||||
- name: Check markup classes
|
||||
run: pnpm run check-markup-classes --html preview/dist --html docs/dist --css preview/dist/dist/css --css preview/dist/dist/libs --css preview/dist/preview/css --css docs/dist/css --css docs/dist/preview/css
|
||||
run: pnpm run check:markup-classes --html preview/dist --html docs/dist --css preview/dist/dist/css --css preview/dist/dist/libs --css preview/dist/preview/css --css docs/dist/css --css docs/dist/preview/css
|
||||
+19
-19
@@ -5,32 +5,32 @@
|
||||
"homepage": "https://tabler.io",
|
||||
"scripts": {
|
||||
"dev": "pnpm run watch",
|
||||
"dev-prepare": "pnpm run clean && pnpm run copy && concurrently \"pnpm run css-build\" \"pnpm run js-build\"",
|
||||
"build": "pnpm run clean && pnpm run build-assets && pnpm run copy",
|
||||
"build-assets": "concurrently \"pnpm run css\" \"pnpm run js\"",
|
||||
"dev:prepare": "pnpm run clean && pnpm run copy && concurrently \"pnpm run css:dev\" \"pnpm run js:build\"",
|
||||
"build": "pnpm run clean && pnpm run build:assets && pnpm run copy",
|
||||
"build:assets": "concurrently \"pnpm run css\" \"pnpm run js\"",
|
||||
"clean": "shx rm -rf dist",
|
||||
"css": "tsx ../.build/build-css.ts scss dist/css --rtl --minify --banner",
|
||||
"css-build": "tsx ../.build/build-css.ts scss dist/css --rtl",
|
||||
"css:dev": "tsx ../.build/build-css.ts scss dist/css --rtl",
|
||||
"lint": "pnpm run lint:scss && pnpm run lint:scss:vars",
|
||||
"lint:scss": "stylelint \"scss/**/*.scss\" --config ../stylelint.config.mjs",
|
||||
"lint:scss:fix": "pnpm run lint:scss --fix",
|
||||
"lint:scss:vars": "find-unused-sass-variables scss/",
|
||||
"js": "pnpm run js-build && pnpm run js-build-min && pnpm run js-types",
|
||||
"js-types": "tsc -p tsconfig.types.json",
|
||||
"js-build": "concurrently \"pnpm run js-build-standalone\" \"pnpm run js-build-theme\"",
|
||||
"js-build-theme": "cross-env BASE_NAME=tabler-theme vite build --config .build/vite.config.mts",
|
||||
"js-build-standalone": "cross-env BASE_NAME=tabler vite build --config .build/vite.config.mts",
|
||||
"js-build-min": "concurrently \"pnpm run js-build-min-standalone\" \"pnpm run js-build-min-theme\"",
|
||||
"js-build-min-standalone": "concurrently \"terser dist/js/tabler.js --compress --mangle --source-map \\\"content=dist/js/tabler.js.map,filename=dist/js/tabler.min.js.map,url=tabler.min.js.map\\\" -o dist/js/tabler.min.js\" \"terser dist/js/tabler.esm.js --module --compress --mangle --source-map \\\"content=dist/js/tabler.esm.js.map,filename=dist/js/tabler.esm.min.js.map,url=tabler.esm.min.js.map\\\" -o dist/js/tabler.esm.min.js\"",
|
||||
"js-build-min-theme": "concurrently \"terser dist/js/tabler-theme.js --compress --mangle --source-map \\\"content=dist/js/tabler-theme.js.map,filename=dist/js/tabler-theme.min.js.map,url=tabler-theme.min.js.map\\\" -o dist/js/tabler-theme.min.js\" \"terser dist/js/tabler-theme.esm.js --module --compress --mangle --source-map \\\"content=dist/js/tabler-theme.esm.js.map,filename=dist/js/tabler-theme.esm.min.js.map,url=tabler-theme.esm.min.js.map\\\" -o dist/js/tabler-theme.esm.min.js\"",
|
||||
"copy": "concurrently \"pnpm run copy-img\" \"pnpm run copy-libs\" \"pnpm run copy-fonts\"",
|
||||
"copy-img": "shx mkdir -p dist/img && shx cp -rf img/* dist/img",
|
||||
"copy-libs": "tsx .build/copy-libs.ts",
|
||||
"copy-fonts": "shx mkdir -p dist/fonts && shx cp -rf fonts/* dist/fonts",
|
||||
"js": "pnpm run js:build && pnpm run js:min && pnpm run js:types",
|
||||
"js:types": "tsc -p tsconfig.types.json",
|
||||
"js:build": "concurrently \"pnpm run js:build:standalone\" \"pnpm run js:build:theme\"",
|
||||
"js:build:theme": "cross-env BASE_NAME=tabler-theme vite build --config .build/vite.config.mts",
|
||||
"js:build:standalone": "cross-env BASE_NAME=tabler vite build --config .build/vite.config.mts",
|
||||
"js:min": "concurrently \"pnpm run js:min:standalone\" \"pnpm run js:min:theme\"",
|
||||
"js:min:standalone": "concurrently \"terser dist/js/tabler.js --compress --mangle --source-map \\\"content=dist/js/tabler.js.map,filename=dist/js/tabler.min.js.map,url=tabler.min.js.map\\\" -o dist/js/tabler.min.js\" \"terser dist/js/tabler.esm.js --module --compress --mangle --source-map \\\"content=dist/js/tabler.esm.js.map,filename=dist/js/tabler.esm.min.js.map,url=tabler.esm.min.js.map\\\" -o dist/js/tabler.esm.min.js\"",
|
||||
"js:min:theme": "concurrently \"terser dist/js/tabler-theme.js --compress --mangle --source-map \\\"content=dist/js/tabler-theme.js.map,filename=dist/js/tabler-theme.min.js.map,url=tabler-theme.min.js.map\\\" -o dist/js/tabler-theme.min.js\" \"terser dist/js/tabler-theme.esm.js --module --compress --mangle --source-map \\\"content=dist/js/tabler-theme.esm.js.map,filename=dist/js/tabler-theme.esm.min.js.map,url=tabler-theme.esm.min.js.map\\\" -o dist/js/tabler-theme.esm.min.js\"",
|
||||
"copy": "concurrently \"pnpm run copy:img\" \"pnpm run copy:libs\" \"pnpm run copy:fonts\"",
|
||||
"copy:img": "shx mkdir -p dist/img && shx cp -rf img/* dist/img",
|
||||
"copy:libs": "tsx .build/copy-libs.ts",
|
||||
"copy:fonts": "shx mkdir -p dist/fonts && shx cp -rf fonts/* dist/fonts",
|
||||
"import-fonts": "tsx .build/import-fonts.ts",
|
||||
"watch": "concurrently \"pnpm run watch-css\" \"pnpm run watch-js\"",
|
||||
"watch-css": "nodemon --watch scss/ --ext scss --exec \"pnpm run css-build\"",
|
||||
"watch-js": "nodemon --watch js/ --ext ts,js --exec \"pnpm run js-build\"",
|
||||
"watch": "concurrently \"pnpm run watch:css\" \"pnpm run watch:js\"",
|
||||
"watch:css": "nodemon --watch scss/ --ext scss --exec \"pnpm run css:dev\"",
|
||||
"watch:js": "nodemon --watch js/ --ext ts,js --exec \"pnpm run js:build\"",
|
||||
"bundlewatch": "bundlewatch",
|
||||
"type-check": "tsc --noEmit",
|
||||
"test": "concurrently \"pnpm run test:js\" \"pnpm run test:scss\"",
|
||||
|
||||
+2
-2
@@ -41,6 +41,6 @@ Static output goes to `dist/` and, via the `@astrojs/vercel` adapter, to `.verce
|
||||
|
||||
```sh
|
||||
pnpm --dir docs run type-check
|
||||
pnpm run lint-md
|
||||
pnpm run check-docs-links # validates internal links at the source level (also part of `pnpm lint`)
|
||||
pnpm run lint:md
|
||||
pnpm run check:docs-links # validates internal links at the source level (also part of `pnpm lint`)
|
||||
```
|
||||
@@ -74,7 +74,7 @@ export default defineConfig({
|
||||
requiredFile: path('./assets/favicon.ico'),
|
||||
},
|
||||
{
|
||||
// docs css built by this package's `css` and `watch-css` scripts
|
||||
// docs css built by this package's `css` and `watch:css` scripts
|
||||
// (both write here). Source is tmp-assets/
|
||||
// (not public/) because copy-assets wipes public/ on every restart —
|
||||
// anything a watcher writes straight into public/ is lost there.
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@
|
||||
"node": ">=22.12.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "pnpm run css && concurrently -n astro,css -c blue,magenta \"astro dev\" \"pnpm run watch-css\"",
|
||||
"dev": "pnpm run css && concurrently -n astro,css -c blue,magenta \"astro dev\" \"pnpm run watch:css\"",
|
||||
"build": "pnpm run css && astro build",
|
||||
"css": "tsx ../.build/build-css.ts scss tmp-assets/css --minify --no-prefix",
|
||||
"watch-css": "nodemon --watch scss/ --ext scss --exec \"tsx ../.build/build-css.ts scss tmp-assets/css --no-prefix\"",
|
||||
"watch:css": "nodemon --watch scss/ --ext scss --exec \"tsx ../.build/build-css.ts scss tmp-assets/css --no-prefix\"",
|
||||
"preview": "astro preview",
|
||||
"clean": "shx rm -rf dist public .astro tmp-assets",
|
||||
"type-check": "astro check"
|
||||
|
||||
+15
-15
@@ -14,25 +14,25 @@
|
||||
"test:coverage": "turbo test:coverage",
|
||||
"version": "changeset version",
|
||||
"publish": "changeset publish",
|
||||
"reformat-md": "tsx .build/reformat-mdx.mts",
|
||||
"format:md": "tsx .build/reformat-mdx.mts",
|
||||
"html-diff": "tsx .build/html-diff.ts check",
|
||||
"html-diff:baseline": "tsx .build/html-diff.ts baseline",
|
||||
"generate-tokens": "tsx .build/generate-tokens.ts",
|
||||
"import-payments": "tsx .build/import-payments.ts",
|
||||
"generate-tokens:check": "tsx .build/generate-tokens.ts check",
|
||||
"check-docs-links": "tsx .build/check-docs-links.ts",
|
||||
"check-css-vars": "tsx .build/check-css-vars.ts",
|
||||
"check-html": "tsx .build/check-html.ts",
|
||||
"check-markup-classes": "tsx .build/check-markup-classes.ts",
|
||||
"lint": "pnpm run lint-md && pnpm run check-docs-links && pnpm run lint-prettier && pnpm run lint-scss && pnpm run check-css-vars && pnpm run generate-tokens:check",
|
||||
"lint:fix": "pnpm run lint-md-fix && pnpm run lint-scss-fix && pnpm run format-prettier",
|
||||
"lint-scss": "pnpm --filter @tabler/core lint",
|
||||
"lint-scss-fix": "pnpm --filter @tabler/core lint:scss:fix",
|
||||
"lint-md": "markdownlint --config .markdownlint-docs.json \"docs/content/**/*.mdx\"",
|
||||
"lint-md-fix": "markdownlint --fix --config .markdownlint-docs.json \"docs/content/**/*.mdx\"",
|
||||
"lint-prettier": "prettier --check \"core/scss/**/*.scss\" \"core/js/**/*.{js,ts}\" \"core/.build/**/*.{ts,mts,mjs}\" \".build/**/*.{ts,mts}\" \"screenshots/.build/**/*.ts\" \"preview/scss/**/*.scss\" \"docs/scss/**/*.scss\" \"preview/js/**/*.{js,ts}\" \"{preview,docs,screenshots,shared}/**/*.astro\" \"{preview,docs,screenshots}/**/*.{mjs,mts,ts}\" \"shared/**/*.{js,mjs,mts,ts}\" --cache",
|
||||
"format": "pnpm run format-prettier && pnpm run reformat-md",
|
||||
"format-prettier": "prettier --write \"core/scss/**/*.scss\" \"core/js/**/*.{js,ts}\" \"core/.build/**/*.{ts,mts,mjs}\" \".build/**/*.{ts,mts}\" \"screenshots/.build/**/*.ts\" \"preview/scss/**/*.scss\" \"docs/scss/**/*.scss\" \"preview/js/**/*.{js,ts}\" \"{preview,docs,screenshots,shared}/**/*.astro\" \"{preview,docs,screenshots}/**/*.{mjs,mts,ts}\" \"shared/**/*.{js,mjs,mts,ts}\" --cache",
|
||||
"check:tokens": "tsx .build/generate-tokens.ts check",
|
||||
"check:docs-links": "tsx .build/check-docs-links.ts",
|
||||
"check:css-vars": "tsx .build/check-css-vars.ts",
|
||||
"check:html": "tsx .build/check-html.ts",
|
||||
"check:markup-classes": "tsx .build/check-markup-classes.ts",
|
||||
"lint": "pnpm run lint:md && pnpm run check:docs-links && pnpm run lint:prettier && pnpm run lint:scss && pnpm run check:css-vars && pnpm run check:tokens",
|
||||
"lint:fix": "pnpm run lint:md:fix && pnpm run lint:scss:fix && pnpm run format:prettier",
|
||||
"lint:scss": "pnpm --filter @tabler/core lint",
|
||||
"lint:scss:fix": "pnpm --filter @tabler/core lint:scss:fix",
|
||||
"lint:md": "markdownlint --config .markdownlint-docs.json \"docs/content/**/*.mdx\"",
|
||||
"lint:md:fix": "markdownlint --fix --config .markdownlint-docs.json \"docs/content/**/*.mdx\"",
|
||||
"lint:prettier": "prettier --check \"core/scss/**/*.scss\" \"core/js/**/*.{js,ts}\" \"core/.build/**/*.{ts,mts,mjs}\" \".build/**/*.{ts,mts}\" \"screenshots/.build/**/*.ts\" \"preview/scss/**/*.scss\" \"docs/scss/**/*.scss\" \"preview/js/**/*.{js,ts}\" \"{preview,docs,screenshots,shared}/**/*.astro\" \"{preview,docs,screenshots}/**/*.{mjs,mts,ts}\" \"shared/**/*.{js,mjs,mts,ts}\" --cache",
|
||||
"format": "pnpm run format:prettier && pnpm run format:md",
|
||||
"format:prettier": "prettier --write \"core/scss/**/*.scss\" \"core/js/**/*.{js,ts}\" \"core/.build/**/*.{ts,mts,mjs}\" \".build/**/*.{ts,mts}\" \"screenshots/.build/**/*.ts\" \"preview/scss/**/*.scss\" \"docs/scss/**/*.scss\" \"preview/js/**/*.{js,ts}\" \"{preview,docs,screenshots,shared}/**/*.astro\" \"{preview,docs,screenshots}/**/*.{mjs,mts,ts}\" \"shared/**/*.{js,mjs,mts,ts}\" --cache",
|
||||
"check": "pnpm run lint && pnpm run type-check && pnpm run type-check:build",
|
||||
"zip-package": "tsx .build/zip-package.ts",
|
||||
"start": "pnpm dev"
|
||||
|
||||
@@ -15,7 +15,7 @@ const entry = path.resolve(__dirname, '../js/demo.ts')
|
||||
// leading-dot path segment (e.g. ".build/out/...") with a spurious "not a supported
|
||||
// option" error; a plain relative dir avoids that entirely.
|
||||
//
|
||||
// Watch mode (pnpm run watch-js, via PREVIEW_JS_OUT_DIR): writes straight to
|
||||
// Watch mode (pnpm run watch:js, via PREVIEW_JS_OUT_DIR): writes straight to
|
||||
// public/preview/js. `astro dev` never touches public/, so there's no dist/
|
||||
// collision to avoid there, and this lets edits show up on refresh without an
|
||||
// extra copy-assets.mjs pass.
|
||||
|
||||
@@ -137,7 +137,7 @@ export default defineConfig({
|
||||
{ from: path('../core/dist'), to: path('./public/dist') },
|
||||
{ from: path('../shared/static'), to: path('./public/static') },
|
||||
],
|
||||
// watch-css/watch-js write straight into public/preview — the file is already
|
||||
// watch:css/watch:js write straight into public/preview — the file is already
|
||||
// in place, but Astro does not reload the browser on public/ changes.
|
||||
reloadDirs: [path('./public/preview')],
|
||||
}),
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
"assets": "shx rm -rf tmp-assets && pnpm run css && pnpm run js",
|
||||
"css": "tsx ../.build/build-css.ts scss tmp-assets/css --minify",
|
||||
"js": "vite build --config .build/vite.config.mts && terser tmp-assets/js/demo.js --module --compress --mangle --source-map \"content=tmp-assets/js/demo.js.map,filename=tmp-assets/js/demo.min.js.map,url=demo.min.js.map\" -o tmp-assets/js/demo.min.js",
|
||||
"watch-css": "nodemon --watch scss/ --ext scss --exec \"tsx ../.build/build-css.ts scss public/preview/css\"",
|
||||
"watch-js": "cross-env PREVIEW_JS_OUT_DIR=public/preview/js vite build --watch --config .build/vite.config.mts",
|
||||
"watch": "concurrently \"pnpm run watch-css\" \"pnpm run watch-js\"",
|
||||
"dev": "concurrently -n astro,css,js -c blue,magenta,cyan \"astro dev\" \"pnpm run watch-css\" \"pnpm run watch-js\"",
|
||||
"dev-prepare": "pnpm run assets",
|
||||
"watch:css": "nodemon --watch scss/ --ext scss --exec \"tsx ../.build/build-css.ts scss public/preview/css\"",
|
||||
"watch:js": "cross-env PREVIEW_JS_OUT_DIR=public/preview/js vite build --watch --config .build/vite.config.mts",
|
||||
"watch": "concurrently \"pnpm run watch:css\" \"pnpm run watch:js\"",
|
||||
"dev": "concurrently -n astro,css,js -c blue,magenta,cyan \"astro dev\" \"pnpm run watch:css\" \"pnpm run watch:js\"",
|
||||
"dev:prepare": "pnpm run assets",
|
||||
"build": "pnpm run assets && astro build",
|
||||
"preview": "astro preview",
|
||||
"clean": "shx rm -rf dist public/dist public/preview public/css .astro tmp-assets",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// fails every file with "Unknown rule @stylistic/…".
|
||||
import stylistic from '@stylistic/stylelint-config'
|
||||
|
||||
// Prettier already owns SCSS formatting in this repo (`pnpm lint-prettier`), so every
|
||||
// Prettier already owns SCSS formatting in this repo (`pnpm lint:prettier`), so every
|
||||
// purely stylistic rule that stylelint-config-twbs-bootstrap pulls in through @stylistic
|
||||
// is switched off — otherwise the two tools fight over quotes, indentation and zeros.
|
||||
const prettierOwned = Object.fromEntries(Object.keys(stylistic.rules).map((rule) => [rule, null]))
|
||||
|
||||
+8
-8
@@ -63,40 +63,40 @@
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"@tabler/core#dev-prepare": {
|
||||
"@tabler/core#dev:prepare": {
|
||||
"cache": false
|
||||
},
|
||||
"@tabler/preview#dev-prepare": {
|
||||
"@tabler/preview#dev:prepare": {
|
||||
"dependsOn": [
|
||||
"@tabler/core#dev-prepare"
|
||||
"@tabler/core#dev:prepare"
|
||||
],
|
||||
"cache": false
|
||||
},
|
||||
"@tabler/core#dev": {
|
||||
"dependsOn": [
|
||||
"@tabler/core#dev-prepare"
|
||||
"@tabler/core#dev:prepare"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"@tabler/preview#dev": {
|
||||
"dependsOn": [
|
||||
"@tabler/preview#dev-prepare"
|
||||
"@tabler/preview#dev:prepare"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"@tabler/screenshots#dev": {
|
||||
"dependsOn": [
|
||||
"@tabler/core#dev-prepare"
|
||||
"@tabler/core#dev:prepare"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"@tabler/docs#dev": {
|
||||
"dependsOn": [
|
||||
"@tabler/core#dev-prepare",
|
||||
"@tabler/preview#dev-prepare"
|
||||
"@tabler/core#dev:prepare",
|
||||
"@tabler/preview#dev:prepare"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
|
||||
Reference in new issue
Block a user