@devup-ui/next-plugin 1.0.44 → 1.0.46

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/plugin.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),r=require("node:path"),b=require("@devup-ui/webpack-plugin");function k(s,n={}){if(process.env.TURBOPACK==="1"){s??={},s.turbopack??={},s.turbopack.rules??={};const{package:i="@devup-ui/react",distDir:e="df",cssDir:u=r.resolve(e,"devup-ui"),singleCss:l=!1}=n,p=r.join(e,"sheet.json"),o=r.join(e,"classMap.json"),d=r.join(e,"fileMap.json"),a=r.join(e,".gitignore");t.existsSync(e)||t.mkdirSync(e),t.existsSync(u)||t.mkdirSync(u),t.existsSync(a)||t.writeFileSync(a,"*");const v={[r.basename(u)]:[{loader:"@devup-ui/webpack-plugin/css-loader",options:{watch:process.env.NODE_ENV==="development"}}],"*.{tsx,ts,js,mjs}":[{loader:"@devup-ui/webpack-plugin/loader",options:{package:i,cssDir:u,sheetFile:p,classMapFile:o,fileMapFile:d,watch:process.env.NODE_ENV==="development",singleCss:l}}]};return Object.assign(s.turbopack.rules,v),s}const{webpack:c}=s;return s.webpack=(i,e)=>(n.cssDir??=r.resolve(e.dev?n.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),i.plugins.push(new b.DevupUIWebpackPlugin({...n,watch:e.dev})),typeof c=="function"?c(i,e):i),s}exports.DevupUI=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("node:fs"),t=require("node:path"),a=require("@devup-ui/wasm"),h=require("@devup-ui/webpack-plugin"),w=require("./preload.cjs");function x(s,u={}){if(process.env.TURBOPACK==="1"||process.env.TURBOPACK==="auto"){s??={},s.turbopack??={},s.turbopack.rules??={};const{package:c="@devup-ui/react",distDir:e="df",cssDir:i=t.resolve(e,"devup-ui"),singleCss:p=!1,devupFile:l="devup.json",include:S=[]}=u,b=t.join(e,"sheet.json"),O=t.join(e,"classMap.json"),k=t.join(e,"fileMap.json"),o=t.join(e,".gitignore");r.existsSync(e)||r.mkdirSync(e,{recursive:!0}),r.existsSync(i)||r.mkdirSync(i,{recursive:!0}),r.existsSync(o)||r.writeFileSync(o,"*");const d=r.existsSync(l)?JSON.parse(r.readFileSync(l,"utf-8"))?.theme:{},v=new RegExp(`node_modules(?!.*(${["@devup-ui",...S].join("|").replaceAll("/","[\\/\\\\_]")})([\\/\\\\.]|$))`);process.env.NODE_ENV!=="production"?(process.env.TURBOPACK_DEBUG_JS="*",process.env.NODE_OPTIONS??="",process.env.NODE_OPTIONS+=" --inspect-brk"):w.preload(v,c,p,d,i);const j={[`./${t.relative(process.cwd(),i).replaceAll("\\","/")}/*.css`]:[{loader:"@devup-ui/webpack-plugin/css-loader"}],"*.{tsx,ts,js,mjs}":{loaders:[{loader:"@devup-ui/webpack-plugin/loader",options:{package:c,cssDir:i,sheetFile:b,classMapFile:O,fileMapFile:k,defaultSheet:JSON.parse(a.exportSheet()),defaultClassMap:JSON.parse(a.exportClassMap()),defaultFileMap:JSON.parse(a.exportFileMap()),watch:process.env.NODE_ENV==="development",singleCss:p,theme:d}}],condition:{not:{path:v}}}};return Object.assign(s.turbopack.rules,j),s}const{webpack:n}=s;return s.webpack=(c,e)=>(u.cssDir??=t.resolve(e.dev?u.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),c.plugins.push(new h.DevupUIWebpackPlugin({...u,watch:e.dev})),typeof n=="function"?n(c,e):c),s}exports.DevupUI=x;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAEtC,KAAK,wBAAwB,GAAG,IAAI,CAClC,OAAO,CAAC,2BAA2B,CAAC,EACpC,OAAO,CACR,CAAA;AAQD,wBAAgB,OAAO,CACrB,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,wBAA6B,GACrC,UAAU,CAgEZ"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAItC,KAAK,wBAAwB,GAAG,IAAI,CAClC,OAAO,CAAC,2BAA2B,CAAC,EACpC,OAAO,CACR,CAAA;AAQD,wBAAgB,OAAO,CACrB,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,wBAA6B,GACrC,UAAU,CA2GZ"}
package/dist/plugin.js CHANGED
@@ -1,53 +1,74 @@
1
- import { existsSync as u, mkdirSync as l, writeFileSync as m } from "node:fs";
2
- import { resolve as n, join as i, basename as w } from "node:path";
3
- import { DevupUIWebpackPlugin as D } from "@devup-ui/webpack-plugin";
4
- function g(s, t = {}) {
5
- if (process.env.TURBOPACK === "1") {
1
+ import { existsSync as a, mkdirSync as v, writeFileSync as N, readFileSync as h } from "node:fs";
2
+ import { resolve as m, join as i, relative as D } from "node:path";
3
+ import { exportFileMap as w, exportClassMap as x, exportSheet as j } from "@devup-ui/wasm";
4
+ import { DevupUIWebpackPlugin as F } from "@devup-ui/webpack-plugin";
5
+ import { preload as E } from "./preload.js";
6
+ function _(s, t = {}) {
7
+ if (process.env.TURBOPACK === "1" || process.env.TURBOPACK === "auto") {
6
8
  s ??= {}, s.turbopack ??= {}, s.turbopack.rules ??= {};
7
9
  const {
8
10
  package: r = "@devup-ui/react",
9
11
  distDir: e = "df",
10
- cssDir: a = n(e, "devup-ui"),
11
- singleCss: o = !1
12
- } = t, d = i(e, "sheet.json"), v = i(e, "classMap.json"), b = i(e, "fileMap.json"), c = i(e, ".gitignore");
13
- u(e) || l(e), u(a) || l(a), u(c) || m(c, "*");
14
- const k = {
15
- [w(a)]: [
12
+ cssDir: p = m(e, "devup-ui"),
13
+ singleCss: c = !1,
14
+ devupFile: l = "devup.json",
15
+ include: O = []
16
+ } = t, b = i(e, "sheet.json"), f = i(e, "classMap.json"), k = i(e, "fileMap.json"), o = i(e, ".gitignore");
17
+ a(e) || v(e, {
18
+ recursive: !0
19
+ }), a(p) || v(p, {
20
+ recursive: !0
21
+ }), a(o) || N(o, "*");
22
+ const n = a(l) ? JSON.parse(h(l, "utf-8"))?.theme : {}, d = new RegExp(
23
+ `node_modules(?!.*(${["@devup-ui", ...O].join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$))`
24
+ );
25
+ process.env.NODE_ENV !== "production" ? (process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk") : E(d, r, c, n, p);
26
+ const S = {
27
+ [`./${D(process.cwd(), p).replaceAll("\\", "/")}/*.css`]: [
16
28
  {
17
- loader: "@devup-ui/webpack-plugin/css-loader",
18
- options: {
19
- watch: process.env.NODE_ENV === "development"
20
- }
29
+ loader: "@devup-ui/webpack-plugin/css-loader"
21
30
  }
22
31
  ],
23
- "*.{tsx,ts,js,mjs}": [
24
- {
25
- loader: "@devup-ui/webpack-plugin/loader",
26
- options: {
27
- package: r,
28
- cssDir: a,
29
- sheetFile: d,
30
- classMapFile: v,
31
- fileMapFile: b,
32
- watch: process.env.NODE_ENV === "development",
33
- singleCss: o
32
+ "*.{tsx,ts,js,mjs}": {
33
+ loaders: [
34
+ {
35
+ loader: "@devup-ui/webpack-plugin/loader",
36
+ options: {
37
+ package: r,
38
+ cssDir: p,
39
+ sheetFile: b,
40
+ classMapFile: f,
41
+ fileMapFile: k,
42
+ defaultSheet: JSON.parse(j()),
43
+ defaultClassMap: JSON.parse(x()),
44
+ defaultFileMap: JSON.parse(w()),
45
+ watch: process.env.NODE_ENV === "development",
46
+ singleCss: c,
47
+ // for turbopack, load theme is required on loader
48
+ theme: n
49
+ }
50
+ }
51
+ ],
52
+ condition: {
53
+ not: {
54
+ path: d
34
55
  }
35
56
  }
36
- ]
57
+ }
37
58
  };
38
- return Object.assign(s.turbopack.rules, k), s;
59
+ return Object.assign(s.turbopack.rules, S), s;
39
60
  }
40
- const { webpack: p } = s;
41
- return s.webpack = (r, e) => (t.cssDir ??= n(
61
+ const { webpack: u } = s;
62
+ return s.webpack = (r, e) => (t.cssDir ??= m(
42
63
  e.dev ? t.distDir ?? "df" : ".next/cache",
43
64
  `devup-ui_${e.buildId}`
44
65
  ), r.plugins.push(
45
- new D({
66
+ new F({
46
67
  ...t,
47
68
  watch: e.dev
48
69
  })
49
- ), typeof p == "function" ? p(r, e) : r), s;
70
+ ), typeof u == "function" ? u(r, e) : r), s;
50
71
  }
51
72
  export {
52
- g as DevupUI
73
+ _ as DevupUI
53
74
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),s=require("node:path"),c=require("@devup-ui/wasm"),p=require("glob");function b(n,l,i,a,o){const u=p.globSync(["**/*.tsx","**/*.ts","**/*.js","**/*.mjs"],{follow:!0,absolute:!0});c.registerTheme(a);for(const f of u){const e=s.relative(process.cwd(),t.realpathSync(f));if(/\.(test(-d)?|d|spec)\.(tsx|ts|js|mjs)$/.test(e)||/^(out|.next)[/\\]/.test(e)||n.test(e))continue;const{cssFile:r,css:d}=c.codeExtract(e,t.readFileSync(e,"utf-8"),l,o,i,!1,!0);r&&t.writeFileSync(s.join(o,s.basename(r)),d??"","utf-8")}}exports.preload=b;
@@ -0,0 +1,2 @@
1
+ export declare function preload(excludeRegex: RegExp, libPackage: string, singleCss: boolean, theme: object, cssDir: string): void;
2
+ //# sourceMappingURL=preload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../src/preload.ts"],"names":[],"mappings":"AAMA,wBAAgB,OAAO,CACrB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,QA6Bf"}
@@ -0,0 +1,29 @@
1
+ import { realpathSync as m, readFileSync as a, writeFileSync as p } from "node:fs";
2
+ import { relative as u, join as d, basename as j } from "node:path";
3
+ import { registerTheme as x, codeExtract as y } from "@devup-ui/wasm";
4
+ import { globSync as S } from "glob";
5
+ function g(s, r, c, i, e) {
6
+ const f = S(["**/*.tsx", "**/*.ts", "**/*.js", "**/*.mjs"], {
7
+ follow: !0,
8
+ absolute: !0
9
+ });
10
+ x(i);
11
+ for (const l of f) {
12
+ const t = u(process.cwd(), m(l));
13
+ if (/\.(test(-d)?|d|spec)\.(tsx|ts|js|mjs)$/.test(t) || /^(out|.next)[/\\]/.test(t) || s.test(t))
14
+ continue;
15
+ const { cssFile: o, css: n } = y(
16
+ t,
17
+ a(t, "utf-8"),
18
+ r,
19
+ e,
20
+ c,
21
+ !1,
22
+ !0
23
+ );
24
+ o && p(d(e, j(o)), n ?? "", "utf-8");
25
+ }
26
+ }
27
+ export {
28
+ g as preload
29
+ };
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "webpack"
20
20
  ],
21
21
  "type": "module",
22
- "version": "1.0.44",
22
+ "version": "1.0.46",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
@@ -37,20 +37,22 @@
37
37
  ],
38
38
  "types": "./dist/index.d.ts",
39
39
  "dependencies": {
40
- "next": "^15.5",
41
- "browserslist": "latest",
42
- "@devup-ui/webpack-plugin": "1.0.43"
40
+ "next": "^16.0",
41
+ "glob": "^11.0",
42
+ "@devup-ui/webpack-plugin": "1.0.45",
43
+ "@devup-ui/wasm": "1.0.44"
43
44
  },
44
45
  "devDependencies": {
45
- "vite": "^7.1.7",
46
- "vite-plugin-dts": "^4.5.4",
47
- "vitest": "^3.2.4",
48
- "typescript": "^5.9.3",
49
- "@types/webpack": "^5.28.5"
46
+ "vite": "^7.1",
47
+ "vite-plugin-dts": "^4.5",
48
+ "vitest": "^4.0",
49
+ "typescript": "^5.9",
50
+ "@types/webpack": "^5.28"
50
51
  },
51
52
  "peerDependencies": {
52
53
  "@devup-ui/webpack-plugin": "*",
53
- "next": "*"
54
+ "next": "*",
55
+ "@devup-ui/wasm": "*"
54
56
  },
55
57
  "scripts": {
56
58
  "lint": "eslint",