@unocss/cli 66.6.8 → 66.7.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 +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-8qD2Z7Td.mjs → src-uJ02cLnZ.mjs} +12 -14
- package/package.json +6 -9
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as handleError, r as version, t as build } from "./src-
|
|
1
|
+
import { n as handleError, r as version, t as build } from "./src-uJ02cLnZ.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { green } from "colorette";
|
|
4
4
|
import { resolve } from "pathe";
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as build } from "./src-
|
|
1
|
+
import { t as build } from "./src-uJ02cLnZ.mjs";
|
|
2
2
|
export { build };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { existsSync, promises } from "node:fs";
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
import { createRecoveryConfigLoader } from "@unocss/config";
|
|
4
3
|
import { BetterMap, createGenerator, cssIdRE, toArray } from "@unocss/core";
|
|
5
|
-
import { createFilter } from "unplugin-utils";
|
|
6
|
-
import remapping from "@jridgewell/remapping";
|
|
7
|
-
import MagicString from "magic-string";
|
|
8
4
|
import { cyan, dim, green, yellow } from "colorette";
|
|
9
5
|
import consola, { consola as consola$1 } from "consola";
|
|
10
6
|
import { basename, dirname, normalize, relative, resolve } from "pathe";
|
|
11
7
|
import { debounce } from "perfect-debounce";
|
|
12
8
|
import { glob } from "tinyglobby";
|
|
9
|
+
import { createRecoveryConfigLoader } from "@unocss/config";
|
|
10
|
+
import { createFilter } from "unplugin-utils";
|
|
11
|
+
import remapping from "@jridgewell/remapping";
|
|
12
|
+
import MagicString from "magic-string";
|
|
13
13
|
const SKIP_START_COMMENT = "@unocss-skip-start";
|
|
14
14
|
const SKIP_END_COMMENT = "@unocss-skip-end";
|
|
15
15
|
const SKIP_COMMENT_RE = new RegExp(`(\/\/\\s*?${SKIP_START_COMMENT}\\s*?|\\/\\*\\s*?${SKIP_START_COMMENT}\\s*?\\*\\/|<!--\\s*?${SKIP_START_COMMENT}\\s*?-->)[\\s\\S]*?(\/\/\\s*?${SKIP_END_COMMENT}\\s*?|\\/\\*\\s*?${SKIP_END_COMMENT}\\s*?\\*\\/|<!--\\s*?${SKIP_END_COMMENT}\\s*?-->)`, "g");
|
|
@@ -38,7 +38,6 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
38
38
|
const loadConfig = createRecoveryConfigLoader();
|
|
39
39
|
let ready = reloadConfig();
|
|
40
40
|
async function reloadConfig() {
|
|
41
|
-
var _rawConfig$content, _rawConfig$content2, _rawConfig$content3;
|
|
42
41
|
await _uno;
|
|
43
42
|
const result = await loadConfig(root, configOrPath, extraConfigSources, defaults);
|
|
44
43
|
resolveConfigResult(result);
|
|
@@ -47,7 +46,7 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
|
|
|
47
46
|
configFileList = result.sources;
|
|
48
47
|
await uno.setConfig(rawConfig);
|
|
49
48
|
uno.config.envMode = "dev";
|
|
50
|
-
rollupFilter =
|
|
49
|
+
rollupFilter = rawConfig.content?.pipeline === false ? () => false : createFilter(rawConfig.content?.pipeline?.include || defaultPipelineInclude, rawConfig.content?.pipeline?.exclude || defaultPipelineExclude, { resolve: typeof configOrPath === "string" ? configOrPath : root });
|
|
51
50
|
tokens.clear();
|
|
52
51
|
await Promise.all(modules.map((code, id) => uno.applyExtractors(code.replace(SKIP_COMMENT_RE, ""), id, tokens)));
|
|
53
52
|
invalidate();
|
|
@@ -193,7 +192,7 @@ async function applyTransformers(ctx, original, id, enforce = "default") {
|
|
|
193
192
|
}
|
|
194
193
|
//#endregion
|
|
195
194
|
//#region package.json
|
|
196
|
-
var version = "66.
|
|
195
|
+
var version = "66.7.0";
|
|
197
196
|
//#endregion
|
|
198
197
|
//#region src/debug.ts
|
|
199
198
|
/**
|
|
@@ -245,8 +244,8 @@ async function getWatcher(options) {
|
|
|
245
244
|
if (!options) return { close: () => {} };
|
|
246
245
|
const { watch } = await import("chokidar");
|
|
247
246
|
const ignored = ["**/{.git,node_modules}/**"];
|
|
248
|
-
const cwd =
|
|
249
|
-
const newWatcher = watch((options
|
|
247
|
+
const cwd = options?.cwd || process.cwd();
|
|
248
|
+
const newWatcher = watch((options?.patterns).map((p) => {
|
|
250
249
|
const abs = resolve(cwd, p);
|
|
251
250
|
if (abs.endsWith("/**/*")) return abs.slice(0, -5);
|
|
252
251
|
return abs;
|
|
@@ -263,19 +262,18 @@ async function getWatcher(options) {
|
|
|
263
262
|
//#endregion
|
|
264
263
|
//#region src/index.ts
|
|
265
264
|
async function resolveOptions(options, userConfig) {
|
|
266
|
-
var _options$patterns, _userConfig$cli;
|
|
267
265
|
const resolvedOptions = {
|
|
268
266
|
...options,
|
|
269
267
|
entries: [],
|
|
270
268
|
debug: options.debug || false
|
|
271
269
|
};
|
|
272
|
-
if (
|
|
270
|
+
if (options.patterns?.length) resolvedOptions.entries.push({
|
|
273
271
|
patterns: options.patterns,
|
|
274
272
|
outFile: options.outFile ?? resolve(options.cwd, "uno.css"),
|
|
275
273
|
rewrite: (options.rewrite || options.writeTransformed) ?? false,
|
|
276
274
|
splitCss: options.splitCss ?? true
|
|
277
275
|
});
|
|
278
|
-
const configEntries = toArray(
|
|
276
|
+
const configEntries = toArray(userConfig.cli?.entry || []).map((entry) => ({
|
|
279
277
|
...entry,
|
|
280
278
|
rewrite: entry.rewrite !== void 0 ? entry.rewrite : (options.rewrite || options.writeTransformed) ?? false,
|
|
281
279
|
splitCss: entry.splitCss !== void 0 ? entry.splitCss : options.splitCss ?? true
|
|
@@ -340,7 +338,7 @@ async function parseEntries(options, cache) {
|
|
|
340
338
|
for (const [key, value] of newCache) cache.set(key, value);
|
|
341
339
|
}
|
|
342
340
|
async function build(_options) {
|
|
343
|
-
_options.cwd
|
|
341
|
+
_options.cwd ??= process.cwd();
|
|
344
342
|
/**
|
|
345
343
|
* Cache of files to process
|
|
346
344
|
*
|
|
@@ -417,7 +415,7 @@ async function transformFiles(ctx, sources) {
|
|
|
417
415
|
applyTransformers(ctx, source.transformedCode ?? source.code, source.id, enforce).then((transformsRes) => {
|
|
418
416
|
resolve({
|
|
419
417
|
...source,
|
|
420
|
-
transformedCode:
|
|
418
|
+
transformedCode: transformsRes?.code ?? source.transformedCode
|
|
421
419
|
});
|
|
422
420
|
});
|
|
423
421
|
})));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.
|
|
4
|
+
"version": "66.7.0",
|
|
5
5
|
"description": "CLI for UnoCSS",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Johann Schopplich",
|
|
@@ -32,9 +32,6 @@
|
|
|
32
32
|
"bin",
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=14"
|
|
37
|
-
},
|
|
38
35
|
"dependencies": {
|
|
39
36
|
"@jridgewell/remapping": "^2.3.5",
|
|
40
37
|
"cac": "^7.0.0",
|
|
@@ -46,11 +43,11 @@
|
|
|
46
43
|
"perfect-debounce": "^2.1.0",
|
|
47
44
|
"tinyglobby": "^0.2.16",
|
|
48
45
|
"unplugin-utils": "^0.3.1",
|
|
49
|
-
"@unocss/config": "66.
|
|
50
|
-
"@unocss/
|
|
51
|
-
"@unocss/
|
|
52
|
-
"@unocss/
|
|
53
|
-
"@unocss/
|
|
46
|
+
"@unocss/config": "66.7.0",
|
|
47
|
+
"@unocss/core": "66.7.0",
|
|
48
|
+
"@unocss/preset-wind3": "66.7.0",
|
|
49
|
+
"@unocss/transformer-directives": "66.7.0",
|
|
50
|
+
"@unocss/preset-wind4": "66.7.0"
|
|
54
51
|
},
|
|
55
52
|
"scripts": {
|
|
56
53
|
"build": "tsdown --config-loader unrun",
|