tailwindcss-patch
Advanced tools
Comparing version 5.0.2 to 6.0.0
#!/usr/bin/env node | ||
import '../dist/cli.js' | ||
require('../dist/cli.js') |
@@ -1,19 +0,19 @@ | ||
import { | ||
TailwindcssPatcher, | ||
config_exports, | ||
getPatchOptions, | ||
logger_default | ||
} from "./chunk-LOQK6LST.js"; | ||
"use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _chunkP7C42UCOjs = require('./chunk-P7C42UCO.js'); | ||
// src/cli.ts | ||
import process from "node:process"; | ||
import cac from "cac"; | ||
var _process = require('process'); var _process2 = _interopRequireDefault(_process); | ||
var _config = require('@tailwindcss-mangle/config'); | ||
var _cac = require('cac'); var _cac2 = _interopRequireDefault(_cac); | ||
function init() { | ||
const cwd = process.cwd(); | ||
return (0, config_exports.initConfig)(cwd); | ||
const cwd = _process2.default.cwd(); | ||
return _config.initConfig.call(void 0, cwd); | ||
} | ||
var cli = cac(); | ||
var cli = _cac2.default.call(void 0, ); | ||
cli.command("install", "patch install").action(() => { | ||
const twPatcher = new TailwindcssPatcher({ | ||
patch: getPatchOptions() | ||
const twPatcher = new (0, _chunkP7C42UCOjs.TailwindcssPatcher)({ | ||
patch: _chunkP7C42UCOjs.getPatchOptions.call(void 0, ) | ||
}); | ||
@@ -24,10 +24,10 @@ twPatcher.patch(); | ||
await init(); | ||
logger_default.success(`\u2728 ${config_exports.configName}.config.ts initialized!`); | ||
_chunkP7C42UCOjs.logger_default.success(`\u2728 ${_config.CONFIG_NAME}.config.ts initialized!`); | ||
}); | ||
cli.command("extract").action(async () => { | ||
const { config } = await (0, config_exports.getConfig)(); | ||
const { config } = await _config.getConfig.call(void 0, ); | ||
if (config) { | ||
const twPatcher = new TailwindcssPatcher(); | ||
const twPatcher = new (0, _chunkP7C42UCOjs.TailwindcssPatcher)(); | ||
const p = await twPatcher.extract(config.patch); | ||
logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p}`); | ||
_chunkP7C42UCOjs.logger_default.success(`\u2728 tailwindcss-patch extract success! file path: ${p}`); | ||
} | ||
@@ -34,0 +34,0 @@ }); |
@@ -1,5 +0,6 @@ | ||
import { UserConfig } from '@tailwindcss-mangle/config'; | ||
import { Node, Rule } from 'postcss'; | ||
import { Config } from 'tailwindcss'; | ||
import { PatchUserConfig } from '@tailwindcss-mangle/config'; | ||
export { defineConfig } from '@tailwindcss-mangle/config'; | ||
import { Rule, Node } from 'postcss'; | ||
import { Config } from 'tailwindcss'; | ||
import { GlobEntry } from '@tailwindcss/oxide'; | ||
import * as consola from 'consola'; | ||
@@ -46,3 +47,3 @@ | ||
applyClassCache: Map<any, any>; | ||
candidateRuleCache: Map<string | string, Set<[ | ||
candidateRuleCache: Map<string, Set<[ | ||
{ | ||
@@ -107,2 +108,9 @@ arbitrary: any; | ||
interface ExtractValidCandidatesOption { | ||
sources?: GlobEntry[]; | ||
base?: string; | ||
css?: string; | ||
} | ||
declare function extractValidCandidates(options?: ExtractValidCandidatesOption): Promise<string[]>; | ||
declare class TailwindcssPatcher { | ||
@@ -114,3 +122,3 @@ rawOptions: TailwindcssPatcherOptions; | ||
cacheManager: CacheManager; | ||
packageInfo?: PackageInfo; | ||
packageInfo: PackageInfo; | ||
majorVersion?: number; | ||
@@ -122,13 +130,9 @@ constructor(options?: TailwindcssPatcherOptions); | ||
getClassCaches(): TailwindcssClassCache[]; | ||
getClassCacheSet(options?: { | ||
removeUniversalSelector?: boolean; | ||
}): Set<string>; | ||
getClassCacheSet(options?: PatchUserConfig): Promise<Set<string>>; | ||
/** | ||
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append | ||
*/ | ||
getClassSet(options?: { | ||
cacheStrategy?: CacheStrategy; | ||
removeUniversalSelector?: boolean; | ||
}): Set<string>; | ||
extract(options?: UserConfig['patch']): Promise<string | undefined>; | ||
getClassSet(options?: PatchUserConfig): Promise<Set<string>>; | ||
extract(options?: PatchUserConfig): Promise<string | undefined>; | ||
extractValidCandidates: typeof extractValidCandidates; | ||
} | ||
@@ -135,0 +139,0 @@ |
@@ -1,23 +0,24 @@ | ||
import { | ||
CacheManager, | ||
TailwindcssPatcher, | ||
config_exports, | ||
getCacheOptions, | ||
internalPatch, | ||
logger_default, | ||
monkeyPatchForExposingContextV2, | ||
monkeyPatchForExposingContextV3, | ||
monkeyPatchForSupportingCustomUnit | ||
} from "./chunk-LOQK6LST.js"; | ||
var export_defineConfig = config_exports.defineConfig; | ||
export { | ||
CacheManager, | ||
TailwindcssPatcher, | ||
export_defineConfig as defineConfig, | ||
getCacheOptions, | ||
internalPatch, | ||
logger_default as logger, | ||
monkeyPatchForExposingContextV2, | ||
monkeyPatchForExposingContextV3, | ||
monkeyPatchForSupportingCustomUnit | ||
}; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkP7C42UCOjs = require('./chunk-P7C42UCO.js'); | ||
// src/index.ts | ||
var _config = require('@tailwindcss-mangle/config'); | ||
exports.CacheManager = _chunkP7C42UCOjs.CacheManager; exports.TailwindcssPatcher = _chunkP7C42UCOjs.TailwindcssPatcher; exports.defineConfig = _config.defineConfig; exports.getCacheOptions = _chunkP7C42UCOjs.getCacheOptions; exports.internalPatch = _chunkP7C42UCOjs.internalPatch; exports.logger = _chunkP7C42UCOjs.logger_default; exports.monkeyPatchForExposingContextV2 = _chunkP7C42UCOjs.monkeyPatchForExposingContextV2; exports.monkeyPatchForExposingContextV3 = _chunkP7C42UCOjs.monkeyPatchForExposingContextV3; exports.monkeyPatchForSupportingCustomUnit = _chunkP7C42UCOjs.monkeyPatchForSupportingCustomUnit; |
{ | ||
"name": "tailwindcss-patch", | ||
"type": "module", | ||
"version": "5.0.2", | ||
"version": "6.0.0", | ||
"description": "patch tailwindcss for exposing context and extract classes", | ||
@@ -26,8 +25,8 @@ "author": "ice breaker <1324318532@qq.com>", | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
@@ -55,17 +54,25 @@ "bin": { | ||
"dependencies": { | ||
"@babel/generator": "^7.26.2", | ||
"@babel/parser": "^7.26.2", | ||
"@babel/traverse": "^7.25.9", | ||
"@babel/types": "^7.26.0", | ||
"@babel/generator": "^7.26.9", | ||
"@babel/parser": "^7.26.9", | ||
"@babel/traverse": "^7.26.9", | ||
"@babel/types": "^7.26.9", | ||
"cac": "^6.7.14", | ||
"consola": "^3.2.3", | ||
"fs-extra": "^11.2.0", | ||
"jiti": "^2.4.0", | ||
"lilconfig": "^3.1.2", | ||
"pathe": "^1.1.2", | ||
"postcss": "^8.4.47", | ||
"resolve": "^1.22.8", | ||
"semver": "^7.6.3", | ||
"@tailwindcss-mangle/config": "^4.0.1" | ||
"consola": "^3.4.0", | ||
"fs-extra": "^11.3.0", | ||
"local-pkg": "^1.0.0", | ||
"pathe": "^2.0.3", | ||
"postcss": "^8.5.2", | ||
"semver": "^7.7.1", | ||
"tailwindcss-config": "^1.0.0", | ||
"@tailwindcss-mangle/config": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"@tailwindcss/node": "^4.0.6", | ||
"@tailwindcss/oxide": "^4.0.6", | ||
"@tailwindcss/postcss": "^4.0.6", | ||
"@tailwindcss/vite": "^4.0.6", | ||
"tailwindcss": "^4.0.6", | ||
"tailwindcss-3": "npm:tailwindcss@^3", | ||
"tailwindcss-4": "npm:tailwindcss@^4" | ||
}, | ||
"scripts": { | ||
@@ -72,0 +79,0 @@ "dev": "tsup --watch --sourcemap", |
# tailwindcss-patch | ||
\[[中文(zh-cn)](./README-cn.md)\] | ||
get tailwindcss context at runtime ! extract all classes into file! | ||
- [tailwindcss-patch](#tailwindcss-patch) | ||
- [Docs](#docs) | ||
- [Setup](#setup) | ||
@@ -19,2 +18,6 @@ - [Usage](#usage) | ||
## Docs | ||
[mangle.icebreaker.top](https://mangle.icebreaker.top) | ||
## Setup | ||
@@ -21,0 +24,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
14
14
122
6
90243
7
2064
1
No
+ Addedlocal-pkg@^1.0.0
+ Addedtailwindcss-config@^1.0.0
+ Added@tailwindcss-mangle/config@5.0.3(transitive)
+ Addedlocal-pkg@1.0.0(transitive)
+ Addedtailwindcss-config@1.0.0(transitive)
- Removedjiti@^2.4.0
- Removedlilconfig@^3.1.2
- Removedresolve@^1.22.8
- Removed@tailwindcss-mangle/config@4.0.1(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-core-module@2.16.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpathe@1.1.2(transitive)
- Removedresolve@1.22.10(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
Updated@babel/generator@^7.26.9
Updated@babel/parser@^7.26.9
Updated@babel/traverse@^7.26.9
Updated@babel/types@^7.26.9
Updatedconsola@^3.4.0
Updatedfs-extra@^11.3.0
Updatedpathe@^2.0.3
Updatedpostcss@^8.5.2
Updatedsemver@^7.7.1