@unocss/postcss 0.62.3 → 0.63.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.
Files changed (2) hide show
  1. package/dist/esm.mjs +13 -13
  2. package/package.json +7 -8
package/dist/esm.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import { stat, readFile } from 'node:fs/promises';
2
2
  import { normalize } from 'node:path';
3
3
  import process from 'node:process';
4
- import { glob } from 'tinyglobby';
5
- import postcss from 'postcss';
6
- import { expandVariantGroup, notNull, regexScopePlaceholder, createGenerator } from '@unocss/core';
7
4
  import { createRecoveryConfigLoader } from '@unocss/config';
5
+ import { expandVariantGroup, notNull, regexScopePlaceholder, createGenerator } from '@unocss/core';
8
6
  import { transformThemeFn, hasThemeFn } from '@unocss/rule-utils';
7
+ import postcss from 'postcss';
8
+ import { glob } from 'tinyglobby';
9
9
  import { parse, generate, clone } from 'css-tree';
10
10
 
11
11
  const defaultFilesystemGlobs = [
@@ -79,12 +79,6 @@ async function parseApply(root, uno, directiveName) {
79
79
  await Promise.all(promises);
80
80
  }
81
81
 
82
- async function parseTheme(root, uno) {
83
- root.walkDecls((decl) => {
84
- decl.value = transformThemeFn(decl.value, uno.config.theme);
85
- });
86
- }
87
-
88
82
  async function parseScreen(root, uno, directiveName) {
89
83
  root.walkAtRules(directiveName, async (rule) => {
90
84
  let breakpointName = "";
@@ -132,6 +126,12 @@ function calcMaxWidthBySize(size) {
132
126
  return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
133
127
  }
134
128
 
129
+ async function parseTheme(root, uno) {
130
+ root.walkDecls((decl) => {
131
+ decl.value = transformThemeFn(decl.value, uno.config.theme);
132
+ });
133
+ }
134
+
135
135
  function createPlugin(options) {
136
136
  const {
137
137
  cwd = process.cwd(),
@@ -226,16 +226,16 @@ function createPlugin(options) {
226
226
  for (let i = 0; i < entries.length; i += BATCH_SIZE) {
227
227
  const batch = entries.slice(i, i + BATCH_SIZE);
228
228
  promises.push(...batch.map(async (file) => {
229
- const { mtimeMs } = await stat(file);
230
- if (fileMap.has(file) && mtimeMs <= fileMap.get(file))
231
- return;
232
- fileMap.set(file, mtimeMs);
233
229
  result.messages.push({
234
230
  type: "dependency",
235
231
  plugin: directiveMap.unocss,
236
232
  file: normalize(file),
237
233
  parent: from
238
234
  });
235
+ const { mtimeMs } = await stat(file);
236
+ if (fileMap.has(file) && mtimeMs <= fileMap.get(file))
237
+ return;
238
+ fileMap.set(file, mtimeMs);
239
239
  const content = await readFile(file, "utf8");
240
240
  const { matched } = await uno.generate(content, {
241
241
  id: file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/postcss",
3
3
  "type": "module",
4
- "version": "0.62.3",
4
+ "version": "0.63.0",
5
5
  "description": "PostCSS plugin for UnoCSS",
6
6
  "author": "sibbng <sibbngheid@gmail.com>",
7
7
  "license": "MIT",
@@ -54,13 +54,12 @@
54
54
  "postcss": "^8.4.21"
55
55
  },
56
56
  "dependencies": {
57
- "css-tree": "^2.3.1",
58
- "magic-string": "^0.30.11",
59
- "postcss": "^8.4.41",
60
- "tinyglobby": "^0.2.5",
61
- "@unocss/core": "0.62.3",
62
- "@unocss/rule-utils": "0.62.3",
63
- "@unocss/config": "0.62.3"
57
+ "css-tree": "^3.0.0",
58
+ "postcss": "^8.4.47",
59
+ "tinyglobby": "^0.2.6",
60
+ "@unocss/core": "0.63.0",
61
+ "@unocss/rule-utils": "0.63.0",
62
+ "@unocss/config": "0.63.0"
64
63
  },
65
64
  "scripts": {
66
65
  "build": "unbuild",