progress on migrating to heex templates and font-icons
This commit is contained in:
parent
d43daafdb7
commit
3eff955672
21793 changed files with 2161968 additions and 16895 deletions
assets_old/node_modules/purgecss
21
assets_old/node_modules/purgecss/LICENSE
generated
vendored
Normal file
21
assets_old/node_modules/purgecss/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 Full Human
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
86
assets_old/node_modules/purgecss/README.md
generated
vendored
Normal file
86
assets_old/node_modules/purgecss/README.md
generated
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
# PurgeCSS
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/UEiUiJ0.png" height="200" width="200" alt="PurgeCSS logo"/>
|
||||
</p>
|
||||
|
||||
## What is PurgeCSS?
|
||||
|
||||
When you are building a website, chances are that you are using a css framework like Bootstrap, Materializecss, Foundation, etc... But you will only use a small set of the framework and a lot of unused css styles will be included.
|
||||
|
||||
This is where PurgeCSS comes into play. PurgeCSS analyzes your content and your css files. Then it matches the selectors used in your files with the one in your content files. It removes unused selectors from your css, resulting in smaller css files.
|
||||
|
||||
## Sponsors 🥰
|
||||
|
||||
[<img src="https://avatars0.githubusercontent.com/u/67109815?v=4" height="85" style="margin-right: 10px">](https://tailwindcss.com)
|
||||
[<img src="https://avatars.githubusercontent.com/u/6852555?&v=4" height="85">](https://vertistudio.com/)
|
||||
|
||||
## Documentation
|
||||
|
||||
You can find the PurgeCSS documentation on [this website](https://purgecss.com).
|
||||
|
||||
### Table of Contents
|
||||
|
||||
#### PurgeCSS
|
||||
|
||||
- [Configuration](https://purgecss.com/configuration.html)
|
||||
- [Command Line Interface](https://purgecss.com/CLI.html)
|
||||
- [Programmatic API](https://purgecss.com/api.html)
|
||||
- [Safelisting](https://purgecss.com/safelisting.html)
|
||||
- [Extractors](https://purgecss.com/extractors.html)
|
||||
- [Comparison](https://purgecss.com/comparison.html)
|
||||
|
||||
#### Plugins
|
||||
|
||||
- [PostCSS](https://purgecss.com/plugins/postcss.html)
|
||||
- [Webpack](https://purgecss.com/plugins/webpack.html)
|
||||
- [Gulp](https://purgecss.com/plugins/gulp.html)
|
||||
- [Grunt](https://purgecss.com/plugins/grunt.html)
|
||||
- [Gatsby](https://purgecss.com/plugins/gatsby.html)
|
||||
|
||||
#### Guides
|
||||
|
||||
- [Vue.js](https://purgecss.com/guides/vue.html)
|
||||
- [Nuxt.js](https://purgecss.com/guides/nuxt.html)
|
||||
- [React.js](https://purgecss.com/guides/react.html)
|
||||
- [Next.js](https://purgecss.com/guides/next.html)
|
||||
- [Razzle](https://purgecss.com/guides/razzle.html)
|
||||
|
||||
## Getting Started
|
||||
|
||||
#### Installation
|
||||
|
||||
```
|
||||
npm i --save-dev purgecss
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import PurgeCSS from 'purgecss'
|
||||
const purgeCSSResults = await new PurgeCSS().purge({
|
||||
content: ['**/*.html'],
|
||||
css: ['**/*.css']
|
||||
})
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read [CONTRIBUTING.md](./../../CONTRIBUTING.md) for details on our code of
|
||||
conduct, and the process for submitting pull requests to us.
|
||||
|
||||
## Versioning
|
||||
|
||||
PurgeCSS use [SemVer](http://semver.org/) for versioning.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE](./../../LICENSE) file
|
||||
for details.
|
92
assets_old/node_modules/purgecss/bin/purgecss.js
generated
vendored
Executable file
92
assets_old/node_modules/purgecss/bin/purgecss.js
generated
vendored
Executable file
|
@ -0,0 +1,92 @@
|
|||
#!/usr/bin/env node
|
||||
const program = require("commander");
|
||||
const fs = require("fs");
|
||||
const {
|
||||
default: PurgeCSS,
|
||||
defaultOptions,
|
||||
setOptions,
|
||||
standardizeSafelist,
|
||||
} = require("../lib/purgecss");
|
||||
|
||||
async function writeCSSToFile(filePath, css) {
|
||||
try {
|
||||
await fs.promises.writeFile(filePath, css);
|
||||
} catch (err) {
|
||||
console.error(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
program
|
||||
.usage("--css <css...> --content <content...> [options]")
|
||||
.option("-con, --content <files...>", "glob of content files")
|
||||
.option("-css, --css <files...>", "glob of css files")
|
||||
.option("-c, --config <path>", "path to the configuration file")
|
||||
.option(
|
||||
"-o, --output <path>",
|
||||
"file path directory to write purged css files to"
|
||||
)
|
||||
.option("-font, --font-face", "option to remove unused font-faces")
|
||||
.option("-keyframes, --keyframes", "option to remove unused keyframes")
|
||||
.option("-rejected, --rejected", "option to output rejected selectors")
|
||||
.option(
|
||||
"-s, --safelist <list...>",
|
||||
"list of classes that should not be removed"
|
||||
)
|
||||
.option(
|
||||
"-b, --blocklist <list...>",
|
||||
"list of selectors that should be removed"
|
||||
)
|
||||
.option(
|
||||
"-k, --skippedContentGlobs <list...>",
|
||||
"list of glob patterns for folders/files that should not be scanned"
|
||||
);
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
const run = async () => {
|
||||
// config file is not specified or the content and css are not,
|
||||
// PurgeCSS will not run
|
||||
if (!program.config && !(program.content && program.css)) {
|
||||
program.help();
|
||||
}
|
||||
|
||||
// if the config file is present, use it
|
||||
// other options specified will override
|
||||
let options = defaultOptions;
|
||||
if (program.config) {
|
||||
options = await setOptions(program.config);
|
||||
}
|
||||
if (program.content) options.content = program.content;
|
||||
if (program.css) options.css = program.css;
|
||||
if (program.fontFace) options.fontFace = program.fontFace;
|
||||
if (program.keyframes) options.keyframes = program.keyframes;
|
||||
if (program.rejected) options.rejected = program.rejected;
|
||||
if (program.variables) options.variables = program.variables;
|
||||
if (program.safelist) options.safelist = standardizeSafelist(program.safelist);
|
||||
if (program.blocklist) options.blocklist = program.blocklist;
|
||||
if (program.skippedContentGlobs) options.skippedContentGlobs = program.skippedContentGlobs;
|
||||
|
||||
const purged = await new PurgeCSS().purge(options);
|
||||
const output = options.output || program.output;
|
||||
// output results in specified directory
|
||||
if (output) {
|
||||
if (purged.length === 1 && output.endsWith(".css")) {
|
||||
await writeCSSToFile(output, purged[0].css);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const purgedResult of purged) {
|
||||
const fileName = purgedResult.file.split("/").pop();
|
||||
await writeCSSToFile(`${output}/${fileName}`, purgedResult.css);
|
||||
}
|
||||
} else {
|
||||
console.log(JSON.stringify(purged));
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
run();
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
process.exit(1);
|
||||
}
|
283
assets_old/node_modules/purgecss/lib/purgecss.d.ts
generated
vendored
Normal file
283
assets_old/node_modules/purgecss/lib/purgecss.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,283 @@
|
|||
import * as postcss from "postcss";
|
||||
interface RawContent<T = string> {
|
||||
extension: string;
|
||||
raw: T;
|
||||
}
|
||||
interface RawCSS {
|
||||
raw: string;
|
||||
}
|
||||
interface ExtractorResultDetailed {
|
||||
attributes: {
|
||||
names: string[];
|
||||
values: string[];
|
||||
};
|
||||
classes: string[];
|
||||
ids: string[];
|
||||
tags: string[];
|
||||
undetermined: string[];
|
||||
}
|
||||
type ExtractorResult = ExtractorResultDetailed | string[];
|
||||
type ExtractorFunction<T = string> = (content: T) => ExtractorResult;
|
||||
interface Extractors {
|
||||
extensions: string[];
|
||||
extractor: ExtractorFunction;
|
||||
}
|
||||
type StringRegExpArray = Array<RegExp | string>;
|
||||
type ComplexSafelist = {
|
||||
standard?: StringRegExpArray;
|
||||
deep?: RegExp[];
|
||||
greedy?: RegExp[];
|
||||
variables?: StringRegExpArray;
|
||||
keyframes?: StringRegExpArray;
|
||||
};
|
||||
type UserDefinedSafelist = StringRegExpArray | ComplexSafelist;
|
||||
interface UserDefinedOptions {
|
||||
content: Array<string | RawContent>;
|
||||
css: Array<string | RawCSS>;
|
||||
defaultExtractor?: ExtractorFunction;
|
||||
extractors?: Array<Extractors>;
|
||||
fontFace?: boolean;
|
||||
keyframes?: boolean;
|
||||
output?: string;
|
||||
rejected?: boolean;
|
||||
stdin?: boolean;
|
||||
stdout?: boolean;
|
||||
variables?: boolean;
|
||||
safelist?: UserDefinedSafelist;
|
||||
blocklist?: StringRegExpArray;
|
||||
skippedContentGlobs?: Array<string>;
|
||||
dynamicAttributes?: string[];
|
||||
}
|
||||
interface Options {
|
||||
content: Array<string | RawContent>;
|
||||
css: Array<string | RawCSS>;
|
||||
defaultExtractor: ExtractorFunction;
|
||||
extractors: Array<Extractors>;
|
||||
fontFace: boolean;
|
||||
keyframes: boolean;
|
||||
output?: string;
|
||||
rejected: boolean;
|
||||
stdin: boolean;
|
||||
stdout: boolean;
|
||||
variables: boolean;
|
||||
safelist: Required<ComplexSafelist>;
|
||||
blocklist: StringRegExpArray;
|
||||
skippedContentGlobs: Array<string>;
|
||||
dynamicAttributes: string[];
|
||||
}
|
||||
interface ResultPurge {
|
||||
css: string;
|
||||
file?: string;
|
||||
rejected?: string[];
|
||||
}
|
||||
declare class ExtractorResultSets {
|
||||
private undetermined;
|
||||
private attrNames;
|
||||
private attrValues;
|
||||
private classes;
|
||||
private ids;
|
||||
private tags;
|
||||
constructor(er: ExtractorResult);
|
||||
merge(that: ExtractorResult | ExtractorResultSets): this;
|
||||
hasAttrName(name: string): boolean;
|
||||
private someAttrValue;
|
||||
hasAttrPrefix(prefix: string): boolean;
|
||||
hasAttrSuffix(suffix: string): boolean;
|
||||
hasAttrSubstr(substr: string): boolean;
|
||||
hasAttrValue(value: string): boolean;
|
||||
hasClass(name: string): boolean;
|
||||
hasId(id: string): boolean;
|
||||
hasTag(tag: string): boolean;
|
||||
}
|
||||
declare const defaultOptions: Options;
|
||||
declare function standardizeSafelist(userDefinedSafelist?: UserDefinedSafelist): Required<ComplexSafelist>;
|
||||
/**
|
||||
* Load the configuration file from the path
|
||||
* @param configFile Path of the config file
|
||||
*/
|
||||
declare function setOptions(configFile?: string): Promise<Options>;
|
||||
/**
|
||||
* Merge two extractor selectors
|
||||
* @param extractorSelectorsA extractor selectors A
|
||||
* @param extractorSelectorsB extractor selectors B
|
||||
*/
|
||||
declare function mergeExtractorSelectors(...extractors: (ExtractorResultDetailed | ExtractorResultSets)[]): ExtractorResultSets;
|
||||
declare class PurgeCSS {
|
||||
private ignore;
|
||||
private atRules;
|
||||
private usedAnimations;
|
||||
private usedFontFaces;
|
||||
selectorsRemoved: Set<string>;
|
||||
private variablesStructure;
|
||||
options: Options;
|
||||
private collectDeclarationsData;
|
||||
/**
|
||||
* Get the extractor corresponding to the extension file
|
||||
* @param filename Name of the file
|
||||
* @param extractors Array of extractors definition
|
||||
*/
|
||||
/**
|
||||
* Get the extractor corresponding to the extension file
|
||||
* @param filename Name of the file
|
||||
* @param extractors Array of extractors definition
|
||||
*/
|
||||
private getFileExtractor;
|
||||
/**
|
||||
* Extract the selectors present in the files using a purgecss extractor
|
||||
* @param files Array of files path or glob pattern
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
/**
|
||||
* Extract the selectors present in the files using a purgecss extractor
|
||||
* @param files Array of files path or glob pattern
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
extractSelectorsFromFiles(files: string[], extractors: Extractors[]): Promise<ExtractorResultSets>;
|
||||
/**
|
||||
* Extract the selectors present in the passed string using a PurgeCSS extractor
|
||||
* @param content Array of content
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
/**
|
||||
* Extract the selectors present in the passed string using a PurgeCSS extractor
|
||||
* @param content Array of content
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
extractSelectorsFromString(content: RawContent[], extractors: Extractors[]): Promise<ExtractorResultSets>;
|
||||
/**
|
||||
* Evaluate at-rule and register it for future reference
|
||||
* @param node node of postcss AST
|
||||
*/
|
||||
/**
|
||||
* Evaluate at-rule and register it for future reference
|
||||
* @param node node of postcss AST
|
||||
*/
|
||||
private evaluateAtRule;
|
||||
/**
|
||||
* Evaluate css selector and decide if it should be removed or not
|
||||
* @param node node of postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
/**
|
||||
* Evaluate css selector and decide if it should be removed or not
|
||||
* @param node node of postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
private evaluateRule;
|
||||
/**
|
||||
* Get the purged version of the css based on the files
|
||||
* @param cssOptions css options, files or raw strings
|
||||
* @param selectors set of extracted css selectors
|
||||
*/
|
||||
/**
|
||||
* Get the purged version of the css based on the files
|
||||
* @param cssOptions css options, files or raw strings
|
||||
* @param selectors set of extracted css selectors
|
||||
*/
|
||||
getPurgedCSS(cssOptions: Array<string | RawCSS>, selectors: ExtractorResultSets): Promise<ResultPurge[]>;
|
||||
/**
|
||||
* Check if the keyframe is safelisted with the option safelist keyframes
|
||||
* @param keyframesName name of the keyframe animation
|
||||
*/
|
||||
/**
|
||||
* Check if the keyframe is safelisted with the option safelist keyframes
|
||||
* @param keyframesName name of the keyframe animation
|
||||
*/
|
||||
private isKeyframesSafelisted;
|
||||
/**
|
||||
* Check if the selector is blocklisted with the option blocklist
|
||||
* @param selector css selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is blocklisted with the option blocklist
|
||||
* @param selector css selector
|
||||
*/
|
||||
private isSelectorBlocklisted;
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist standard
|
||||
* @param selector css selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist standard
|
||||
* @param selector css selector
|
||||
*/
|
||||
private isSelectorSafelisted;
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist deep
|
||||
* @param selector selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist deep
|
||||
* @param selector selector
|
||||
*/
|
||||
private isSelectorSafelistedDeep;
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist greedy
|
||||
* @param selector selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist greedy
|
||||
* @param selector selector
|
||||
*/
|
||||
private isSelectorSafelistedGreedy;
|
||||
/**
|
||||
* Remove unused css
|
||||
* @param userOptions PurgeCSS options
|
||||
*/
|
||||
/**
|
||||
* Remove unused css
|
||||
* @param userOptions PurgeCSS options
|
||||
*/
|
||||
purge(userOptions: UserDefinedOptions | string | undefined): Promise<ResultPurge[]>;
|
||||
/**
|
||||
* Remove unused CSS variables
|
||||
*/
|
||||
/**
|
||||
* Remove unused CSS variables
|
||||
*/
|
||||
removeUnusedCSSVariables(): void;
|
||||
/**
|
||||
* Remove unused font-faces
|
||||
*/
|
||||
/**
|
||||
* Remove unused font-faces
|
||||
*/
|
||||
removeUnusedFontFaces(): void;
|
||||
/**
|
||||
* Remove unused keyframes
|
||||
*/
|
||||
/**
|
||||
* Remove unused keyframes
|
||||
*/
|
||||
removeUnusedKeyframes(): void;
|
||||
/**
|
||||
* Transform a selector node into a string
|
||||
*/
|
||||
/**
|
||||
* Transform a selector node into a string
|
||||
*/
|
||||
private getSelectorValue;
|
||||
/**
|
||||
* Determine if the selector should be kept, based on the selectors found in the files
|
||||
* @param selector set of css selectors found in the content files or string
|
||||
* @param selectorsFromExtractor selectors in the css rule
|
||||
*/
|
||||
/**
|
||||
* Determine if the selector should be kept, based on the selectors found in the files
|
||||
* @param selector set of css selectors found in the content files or string
|
||||
* @param selectorsFromExtractor selectors in the css rule
|
||||
*/
|
||||
private shouldKeepSelector;
|
||||
/**
|
||||
* Walk through the CSS AST and remove unused CSS
|
||||
* @param root root node of the postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
/**
|
||||
* Walk through the CSS AST and remove unused CSS
|
||||
* @param root root node of the postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
walkThroughCSS(root: postcss.Root, selectors: ExtractorResultSets): void;
|
||||
}
|
||||
export { PurgeCSS as default, PurgeCSS, defaultOptions, standardizeSafelist, setOptions, mergeExtractorSelectors };
|
283
assets_old/node_modules/purgecss/lib/purgecss.esm.d.ts
generated
vendored
Normal file
283
assets_old/node_modules/purgecss/lib/purgecss.esm.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,283 @@
|
|||
import * as postcss from "postcss";
|
||||
interface RawContent<T = string> {
|
||||
extension: string;
|
||||
raw: T;
|
||||
}
|
||||
interface RawCSS {
|
||||
raw: string;
|
||||
}
|
||||
interface ExtractorResultDetailed {
|
||||
attributes: {
|
||||
names: string[];
|
||||
values: string[];
|
||||
};
|
||||
classes: string[];
|
||||
ids: string[];
|
||||
tags: string[];
|
||||
undetermined: string[];
|
||||
}
|
||||
type ExtractorResult = ExtractorResultDetailed | string[];
|
||||
type ExtractorFunction<T = string> = (content: T) => ExtractorResult;
|
||||
interface Extractors {
|
||||
extensions: string[];
|
||||
extractor: ExtractorFunction;
|
||||
}
|
||||
type StringRegExpArray = Array<RegExp | string>;
|
||||
type ComplexSafelist = {
|
||||
standard?: StringRegExpArray;
|
||||
deep?: RegExp[];
|
||||
greedy?: RegExp[];
|
||||
variables?: StringRegExpArray;
|
||||
keyframes?: StringRegExpArray;
|
||||
};
|
||||
type UserDefinedSafelist = StringRegExpArray | ComplexSafelist;
|
||||
interface UserDefinedOptions {
|
||||
content: Array<string | RawContent>;
|
||||
css: Array<string | RawCSS>;
|
||||
defaultExtractor?: ExtractorFunction;
|
||||
extractors?: Array<Extractors>;
|
||||
fontFace?: boolean;
|
||||
keyframes?: boolean;
|
||||
output?: string;
|
||||
rejected?: boolean;
|
||||
stdin?: boolean;
|
||||
stdout?: boolean;
|
||||
variables?: boolean;
|
||||
safelist?: UserDefinedSafelist;
|
||||
blocklist?: StringRegExpArray;
|
||||
skippedContentGlobs?: Array<string>;
|
||||
dynamicAttributes?: string[];
|
||||
}
|
||||
interface Options {
|
||||
content: Array<string | RawContent>;
|
||||
css: Array<string | RawCSS>;
|
||||
defaultExtractor: ExtractorFunction;
|
||||
extractors: Array<Extractors>;
|
||||
fontFace: boolean;
|
||||
keyframes: boolean;
|
||||
output?: string;
|
||||
rejected: boolean;
|
||||
stdin: boolean;
|
||||
stdout: boolean;
|
||||
variables: boolean;
|
||||
safelist: Required<ComplexSafelist>;
|
||||
blocklist: StringRegExpArray;
|
||||
skippedContentGlobs: Array<string>;
|
||||
dynamicAttributes: string[];
|
||||
}
|
||||
interface ResultPurge {
|
||||
css: string;
|
||||
file?: string;
|
||||
rejected?: string[];
|
||||
}
|
||||
declare class ExtractorResultSets {
|
||||
private undetermined;
|
||||
private attrNames;
|
||||
private attrValues;
|
||||
private classes;
|
||||
private ids;
|
||||
private tags;
|
||||
constructor(er: ExtractorResult);
|
||||
merge(that: ExtractorResult | ExtractorResultSets): this;
|
||||
hasAttrName(name: string): boolean;
|
||||
private someAttrValue;
|
||||
hasAttrPrefix(prefix: string): boolean;
|
||||
hasAttrSuffix(suffix: string): boolean;
|
||||
hasAttrSubstr(substr: string): boolean;
|
||||
hasAttrValue(value: string): boolean;
|
||||
hasClass(name: string): boolean;
|
||||
hasId(id: string): boolean;
|
||||
hasTag(tag: string): boolean;
|
||||
}
|
||||
declare const defaultOptions: Options;
|
||||
declare function standardizeSafelist(userDefinedSafelist?: UserDefinedSafelist): Required<ComplexSafelist>;
|
||||
/**
|
||||
* Load the configuration file from the path
|
||||
* @param configFile Path of the config file
|
||||
*/
|
||||
declare function setOptions(configFile?: string): Promise<Options>;
|
||||
/**
|
||||
* Merge two extractor selectors
|
||||
* @param extractorSelectorsA extractor selectors A
|
||||
* @param extractorSelectorsB extractor selectors B
|
||||
*/
|
||||
declare function mergeExtractorSelectors(...extractors: (ExtractorResultDetailed | ExtractorResultSets)[]): ExtractorResultSets;
|
||||
declare class PurgeCSS {
|
||||
private ignore;
|
||||
private atRules;
|
||||
private usedAnimations;
|
||||
private usedFontFaces;
|
||||
selectorsRemoved: Set<string>;
|
||||
private variablesStructure;
|
||||
options: Options;
|
||||
private collectDeclarationsData;
|
||||
/**
|
||||
* Get the extractor corresponding to the extension file
|
||||
* @param filename Name of the file
|
||||
* @param extractors Array of extractors definition
|
||||
*/
|
||||
/**
|
||||
* Get the extractor corresponding to the extension file
|
||||
* @param filename Name of the file
|
||||
* @param extractors Array of extractors definition
|
||||
*/
|
||||
private getFileExtractor;
|
||||
/**
|
||||
* Extract the selectors present in the files using a purgecss extractor
|
||||
* @param files Array of files path or glob pattern
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
/**
|
||||
* Extract the selectors present in the files using a purgecss extractor
|
||||
* @param files Array of files path or glob pattern
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
extractSelectorsFromFiles(files: string[], extractors: Extractors[]): Promise<ExtractorResultSets>;
|
||||
/**
|
||||
* Extract the selectors present in the passed string using a PurgeCSS extractor
|
||||
* @param content Array of content
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
/**
|
||||
* Extract the selectors present in the passed string using a PurgeCSS extractor
|
||||
* @param content Array of content
|
||||
* @param extractors Array of extractors
|
||||
*/
|
||||
extractSelectorsFromString(content: RawContent[], extractors: Extractors[]): Promise<ExtractorResultSets>;
|
||||
/**
|
||||
* Evaluate at-rule and register it for future reference
|
||||
* @param node node of postcss AST
|
||||
*/
|
||||
/**
|
||||
* Evaluate at-rule and register it for future reference
|
||||
* @param node node of postcss AST
|
||||
*/
|
||||
private evaluateAtRule;
|
||||
/**
|
||||
* Evaluate css selector and decide if it should be removed or not
|
||||
* @param node node of postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
/**
|
||||
* Evaluate css selector and decide if it should be removed or not
|
||||
* @param node node of postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
private evaluateRule;
|
||||
/**
|
||||
* Get the purged version of the css based on the files
|
||||
* @param cssOptions css options, files or raw strings
|
||||
* @param selectors set of extracted css selectors
|
||||
*/
|
||||
/**
|
||||
* Get the purged version of the css based on the files
|
||||
* @param cssOptions css options, files or raw strings
|
||||
* @param selectors set of extracted css selectors
|
||||
*/
|
||||
getPurgedCSS(cssOptions: Array<string | RawCSS>, selectors: ExtractorResultSets): Promise<ResultPurge[]>;
|
||||
/**
|
||||
* Check if the keyframe is safelisted with the option safelist keyframes
|
||||
* @param keyframesName name of the keyframe animation
|
||||
*/
|
||||
/**
|
||||
* Check if the keyframe is safelisted with the option safelist keyframes
|
||||
* @param keyframesName name of the keyframe animation
|
||||
*/
|
||||
private isKeyframesSafelisted;
|
||||
/**
|
||||
* Check if the selector is blocklisted with the option blocklist
|
||||
* @param selector css selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is blocklisted with the option blocklist
|
||||
* @param selector css selector
|
||||
*/
|
||||
private isSelectorBlocklisted;
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist standard
|
||||
* @param selector css selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist standard
|
||||
* @param selector css selector
|
||||
*/
|
||||
private isSelectorSafelisted;
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist deep
|
||||
* @param selector selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist deep
|
||||
* @param selector selector
|
||||
*/
|
||||
private isSelectorSafelistedDeep;
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist greedy
|
||||
* @param selector selector
|
||||
*/
|
||||
/**
|
||||
* Check if the selector is safelisted with the option safelist greedy
|
||||
* @param selector selector
|
||||
*/
|
||||
private isSelectorSafelistedGreedy;
|
||||
/**
|
||||
* Remove unused css
|
||||
* @param userOptions PurgeCSS options
|
||||
*/
|
||||
/**
|
||||
* Remove unused css
|
||||
* @param userOptions PurgeCSS options
|
||||
*/
|
||||
purge(userOptions: UserDefinedOptions | string | undefined): Promise<ResultPurge[]>;
|
||||
/**
|
||||
* Remove unused CSS variables
|
||||
*/
|
||||
/**
|
||||
* Remove unused CSS variables
|
||||
*/
|
||||
removeUnusedCSSVariables(): void;
|
||||
/**
|
||||
* Remove unused font-faces
|
||||
*/
|
||||
/**
|
||||
* Remove unused font-faces
|
||||
*/
|
||||
removeUnusedFontFaces(): void;
|
||||
/**
|
||||
* Remove unused keyframes
|
||||
*/
|
||||
/**
|
||||
* Remove unused keyframes
|
||||
*/
|
||||
removeUnusedKeyframes(): void;
|
||||
/**
|
||||
* Transform a selector node into a string
|
||||
*/
|
||||
/**
|
||||
* Transform a selector node into a string
|
||||
*/
|
||||
private getSelectorValue;
|
||||
/**
|
||||
* Determine if the selector should be kept, based on the selectors found in the files
|
||||
* @param selector set of css selectors found in the content files or string
|
||||
* @param selectorsFromExtractor selectors in the css rule
|
||||
*/
|
||||
/**
|
||||
* Determine if the selector should be kept, based on the selectors found in the files
|
||||
* @param selector set of css selectors found in the content files or string
|
||||
* @param selectorsFromExtractor selectors in the css rule
|
||||
*/
|
||||
private shouldKeepSelector;
|
||||
/**
|
||||
* Walk through the CSS AST and remove unused CSS
|
||||
* @param root root node of the postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
/**
|
||||
* Walk through the CSS AST and remove unused CSS
|
||||
* @param root root node of the postcss AST
|
||||
* @param selectors selectors used in content files
|
||||
*/
|
||||
walkThroughCSS(root: postcss.Root, selectors: ExtractorResultSets): void;
|
||||
}
|
||||
export { PurgeCSS as default, PurgeCSS, defaultOptions, standardizeSafelist, setOptions, mergeExtractorSelectors };
|
1
assets_old/node_modules/purgecss/lib/purgecss.esm.js
generated
vendored
Normal file
1
assets_old/node_modules/purgecss/lib/purgecss.esm.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
assets_old/node_modules/purgecss/lib/purgecss.js
generated
vendored
Normal file
1
assets_old/node_modules/purgecss/lib/purgecss.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
54
assets_old/node_modules/purgecss/package.json
generated
vendored
Normal file
54
assets_old/node_modules/purgecss/package.json
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"name": "purgecss",
|
||||
"version": "4.0.3",
|
||||
"description": "Remove unused css selectors",
|
||||
"author": "Ffloriel",
|
||||
"homepage": "https://purgecss.com",
|
||||
"keywords": [
|
||||
"optimize",
|
||||
"optimization",
|
||||
"remove",
|
||||
"unused",
|
||||
"css",
|
||||
"html",
|
||||
"rules",
|
||||
"purge",
|
||||
"uncss",
|
||||
"purify"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/purgecss.js",
|
||||
"module": "./lib/purgecss.esm.js",
|
||||
"types": "./lib/purgecss.d.ts",
|
||||
"bin": {
|
||||
"purgecss": "bin/purgecss.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"lib"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/FullHuman/purgecss.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: run tests from root\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "^6.0.0",
|
||||
"glob": "^7.0.0",
|
||||
"postcss": "^8.2.1",
|
||||
"postcss-selector-parser": "^6.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^7.1.1"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/FullHuman/purgecss/issues"
|
||||
},
|
||||
"gitHead": "ff1c5582383288e5300ecfb798a89e262d65c071"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue