@unocss/cli 66.6.8 → 66.7.0-beta.1

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,4 +1,4 @@
1
- import { n as handleError, r as version, t as build } from "./src-8qD2Z7Td.mjs";
1
+ import { n as handleError, r as version, t as build } from "./src-0GM1yfOA.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-8qD2Z7Td.mjs";
1
+ import { t as build } from "./src-0GM1yfOA.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 = ((_rawConfig$content = rawConfig.content) === null || _rawConfig$content === void 0 ? void 0 : _rawConfig$content.pipeline) === false ? () => false : createFilter(((_rawConfig$content2 = rawConfig.content) === null || _rawConfig$content2 === void 0 || (_rawConfig$content2 = _rawConfig$content2.pipeline) === null || _rawConfig$content2 === void 0 ? void 0 : _rawConfig$content2.include) || defaultPipelineInclude, ((_rawConfig$content3 = rawConfig.content) === null || _rawConfig$content3 === void 0 || (_rawConfig$content3 = _rawConfig$content3.pipeline) === null || _rawConfig$content3 === void 0 ? void 0 : _rawConfig$content3.exclude) || defaultPipelineExclude, { resolve: typeof configOrPath === "string" ? configOrPath : root });
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.6.8";
195
+ var version = "66.7.0-beta.1";
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 = (options === null || options === void 0 ? void 0 : options.cwd) || process.cwd();
249
- const newWatcher = watch((options === null || options === void 0 ? void 0 : options.patterns).map((p) => {
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 ((_options$patterns = options.patterns) === null || _options$patterns === void 0 ? void 0 : _options$patterns.length) resolvedOptions.entries.push({
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(((_userConfig$cli = userConfig.cli) === null || _userConfig$cli === void 0 ? void 0 : _userConfig$cli.entry) || []).map((entry) => ({
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 ?? (_options.cwd = process.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: (transformsRes === null || transformsRes === void 0 ? void 0 : transformsRes.code) ?? source.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.6.8",
4
+ "version": "66.7.0-beta.1",
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.6.8",
50
- "@unocss/preset-wind3": "66.6.8",
51
- "@unocss/core": "66.6.8",
52
- "@unocss/preset-wind4": "66.6.8",
53
- "@unocss/transformer-directives": "66.6.8"
46
+ "@unocss/core": "66.7.0-beta.1",
47
+ "@unocss/preset-wind4": "66.7.0-beta.1",
48
+ "@unocss/preset-wind3": "66.7.0-beta.1",
49
+ "@unocss/transformer-directives": "66.7.0-beta.1",
50
+ "@unocss/config": "66.7.0-beta.1"
54
51
  },
55
52
  "scripts": {
56
53
  "build": "tsdown --config-loader unrun",