tailwindcss-patch 1.2.6 → 1.2.7

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/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var patcher = require('./patcher-d1886807.js');
3
+ var patcher = require('./patcher-a07f477f.js');
4
4
  require('node:path');
5
5
  require('node:fs');
6
6
  require('semver');
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var path = require('node:path');
6
6
  var fs = require('node:fs');
7
- var patcher = require('./patcher-d1886807.js');
7
+ var patcher = require('./patcher-a07f477f.js');
8
8
  require('semver');
9
9
  require('@babel/types');
10
10
  require('@babel/generator');
@@ -284,6 +284,7 @@ function internalPatch(pkgJsonPath, options) {
284
284
  const pkgJson = require(pkgJsonPath);
285
285
  const twDir = path__default["default"].dirname(pkgJsonPath);
286
286
  if (semver.gte(pkgJson.version, '3.0.0')) {
287
+ options.version = pkgJson.version;
287
288
  const result = monkeyPatchForExposingContext(twDir, options);
288
289
  return result;
289
290
  }
@@ -13,5 +13,5 @@ export declare class TailwindcssPatcher {
13
13
  basedir?: string;
14
14
  cacheStrategy?: CacheStrategy;
15
15
  }): Set<string>;
16
- getContexts(basedir?: string): any[];
16
+ getContexts(basedir?: string): import("./type").TailwindcssRuntimeContext[];
17
17
  }
@@ -1,9 +1,5 @@
1
- import type { Rule } from 'postcss';
1
+ import type { TailwindcssClassCache, TailwindcssRuntimeContext } from './type';
2
2
  export declare function getTailwindcssEntry(basedir?: string): string;
3
- export declare function getContexts(basedir?: string): any[];
4
- export declare function getClassCaches(basedir?: string): Map<string, ({
5
- layer: string;
6
- options: Record<string, any>;
7
- sort: Record<string, any>;
8
- } | Rule)[]>[];
3
+ export declare function getContexts(basedir?: string): TailwindcssRuntimeContext[];
4
+ export declare function getClassCaches(basedir?: string): TailwindcssClassCache[];
9
5
  export declare function getClassCacheSet(basedir?: string): Set<string>;
@@ -1,3 +1,5 @@
1
+ import type { Rule, Node } from 'postcss';
2
+ import type { Config } from 'tailwindcss';
1
3
  export type CacheStrategy = 'merge' | 'overwrite';
2
4
  export interface CacheOptions {
3
5
  dir?: string;
@@ -19,8 +21,52 @@ export interface InternalPatchOptions {
19
21
  paths?: string[];
20
22
  basedir?: string;
21
23
  custom?: (dir: string, ctx: Record<string, any>) => void;
24
+ version?: string;
22
25
  }
23
26
  export interface TailwindcssPatcherOptions {
24
27
  cache?: CacheOptions | boolean;
25
28
  patch?: PatchOptions;
26
29
  }
30
+ export type TailwindcssClassCache = Map<string, ({
31
+ layer: string;
32
+ options: Record<string, any>;
33
+ sort: Record<string, any>;
34
+ } | Rule)[]>;
35
+ export type TailwindcssRuntimeContext = {
36
+ applyClassCache: Map<any, any>;
37
+ candidateRuleCache: Map<string | String, Set<[
38
+ {
39
+ arbitrary: any;
40
+ index: any;
41
+ layer: string;
42
+ options: any[];
43
+ parallelIndex: any;
44
+ parentLayer: string;
45
+ variants: any;
46
+ },
47
+ Node
48
+ ]>>;
49
+ candidateRuleMap: Map<string | String, [object, Node][]>;
50
+ changedContent: any[];
51
+ classCache: TailwindcssClassCache;
52
+ disposables: any[];
53
+ getClassList: Function;
54
+ getClassOrder: Function;
55
+ getVariants: Function;
56
+ markInvalidUtilityCandidate: Function;
57
+ markInvalidUtilityNode: Function;
58
+ notClassCache: Set<String>;
59
+ offsets: {
60
+ layerPositions: object;
61
+ offsets: object;
62
+ reservedVariantBits: any;
63
+ variantOffsets: Map<string, any>;
64
+ };
65
+ postCssNodeCache: Map<object, [Node]>;
66
+ ruleCache: Set<[object, Node]>;
67
+ stylesheetCache: Record<string, Set<any>>;
68
+ tailwindConfig: Config;
69
+ userConfigPath: string | null;
70
+ variantMap: Map<string, [[object, Function]]>;
71
+ variantOptions: Map<string, object>;
72
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss-patch",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "patch tailwindcss for exposing context",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -30,16 +30,16 @@
30
30
  "@types/semver": "^7.5.0",
31
31
  "defu": "^6.1.2",
32
32
  "pkg-types": "^1.0.3",
33
- "postcss": "^8.4.24",
34
- "tailwindcss": "^3.3.2"
33
+ "postcss": "^8.4.26",
34
+ "tailwindcss": "^3.3.3"
35
35
  },
36
36
  "dependencies": {
37
- "@babel/generator": "^7.22.5",
38
- "@babel/parser": "^7.22.5",
39
- "@babel/traverse": "^7.22.5",
37
+ "@babel/generator": "^7.22.9",
38
+ "@babel/parser": "^7.22.7",
39
+ "@babel/traverse": "^7.22.8",
40
40
  "@babel/types": "^7.22.5",
41
41
  "resolve": "^1.22.2",
42
- "semver": "^7.5.2"
42
+ "semver": "^7.5.4"
43
43
  },
44
44
  "homepage": "https://github.com/sonofmagic/tailwindcss-mangle",
45
45
  "repository": {