@veryfront/ext-css-purgecss 0.1.1271-rc.23194 → 0.1.1271-rc.23202
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/NOTICE +46 -0
- package/README.md +36 -8
- package/esm/deno.d.ts +2 -0
- package/esm/deno.js +14 -5
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/index.js +14 -14
- package/esm/vendor/purgecss-memory.d.ts +293 -0
- package/esm/vendor/purgecss-memory.d.ts.map +1 -0
- package/esm/vendor/purgecss-memory.js +990 -0
- package/esm/vendor-sources.d.ts +18 -0
- package/esm/vendor-sources.d.ts.map +1 -0
- package/esm/vendor-sources.js +18 -0
- package/package.json +5 -5
package/NOTICE
CHANGED
|
@@ -1,2 +1,48 @@
|
|
|
1
1
|
Veryfront Code
|
|
2
2
|
Copyright 2026 Veryfront GmbH
|
|
3
|
+
|
|
4
|
+
PurgeCSS 8.0.0 in-memory source distribution
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2020 Full Human
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
@tailwindcss/typography 0.5.19 — reviewed parser-patched source distribution
|
|
28
|
+
MIT License
|
|
29
|
+
|
|
30
|
+
Copyright (c) Tailwind Labs, Inc.
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
34
|
+
in the Software without restriction, including without limitation the rights
|
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
furnished to do so, subject to the following conditions:
|
|
38
|
+
|
|
39
|
+
The above copyright notice and this permission notice shall be included in all
|
|
40
|
+
copies or substantial portions of the Software.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -25,14 +25,42 @@ network, or workspace fallback.
|
|
|
25
25
|
## Configuration and capabilities
|
|
26
26
|
|
|
27
27
|
The factory accepts no options. It receives only bounded in-memory CSS and
|
|
28
|
-
content snapshots from core.
|
|
29
|
-
`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
content snapshots from core. PostCSS loads picocolors, which reads `NO_COLOR`,
|
|
29
|
+
`FORCE_COLOR`, `TERM`, and `CI` to select terminal colors. The manifest, factory,
|
|
30
|
+
standalone test task and exact capability audit allow only those four environment
|
|
31
|
+
keys.
|
|
32
|
+
|
|
33
|
+
## Reproducible in-memory distribution
|
|
34
|
+
|
|
35
|
+
Upstream PurgeCSS 8.0.0 uses fast-glob, which introduces braces 3.0.3 and the
|
|
36
|
+
unpatched High advisory
|
|
37
|
+
[GHSA-vfj7-8cjw-p6xm](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm).
|
|
38
|
+
The extension therefore ships a reviewed in-memory distribution of PurgeCSS 8,
|
|
39
|
+
with direct exact PostCSS 8.5.29 and selector-parser 7.1.6 dependencies. It retains
|
|
40
|
+
the upstream CSS algorithm and MIT attribution. Config-file, content-file and
|
|
41
|
+
stylesheet-file paths throw explicitly; those inputs are already outside the
|
|
42
|
+
provider-neutral in-memory contract.
|
|
43
|
+
|
|
44
|
+
Eight reversible source edits remove unused filesystem/glob imports and constants,
|
|
45
|
+
replace file operations with explicit rejection, and use block-scoped temporaries
|
|
46
|
+
in their original function scopes. Verify the bundled algorithm
|
|
47
|
+
against the pinned upstream source, offline, with:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
deno run --frozen --allow-read scripts/build/prepare-purgecss-memory-source.ts
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The verifier reconstructs the original upstream module and checks its pinned
|
|
54
|
+
SHA-256, checks the MIT license digest, and reproduces the exact bundled source.
|
|
55
|
+
`vendor-sources.json` binds the distribution version, source bytes and upstream
|
|
56
|
+
origin. SBOM generation verifies those bytes and includes the modified library,
|
|
57
|
+
its upstream pedigree and MIT license in both aggregate and extension outputs.
|
|
58
|
+
The engine cache identity includes the distribution version and source digest.
|
|
59
|
+
|
|
60
|
+
The frozen parser pin excludes versions affected by
|
|
61
|
+
[GHSA-rj75-hqrm-r3gf](https://github.com/advisories/GHSA-rj75-hqrm-r3gf).
|
|
62
|
+
The separately pinned typography parser finding remains retained for its own
|
|
63
|
+
disposition. This distribution does not require CPU-information access.
|
|
36
64
|
|
|
37
65
|
PurgeCSS does not expose an operation-level cancellation signal, so this
|
|
38
66
|
contract cannot interrupt an invocation after it enters the provider. Core
|
package/esm/deno.d.ts
CHANGED
package/esm/deno.js
CHANGED
|
@@ -6,23 +6,32 @@ export default {
|
|
|
6
6
|
"extension": true,
|
|
7
7
|
"activation": "explicit",
|
|
8
8
|
"contracts": {
|
|
9
|
-
"provides": [
|
|
9
|
+
"provides": [
|
|
10
|
+
"CSSPurgingEngine"
|
|
11
|
+
]
|
|
10
12
|
},
|
|
11
13
|
"capabilities": [
|
|
12
14
|
{
|
|
13
15
|
"type": "env:read",
|
|
14
|
-
"keys": [
|
|
16
|
+
"keys": [
|
|
17
|
+
"NO_COLOR",
|
|
18
|
+
"FORCE_COLOR",
|
|
19
|
+
"TERM",
|
|
20
|
+
"CI"
|
|
21
|
+
]
|
|
15
22
|
}
|
|
16
23
|
]
|
|
17
24
|
},
|
|
18
25
|
"imports": {
|
|
19
|
-
"purgecss": "
|
|
26
|
+
"purgecss": "./vendor/purgecss-memory.js",
|
|
20
27
|
"@std/assert": "jsr:@std/assert@1.0.19",
|
|
21
28
|
"@std/testing/bdd": "jsr:@std/testing@1.0.17/bdd",
|
|
22
29
|
"veryfront/extensions": "../../src/extensions/types.ts",
|
|
23
|
-
"veryfront/extensions/css": "../../src/extensions/css/index.ts"
|
|
30
|
+
"veryfront/extensions/css": "../../src/extensions/css/index.ts",
|
|
31
|
+
"postcss": "npm:postcss@8.5.29",
|
|
32
|
+
"postcss-selector-parser": "npm:postcss-selector-parser@7.1.6"
|
|
24
33
|
},
|
|
25
34
|
"tasks": {
|
|
26
|
-
"test": "deno test --frozen --no-check --allow-env=
|
|
35
|
+
"test": "deno test --frozen --no-check --allow-env=NO_COLOR,FORCE_COLOR,TERM,CI src/"
|
|
27
36
|
}
|
|
28
37
|
};
|
package/esm/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AA2P7D,QAAA,MAAM,cAAc,EAAE,gBAkBrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/esm/src/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** PurgeCSS implementation of the provider-neutral CSS purging contract. */
|
|
2
2
|
import "../_dnt.polyfills.js";
|
|
3
3
|
import { CSSPurgingEngineName, } from "veryfront/extensions/css";
|
|
4
|
-
import { PurgeCSS } from "purgecss";
|
|
4
|
+
import { PurgeCSS } from "../vendor/purgecss-memory.js";
|
|
5
|
+
import vendorSources from "../vendor-sources.js";
|
|
5
6
|
import extensionPackage from "../deno.js";
|
|
6
7
|
const arrayIsArray = Array.isArray;
|
|
7
8
|
const freeze = Object.freeze;
|
|
@@ -11,24 +12,23 @@ const getPrototypeOf = Object.getPrototypeOf;
|
|
|
11
12
|
const hasOwn = Object.hasOwn;
|
|
12
13
|
const objectPrototype = Object.prototype;
|
|
13
14
|
const ownKeys = Reflect.ownKeys;
|
|
14
|
-
const executeRegularExpression = RegExp.prototype.exec;
|
|
15
15
|
const apply = Reflect.apply;
|
|
16
16
|
const purgeCSSPurge = PurgeCSS.prototype.purge;
|
|
17
|
-
const
|
|
18
|
-
const ENGINE_SEMANTICS_VERSION = "veryfront.css-purgecss.v1";
|
|
17
|
+
const ENGINE_SEMANTICS_VERSION = "veryfront.css-purgecss.v2";
|
|
19
18
|
const PROVIDER_RESULT_KEYS = freeze([
|
|
20
19
|
"css",
|
|
21
20
|
"file",
|
|
22
21
|
"rejectedCss",
|
|
23
22
|
]);
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
function providerSourceIdentity() {
|
|
24
|
+
const source = vendorSources.components[0];
|
|
25
|
+
if (vendorSources.components.length !== 1 || source === undefined ||
|
|
26
|
+
extensionPackage.imports.purgecss !== `./${source.source}` ||
|
|
27
|
+
source.upstream.name !== "purgecss" || source.upstream.version !== "8.0.0" ||
|
|
28
|
+
!/^[a-f0-9]{64}$/.test(source.sha256)) {
|
|
29
|
+
throw new TypeError("ext-css-purgecss requires its pinned in-memory source distribution");
|
|
30
|
+
}
|
|
31
|
+
return `${source.upstream.name}@${source.upstream.version};${source.name}@${source.version};sha256:${source.sha256}`;
|
|
32
32
|
}
|
|
33
33
|
function assertEmptyConfig(value) {
|
|
34
34
|
if (value === undefined)
|
|
@@ -190,7 +190,7 @@ class PurgeCSSPurgingEngine {
|
|
|
190
190
|
cacheIdentity;
|
|
191
191
|
constructor() {
|
|
192
192
|
this.cacheIdentity =
|
|
193
|
-
`${ENGINE_SEMANTICS_VERSION};ext-css-purgecss@${extensionPackage.version}
|
|
193
|
+
`${ENGINE_SEMANTICS_VERSION};ext-css-purgecss@${extensionPackage.version};${providerSourceIdentity()}`;
|
|
194
194
|
freeze(this);
|
|
195
195
|
}
|
|
196
196
|
async purge(request) {
|
|
@@ -212,7 +212,7 @@ const extCSSPurgeCSS = (config) => {
|
|
|
212
212
|
contracts: { provides: ["CSSPurgingEngine"] },
|
|
213
213
|
capabilities: [{
|
|
214
214
|
type: "env:read",
|
|
215
|
-
keys: ["
|
|
215
|
+
keys: ["NO_COLOR", "FORCE_COLOR", "TERM", "CI"],
|
|
216
216
|
}],
|
|
217
217
|
setup(ctx) {
|
|
218
218
|
ctx.provide(CSSPurgingEngineName, engine);
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
4
|
+
export class ExtractorResultSets {
|
|
5
|
+
constructor(er: any);
|
|
6
|
+
undetermined: Set<any>;
|
|
7
|
+
attrNames: Set<any>;
|
|
8
|
+
attrValues: Set<any>;
|
|
9
|
+
classes: Set<any>;
|
|
10
|
+
ids: Set<any>;
|
|
11
|
+
tags: Set<any>;
|
|
12
|
+
merge(that: any): this;
|
|
13
|
+
hasAttrName(name: any): boolean;
|
|
14
|
+
someAttrValue(predicate: any): boolean;
|
|
15
|
+
hasAttrPrefix(prefix: any): boolean;
|
|
16
|
+
hasAttrSuffix(suffix: any): boolean;
|
|
17
|
+
hasAttrSubstr(substr: any): any;
|
|
18
|
+
hasAttrValue(value: any): boolean;
|
|
19
|
+
hasClass(name: any): boolean;
|
|
20
|
+
hasId(id: any): boolean;
|
|
21
|
+
hasTag(tag: any): boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Class used to instantiate PurgeCSS and can then be used
|
|
25
|
+
* to purge CSS files.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* await new PurgeCSS().purge({
|
|
30
|
+
* content: ['index.html'],
|
|
31
|
+
* css: ['css/app.css']
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export class PurgeCSS {
|
|
38
|
+
ignore: boolean;
|
|
39
|
+
atRules: {
|
|
40
|
+
fontFace: never[];
|
|
41
|
+
keyframes: never[];
|
|
42
|
+
};
|
|
43
|
+
usedAnimations: Set<any>;
|
|
44
|
+
usedFontFaces: Set<any>;
|
|
45
|
+
selectorsRemoved: Set<any>;
|
|
46
|
+
removedNodes: any[];
|
|
47
|
+
variablesStructure: VariablesStructure;
|
|
48
|
+
options: {
|
|
49
|
+
css: never[];
|
|
50
|
+
content: never[];
|
|
51
|
+
defaultExtractor: (content: any) => any;
|
|
52
|
+
extractors: never[];
|
|
53
|
+
fontFace: boolean;
|
|
54
|
+
keyframes: boolean;
|
|
55
|
+
rejected: boolean;
|
|
56
|
+
rejectedCss: boolean;
|
|
57
|
+
sourceMap: boolean;
|
|
58
|
+
stdin: boolean;
|
|
59
|
+
stdout: boolean;
|
|
60
|
+
variables: boolean;
|
|
61
|
+
safelist: {
|
|
62
|
+
standard: never[];
|
|
63
|
+
deep: never[];
|
|
64
|
+
greedy: never[];
|
|
65
|
+
variables: never[];
|
|
66
|
+
keyframes: never[];
|
|
67
|
+
};
|
|
68
|
+
blocklist: never[];
|
|
69
|
+
skippedContentGlobs: never[];
|
|
70
|
+
dynamicAttributes: never[];
|
|
71
|
+
};
|
|
72
|
+
collectDeclarationsData(declaration: any): void;
|
|
73
|
+
/**
|
|
74
|
+
* Get the extractor corresponding to the extension file
|
|
75
|
+
* @param filename - Name of the file
|
|
76
|
+
* @param extractors - Array of extractors definition
|
|
77
|
+
*/
|
|
78
|
+
getFileExtractor(filename: any, extractors: any): any;
|
|
79
|
+
/**
|
|
80
|
+
* Extract the selectors present in the files using a PurgeCSS extractor
|
|
81
|
+
*
|
|
82
|
+
* @param files - Array of files path or glob pattern
|
|
83
|
+
* @param extractors - Array of extractors
|
|
84
|
+
*/
|
|
85
|
+
extractSelectorsFromFiles(files: any): Promise<ExtractorResultSets>;
|
|
86
|
+
/**
|
|
87
|
+
* Extract the selectors present in the passed string using a PurgeCSS extractor
|
|
88
|
+
*
|
|
89
|
+
* @param content - Array of content
|
|
90
|
+
* @param extractors - Array of extractors
|
|
91
|
+
*/
|
|
92
|
+
extractSelectorsFromString(content: any, extractors: any): Promise<ExtractorResultSets>;
|
|
93
|
+
/**
|
|
94
|
+
* Evaluate at-rule and register it for future reference
|
|
95
|
+
* @param node - node of postcss AST
|
|
96
|
+
*/
|
|
97
|
+
evaluateAtRule(node: any): void;
|
|
98
|
+
/**
|
|
99
|
+
* Evaluate css selector and decide if it should be removed or not
|
|
100
|
+
*
|
|
101
|
+
* @param node - node of postcss AST
|
|
102
|
+
* @param selectors - selectors used in content files
|
|
103
|
+
*/
|
|
104
|
+
evaluateRule(node: any, selectors: any): void;
|
|
105
|
+
/**
|
|
106
|
+
* Get the purged version of the css based on the files
|
|
107
|
+
*
|
|
108
|
+
* @param cssOptions - css options, files or raw strings
|
|
109
|
+
* @param selectors - set of extracted css selectors
|
|
110
|
+
*/
|
|
111
|
+
getPurgedCSS(cssOptions: any, selectors: any): Promise<{
|
|
112
|
+
css: string;
|
|
113
|
+
file: any;
|
|
114
|
+
}[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Check if the keyframe is safelisted with the option safelist keyframes
|
|
117
|
+
*
|
|
118
|
+
* @param keyframesName - name of the keyframe animation
|
|
119
|
+
*/
|
|
120
|
+
isKeyframesSafelisted(keyframesName: any): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Check if the selector is blocklisted with the option blocklist
|
|
123
|
+
*
|
|
124
|
+
* @param selector - css selector
|
|
125
|
+
*/
|
|
126
|
+
isSelectorBlocklisted(selector: any): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Check if the selector is safelisted with the option safelist standard
|
|
129
|
+
*
|
|
130
|
+
* @param selector - css selector
|
|
131
|
+
*/
|
|
132
|
+
isSelectorSafelisted(selector: any): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Check if the selector is safelisted with the option safelist deep
|
|
135
|
+
*
|
|
136
|
+
* @param selector - selector
|
|
137
|
+
*/
|
|
138
|
+
isSelectorSafelistedDeep(selector: any): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Check if the selector is safelisted with the option safelist greedy
|
|
141
|
+
*
|
|
142
|
+
* @param selector - selector
|
|
143
|
+
*/
|
|
144
|
+
isSelectorSafelistedGreedy(selector: any): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Remove unused CSS
|
|
147
|
+
*
|
|
148
|
+
* @param userOptions - PurgeCSS options or path to the configuration file
|
|
149
|
+
* @returns an array of object containing the filename and the associated CSS
|
|
150
|
+
*
|
|
151
|
+
* @example Using a configuration file named purgecss.config.js
|
|
152
|
+
* ```ts
|
|
153
|
+
* const purgeCSSResults = await new PurgeCSS().purge()
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @example Using a custom path to the configuration file
|
|
157
|
+
* ```ts
|
|
158
|
+
* const purgeCSSResults = await new PurgeCSS().purge('./purgecss.config.js')
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* @example Using the PurgeCSS options
|
|
162
|
+
* ```ts
|
|
163
|
+
* const purgeCSSResults = await new PurgeCSS().purge({
|
|
164
|
+
* content: ['index.html', '**\/*.js', '**\/*.html', '**\/*.vue'],
|
|
165
|
+
* css: ['css/app.css']
|
|
166
|
+
* })
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
purge(userOptions: any): Promise<{
|
|
170
|
+
css: string;
|
|
171
|
+
file: any;
|
|
172
|
+
}[]>;
|
|
173
|
+
/**
|
|
174
|
+
* Remove unused CSS variables
|
|
175
|
+
*/
|
|
176
|
+
removeUnusedCSSVariables(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Remove unused font-faces
|
|
179
|
+
*/
|
|
180
|
+
removeUnusedFontFaces(): void;
|
|
181
|
+
/**
|
|
182
|
+
* Remove unused keyframes
|
|
183
|
+
*/
|
|
184
|
+
removeUnusedKeyframes(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Transform a selector node into a string
|
|
187
|
+
*/
|
|
188
|
+
getSelectorValue(selector: any): any;
|
|
189
|
+
/**
|
|
190
|
+
* Determine if the selector should be kept, based on the selectors found in the files
|
|
191
|
+
*
|
|
192
|
+
* @param selector - set of css selectors found in the content files or string
|
|
193
|
+
* @param selectorsFromExtractor - selectors in the css rule
|
|
194
|
+
*
|
|
195
|
+
* @returns true if the selector should be kept in the processed CSS
|
|
196
|
+
*/
|
|
197
|
+
shouldKeepSelector(selector: any, selectorsFromExtractor: any): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Walk through the CSS AST and remove unused CSS
|
|
200
|
+
*
|
|
201
|
+
* @param root - root node of the postcss AST
|
|
202
|
+
* @param selectors - selectors used in content files
|
|
203
|
+
*/
|
|
204
|
+
walkThroughCSS(root: any, selectors: any): void;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
export class VariableNode {
|
|
210
|
+
constructor(declaration: any);
|
|
211
|
+
nodes: any[];
|
|
212
|
+
isUsed: boolean;
|
|
213
|
+
value: any;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @public
|
|
217
|
+
*/
|
|
218
|
+
export class VariablesStructure {
|
|
219
|
+
nodes: Map<any, any>;
|
|
220
|
+
usedVariables: Set<any>;
|
|
221
|
+
safelist: any[];
|
|
222
|
+
addVariable(declaration: any): void;
|
|
223
|
+
addVariableUsage(declaration: any, matchedVariables: any): void;
|
|
224
|
+
addVariableUsageInProperties(matchedVariables: any): void;
|
|
225
|
+
setAsUsed(variableName: any): void;
|
|
226
|
+
removeUnused(): void;
|
|
227
|
+
isVariablesSafelisted(variable: any): boolean;
|
|
228
|
+
}
|
|
229
|
+
export namespace defaultOptions {
|
|
230
|
+
let css: never[];
|
|
231
|
+
let content: never[];
|
|
232
|
+
function defaultExtractor(content: any): any;
|
|
233
|
+
let extractors: never[];
|
|
234
|
+
let fontFace: boolean;
|
|
235
|
+
let keyframes: boolean;
|
|
236
|
+
let rejected: boolean;
|
|
237
|
+
let rejectedCss: boolean;
|
|
238
|
+
let sourceMap: boolean;
|
|
239
|
+
let stdin: boolean;
|
|
240
|
+
let stdout: boolean;
|
|
241
|
+
let variables: boolean;
|
|
242
|
+
namespace safelist {
|
|
243
|
+
export let standard: never[];
|
|
244
|
+
export let deep: never[];
|
|
245
|
+
export let greedy: never[];
|
|
246
|
+
let variables_1: never[];
|
|
247
|
+
export { variables_1 as variables };
|
|
248
|
+
let keyframes_1: never[];
|
|
249
|
+
export { keyframes_1 as keyframes };
|
|
250
|
+
}
|
|
251
|
+
let blocklist: never[];
|
|
252
|
+
let skippedContentGlobs: never[];
|
|
253
|
+
let dynamicAttributes: never[];
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Merge two extractor selectors
|
|
257
|
+
*
|
|
258
|
+
* @param extractorSelectorsA - extractor selectors A
|
|
259
|
+
* @param extractorSelectorsB - extractor selectors B
|
|
260
|
+
* @returns the merged extractor result sets
|
|
261
|
+
*
|
|
262
|
+
* @public
|
|
263
|
+
*/
|
|
264
|
+
export function mergeExtractorSelectors(...extractors: any[]): ExtractorResultSets;
|
|
265
|
+
/**
|
|
266
|
+
* Load the configuration file from the path
|
|
267
|
+
*
|
|
268
|
+
* @param configFile - Path of the config file
|
|
269
|
+
* @returns The options from the configuration file
|
|
270
|
+
*
|
|
271
|
+
* @throws Error
|
|
272
|
+
* This exception is thrown if the configuration file was not imported
|
|
273
|
+
*
|
|
274
|
+
* @public
|
|
275
|
+
*/
|
|
276
|
+
export function setOptions(): Promise<void>;
|
|
277
|
+
/**
|
|
278
|
+
* Core package of PurgeCSS
|
|
279
|
+
*
|
|
280
|
+
* Contains the core methods to analyze the files, remove unused CSS.
|
|
281
|
+
*
|
|
282
|
+
* @packageDocumentation
|
|
283
|
+
*/
|
|
284
|
+
/**
|
|
285
|
+
* Format the user defined safelist into a standardized safelist object
|
|
286
|
+
*
|
|
287
|
+
* @param userDefinedSafelist - the user defined safelist
|
|
288
|
+
* @returns the formatted safelist object that can be used in the PurgeCSS options
|
|
289
|
+
*
|
|
290
|
+
* @public
|
|
291
|
+
*/
|
|
292
|
+
export function standardizeSafelist(userDefinedSafelist?: any[]): any;
|
|
293
|
+
//# sourceMappingURL=purgecss-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purgecss-memory.d.ts","sourceRoot":"","sources":["../../src/vendor/purgecss-memory.js"],"names":[],"mappings":"AAuCA;;GAEG;AACH;IACI,qBAQC;IAPG,uBAA6B;IAC7B,oBAA0B;IAC1B,qBAA2B;IAC3B,kBAAwB;IACxB,cAAoB;IACpB,eAAqB;IAGzB,uBAwBC;IACD,gCAEC;IACD,uCAUC;IACD,oCAEC;IACD,oCAEC;IACD,gCAGC;IACD,kCAEC;IACD,6BAEC;IACD,wBAEC;IACD,0BAEC;CACJ;AA6WD;;;;;;;;;;;;;GAaG;AACH;IAEQ,gBAAmB;IACnB;;;MAGC;IACD,yBAA+B;IAC/B,wBAA8B;IAC9B,2BAAiC;IACjC,oBAAsB;IACtB,uCAAkD;IAClD;;;;;;;;;;;;;;;;;;;;;;;MAA6B;IAEjC,gDAuCC;IACD;;;;OAIG;IACH,sDAKC;IACD;;;;;OAKG;IACH,oEAGC;IACD;;;;;OAKG;IACH,wFAQC;IACD;;;OAGG;IACH,gCAiBC;IACD;;;;;OAKG;IACH,8CA4FC;IACD;;;;;OAKG;IACH;;;SAgDC;IACD;;;;OAIG;IACH,mDAMC;IACD;;;;OAIG;IACH,8CAMC;IACD;;;;OAIG;IACH,6CAQC;IACD;;;;OAIG;IACH,iDAEC;IACD;;;;OAIG;IACH,mDAEC;IACD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH;;;SAkBC;IACD;;OAEG;IACH,iCAEC;IACD;;OAEG;IACH,8BAMC;IACD;;OAEG;IACH,8BAOC;IACD;;OAEG;IACH,qCAEC;IACD;;;;;;;OAOG;IACH,wEAqEC;IACD;;;;;OAKG;IACH,gDAqBC;CACJ;AAj1BD;;GAEG;AACH;IACI,8BAIC;IAHG,aAAe;IACf,gBAAmB;IACnB,WAAwB;CAE/B;AACD;;GAEG;AACH;IAEQ,qBAAsB;IACtB,wBAA8B;IAC9B,gBAAkB;IAEtB,oCAWC;IACD,gEAaC;IACD,0DAMC;IACD,mCAYC;IACD,qBAyBC;IACD,8CAMC;CACJ;;;;IAxHqB,6CAAmD;;;;;;;;;;;;;;;;;;;;;;;AA+NzE;;;;;;;;GAQG;AACH,mFAIC;AAvFD;;;;;;;;;;GAUG;AACH,4CAEC;AAxCD;;;;;;GAMG;AACH;;;;;;;GAOG;AACH,sEAWC"}
|