@unocss/cli 0.54.2 → 0.55.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
@@ -2,7 +2,7 @@ import process from 'node:process';
2
2
  import { cac } from 'cac';
3
3
  import { loadConfig } from '@unocss/config';
4
4
  import { toArray } from '@unocss/core';
5
- import { b as build, v as version, h as handleError } from './shared/cli.abae14eb.mjs';
5
+ import { b as build, v as version, h as handleError } from './shared/cli.121b364e.mjs';
6
6
  import 'node:fs';
7
7
  import 'pathe';
8
8
  import 'fast-glob';
@@ -23,7 +23,7 @@ async function startCli(cwd = process.cwd(), argv = process.argv, options = {})
23
23
  default: cwd
24
24
  }).option("--stdout", "Output to STDOUT", {
25
25
  default: false
26
- }).option("-c, --config [file]", "Config file").option("-w, --watch", "Watch for file changes").option("--preflights", "Enable preflights", { default: true }).option("-m, --minify", "Minify generated CSS", { default: false }).action(async (patterns, flags) => {
26
+ }).option("-c, --config [file]", "Config file").option("-w, --watch", "Watch for file changes").option("--write-transformed", "Update source files with transformed utilities", { default: false }).option("--preflights", "Enable preflights", { default: true }).option("-m, --minify", "Minify generated CSS", { default: false }).action(async (patterns, flags) => {
27
27
  Object.assign(options, {
28
28
  cwd,
29
29
  ...flags
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ interface CliOptions {
7
7
  watch?: boolean;
8
8
  config?: string;
9
9
  stdout?: boolean;
10
+ writeTransformed?: boolean;
10
11
  preflights?: boolean;
11
12
  minify?: boolean;
12
13
  }
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import 'consola';
6
6
  import 'colorette';
7
7
  import 'perfect-debounce';
8
8
  import '@unocss/core';
9
- export { b as build, r as resolveOptions } from './shared/cli.abae14eb.mjs';
9
+ export { b as build, r as resolveOptions } from './shared/cli.121b364e.mjs';
10
10
  import '@rollup/pluginutils';
11
11
  import '@unocss/config';
12
12
  import 'magic-string';
@@ -204,7 +204,7 @@ function restoreSkipCode(code, map) {
204
204
  return code;
205
205
  }
206
206
 
207
- const version = "0.54.2";
207
+ const version = "0.55.0";
208
208
 
209
209
  const defaultConfig = {
210
210
  envMode: "build",
@@ -321,12 +321,14 @@ async function build(_options) {
321
321
  const preTransform = await transformFiles(sourceCache, "pre");
322
322
  const defaultTransform = await transformFiles(preTransform);
323
323
  const postTransform = await transformFiles(defaultTransform, "post");
324
- await Promise.all(
325
- postTransform.filter(({ transformedCode }) => !!transformedCode).map(({ transformedCode, id }) => new Promise((resolve2) => {
326
- if (existsSync(id))
327
- promises.writeFile(id, transformedCode, "utf-8").then(resolve2);
328
- }))
329
- );
324
+ if (options2.writeTransformed) {
325
+ await Promise.all(
326
+ postTransform.filter(({ transformedCode }) => !!transformedCode).map(({ transformedCode, id }) => new Promise((resolve2) => {
327
+ if (existsSync(id))
328
+ promises.writeFile(id, transformedCode, "utf-8").then(resolve2);
329
+ }))
330
+ );
331
+ }
330
332
  const { css, matched } = await ctx.uno.generate(
331
333
  [...postTransform.map(({ code, transformedCode }) => transformedCode ?? code)].join("\n"),
332
334
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/cli",
3
- "version": "0.54.2",
3
+ "version": "0.55.0",
4
4
  "description": "CLI for UnoCSS",
5
5
  "author": {
6
6
  "name": "Johann Schopplich",
@@ -49,9 +49,9 @@
49
49
  "magic-string": "^0.30.2",
50
50
  "pathe": "^1.1.1",
51
51
  "perfect-debounce": "^1.0.0",
52
- "@unocss/config": "0.54.2",
53
- "@unocss/core": "0.54.2",
54
- "@unocss/preset-uno": "0.54.2"
52
+ "@unocss/config": "0.55.0",
53
+ "@unocss/core": "0.55.0",
54
+ "@unocss/preset-uno": "0.55.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "unbuild",