@devup-ui/next-plugin 1.0.53 → 1.0.54

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/loader.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("node:fs"),t=require("node:fs/promises"),r=require("node:path"),e=require("@devup-ui/wasm");let F=!1;const J=function(S){const{watch:o,package:M,cssDir:n,sheetFile:c,classMapFile:p,fileMapFile:u,themeFile:h,singleCss:g,theme:y,defaultClassMap:w,defaultFileMap:x,defaultSheet:v}=this.getOptions(),s=[];F||(F=!0,o?(l.existsSync(c)&&s.push(t.readFile(c,"utf-8").then(JSON.parse).then(e.importSheet)),l.existsSync(p)&&s.push(t.readFile(p,"utf-8").then(JSON.parse).then(e.importClassMap)),l.existsSync(u)&&s.push(t.readFile(u,"utf-8").then(JSON.parse).then(e.importFileMap)),l.existsSync(h)&&s.push(t.readFile(h,"utf-8").then(JSON.parse).then(i=>i?.theme??{}).then(e.registerTheme))):(e.importFileMap(x),e.importClassMap(w),e.importSheet(v),e.registerTheme(y)));const f=this.async();try{const i=this.resourcePath;let a=r.relative(r.dirname(i),n).replaceAll("\\","/");const C=r.relative(process.cwd(),i);a.startsWith("./")||(a=`./${a}`);const{code:O,map:d,cssFile:m,updatedBaseStyle:P}=e.codeExtract(C,S.toString(),M,a,g,!1,!0),b=d?JSON.parse(d):null;P&&o&&s.push(t.writeFile(r.join(n,"devup-ui.css"),e.getCss(null,!1),"utf-8")),m&&o&&s.push(t.writeFile(r.join(n,r.basename(m)),`/* ${this.resourcePath} ${Date.now()} */`),t.writeFile(c,e.exportSheet()),t.writeFile(p,e.exportClassMap()),t.writeFile(u,e.exportFileMap())),Promise.all(s).catch(console.error).finally(()=>f(null,O,b))}catch(i){Promise.all(s).catch(console.error).finally(()=>f(i))}};exports.default=J;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("node:fs"),i=require("node:fs/promises"),s=require("node:path"),e=require("@devup-ui/wasm");let m=!1;const J=function(F){const{watch:o,package:y,cssDir:c,sheetFile:n,classMapFile:p,fileMapFile:u,themeFile:f,singleCss:M,theme:g,defaultClassMap:w,defaultFileMap:x,defaultSheet:v}=this.getOptions(),r=[];m||(m=!0,o?(t.existsSync(n)&&e.importSheet(JSON.parse(t.readFileSync(n,"utf-8"))),t.existsSync(p)&&e.importClassMap(JSON.parse(t.readFileSync(p,"utf-8"))),t.existsSync(u)&&e.importFileMap(JSON.parse(t.readFileSync(u,"utf-8"))),t.existsSync(f)&&e.registerTheme(JSON.parse(t.readFileSync(f,"utf-8"))?.theme??{})):(e.importFileMap(x),e.importClassMap(w),e.importSheet(v),e.registerTheme(g)));const h=this.async();try{const a=this.resourcePath;let l=s.relative(s.dirname(a),c).replaceAll("\\","/");const C=s.relative(process.cwd(),a);l.startsWith("./")||(l=`./${l}`);const{code:O,map:d,cssFile:S,updatedBaseStyle:P}=e.codeExtract(C,F.toString(),y,l,M,!1,!0),b=d?JSON.parse(d):null;P&&o&&r.push(i.writeFile(s.join(c,"devup-ui.css"),e.getCss(null,!1),"utf-8")),S&&o&&r.push(i.writeFile(s.join(c,s.basename(S)),`/* ${this.resourcePath} ${Date.now()} */`),i.writeFile(n,e.exportSheet()),i.writeFile(p,e.exportClassMap()),i.writeFile(u,e.exportFileMap())),Promise.all(r).catch(console.error).finally(()=>h(null,O,b))}catch(a){Promise.all(r).catch(console.error).finally(()=>h(a))}};exports.default=J;
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAElB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;CACvB;AAGD,QAAA,MAAM,aAAa,EAAE,2BAA2B,CAAC,oBAAoB,CAiGlE,CAAA;AACH,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAE1D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAElB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;CACvB;AAGD,QAAA,MAAM,aAAa,EAAE,2BAA2B,CAAC,oBAAoB,CAsFlE,CAAA;AACH,eAAe,aAAa,CAAA"}
package/dist/loader.js CHANGED
@@ -1,39 +1,33 @@
1
- import { existsSync as r } from "node:fs";
2
- import { readFile as i, writeFile as s } from "node:fs/promises";
1
+ import { existsSync as r, readFileSync as i } from "node:fs";
2
+ import { writeFile as e } from "node:fs/promises";
3
3
  import { relative as d, dirname as j, join as S, basename as A } from "node:path";
4
- import { importSheet as F, importClassMap as M, importFileMap as g, registerTheme as x, codeExtract as B, getCss as E, exportSheet as I, exportClassMap as L, exportFileMap as T } from "@devup-ui/wasm";
5
- let y = !1;
4
+ import { importSheet as F, importClassMap as M, importFileMap as g, registerTheme as y, codeExtract as B, getCss as E, exportSheet as I, exportClassMap as L, exportFileMap as T } from "@devup-ui/wasm";
5
+ let x = !1;
6
6
  const G = function(C) {
7
7
  const {
8
8
  watch: l,
9
9
  package: O,
10
10
  cssDir: o,
11
- sheetFile: p,
12
- classMapFile: c,
13
- fileMapFile: n,
14
- themeFile: h,
11
+ sheetFile: c,
12
+ classMapFile: p,
13
+ fileMapFile: f,
14
+ themeFile: n,
15
15
  singleCss: P,
16
16
  theme: J,
17
17
  defaultClassMap: N,
18
18
  defaultFileMap: v,
19
19
  defaultSheet: w
20
- } = this.getOptions(), e = [];
21
- y || (y = !0, l ? (r(p) && e.push(
22
- i(p, "utf-8").then(JSON.parse).then(F)
23
- ), r(c) && e.push(
24
- i(c, "utf-8").then(JSON.parse).then(M)
25
- ), r(n) && e.push(
26
- i(n, "utf-8").then(JSON.parse).then(g)
27
- ), r(h) && e.push(
28
- i(h, "utf-8").then(JSON.parse).then((t) => t?.theme ?? {}).then(x)
29
- )) : (g(v), M(N), F(w), x(J)));
30
- const f = this.async();
20
+ } = this.getOptions(), t = [];
21
+ x || (x = !0, l ? (r(c) && F(JSON.parse(i(c, "utf-8"))), r(p) && M(JSON.parse(i(p, "utf-8"))), r(f) && g(JSON.parse(i(f, "utf-8"))), r(n) && y(
22
+ JSON.parse(i(n, "utf-8"))?.theme ?? {}
23
+ )) : (g(v), M(N), F(w), y(J)));
24
+ const u = this.async();
31
25
  try {
32
- const t = this.resourcePath;
33
- let a = d(j(t), o).replaceAll("\\", "/");
34
- const b = d(process.cwd(), t);
26
+ const s = this.resourcePath;
27
+ let a = d(j(s), o).replaceAll("\\", "/");
28
+ const b = d(process.cwd(), s);
35
29
  a.startsWith("./") || (a = `./${a}`);
36
- const { code: k, map: u, cssFile: m, updatedBaseStyle: D } = B(
30
+ const { code: k, map: h, cssFile: m, updatedBaseStyle: D } = B(
37
31
  b,
38
32
  C.toString(),
39
33
  O,
@@ -41,20 +35,20 @@ const G = function(C) {
41
35
  P,
42
36
  !1,
43
37
  !0
44
- ), $ = u ? JSON.parse(u) : null;
45
- D && l && e.push(
46
- s(S(o, "devup-ui.css"), E(null, !1), "utf-8")
47
- ), m && l && e.push(
48
- s(
38
+ ), $ = h ? JSON.parse(h) : null;
39
+ D && l && t.push(
40
+ e(S(o, "devup-ui.css"), E(null, !1), "utf-8")
41
+ ), m && l && t.push(
42
+ e(
49
43
  S(o, A(m)),
50
44
  `/* ${this.resourcePath} ${Date.now()} */`
51
45
  ),
52
- s(p, I()),
53
- s(c, L()),
54
- s(n, T())
55
- ), Promise.all(e).catch(console.error).finally(() => f(null, k, $));
56
- } catch (t) {
57
- Promise.all(e).catch(console.error).finally(() => f(t));
46
+ e(c, I()),
47
+ e(p, L()),
48
+ e(f, T())
49
+ ), Promise.all(t).catch(console.error).finally(() => u(null, k, $));
50
+ } catch (s) {
51
+ Promise.all(t).catch(console.error).finally(() => u(s));
58
52
  }
59
53
  };
60
54
  export {
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "webpack"
20
20
  ],
21
21
  "type": "module",
22
- "version": "1.0.53",
22
+ "version": "1.0.54",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },