@devup-ui/next-plugin 1.0.44 → 1.0.45

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"),k=require("@devup-ui/webpack-plugin");function O(s,c={}){if(process.env.TURBOPACK==="1"||process.env.TURBOPACK==="auto"){if(process.env.NODE_ENV==="production")throw new Error("Devup UI is not supported in production with turbopack");s??={},s.turbopack??={},s.turbopack.rules??={};const{package:i="@devup-ui/react",distDir:e="df",cssDir:u=t.resolve(e,"devup-ui"),singleCss:a=!1,devupFile:p="devup.json"}=c,l=t.join(e,"sheet.json"),d=t.join(e,"classMap.json"),v=t.join(e,"fileMap.json"),o=t.join(e,".gitignore");r.existsSync(e)||r.mkdirSync(e,{recursive:!0}),r.existsSync(u)||r.mkdirSync(u,{recursive:!0}),r.existsSync(o)||r.writeFileSync(o,"*"),process.env.TURBOPACK_DEBUG_JS="*",process.env.NODE_OPTIONS??="",process.env.NODE_OPTIONS+=" --inspect-brk";const b={[`./${t.relative(process.cwd(),u).replaceAll("\\","/")}/*.css`]:[{loader:"@devup-ui/webpack-plugin/css-loader"}],"*.{tsx,ts,js,mjs}":[{loader:"@devup-ui/webpack-plugin/loader",options:{package:i,cssDir:u,sheetFile:l,classMapFile:d,fileMapFile:v,watch:process.env.NODE_ENV==="development",singleCss:a,theme:r.existsSync(p)?JSON.parse(r.readFileSync(p,"utf-8"))?.theme:void 0}}]};return Object.assign(s.turbopack.rules,b),s}const{webpack:n}=s;return s.webpack=(i,e)=>(c.cssDir??=t.resolve(e.dev?c.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),i.plugins.push(new k.DevupUIWebpackPlugin({...c,watch:e.dev})),typeof n=="function"?n(i,e):i),s}exports.DevupUI=O;
@@ -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":"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,CAmFZ"}
package/dist/plugin.js CHANGED
@@ -1,23 +1,27 @@
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 p, mkdirSync as n, writeFileSync as w, readFileSync as D } from "node:fs";
2
+ import { resolve as l, join as u, relative as m } from "node:path";
3
+ import { DevupUIWebpackPlugin as h } from "@devup-ui/webpack-plugin";
4
+ function S(s, t = {}) {
5
+ if (process.env.TURBOPACK === "1" || process.env.TURBOPACK === "auto") {
6
+ if (process.env.NODE_ENV === "production")
7
+ throw new Error("Devup UI is not supported in production with turbopack");
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: i = l(e, "devup-ui"),
13
+ singleCss: d = !1,
14
+ devupFile: a = "devup.json"
15
+ } = t, v = u(e, "sheet.json"), b = u(e, "classMap.json"), k = u(e, "fileMap.json"), o = u(e, ".gitignore");
16
+ p(e) || n(e, {
17
+ recursive: !0
18
+ }), p(i) || n(i, {
19
+ recursive: !0
20
+ }), p(o) || w(o, "*"), process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk";
21
+ const O = {
22
+ [`./${m(process.cwd(), i).replaceAll("\\", "/")}/*.css`]: [
16
23
  {
17
- loader: "@devup-ui/webpack-plugin/css-loader",
18
- options: {
19
- watch: process.env.NODE_ENV === "development"
20
- }
24
+ loader: "@devup-ui/webpack-plugin/css-loader"
21
25
  }
22
26
  ],
23
27
  "*.{tsx,ts,js,mjs}": [
@@ -25,29 +29,31 @@ function g(s, t = {}) {
25
29
  loader: "@devup-ui/webpack-plugin/loader",
26
30
  options: {
27
31
  package: r,
28
- cssDir: a,
29
- sheetFile: d,
30
- classMapFile: v,
31
- fileMapFile: b,
32
+ cssDir: i,
33
+ sheetFile: v,
34
+ classMapFile: b,
35
+ fileMapFile: k,
32
36
  watch: process.env.NODE_ENV === "development",
33
- singleCss: o
37
+ singleCss: d,
38
+ // for turbopack, load theme is required on loader
39
+ theme: p(a) ? JSON.parse(D(a, "utf-8"))?.theme : void 0
34
40
  }
35
41
  }
36
42
  ]
37
43
  };
38
- return Object.assign(s.turbopack.rules, k), s;
44
+ return Object.assign(s.turbopack.rules, O), s;
39
45
  }
40
- const { webpack: p } = s;
41
- return s.webpack = (r, e) => (t.cssDir ??= n(
46
+ const { webpack: c } = s;
47
+ return s.webpack = (r, e) => (t.cssDir ??= l(
42
48
  e.dev ? t.distDir ?? "df" : ".next/cache",
43
49
  `devup-ui_${e.buildId}`
44
50
  ), r.plugins.push(
45
- new D({
51
+ new h({
46
52
  ...t,
47
53
  watch: e.dev
48
54
  })
49
- ), typeof p == "function" ? p(r, e) : r), s;
55
+ ), typeof c == "function" ? c(r, e) : r), s;
50
56
  }
51
57
  export {
52
- g as DevupUI
58
+ S as DevupUI
53
59
  };
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.45",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
@@ -37,20 +37,21 @@
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
+ "@devup-ui/webpack-plugin": "1.0.44",
42
+ "@devup-ui/wasm": "1.0.43"
43
43
  },
44
44
  "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"
45
+ "vite": "^7.1",
46
+ "vite-plugin-dts": "^4.5",
47
+ "vitest": "^4.0",
48
+ "typescript": "^5.9",
49
+ "@types/webpack": "^5.28"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@devup-ui/webpack-plugin": "*",
53
- "next": "*"
53
+ "next": "*",
54
+ "@devup-ui/wasm": "*"
54
55
  },
55
56
  "scripts": {
56
57
  "lint": "eslint",