@master/css-compiler 2.0.0-beta.131 → 2.0.0-beta.133
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/README.md +1 -158
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,158 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<div align="center">
|
|
3
|
-
|
|
4
|
-
<p align="center">
|
|
5
|
-
<a href="https://css.master.co">
|
|
6
|
-
<picture>
|
|
7
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
|
|
8
|
-
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
|
|
9
|
-
<img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
|
|
10
|
-
</picture>
|
|
11
|
-
</a>
|
|
12
|
-
</p>
|
|
13
|
-
<p align="center">The ahead-of-time compiler of Master CSS</p>
|
|
14
|
-
|
|
15
|
-
<p align="center">
|
|
16
|
-
<a aria-label="overview" href="https://github.com/master-co/css/tree/beta">
|
|
17
|
-
<picture>
|
|
18
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=212022&style=for-the-badge">
|
|
19
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=f6f7f8&style=for-the-badge">
|
|
20
|
-
<img alt="NPM Version" src="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=f6f7f8&style=for-the-badge">
|
|
21
|
-
</picture>
|
|
22
|
-
</a>
|
|
23
|
-
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
24
|
-
<picture>
|
|
25
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
|
|
26
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
|
|
27
|
-
<img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
|
|
28
|
-
</picture>
|
|
29
|
-
</a>
|
|
30
|
-
<a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css-compiler">
|
|
31
|
-
<picture>
|
|
32
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/css-compiler?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
33
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/css-compiler?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
34
|
-
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/css-compiler?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
35
|
-
</picture>
|
|
36
|
-
</a>
|
|
37
|
-
<a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
|
|
38
|
-
<picture>
|
|
39
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
|
|
40
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
41
|
-
<img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
42
|
-
</picture>
|
|
43
|
-
</a>
|
|
44
|
-
<a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
|
|
45
|
-
<picture>
|
|
46
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
|
|
47
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
48
|
-
<img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
49
|
-
</picture>
|
|
50
|
-
</a>
|
|
51
|
-
<a aria-label="Github Actions" href="https://github.com/1aron/repo/actions/workflows/release.yml">
|
|
52
|
-
<picture>
|
|
53
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
54
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
55
|
-
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
56
|
-
</picture>
|
|
57
|
-
</a>
|
|
58
|
-
</p>
|
|
59
|
-
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
## Usage
|
|
63
|
-
```bash
|
|
64
|
-
npm install @master/css-compiler
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
const compiler = await new MasterCSSCompiler()
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Options
|
|
72
|
-
```ts
|
|
73
|
-
{
|
|
74
|
-
// specify virtual CSS module id (e.g. virtual:master.css)
|
|
75
|
-
module: 'master.css',
|
|
76
|
-
// specify config file path or set `Config`
|
|
77
|
-
config: 'master.css.*',
|
|
78
|
-
// forcibly specify sources for scanning, not excluded by `options.exclude`
|
|
79
|
-
sources: [],
|
|
80
|
-
// specify sources for scanning
|
|
81
|
-
include: ['**/*.{html,js,jsx,ts,tsx,svelte,astro,vue,md,mdx,pug,php}'],
|
|
82
|
-
// specify sources to exclude
|
|
83
|
-
exclude: [
|
|
84
|
-
'**/node_modules/**',
|
|
85
|
-
'**/*.d.ts',
|
|
86
|
-
'**/*.test.*',
|
|
87
|
-
'node_modules',
|
|
88
|
-
'master.css.{js,ts,mjs,cjs}',
|
|
89
|
-
'dist',
|
|
90
|
-
'out',
|
|
91
|
-
'README.md'
|
|
92
|
-
],
|
|
93
|
-
classes: {
|
|
94
|
-
// whitelist of class names for unpredictable dynamics
|
|
95
|
-
fixed: [],
|
|
96
|
-
// blacklist of class names to exclude accidentally captured
|
|
97
|
-
ignored: [] // or RegExp[]
|
|
98
|
-
},
|
|
99
|
-
cwd: process.cwd()
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Methods
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
// Reload the compiler and MasterCSS
|
|
107
|
-
refresh(): this
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
```ts
|
|
111
|
-
// Scan sources, extract class names, and generate CSS rules
|
|
112
|
-
compile()
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
```ts
|
|
116
|
-
// Extract potential class names from the given file content
|
|
117
|
-
extract(name: string, content: string): string[]
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
```ts
|
|
121
|
-
// `extract(name, content)`, insert extractions, and generate CSS rules
|
|
122
|
-
insert(name: string, content: string): boolean
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
```ts
|
|
126
|
-
// Read file source paths by `options.include` and `options.exclude`
|
|
127
|
-
get sources(): string[]
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
```ts
|
|
131
|
-
// Check source file path by `options.include` and `options.exclude`
|
|
132
|
-
checkSourcePath(name: string): boolean
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
// Read user config file by `options.config`
|
|
137
|
-
readConfig(): Config
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```ts
|
|
141
|
-
// Get user config path
|
|
142
|
-
get configPath(): string
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
// Get resolved user config path
|
|
147
|
-
get resolvedConfigPath(): string
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Properties
|
|
151
|
-
|
|
152
|
-
```ts
|
|
153
|
-
export default class MasterCSSCompiler {
|
|
154
|
-
css: MasterCSS
|
|
155
|
-
extractions = new Set<string>()
|
|
156
|
-
...
|
|
157
|
-
}
|
|
158
|
-
```
|
|
1
|
+
Check out the [official documentation](https://beta.css.master.co/docs/compiler).
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@master/css-compiler","scripts":{"build":"techor pack --platform node --shakable","dev":"npm run build -- --watch","lint":"eslint ./src","test":"jest"},"license":"MIT","description":"The ahead-of-time compiler of Master CSS","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/compiler"},"keywords":["webpack","plugin","integration","vite","parcel","build tools","css","mastercss","vite-plugin"],"sideEffects":false,"main":"./dist/cjs/index.js","jsnext:main":"./dist/esm/index.mjs","esnext":"./dist/esm/index.mjs","module":"./dist/esm/index.mjs","types":"./dist/index.d.ts","exports":{".":{"node":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.mjs","types":"./dist/index.d.ts"},"require":"./dist/cjs/index.default.js","import":"./dist/esm/index.default.mjs","types":"./dist/index.default.d.ts"}},"files":["dist"],"publishConfig":{"access":"public"},"dependencies":{"@master/css":"^2.0.0-beta.
|
|
1
|
+
{"name":"@master/css-compiler","scripts":{"build":"techor pack --platform node --shakable","dev":"npm run build -- --watch","lint":"eslint ./src","test":"jest"},"license":"MIT","description":"The ahead-of-time compiler of Master CSS","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/compiler"},"keywords":["webpack","plugin","integration","vite","parcel","build tools","css","mastercss","vite-plugin"],"sideEffects":false,"main":"./dist/cjs/index.js","jsnext:main":"./dist/esm/index.mjs","esnext":"./dist/esm/index.mjs","module":"./dist/esm/index.mjs","types":"./dist/index.d.ts","exports":{".":{"node":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.mjs","types":"./dist/index.d.ts"},"require":"./dist/cjs/index.default.js","import":"./dist/esm/index.default.mjs","types":"./dist/index.default.d.ts"}},"files":["dist"],"publishConfig":{"access":"public"},"dependencies":{"@master/css":"^2.0.0-beta.133","fast-glob":"^3.2.12","minimatch":"^5.1.1","stylelint":"^15.2.0","techor":"^1.2.7","to-extend":"^1.5.2","upath":"^2.0.1"},"devDependencies":{"@swc-node/jest":"^1.6.2","ts-jest":"^29.0.5"},"version":"2.0.0-beta.133"}
|