@unocss/cli 0.45.29 → 0.46.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.4f378b9a.mjs';
4
+ import { b as build, v as version, h as handleError } from './shared/cli.a9e425d0.mjs';
5
5
  import 'fs';
6
6
  import 'pathe';
7
7
  import 'fast-glob';
package/dist/index.mjs CHANGED
@@ -5,9 +5,9 @@ import 'consola';
5
5
  import 'colorette';
6
6
  import 'perfect-debounce';
7
7
  import '@unocss/core';
8
- import '@unocss/config';
9
- export { b as build, r as resolveOptions } from './shared/cli.4f378b9a.mjs';
8
+ export { b as build, r as resolveOptions } from './shared/cli.a9e425d0.mjs';
10
9
  import '@rollup/pluginutils';
10
+ import '@unocss/config';
11
11
  import 'magic-string';
12
12
  import '@ampproject/remapping';
13
13
  import '@unocss/preset-uno';
@@ -5,20 +5,20 @@ import consola from 'consola';
5
5
  import { cyan, green, dim } from 'colorette';
6
6
  import { debounce } from 'perfect-debounce';
7
7
  import { cssIdRE, createGenerator, BetterMap, toArray } from '@unocss/core';
8
- import { loadConfig } from '@unocss/config';
9
8
  import { createFilter } from '@rollup/pluginutils';
9
+ import { loadConfig } from '@unocss/config';
10
10
  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.45.29";
14
+ const version = "0.46.0";
15
15
 
16
16
  const INCLUDE_COMMENT = "@unocss-include";
17
17
  const IGNORE_COMMENT = "@unocss-ignore";
18
18
  const CSS_PLACEHOLDER = "@unocss-placeholder";
19
19
 
20
20
  const defaultExclude = [cssIdRE];
21
- const defaultInclude = [/\.vue$/, /\.vue\?vue/, /\.svelte$/, /\.[jt]sx$/, /\.mdx?$/, /\.astro$/, /\.elm$/, /\.html$/];
21
+ const defaultInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|html)($|\?)/];
22
22
 
23
23
  function createContext(configOrPath, defaults = {}, extraConfigSources = [], resolveConfigResult = () => {
24
24
  }) {
@@ -182,8 +182,12 @@ async function build(_options) {
182
182
  const fileCache = /* @__PURE__ */ new Map();
183
183
  const cwd = _options.cwd || process.cwd();
184
184
  const options = await resolveOptions(_options);
185
- const { config, sources: configSources } = await loadConfig(cwd, options.config);
186
- const ctx = createContext(config, defaultConfig);
185
+ async function loadConfig() {
186
+ const ctx2 = createContext(options.config, defaultConfig);
187
+ const configSources2 = (await ctx2.updateRoot(cwd)).sources;
188
+ return { ctx: ctx2, configSources: configSources2 };
189
+ }
190
+ const { ctx, configSources } = await loadConfig();
187
191
  const files = await fg(options.patterns, { cwd, absolute: true });
188
192
  await Promise.all(
189
193
  files.map(async (file) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/cli",
3
- "version": "0.45.29",
3
+ "version": "0.46.0",
4
4
  "description": "CLI for UnoCSS",
5
5
  "author": {
6
6
  "name": "Johann Schopplich",
@@ -40,16 +40,16 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@ampproject/remapping": "^2.2.0",
43
- "@rollup/pluginutils": "^4.2.1",
44
- "@unocss/config": "0.45.29",
45
- "@unocss/core": "0.45.29",
46
- "@unocss/preset-uno": "0.45.29",
43
+ "@rollup/pluginutils": "^5.0.1",
44
+ "@unocss/config": "0.46.0",
45
+ "@unocss/core": "0.46.0",
46
+ "@unocss/preset-uno": "0.46.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.26.6",
52
+ "magic-string": "^0.26.7",
53
53
  "pathe": "^0.3.9",
54
54
  "perfect-debounce": "^0.1.3"
55
55
  },