tailwindcss-patch 7.1.2 → 7.1.3

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.
@@ -1055,8 +1055,7 @@ var TailwindcssPatcher = class {
1055
1055
  async extract(options) {
1056
1056
  const { write } = defu(options, { write: true });
1057
1057
  const { output, tailwindcss } = this.patchOptions;
1058
- if (output && tailwindcss) {
1059
- const { filename, loose } = output;
1058
+ if (tailwindcss) {
1060
1059
  if (this.majorVersion === 3 || this.majorVersion === 2) {
1061
1060
  await processTailwindcss({
1062
1061
  ...tailwindcss,
@@ -1064,19 +1063,23 @@ var TailwindcssPatcher = class {
1064
1063
  });
1065
1064
  }
1066
1065
  const classSet = await this.getClassSet();
1067
- if (filename) {
1068
- const classList = [...classSet];
1069
- if (write) {
1070
- await fs4.outputJSON(filename, classList, {
1071
- spaces: loose ? 2 : void 0
1072
- });
1066
+ const classList = [...classSet];
1067
+ const result = {
1068
+ classList,
1069
+ classSet
1070
+ };
1071
+ if (output) {
1072
+ const { filename, loose } = output;
1073
+ if (filename) {
1074
+ if (write) {
1075
+ await fs4.outputJSON(filename, classList, {
1076
+ spaces: loose ? 2 : void 0
1077
+ });
1078
+ }
1079
+ result.filename = filename;
1073
1080
  }
1074
- return {
1075
- filename,
1076
- classList,
1077
- classSet
1078
- };
1079
1081
  }
1082
+ return result;
1080
1083
  }
1081
1084
  }
1082
1085
  extractValidCandidates = extractValidCandidates;
@@ -1059,8 +1059,7 @@ var TailwindcssPatcher = (_class = class {
1059
1059
  async extract(options) {
1060
1060
  const { write } = defu(options, { write: true });
1061
1061
  const { output, tailwindcss } = this.patchOptions;
1062
- if (output && tailwindcss) {
1063
- const { filename, loose } = output;
1062
+ if (tailwindcss) {
1064
1063
  if (this.majorVersion === 3 || this.majorVersion === 2) {
1065
1064
  await processTailwindcss({
1066
1065
  ...tailwindcss,
@@ -1068,19 +1067,23 @@ var TailwindcssPatcher = (_class = class {
1068
1067
  });
1069
1068
  }
1070
1069
  const classSet = await this.getClassSet();
1071
- if (filename) {
1072
- const classList = [...classSet];
1073
- if (write) {
1074
- await _fsextra2.default.outputJSON(filename, classList, {
1075
- spaces: loose ? 2 : void 0
1076
- });
1070
+ const classList = [...classSet];
1071
+ const result = {
1072
+ classList,
1073
+ classSet
1074
+ };
1075
+ if (output) {
1076
+ const { filename, loose } = output;
1077
+ if (filename) {
1078
+ if (write) {
1079
+ await _fsextra2.default.outputJSON(filename, classList, {
1080
+ spaces: loose ? 2 : void 0
1081
+ });
1082
+ }
1083
+ result.filename = filename;
1077
1084
  }
1078
- return {
1079
- filename,
1080
- classList,
1081
- classSet
1082
- };
1083
1085
  }
1086
+ return result;
1084
1087
  }
1085
1088
  }
1086
1089
  __init() {this.extractValidCandidates = extractValidCandidates}
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkWNQ2OYR4js = require('./chunk-WNQ2OYR4.js');
7
+ var _chunkZB7IRGF6js = require('./chunk-ZB7IRGF6.js');
8
8
 
9
9
  // src/cli.ts
10
10
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
@@ -16,26 +16,26 @@ function init() {
16
16
  }
17
17
  var cli = _cac2.default.call(void 0, );
18
18
  cli.command("install", "patch install").action(() => {
19
- const twPatcher = new (0, _chunkWNQ2OYR4js.TailwindcssPatcher)({
20
- patch: _chunkWNQ2OYR4js.getPatchOptions.call(void 0, )
19
+ const twPatcher = new (0, _chunkZB7IRGF6js.TailwindcssPatcher)({
20
+ patch: _chunkZB7IRGF6js.getPatchOptions.call(void 0, )
21
21
  });
22
22
  twPatcher.patch();
23
23
  });
24
24
  cli.command("init").action(async () => {
25
25
  await init();
26
- _chunkWNQ2OYR4js.logger_default.success(`\u2728 ${_config.CONFIG_NAME}.config.ts initialized!`);
26
+ _chunkZB7IRGF6js.logger_default.success(`\u2728 ${_config.CONFIG_NAME}.config.ts initialized!`);
27
27
  });
28
28
  cli.command("extract").option("--css [file]", "css file entries").action(async (options) => {
29
29
  const { config } = await _config.getConfig.call(void 0, );
30
30
  const file = options.css;
31
31
  if (config) {
32
- const twPatcher = new (0, _chunkWNQ2OYR4js.TailwindcssPatcher)(
32
+ const twPatcher = new (0, _chunkZB7IRGF6js.TailwindcssPatcher)(
33
33
  {
34
- patch: _chunkWNQ2OYR4js.defuOverrideArray.call(void 0,
34
+ patch: _chunkZB7IRGF6js.defuOverrideArray.call(void 0,
35
35
  config.patch,
36
36
  {
37
37
  resolve: {
38
- paths: [_chunkWNQ2OYR4js.importMetaUrl]
38
+ paths: [_chunkZB7IRGF6js.importMetaUrl]
39
39
  },
40
40
  tailwindcss: {
41
41
  v4: {
@@ -47,7 +47,7 @@ cli.command("extract").option("--css [file]", "css file entries").action(async (
47
47
  }
48
48
  );
49
49
  const p = await twPatcher.extract();
50
- p && _chunkWNQ2OYR4js.logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p.filename}, classList length: ${p.classList.length}`);
50
+ p && _chunkZB7IRGF6js.logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p.filename}, classList length: ${p.classList.length}`);
51
51
  }
52
52
  });
53
53
  cli.help();
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  defuOverrideArray,
4
4
  getPatchOptions,
5
5
  logger_default
6
- } from "./chunk-5PNNXDLA.mjs";
6
+ } from "./chunk-WQACRZUK.mjs";
7
7
 
8
8
  // src/cli.ts
9
9
  import process from "process";
package/dist/index.d.mts CHANGED
@@ -133,9 +133,9 @@ declare class TailwindcssPatcher {
133
133
  getClassSet(): Promise<Set<string>>;
134
134
  getClassSetV3(): Set<string>;
135
135
  extract(options?: PatchExtractOptions): Promise<{
136
- filename: string;
137
136
  classList: string[];
138
137
  classSet: Set<string>;
138
+ filename?: string;
139
139
  } | undefined>;
140
140
  extractValidCandidates: typeof extractValidCandidates;
141
141
  }
package/dist/index.d.ts CHANGED
@@ -133,9 +133,9 @@ declare class TailwindcssPatcher {
133
133
  getClassSet(): Promise<Set<string>>;
134
134
  getClassSetV3(): Set<string>;
135
135
  extract(options?: PatchExtractOptions): Promise<{
136
- filename: string;
137
136
  classList: string[];
138
137
  classSet: Set<string>;
138
+ filename?: string;
139
139
  } | undefined>;
140
140
  extractValidCandidates: typeof extractValidCandidates;
141
141
  }
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkWNQ2OYR4js = require('./chunk-WNQ2OYR4.js');
11
+ var _chunkZB7IRGF6js = require('./chunk-ZB7IRGF6.js');
12
12
 
13
13
  // src/index.ts
14
14
  var _config = require('@tailwindcss-mangle/config');
@@ -23,4 +23,4 @@ var _config = require('@tailwindcss-mangle/config');
23
23
 
24
24
 
25
25
 
26
- exports.CacheManager = _chunkWNQ2OYR4js.CacheManager; exports.TailwindcssPatcher = _chunkWNQ2OYR4js.TailwindcssPatcher; exports.defineConfig = _config.defineConfig; exports.getCacheOptions = _chunkWNQ2OYR4js.getCacheOptions; exports.internalPatch = _chunkWNQ2OYR4js.internalPatch; exports.logger = _chunkWNQ2OYR4js.logger_default; exports.monkeyPatchForExposingContextV2 = _chunkWNQ2OYR4js.monkeyPatchForExposingContextV2; exports.monkeyPatchForExposingContextV3 = _chunkWNQ2OYR4js.monkeyPatchForExposingContextV3; exports.monkeyPatchForSupportingCustomUnitV3 = _chunkWNQ2OYR4js.monkeyPatchForSupportingCustomUnitV3; exports.monkeyPatchForSupportingCustomUnitV4 = _chunkWNQ2OYR4js.monkeyPatchForSupportingCustomUnitV4;
26
+ exports.CacheManager = _chunkZB7IRGF6js.CacheManager; exports.TailwindcssPatcher = _chunkZB7IRGF6js.TailwindcssPatcher; exports.defineConfig = _config.defineConfig; exports.getCacheOptions = _chunkZB7IRGF6js.getCacheOptions; exports.internalPatch = _chunkZB7IRGF6js.internalPatch; exports.logger = _chunkZB7IRGF6js.logger_default; exports.monkeyPatchForExposingContextV2 = _chunkZB7IRGF6js.monkeyPatchForExposingContextV2; exports.monkeyPatchForExposingContextV3 = _chunkZB7IRGF6js.monkeyPatchForExposingContextV3; exports.monkeyPatchForSupportingCustomUnitV3 = _chunkZB7IRGF6js.monkeyPatchForSupportingCustomUnitV3; exports.monkeyPatchForSupportingCustomUnitV4 = _chunkZB7IRGF6js.monkeyPatchForSupportingCustomUnitV4;
package/dist/index.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  monkeyPatchForExposingContextV3,
9
9
  monkeyPatchForSupportingCustomUnitV3,
10
10
  monkeyPatchForSupportingCustomUnitV4
11
- } from "./chunk-5PNNXDLA.mjs";
11
+ } from "./chunk-WQACRZUK.mjs";
12
12
 
13
13
  // src/index.ts
14
14
  import { defineConfig } from "@tailwindcss-mangle/config";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss-patch",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
4
4
  "description": "patch tailwindcss for exposing context and extract classes",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",