rainbowindex 0.2.2 → 0.4.0

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/CHANGELOG.md CHANGED
@@ -5,6 +5,76 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.0] - 2026-08-20
9
+
10
+ ### Added
11
+
12
+ - **GitHub Packages publishing** — every release is now also published to
13
+ GitHub Packages as `@rainbowindex/rainbowindex` (that registry requires an
14
+ owner-scoped name). The README documents installing it under the usual
15
+ name via `pnpm add rainbowindex@npm:@rainbowindex/rainbowindex`, so all
16
+ documented imports and CLI invocations work unchanged.
17
+
18
+ ### Changed
19
+
20
+ - **Stricter CLI argument validation** — the CLI is now driven by a
21
+ declarative command table that knows which flags and positionals each
22
+ command accepts. Flags used under the wrong command, stray positional
23
+ arguments, and flags missing their value are rejected with an error
24
+ instead of being silently ignored.
25
+ - **Internal restructuring** (behavior-preserving, net ≈ −4,500 lines) —
26
+ the merge, scanner, and effects modules were split into focused modules;
27
+ the spacing/border prefix→property maps are now single-sourced from the
28
+ merge conflict table with a machine-checked parity test; `@apply` reuses
29
+ the engine's cascade ordering; the CLI and PostCSS builds share one
30
+ orchestration path with parallelized font fetches; and all internal
31
+ import cycles were broken. Public entry points are unchanged.
32
+
33
+ ### Fixed
34
+
35
+ - **`ri()` stroke-width vs stroke-color conflict** — width-shaped `stroke-*`
36
+ classes (`stroke-2`, `stroke-1.5`, `stroke-[3px]`) were claiming the
37
+ `stroke` color property in the merge conflict table, so
38
+ `ri("stroke-2 stroke-red-500")` dropped `stroke-2` even though the two
39
+ classes set different CSS properties. The `stroke` prefix is now
40
+ width-vs-color dual-mode (mirroring `border`/`outline`): decimal and
41
+ non-color arbitrary values claim `stroke-width`, color values claim
42
+ `stroke`. Same-property conflicts (`stroke-2` vs `stroke-4`,
43
+ `stroke-red-500` vs `stroke-blue-500`) still merge as before.
44
+ - **Watch mode double rebuild** — debouncing and rate-limiting now share a
45
+ single timer, so a burst of file changes landing inside the rate-limit
46
+ window schedules one rebuild instead of a redundant second one.
47
+ - **`@color` entries without a colon** — a colon-less fragment in an
48
+ `@color` block now produces a warning and is skipped on its own; it no
49
+ longer swallowed the entry that followed it.
50
+
51
+ ## [0.3.0] - 2026-08-14
52
+
53
+ ### Added — editor tooling API (phase 2)
54
+
55
+ - **`ClassCandidate.callId`** — helper/safelist candidates now carry the
56
+ identity of the call they were collected from: candidates from the same
57
+ call share one id, distinct calls get distinct ids. This is the grouping
58
+ key merge tooling needs to run `analyzeMerge()` over one `ri(…)` call's
59
+ classes without mixing neighbouring calls. Feature-detect via the new
60
+ `"candidate-call-ids"` entry in `editorCapabilities`.
61
+ - **`ri()` joins the scanned class helpers** — the scanner now walks `ri(…)`
62
+ calls like `clsx`/`cn`/`twMerge`, so their arguments get `helper` origin,
63
+ a helper name, and a call id (previously they were only caught by the
64
+ whole-file literal scan as `plain` candidates). `CLASS_HELPER_NAMES`
65
+ includes `"ri"` accordingly.
66
+ - **Value typos get suggestions** — the class inspector's suggestion corpus
67
+ now includes the enumerated completion universe, so `validate()` suggests
68
+ concrete neighbours for functional-value typos (`bg-blu-500` →
69
+ `bg-blue-500`, `bg-thme-500` → `bg-theme-500`) instead of staying silent.
70
+
71
+ ### Fixed
72
+
73
+ - **`--optimize` CLI flag** — the README documented `--optimize` but the CLI
74
+ rejected it with "Unknown option". It is now accepted as an alias of
75
+ `--minify` (both run the same LightningCSS minification +
76
+ browser-fallback pass).
77
+
8
78
  ## [0.2.2] - 2026-08-13
9
79
 
10
80
  ### Added — editor tooling API (phase 1)
@@ -132,20 +202,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
132
202
  imports rather than relying on tree-shaking. The barrel re-exports the
133
203
  model, so existing importers are unaffected.
134
204
 
135
- ### Fixed
136
-
137
- - **Dep-advertised `safelistSources` were silently dropped in standard
138
- install layouts** — auto-discovered safelist patterns resolve to absolute
139
- paths inside the consumer's `node_modules`, but were globbed in the pass
140
- that carries the default `node_modules/**` exclude, so they matched
141
- nothing whenever the dep's real path sat inside the project root — i.e.
142
- every plain npm/yarn/pnpm install. They now go through the same relaxed
143
- second glob pass as explicit `@source "node_modules/…"` patterns, which
144
- drops only that one exclude. (Tests previously passed on macOS only
145
- because the symlinked tmpdir placed fixture deps outside the literal cwd,
146
- dodging the cwd-relative exclude; fixtures now realpath the tmp root so
147
- every platform exercises the real geometry.)
148
-
149
205
  ## [0.2.1] - 2026-07-28
150
206
 
151
207
  ### Added — diagnostics
package/LICENSE CHANGED
@@ -19,4 +19,4 @@ Software.
19
19
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20
20
  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21
21
  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -28,6 +28,28 @@ pnpm add rainbowindex
28
28
 
29
29
  Requires Node `>=20.19`. The package is **ESM-only** — there is no CommonJS build, so `require("rainbowindex")` is only supported on runtimes that can `require()` ES modules (Node 20.19+); use `import` otherwise (e.g. an ESM `postcss.config.js`/`.mjs`). `postcss` is a required peer dependency, `vite` an optional one; `lightningcss`, `chokidar`, and `tinyglobby` are bundled as direct deps.
30
30
 
31
+ ### From GitHub Packages
32
+
33
+ Every release is also published to [GitHub Packages](https://github.com/rainbowindex/rainbowindex/pkgs/npm/rainbowindex) as `@rainbowindex/rainbowindex` — the same build under an owner-scoped name, which that registry requires. Point the scope at the registry in your project's `.npmrc`:
34
+
35
+ ```ini
36
+ @rainbowindex:registry=https://npm.pkg.github.com
37
+ ```
38
+
39
+ GitHub Packages authenticates every read, including public ones, so put a [personal access token (classic)](https://github.com/settings/tokens) with the `read:packages` scope in your `~/.npmrc`:
40
+
41
+ ```ini
42
+ //npm.pkg.github.com/:_authToken=YOUR_TOKEN
43
+ ```
44
+
45
+ Then install under the alias `rainbowindex`, so every import, `@import`, and CLI invocation in the docs below works unchanged:
46
+
47
+ ```sh
48
+ pnpm add rainbowindex@npm:@rainbowindex/rainbowindex
49
+ ```
50
+
51
+ Without the alias — `pnpm add @rainbowindex/rainbowindex` — the package resolves under its scoped name, and specifiers become `@rainbowindex/rainbowindex`, `@rainbowindex/rainbowindex/vite`, and so on.
52
+
31
53
  ## Quick start (Vite)
32
54
 
33
55
  The fastest path is the Vite plugin, which auto-injects PostCSS config and discovers your CSS entry on first dev-server listen.
@@ -80,8 +102,7 @@ Common flags:
80
102
  | --- | --- |
81
103
  | `-o`, `--output <file>` | Output CSS file path. Required with `--watch`. |
82
104
  | `--watch` | Re-run on source-file changes (chokidar). |
83
- | `--minify` | Minify output via LightningCSS. |
84
- | `--optimize` | Minification + browser-fallback passes. |
105
+ | `--minify` | Minification + browser-fallback passes via LightningCSS. `--optimize` is an accepted alias. |
85
106
  | `--css <file>` | CSS input with directives. Auto-detected if omitted. |
86
107
  | `--strict` | Drop the string escape hatch in generated types. |
87
108
  | `--template <name>` | Vite template to scaffold (default: `react-ts`). |
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { C as ColorDefinition, a as CompilationContext, b as CompilationSnapshot, D as DEFAULT_TEXT_SIZES, F as FluidConfig, T as TextSize, c as Theme, d as createCompilationContext, e as createRi, f as defaultTheme, g as finalizeCompilationContext, r as registerColorNames, h as registerCustomFontFamilies, i as registerCustomTextSizes, j as registerCustomUtility, k as ri } from './index-CfDtWufj.js';
2
- export { s as safelist } from './safelist-CH3_PywB.js';
1
+ export { C as ColorDefinition, a as CompilationContext, b as CompilationSnapshot, F as FluidConfig, T as TextSize, c as Theme, d as createCompilationContext, e as defaultTheme, f as finalizeCompilationContext, r as registerColorNames, g as registerCustomFontFamilies, h as registerCustomTextSizes, i as registerCustomUtility } from './context-ruu2x_jR.js';
2
+ export { D as DEFAULT_TEXT_SIZES, c as createRi, r as ri, s as safelist } from './safelist-D9-Plqta.js';
3
3
 
4
4
  declare function browserEntryUnavailable(): never;
5
5
 
package/dist/browser.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  registerCustomTextSizes,
14
14
  registerCustomUtility,
15
15
  ri
16
- } from "./chunk-SOMDX7V6.mjs";
16
+ } from "./chunk-5Y7EXXLS.mjs";
17
17
 
18
18
  // src/entries/browser.ts
19
19
  function browserEntryUnavailable() {
@@ -0,0 +1,19 @@
1
+ // src/scanner/source-files.ts
2
+ var SOURCE_FILE_EXTENSIONS = Object.freeze([
3
+ "html",
4
+ "js",
5
+ "jsx",
6
+ "ts",
7
+ "tsx",
8
+ "md",
9
+ "mdx",
10
+ "vue",
11
+ "svelte"
12
+ ]);
13
+ function isSourceFile(file) {
14
+ return SOURCE_FILE_EXTENSIONS.some((ext) => file.endsWith(`.${ext}`));
15
+ }
16
+
17
+ export {
18
+ isSourceFile
19
+ };