@style-contract/binary-win32-x64 0.7.2 → 0.9.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # StyleContract
2
2
 
3
- StyleContract is a fast, standalone Rust CLI that verifies the contract between TypeScript CSS Module references and CSS/SCSS declarations. It detects missing symbols, unused classes and `:export` keys, empty style rules, unsafe module-to-module stylesheet imports, naming mismatches, and dynamic accesses that cannot be checked safely.
3
+ StyleContract is a fast, standalone Rust CLI that verifies the contract between TypeScript CSS Module references and CSS/SCSS declarations. It detects missing symbols, unused classes and `:export` keys, empty style rules, class leaks from Sass imports, optional naming mismatches, and dynamic accesses that cannot be checked safely.
4
4
 
5
5
  ## Install
6
6
 
@@ -17,7 +17,7 @@ The platform packages use names such as `@style-contract/binary-win32-x64`. They
17
17
  It can then be run from package scripts or directly with `npx`:
18
18
 
19
19
  ```console
20
- npx style-contract --convention camel-to-kebab
20
+ npx style-contract
21
21
  ```
22
22
 
23
23
  Alternatively, build and install directly from the Rust source:
@@ -28,21 +28,27 @@ cargo install --path .
28
28
 
29
29
  ## Use
30
30
 
31
- Choose exactly one naming convention on the command line or in a config file:
31
+ Naming enforcement is optional. With no convention, StyleContract uses `none`: it emits no naming diagnostics and treats `styles.primaryButton` as a reference to both `.primaryButton` and `.primary-button`. This is deliberately not convention detection.
32
+
33
+ Choose an explicit convention on the command line or in a config file when a project should enforce one:
32
34
 
33
35
  ```console
34
36
  style-contract --convention camel-case
35
37
  style-contract --convention kebab-case
36
38
  style-contract --convention camel-to-kebab
39
+ style-contract --convention none
37
40
  ```
38
41
 
39
- `camel-case` accepts both lower-camel names such as `primaryButton` and capitalized names such as `ComponentRoot`. `camel-to-kebab` continues to require lower-camel TypeScript references and maps `styles.primaryButton` to `.primary-button`. `kebab-case` references use bracket notation such as `styles["primary-button"]`.
42
+ `camel-case` accepts both lower-camel names such as `primaryButton` and capitalized names such as `ComponentRoot`. `camel-to-kebab` requires lower-camel TypeScript references and maps `styles.primaryButton` to `.primary-button`. `kebab-case` references use bracket notation such as `styles["primary-button"]`. In `none`, kebab references remain exact: `styles["primary-button"]` does not also reference `.primaryButton`.
40
43
 
41
44
  Available options:
42
45
 
43
46
  ```text
47
+ --convention <none|camel-case|kebab-case|camel-to-kebab>
48
+ Naming convention (default: none)
44
49
  --source <PATH> Source folder (default: ./src)
45
50
  --output <minimal|rich> Output style (default: rich)
51
+ --print-only-errors[=BOOL] Print errors without printing warnings
46
52
  --config <PATH> JSON5 configuration file (auto: ./style-contract.json)
47
53
  --exclude <PATH> Excluded folder; repeat as needed
48
54
  --include <PATH> Re-include a folder below an exclusion
@@ -51,7 +57,7 @@ Available options:
51
57
  --tsconfig <PATH> tsconfig used for paths aliases (default: ./tsconfig.json)
52
58
  ```
53
59
 
54
- CLI paths are resolved from the working directory. Paths in a config file are resolved from that file's directory. Include and exclude folders must exist beneath the source folder. A tsconfig is optional when no aliases are needed.
60
+ CLI paths are resolved from the working directory. Paths in a config file are resolved from that file's directory. Include and exclude folders must exist beneath the source folder. A tsconfig is optional when no aliases are needed. Each tsconfig `paths` replacement is resolved relative to the config that declares it, including mappings inherited through `extends`. StyleContract does not use `baseUrl`; migrate stylesheet aliases that rely on it to explicit `paths` mappings.
55
61
 
56
62
  With no explicit `--config`, StyleContract automatically loads `./style-contract.json` when it exists. Use `--config` to select another file. JSON5 comments and trailing commas are supported regardless of the filename extension:
57
63
 
@@ -59,6 +65,7 @@ With no explicit `--config`, StyleContract automatically loads `./style-contract
59
65
  {
60
66
  convention: "camel-to-kebab",
61
67
  output: "rich",
68
+ printOnlyErrors: false,
62
69
  source: "./src",
63
70
  exclude: ["./src/generated"],
64
71
  include: [],
@@ -69,12 +76,12 @@ With no explicit `--config`, StyleContract automatically loads `./style-contract
69
76
  "unused-dependent-class": "warning",
70
77
  "naming-convention-global": "off",
71
78
  "empty-rule": "warning",
72
- "module-to-module-import": "warning",
79
+ "class-leak": "warning",
73
80
  },
74
81
  }
75
82
  ```
76
83
 
77
- Explicit CLI values replace matching config values. Supplying any CLI entries for `--exclude`, `--include`, or `--rule` replaces that configured collection. `--ignore-exports=false` can disable a value enabled by the config.
84
+ Explicit CLI values replace matching config values. Supplying any CLI entries for `--exclude`, `--include`, or `--rule` replaces that configured collection. `--ignore-exports=false` and `--print-only-errors=false` can disable values enabled by the config.
78
85
 
79
86
  Supported rules:
80
87
 
@@ -86,9 +93,9 @@ Supported rules:
86
93
  - `naming-convention-global`
87
94
  - `dynamic-reference`
88
95
  - `empty-rule`
89
- - `module-to-module-import`
96
+ - `class-leak`
90
97
 
91
- All enabled rules are errors except `naming-convention-global`, `dynamic-reference`, `empty-rule`, and `module-to-module-import`, which are warnings. `unused-dependent-class` is disabled by default; when enabled, it verifies that classes declared in same-element compound selectors are used together with a complete prerequisite class path in one JSX `className` expression or `clsx(...)` call. `empty-rule` reports selector blocks that contain only whitespace or comments; empty `:export` and structural at-rule blocks are not reported. `module-to-module-import` reports `@use`, `@forward`, and `@import` dependencies from one `.module.css` or `.module.scss` file to another. Imports from ordinary non-module stylesheets remain allowed. The warning exists because Sass merges the imported module's classes into the importing module's generated class map, which can expose unexpected classes and compound through transitive import chains.
98
+ All enabled rules are errors except `naming-convention-local`, `naming-convention-global`, `dynamic-reference`, `empty-rule`, and `class-leak`, which are warnings. Naming-convention rules do not emit findings in `none` mode. `unused-dependent-class` is disabled by default; when enabled, it verifies that classes declared in same-element compound selectors are used together with a complete prerequisite class path in one JSX `className` expression or `clsx(...)` call. `empty-rule` reports selector blocks that contain only whitespace or comments; empty `:export` and structural at-rule blocks are not reported. `class-leak` reports a CSS Module's direct `@use`, `@forward`, and `@import` dependencies when the imported file declares classes. This includes ordinary stylesheets as well as other CSS Modules, because those classes are emitted into the importing module. Keep shared Sass dependencies class-free; when another CSS Module's classes are needed in TypeScript, import that module independently from the TS or TSX file.
92
99
 
93
100
  ### Targeted suppressions
94
101
 
@@ -126,15 +133,15 @@ style-contract --convention camel-to-kebab \
126
133
 
127
134
  Diagnostics follow `path:line:column severity rule message`. Exit code `0` means no errors, `1` means rule errors were found, and `2` means configuration or analysis failed.
128
135
 
129
- Rich output uses compiler-style diagnostics, terminal colors, linked-looking source locations, compact per-source error/warning totals, and a final total across all affected files. Use `--output minimal` for the original single-line format. Colors are disabled when output is redirected or the `NO_COLOR` environment variable is set.
136
+ Rich output uses compiler-style diagnostics, terminal colors, linked-looking source locations, compact per-source error/warning totals, and a final total across all affected files. Use `--output minimal` for the original single-line format. Use `--print-only-errors` to hide warnings from either report without disabling their analysis. Colors are disabled when output is redirected or the `NO_COLOR` environment variable is set.
130
137
 
131
138
  ## Static-analysis boundary
132
139
 
133
- The MVP supports `.ts`, `.tsx`, `.css`, and `.scss`, default or namespace CSS Module imports, relative imports, tsconfig `baseUrl`/`paths`, dot and literal bracket access, and static destructuring. It recognizes literal class selectors, nested literal SCSS selectors, empty selector blocks, `:export` blocks, CSS Modules `:global`/`:local` functions and blocks, Sass `@use`/`@forward`/`@import` dependencies, Sass `@extend`, and same-file or relative-file CSS Modules `composes` references.
140
+ The MVP supports `.ts`, `.tsx`, `.css`, and `.scss`, default or namespace CSS Module imports, relative imports, tsconfig `paths`, dot and literal bracket access, and static destructuring. `baseUrl` resolution is not supported; define non-relative stylesheet aliases with `compilerOptions.paths`. It recognizes literal class selectors, nested literal SCSS selectors, empty selector blocks, `:export` blocks, CSS Modules `:global`/`:local` functions and blocks, Sass `@use`/`@forward`/`@import` dependencies, Sass `@extend`, and same-file or relative-file CSS Modules `composes` references.
134
141
 
135
- Classes in `.module.css` and `.module.scss` are local by default. Classes in other stylesheets are global by default. Global classes are checked against the warning-level global convention rule, but are not CSS Module exports and therefore do not participate in missing or unused checks.
142
+ Classes in `.module.css` and `.module.scss` are local by default. Classes in other stylesheets are global by default. With an explicit convention, global classes are checked against the warning-level global convention rule, but are not CSS Module exports and therefore do not participate in missing or unused checks.
136
143
 
137
- Dynamic Sass-generated selectors and computed accesses such as `styles[name]` produce warnings. Because their complete usage cannot be proven, unused-symbol findings are suppressed for that stylesheet. StyleContract detects module-to-module Sass dependencies but does not evaluate Sass or flatten imported classes into the importing module's symbol table. Sass evaluation and `composes` evaluation remain outside the MVP.
144
+ Dynamic Sass-generated selectors and computed accesses such as `styles[name]` produce warnings. Because their complete usage cannot be proven, unused-symbol findings are suppressed for that stylesheet. StyleContract detects direct class leaks from resolvable Sass dependencies but does not evaluate Sass, follow transitive Sass imports, or flatten imported classes into the importing module's symbol table. Sass evaluation and `composes` evaluation remain outside the MVP.
138
145
 
139
146
  ## Development
140
147
 
@@ -149,5 +156,5 @@ cargo build --release
149
156
 
150
157
  Releases are published from version tags. Before the first release, create or claim the `@style-contract` organization on npm, grant the publisher access to it, and add an npm automation token to the GitHub repository as the `NPM_TOKEN` Actions secret.
151
158
 
152
- Keep the version in `package.json`, `Cargo.toml`, `Cargo.lock`, and every platform package dependency identical. The release verifier enforces this. Push a tag matching that version, such as `v0.7.2`; the release workflow builds and publishes all eight platform packages before publishing `style-contract`.
159
+ Keep the version in `package.json`, `Cargo.toml`, `Cargo.lock`, and every platform package dependency identical. The release verifier enforces this. Push a tag matching that version, such as `v0.9.0`; the release workflow builds and publishes all eight platform packages before publishing `style-contract`.
153
160
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@style-contract/binary-win32-x64",
3
- "version": "0.7.2",
3
+ "version": "0.9.0",
4
4
  "description": "Precompiled StyleContract binary for win32/x64",
5
5
  "repository": {
6
6
  "type": "git",
Binary file