@unocss/cli 0.47.6 → 0.48.0
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.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cac } from 'cac';
|
|
2
2
|
import { loadConfig } from '@unocss/config';
|
|
3
3
|
import { toArray } from '@unocss/core';
|
|
4
|
-
import { b as build, v as version, h as handleError } from './shared/cli.
|
|
4
|
+
import { b as build, v as version, h as handleError } from './shared/cli.63059cce.mjs';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'pathe';
|
|
7
7
|
import 'fast-glob';
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import 'consola';
|
|
|
5
5
|
import 'colorette';
|
|
6
6
|
import 'perfect-debounce';
|
|
7
7
|
import '@unocss/core';
|
|
8
|
-
export { b as build, r as resolveOptions } from './shared/cli.
|
|
8
|
+
export { b as build, r as resolveOptions } from './shared/cli.63059cce.mjs';
|
|
9
9
|
import '@rollup/pluginutils';
|
|
10
10
|
import '@unocss/config';
|
|
11
11
|
import 'magic-string';
|
|
@@ -11,7 +11,7 @@ import MagicString from 'magic-string';
|
|
|
11
11
|
import remapping from '@ampproject/remapping';
|
|
12
12
|
import presetUno from '@unocss/preset-uno';
|
|
13
13
|
|
|
14
|
-
const version = "0.
|
|
14
|
+
const version = "0.48.0";
|
|
15
15
|
|
|
16
16
|
const INCLUDE_COMMENT = "@unocss-include";
|
|
17
17
|
const IGNORE_COMMENT = "@unocss-ignore";
|
|
@@ -31,6 +31,7 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
31
31
|
const reloadListeners = [];
|
|
32
32
|
const modules = new BetterMap();
|
|
33
33
|
const tokens = /* @__PURE__ */ new Set();
|
|
34
|
+
const tasks = [];
|
|
34
35
|
const affectedModules = /* @__PURE__ */ new Set();
|
|
35
36
|
let ready = reloadConfig();
|
|
36
37
|
async function reloadConfig() {
|
|
@@ -80,15 +81,20 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
80
81
|
if (tokens.size > len)
|
|
81
82
|
invalidate();
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
function filter(code, id) {
|
|
84
85
|
if (code.includes(IGNORE_COMMENT))
|
|
85
86
|
return false;
|
|
86
87
|
return code.includes(INCLUDE_COMMENT) || code.includes(CSS_PLACEHOLDER) || rollupFilter(id.replace(/\?v=\w+$/, ""));
|
|
87
|
-
}
|
|
88
|
+
}
|
|
88
89
|
async function getConfig() {
|
|
89
90
|
await ready;
|
|
90
91
|
return rawConfig;
|
|
91
92
|
}
|
|
93
|
+
async function flushTasks() {
|
|
94
|
+
const _tasks = [...tasks];
|
|
95
|
+
await Promise.all(_tasks);
|
|
96
|
+
tasks.splice(0, _tasks.length);
|
|
97
|
+
}
|
|
92
98
|
return {
|
|
93
99
|
get ready() {
|
|
94
100
|
return ready;
|
|
@@ -96,6 +102,8 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
96
102
|
tokens,
|
|
97
103
|
modules,
|
|
98
104
|
affectedModules,
|
|
105
|
+
tasks,
|
|
106
|
+
flushTasks,
|
|
99
107
|
invalidate,
|
|
100
108
|
onInvalidate(fn) {
|
|
101
109
|
invalidations.push(fn);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "CLI for UnoCSS",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Johann Schopplich",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@ampproject/remapping": "^2.2.0",
|
|
43
43
|
"@rollup/pluginutils": "^5.0.2",
|
|
44
|
-
"@unocss/config": "0.
|
|
45
|
-
"@unocss/core": "0.
|
|
46
|
-
"@unocss/preset-uno": "0.
|
|
44
|
+
"@unocss/config": "0.48.0",
|
|
45
|
+
"@unocss/core": "0.48.0",
|
|
46
|
+
"@unocss/preset-uno": "0.48.0",
|
|
47
47
|
"cac": "^6.7.14",
|
|
48
48
|
"chokidar": "^3.5.3",
|
|
49
49
|
"colorette": "^2.0.19",
|
|
50
50
|
"consola": "^2.15.3",
|
|
51
51
|
"fast-glob": "^3.2.12",
|
|
52
|
-
"magic-string": "^0.
|
|
52
|
+
"magic-string": "^0.27.0",
|
|
53
53
|
"pathe": "^1.0.0",
|
|
54
54
|
"perfect-debounce": "^0.1.3"
|
|
55
55
|
},
|