tailwindcss-patch 8.7.1 → 8.7.2

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
@@ -119,19 +119,19 @@ The CLI loads `tailwindcss-patch.config.ts` via `@tailwindcss-mangle/config`. Le
119
119
 
120
120
  ### Migrate options
121
121
 
122
- | Flag | Description |
123
- | ---------------- | ---------------------------------------------------------------------------- |
124
- | `--cwd <dir>` | Working directory used to locate config files. |
125
- | `--config <file>`| Migrate only one specific config file path. |
126
- | `--workspace` | Recursively scan the workspace for supported config filenames. |
127
- | `--max-depth <n>`| Maximum recursion depth for `--workspace` mode (default: `6`). |
128
- | `--include <glob>` | Only migrate files matching this glob pattern (repeatable). |
129
- | `--exclude <glob>` | Skip files matching this glob pattern (repeatable). |
122
+ | Flag | Description |
123
+ | ---------------------- | --------------------------------------------------------------------- |
124
+ | `--cwd <dir>` | Working directory used to locate config files. |
125
+ | `--config <file>` | Migrate only one specific config file path. |
126
+ | `--workspace` | Recursively scan the workspace for supported config filenames. |
127
+ | `--max-depth <n>` | Maximum recursion depth for `--workspace` mode (default: `6`). |
128
+ | `--include <glob>` | Only migrate files matching this glob pattern (repeatable). |
129
+ | `--exclude <glob>` | Skip files matching this glob pattern (repeatable). |
130
130
  | `--report-file <file>` | Write the migration report JSON to this file. |
131
- | `--backup-dir <dir>` | Store pre-migration file backups in this directory. |
132
- | `--check` | Check mode for CI. Exits with an error if files still need migration. |
133
- | `--json` | Print the migration report as JSON. |
134
- | `--dry-run` | Preview planned changes without writing files. |
131
+ | `--backup-dir <dir>` | Store pre-migration file backups in this directory. |
132
+ | `--check` | Check mode for CI. Exits with an error if files still need migration. |
133
+ | `--json` | Print the migration report as JSON. |
134
+ | `--dry-run` | Preview planned changes without writing files. |
135
135
 
136
136
  `tw-patch migrate` scans `tailwindcss-patch.config.*` and `tailwindcss-mangle.config.*` in the target directory. With `--workspace`, it recursively scans sub-projects (excluding folders like `node_modules`, `.git`, and `dist`). Use `--include` / `--exclude` to control monorepo scanning ranges. It rewrites deprecated keys (for example `registry.output` -> `registry.extract`, `registry.tailwind` -> `registry.tailwindcss`) and prints a per-file change summary.
137
137
 
@@ -141,25 +141,25 @@ Migration reports now include envelope metadata: `reportKind`, `schemaVersion`,
141
141
 
142
142
  ### Restore options
143
143
 
144
- | Flag | Description |
145
- | --------------------- | ----------------------------------------------------------------- |
146
- | `--cwd <dir>` | Working directory used to resolve report and target paths. |
147
- | `--report-file <file>`| Migration report file path (defaults to `.tw-patch/migrate-report.json`). |
148
- | `--dry-run` | Preview restore targets without writing files. |
149
- | `--strict` | Fail when any backup file in the report is missing. |
150
- | `--json` | Print restore summary as JSON. |
144
+ | Flag | Description |
145
+ | ---------------------- | ------------------------------------------------------------------------- |
146
+ | `--cwd <dir>` | Working directory used to resolve report and target paths. |
147
+ | `--report-file <file>` | Migration report file path (defaults to `.tw-patch/migrate-report.json`). |
148
+ | `--dry-run` | Preview restore targets without writing files. |
149
+ | `--strict` | Fail when any backup file in the report is missing. |
150
+ | `--json` | Print restore summary as JSON. |
151
151
 
152
152
  `tw-patch restore` validates report schema metadata when available. Reports with unsupported `reportKind` or newer `schemaVersion` are rejected to avoid unsafe restores. Legacy reports without metadata are still supported.
153
153
  With `--json`, restore output includes `reportKind` / `reportSchemaVersion` when report metadata is present.
154
154
 
155
155
  ### Validate options
156
156
 
157
- | Flag | Description |
158
- | --------------------- | ----------------------------------------------------------------- |
159
- | `--cwd <dir>` | Working directory used to resolve report paths. |
160
- | `--report-file <file>`| Migration report file path (defaults to `.tw-patch/migrate-report.json`). |
161
- | `--strict` | Fail when any backup file in the report is missing. |
162
- | `--json` | Print validation result as JSON. |
157
+ | Flag | Description |
158
+ | ---------------------- | ------------------------------------------------------------------------- |
159
+ | `--cwd <dir>` | Working directory used to resolve report paths. |
160
+ | `--report-file <file>` | Migration report file path (defaults to `.tw-patch/migrate-report.json`). |
161
+ | `--strict` | Fail when any backup file in the report is missing. |
162
+ | `--json` | Print validation result as JSON. |
163
163
 
164
164
  `tw-patch validate` performs migration report compatibility checks without writing restored files. It runs report schema validation and scans backup references in dry-run mode.
165
165
  On failure, validate uses dedicated exit codes for CI:
@@ -196,6 +196,7 @@ esac
196
196
  ```
197
197
 
198
198
  GitHub Actions templates:
199
+
199
200
  - single job: `packages/tailwindcss-patch/examples/github-actions/validate-migration-report.yml`
200
201
  - monorepo matrix shards (`root/apps/packages`): `packages/tailwindcss-patch/examples/github-actions/validate-migration-report-matrix.yml`
201
202
  - monorepo affected shards (PR diff-aware): `packages/tailwindcss-patch/examples/github-actions/validate-migration-report-affected.yml`
@@ -214,30 +215,30 @@ This lets you choose between action-managed setup or workflow-managed setup depe
214
215
  ### CI copy checklist
215
216
 
216
217
  1. Pick one workflow template based on your repository shape:
217
- `validate-migration-report.yml` (single job), `validate-migration-report-matrix.yml` (fixed shards), or `validate-migration-report-affected.yml` (PR diff-aware shards).
218
+ `validate-migration-report.yml` (single job), `validate-migration-report-matrix.yml` (fixed shards), or `validate-migration-report-affected.yml` (PR diff-aware shards).
218
219
  2. Always copy the shared composite action:
219
- `packages/tailwindcss-patch/examples/github-actions/actions/validate-migration-report/action.yml`.
220
+ `packages/tailwindcss-patch/examples/github-actions/actions/validate-migration-report/action.yml`.
220
221
  3. If you use the affected-shards template, also copy:
221
- `packages/tailwindcss-patch/examples/github-actions/scripts/resolve-shards.mjs`,
222
- `packages/tailwindcss-patch/examples/github-actions/resolve-shards-result.schema.json`,
223
- `packages/tailwindcss-patch/examples/github-actions/resolve-shards-result.dispatch.snapshot.json`.
222
+ `packages/tailwindcss-patch/examples/github-actions/scripts/resolve-shards.mjs`,
223
+ `packages/tailwindcss-patch/examples/github-actions/resolve-shards-result.schema.json`,
224
+ `packages/tailwindcss-patch/examples/github-actions/resolve-shards-result.dispatch.snapshot.json`.
224
225
  4. If your workspace paths differ from defaults, add `.tw-patch/ci-shards.json` (based on `ci-shards.example.json`) and adjust shard patterns/report files.
225
226
  5. Confirm the composite action inputs match your runner setup:
226
- action-managed setup (`setup-pnpm/setup-node/install-deps`) or pre-provisioned setup (`false` + custom install command).
227
+ action-managed setup (`setup-pnpm/setup-node/install-deps`) or pre-provisioned setup (`false` + custom install command).
227
228
  6. Keep `permissions.contents: read` and ensure `pnpm-lock.yaml` path matches `cache-dependency-path`.
228
229
 
229
230
  ### CI troubleshooting
230
231
 
231
232
  - `uses: ./.../validate-migration-report` not found:
232
- the workflow references a local action path; copy the action directory with the workflow file.
233
+ the workflow references a local action path; copy the action directory with the workflow file.
233
234
  - `No affected shards for migration report validation.` in PR:
234
- either files are outside configured shard patterns or base diff resolution returned empty; verify `.tw-patch/ci-shards.json` and PR base branch.
235
+ either files are outside configured shard patterns or base diff resolution returned empty; verify `.tw-patch/ci-shards.json` and PR base branch.
235
236
  - `Unknown scope` in composite action:
236
- `scope` currently accepts only `all`, `root`, `apps`, `packages` unless you customize action logic.
237
+ `scope` currently accepts only `all`, `root`, `apps`, `packages` unless you customize action logic.
237
238
  - `validate` exits `21/22/23`:
238
- `21` incompatible report schema/kind, `22` missing backups under `--strict`, `23` report/backup I/O failure.
239
+ `21` incompatible report schema/kind, `22` missing backups under `--strict`, `23` report/backup I/O failure.
239
240
  - Resolver snapshot diff failure in `workflow-lint`:
240
- you changed resolver contract behavior; update both schema/snapshot fixtures and corresponding tests in one commit.
241
+ you changed resolver contract behavior; update both schema/snapshot fixtures and corresponding tests in one commit.
241
242
 
242
243
  ### Token report options
243
244
 
@@ -300,6 +301,7 @@ The constructor accepts either the new object shown above or historical shapes.
300
301
  Deprecated fields kept temporarily (to be removed in the next major): `cwd`, `overwrite`, `tailwind`, `features`, `output`.
301
302
 
302
303
  Migration mapping:
304
+
303
305
  - `cwd` -> `projectRoot`
304
306
  - `overwrite` -> `apply.overwrite`
305
307
  - `tailwind` -> `tailwindcss`
@@ -20,7 +20,7 @@ var _pathe = require('pathe'); var _pathe2 = _interopRequireDefault(_pathe);
20
20
  // package.json
21
21
  var package_default = {
22
22
  name: "tailwindcss-patch",
23
- version: "8.7.1",
23
+ version: "8.7.2",
24
24
  description: "patch tailwindcss for exposing context and extract classes",
25
25
  author: "ice breaker <1324318532@qq.com>",
26
26
  license: "MIT",
@@ -105,7 +105,7 @@ var package_default = {
105
105
  "@babel/traverse": "^7.29.0",
106
106
  "@babel/types": "^7.29.0",
107
107
  "@tailwindcss-mangle/config": "workspace:*",
108
- "@tailwindcss/node": "^4.2.0",
108
+ "@tailwindcss/node": "^4.2.1",
109
109
  cac: "^6.7.14",
110
110
  consola: "^3.4.2",
111
111
  "fs-extra": "^11.3.3",
@@ -116,9 +116,9 @@ var package_default = {
116
116
  "tailwindcss-config": "^1.1.4"
117
117
  },
118
118
  devDependencies: {
119
- "@tailwindcss/oxide": "^4.2.0",
120
- "@tailwindcss/postcss": "^4.2.0",
121
- "@tailwindcss/vite": "^4.2.0",
119
+ "@tailwindcss/oxide": "^4.2.1",
120
+ "@tailwindcss/postcss": "^4.2.1",
121
+ "@tailwindcss/vite": "^4.2.1",
122
122
  tailwindcss: "catalog:tailwindcss4",
123
123
  "tailwindcss-3": "catalog:tailwindcss3",
124
124
  "tailwindcss-4": "catalog:tailwindcss4"
@@ -16,7 +16,7 @@ import path from "pathe";
16
16
  // package.json
17
17
  var package_default = {
18
18
  name: "tailwindcss-patch",
19
- version: "8.7.1",
19
+ version: "8.7.2",
20
20
  description: "patch tailwindcss for exposing context and extract classes",
21
21
  author: "ice breaker <1324318532@qq.com>",
22
22
  license: "MIT",
@@ -101,7 +101,7 @@ var package_default = {
101
101
  "@babel/traverse": "^7.29.0",
102
102
  "@babel/types": "^7.29.0",
103
103
  "@tailwindcss-mangle/config": "workspace:*",
104
- "@tailwindcss/node": "^4.2.0",
104
+ "@tailwindcss/node": "^4.2.1",
105
105
  cac: "^6.7.14",
106
106
  consola: "^3.4.2",
107
107
  "fs-extra": "^11.3.3",
@@ -112,9 +112,9 @@ var package_default = {
112
112
  "tailwindcss-config": "^1.1.4"
113
113
  },
114
114
  devDependencies: {
115
- "@tailwindcss/oxide": "^4.2.0",
116
- "@tailwindcss/postcss": "^4.2.0",
117
- "@tailwindcss/vite": "^4.2.0",
115
+ "@tailwindcss/oxide": "^4.2.1",
116
+ "@tailwindcss/postcss": "^4.2.1",
117
+ "@tailwindcss/vite": "^4.2.1",
118
118
  tailwindcss: "catalog:tailwindcss4",
119
119
  "tailwindcss-3": "catalog:tailwindcss3",
120
120
  "tailwindcss-4": "catalog:tailwindcss4"
@@ -3342,8 +3342,8 @@ var TailwindcssPatcher = class {
3342
3342
  };
3343
3343
 
3344
3344
  // src/cli/migrate-config.ts
3345
- import { parse as parse2 } from "@babel/parser";
3346
3345
  import generate2 from "@babel/generator";
3346
+ import { parse as parse2 } from "@babel/parser";
3347
3347
  import * as t5 from "@babel/types";
3348
3348
  import fs11 from "fs-extra";
3349
3349
  import path11 from "pathe";
package/dist/cli.js CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkK3NZYVMLjs = require('./chunk-K3NZYVML.js');
5
+ var _chunk7WRLTAPZjs = require('./chunk-7WRLTAPZ.js');
6
6
 
7
7
  // src/cli.ts
8
8
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
9
9
  async function main() {
10
- const cli = _chunkK3NZYVMLjs.createTailwindcssPatchCli.call(void 0, );
10
+ const cli = _chunk7WRLTAPZjs.createTailwindcssPatchCli.call(void 0, );
11
11
  cli.help();
12
12
  cli.parse(_process2.default.argv, { run: false });
13
13
  await cli.runMatchedCommand();
14
14
  }
15
15
  main().catch((error) => {
16
- if (error instanceof _chunkK3NZYVMLjs.ValidateCommandError) {
16
+ if (error instanceof _chunk7WRLTAPZjs.ValidateCommandError) {
17
17
  _process2.default.exitCode = error.exitCode;
18
18
  return;
19
19
  }
20
20
  const message = error instanceof Error ? error.message : String(error);
21
- _chunkK3NZYVMLjs.logger_default.error(message);
21
+ _chunk7WRLTAPZjs.logger_default.error(message);
22
22
  _process2.default.exitCode = 1;
23
23
  });
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  ValidateCommandError,
3
3
  createTailwindcssPatchCli,
4
4
  logger_default
5
- } from "./chunk-OK2PBYIA.mjs";
5
+ } from "./chunk-PL4WB2UD.mjs";
6
6
 
7
7
  // src/cli.ts
8
8
  import process from "process";
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
 
25
25
 
26
- var _chunkK3NZYVMLjs = require('./chunk-K3NZYVML.js');
26
+ var _chunk7WRLTAPZjs = require('./chunk-7WRLTAPZ.js');
27
27
 
28
28
  // src/index.ts
29
29
  var _config = require('@tailwindcss-mangle/config');
@@ -53,4 +53,4 @@ var _config = require('@tailwindcss-mangle/config');
53
53
 
54
54
 
55
55
 
56
- exports.CacheStore = _chunkK3NZYVMLjs.CacheStore; exports.MIGRATION_REPORT_KIND = _chunkK3NZYVMLjs.MIGRATION_REPORT_KIND; exports.MIGRATION_REPORT_SCHEMA_VERSION = _chunkK3NZYVMLjs.MIGRATION_REPORT_SCHEMA_VERSION; exports.TailwindcssPatcher = _chunkK3NZYVMLjs.TailwindcssPatcher; exports.VALIDATE_EXIT_CODES = _chunkK3NZYVMLjs.VALIDATE_EXIT_CODES; exports.VALIDATE_FAILURE_REASONS = _chunkK3NZYVMLjs.VALIDATE_FAILURE_REASONS; exports.ValidateCommandError = _chunkK3NZYVMLjs.ValidateCommandError; exports.collectClassesFromContexts = _chunkK3NZYVMLjs.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunkK3NZYVMLjs.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunkK3NZYVMLjs.createTailwindcssPatchCli; exports.defineConfig = _config.defineConfig; exports.extractProjectCandidatesWithPositions = _chunkK3NZYVMLjs.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunkK3NZYVMLjs.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunkK3NZYVMLjs.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunkK3NZYVMLjs.extractValidCandidates; exports.getPatchStatusReport = _chunkK3NZYVMLjs.getPatchStatusReport; exports.groupTokensByFile = _chunkK3NZYVMLjs.groupTokensByFile; exports.loadRuntimeContexts = _chunkK3NZYVMLjs.loadRuntimeContexts; exports.logger = _chunkK3NZYVMLjs.logger_default; exports.migrateConfigFiles = _chunkK3NZYVMLjs.migrateConfigFiles; exports.mountTailwindcssPatchCommands = _chunkK3NZYVMLjs.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunkK3NZYVMLjs.normalizeOptions; exports.restoreConfigFiles = _chunkK3NZYVMLjs.restoreConfigFiles; exports.runTailwindBuild = _chunkK3NZYVMLjs.runTailwindBuild; exports.tailwindcssPatchCommands = _chunkK3NZYVMLjs.tailwindcssPatchCommands;
56
+ exports.CacheStore = _chunk7WRLTAPZjs.CacheStore; exports.MIGRATION_REPORT_KIND = _chunk7WRLTAPZjs.MIGRATION_REPORT_KIND; exports.MIGRATION_REPORT_SCHEMA_VERSION = _chunk7WRLTAPZjs.MIGRATION_REPORT_SCHEMA_VERSION; exports.TailwindcssPatcher = _chunk7WRLTAPZjs.TailwindcssPatcher; exports.VALIDATE_EXIT_CODES = _chunk7WRLTAPZjs.VALIDATE_EXIT_CODES; exports.VALIDATE_FAILURE_REASONS = _chunk7WRLTAPZjs.VALIDATE_FAILURE_REASONS; exports.ValidateCommandError = _chunk7WRLTAPZjs.ValidateCommandError; exports.collectClassesFromContexts = _chunk7WRLTAPZjs.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunk7WRLTAPZjs.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunk7WRLTAPZjs.createTailwindcssPatchCli; exports.defineConfig = _config.defineConfig; exports.extractProjectCandidatesWithPositions = _chunk7WRLTAPZjs.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunk7WRLTAPZjs.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunk7WRLTAPZjs.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunk7WRLTAPZjs.extractValidCandidates; exports.getPatchStatusReport = _chunk7WRLTAPZjs.getPatchStatusReport; exports.groupTokensByFile = _chunk7WRLTAPZjs.groupTokensByFile; exports.loadRuntimeContexts = _chunk7WRLTAPZjs.loadRuntimeContexts; exports.logger = _chunk7WRLTAPZjs.logger_default; exports.migrateConfigFiles = _chunk7WRLTAPZjs.migrateConfigFiles; exports.mountTailwindcssPatchCommands = _chunk7WRLTAPZjs.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunk7WRLTAPZjs.normalizeOptions; exports.restoreConfigFiles = _chunk7WRLTAPZjs.restoreConfigFiles; exports.runTailwindBuild = _chunk7WRLTAPZjs.runTailwindBuild; exports.tailwindcssPatchCommands = _chunk7WRLTAPZjs.tailwindcssPatchCommands;
package/dist/index.mjs CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  restoreConfigFiles,
24
24
  runTailwindBuild,
25
25
  tailwindcssPatchCommands
26
- } from "./chunk-OK2PBYIA.mjs";
26
+ } from "./chunk-PL4WB2UD.mjs";
27
27
 
28
28
  // src/index.ts
29
29
  import { defineConfig } from "@tailwindcss-mangle/config";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss-patch",
3
- "version": "8.7.1",
3
+ "version": "8.7.2",
4
4
  "description": "patch tailwindcss for exposing context and extract classes",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -58,7 +58,7 @@
58
58
  "@babel/parser": "^7.29.0",
59
59
  "@babel/traverse": "^7.29.0",
60
60
  "@babel/types": "^7.29.0",
61
- "@tailwindcss/node": "^4.2.0",
61
+ "@tailwindcss/node": "^4.2.1",
62
62
  "cac": "^6.7.14",
63
63
  "consola": "^3.4.2",
64
64
  "fs-extra": "^11.3.3",
@@ -67,12 +67,12 @@
67
67
  "postcss": "^8.5.6",
68
68
  "semver": "^7.7.4",
69
69
  "tailwindcss-config": "^1.1.4",
70
- "@tailwindcss-mangle/config": "6.1.1"
70
+ "@tailwindcss-mangle/config": "6.1.2"
71
71
  },
72
72
  "devDependencies": {
73
- "@tailwindcss/oxide": "^4.2.0",
74
- "@tailwindcss/postcss": "^4.2.0",
75
- "@tailwindcss/vite": "^4.2.0",
73
+ "@tailwindcss/oxide": "^4.2.1",
74
+ "@tailwindcss/postcss": "^4.2.1",
75
+ "@tailwindcss/vite": "^4.2.1",
76
76
  "tailwindcss": "^4.1.18",
77
77
  "tailwindcss-3": "npm:tailwindcss@^3.4.19",
78
78
  "tailwindcss-4": "npm:tailwindcss@^4.1.18"