@jiakun-zhao/unocss-preset 0.0.3 → 0.0.4

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/index.mjs +6 -7
  2. package/package.json +3 -4
package/dist/index.mjs CHANGED
@@ -1,11 +1,10 @@
1
- import { resolvePath } from "mlly";
1
+ import { fileURLToPath } from "node:url";
2
2
 
3
3
  //#region package.json
4
4
  var name = "@jiakun-zhao/unocss-preset";
5
5
  var dependencies = {
6
6
  "@fontsource-variable/geist": "^5.2.8",
7
- "@fontsource-variable/geist-mono": "^5.2.7",
8
- "mlly": "^1.8.0"
7
+ "@fontsource-variable/geist-mono": "^5.2.7"
9
8
  };
10
9
 
11
10
  //#endregion
@@ -79,13 +78,13 @@ function src_default() {
79
78
  }
80
79
  },
81
80
  preflights: [{ async getCSS() {
82
- const fonts = Object.keys(dependencies).filter((it) => it.startsWith("@fontsource"));
83
- const paths = await Promise.all(fonts.map((it) => resolvePath(it)));
84
- paths.push(await resolvePath(`${name}/reset.css`));
85
- return paths.map((path) => `@import url(${JSON.stringify(path)});`).join("");
81
+ return [...Object.keys(dependencies).filter((it) => it.startsWith("@fontsource")), `${name}/reset.css`].map(resolvePath).map((path) => `@import url(${JSON.stringify(path)});`).join("");
86
82
  } }]
87
83
  };
88
84
  }
85
+ function resolvePath(specifier) {
86
+ return fileURLToPath(import.meta.resolve(specifier));
87
+ }
89
88
 
90
89
  //#endregion
91
90
  export { src_default as default, neutralColor };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jiakun-zhao/unocss-preset",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "description": "",
6
6
  "author": "Jiakun Zhao <hi@zhaojiakun.com>",
7
7
  "license": "MIT",
@@ -32,11 +32,10 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@fontsource-variable/geist": "^5.2.8",
35
- "@fontsource-variable/geist-mono": "^5.2.7",
36
- "mlly": "^1.8.0"
35
+ "@fontsource-variable/geist-mono": "^5.2.7"
37
36
  },
38
37
  "devDependencies": {
39
- "@jiakun-zhao/eslint-config": "^4.1.8",
38
+ "@jiakun-zhao/eslint-config": "^4.2.0",
40
39
  "@types/node": "^25.0.3",
41
40
  "bumpp": "^10.3.2",
42
41
  "eslint": "^9.39.2",