@devup-ui/next-plugin 1.0.57 → 1.0.59
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/find-top-package-root.cjs +1 -0
- package/dist/find-top-package-root.d.ts +2 -0
- package/dist/find-top-package-root.d.ts.map +1 -0
- package/dist/find-top-package-root.js +16 -0
- package/dist/get-package-name.cjs +1 -0
- package/dist/get-package-name.d.ts +2 -0
- package/dist/get-package-name.d.ts.map +1 -0
- package/dist/get-package-name.js +8 -0
- package/dist/has-localpackage.cjs +1 -0
- package/dist/has-localpackage.d.ts +2 -0
- package/dist/has-localpackage.d.ts.map +1 -0
- package/dist/has-localpackage.js +11 -0
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.js +18 -18
- package/dist/preload.cjs +1 -1
- package/dist/preload.d.ts +1 -1
- package/dist/preload.d.ts.map +1 -1
- package/dist/preload.js +32 -18
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node:fs"),r=require("node:path");function a(t=process.cwd()){let e=t,o=null;for(;;){i.existsSync(r.join(e,"package.json"))&&(o=e);const n=r.dirname(e);if(n===e)break;e=n}return o??t}exports.findTopPackageRoot=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-top-package-root.d.ts","sourceRoot":"","sources":["../src/find-top-package-root.ts"],"names":[],"mappings":"AASA,wBAAgB,kBAAkB,CAAC,GAAG,SAAgB,UAiBrD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { existsSync as n } from "node:fs";
|
|
2
|
+
import { join as i, dirname as a } from "node:path";
|
|
3
|
+
function f(t = process.cwd()) {
|
|
4
|
+
let e = t, o = null;
|
|
5
|
+
for (; ; ) {
|
|
6
|
+
n(i(e, "package.json")) && (o = e);
|
|
7
|
+
const r = a(e);
|
|
8
|
+
if (r === e)
|
|
9
|
+
break;
|
|
10
|
+
e = r;
|
|
11
|
+
}
|
|
12
|
+
return o ?? t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
f as findTopPackageRoot
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs");function c(e){const a=t.readFileSync(e,"utf-8");return JSON.parse(a).name}exports.getPackageName=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-package-name.d.ts","sourceRoot":"","sources":["../src/get-package-name.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,OAIrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:fs"),s=require("node:path");function n(){const c=o.readFileSync(s.join(process.cwd(),"package.json"),"utf-8"),a=JSON.parse(c);return Object.values(a.dependencies??{}).some(e=>typeof e=="string"&&e.includes("workspace:"))}exports.hasLocalPackage=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-localpackage.d.ts","sourceRoot":"","sources":["../src/has-localpackage.ts"],"names":[],"mappings":"AASA,wBAAgB,eAAe,YAM9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { readFileSync as s } from "node:fs";
|
|
2
|
+
import { join as a } from "node:path";
|
|
3
|
+
function t() {
|
|
4
|
+
const o = s(a(process.cwd(), "package.json"), "utf-8"), c = JSON.parse(o);
|
|
5
|
+
return Object.values(c.dependencies ?? {}).some(
|
|
6
|
+
(e) => typeof e == "string" && e.includes("workspace:")
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
t as hasLocalPackage
|
|
11
|
+
};
|
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"),n=require("@devup-ui/wasm"),x=require("@devup-ui/webpack-plugin"),y=require("./preload.cjs");function _(s,o={}){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=r.resolve(e,"devup-ui"),singleCss:a=!1,devupFile:u="devup.json",include:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),r=require("node:path"),n=require("@devup-ui/wasm"),x=require("@devup-ui/webpack-plugin"),y=require("./preload.cjs");function _(s,o={}){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=r.resolve(e,"devup-ui"),singleCss:a=!1,devupFile:u="devup.json",include:d=[]}=o,T=r.join(e,"sheet.json"),D=r.join(e,"classMap.json"),O=r.join(e,"fileMap.json"),v=r.join(e,".gitignore");t.existsSync(e)||t.mkdirSync(e,{recursive:!0}),t.existsSync(i)||t.mkdirSync(i,{recursive:!0}),t.existsSync(v)||t.writeFileSync(v,"*");const h=t.existsSync(u)?JSON.parse(t.readFileSync(u,"utf-8"))?.theme:{};n.registerTheme(h);const m=n.getThemeInterface(c,"CustomColors","DevupThemeTypography","DevupTheme");m&&t.writeFileSync(r.join(e,"theme.d.ts"),m);const S=new RegExp(`(node_modules(?!.*(${["@devup-ui",...d].join("|").replaceAll("/","[\\/\\\\_]")})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`);process.env.NODE_ENV!=="production"?(fetch("http://localhost:"+process.env.PORT),fetch("http://localhost:"+process.debugPort).catch(()=>{setTimeout(()=>{process.exit(77)},500)}),process.env.TURBOPACK_DEBUG_JS="*",process.env.NODE_OPTIONS??="",process.env.NODE_OPTIONS+=" --inspect-brk",t.writeFileSync(r.join(i,"devup-ui.css"),n.getCss(null,!1))):y.preload(S,c,a,i,d);const f=JSON.parse(n.exportSheet()),E=JSON.parse(n.exportClassMap()),b=JSON.parse(n.exportFileMap()),l=n.getDefaultTheme();l&&(process.env.DEVUP_UI_DEFAULT_THEME=l,s.env??={},Object.assign(s.env,{DEVUP_UI_DEFAULT_THEME:l}));const j={[`./${r.relative(process.cwd(),i).replaceAll("\\","/")}/*.css`]:[{loader:"@devup-ui/next-plugin/css-loader",options:{watch:process.env.NODE_ENV==="development"}}],"*.{tsx,ts,js,mjs}":{loaders:[{loader:"@devup-ui/next-plugin/loader",options:{package:c,cssDir:i,sheetFile:T,classMapFile:D,fileMapFile:O,themeFile:u,defaultSheet:f,defaultClassMap:E,defaultFileMap:b,watch:process.env.NODE_ENV==="development",singleCss:a,theme:h}}],condition:{not:{path:S}}}};return Object.assign(s.turbopack.rules,j),s}const{webpack:p}=s;return s.webpack=(c,e)=>(o.cssDir??=r.resolve(e.dev?o.distDir??"df":".next/cache",`devup-ui_${e.buildId}`),c.plugins.push(new x.DevupUIWebpackPlugin({...o,watch:e.dev})),typeof p=="function"?p(c,e):c),s}exports.DevupUI=_;
|
package/dist/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { existsSync as c, mkdirSync as
|
|
2
|
-
import { resolve as
|
|
1
|
+
import { existsSync as c, mkdirSync as T, writeFileSync as u, readFileSync as F } from "node:fs";
|
|
2
|
+
import { resolve as D, join as p, relative as U } from "node:path";
|
|
3
3
|
import { registerTheme as g, getThemeInterface as j, getCss as k, exportSheet as P, exportClassMap as M, exportFileMap as w, getDefaultTheme as C } from "@devup-ui/wasm";
|
|
4
4
|
import { DevupUIWebpackPlugin as I } from "@devup-ui/webpack-plugin";
|
|
5
5
|
import { preload as y } from "./preload.js";
|
|
@@ -9,33 +9,33 @@ function K(s, o = {}) {
|
|
|
9
9
|
const {
|
|
10
10
|
package: t = "@devup-ui/react",
|
|
11
11
|
distDir: e = "df",
|
|
12
|
-
cssDir: r =
|
|
12
|
+
cssDir: r = D(e, "devup-ui"),
|
|
13
13
|
singleCss: n = !1,
|
|
14
14
|
devupFile: a = "devup.json",
|
|
15
|
-
include:
|
|
16
|
-
} = o, O = p(e, "sheet.json"), E = p(e, "classMap.json"), x = p(e, "fileMap.json"),
|
|
17
|
-
c(e) ||
|
|
15
|
+
include: d = []
|
|
16
|
+
} = o, O = p(e, "sheet.json"), E = p(e, "classMap.json"), x = p(e, "fileMap.json"), v = p(e, ".gitignore");
|
|
17
|
+
c(e) || T(e, {
|
|
18
18
|
recursive: !0
|
|
19
|
-
}), c(r) ||
|
|
19
|
+
}), c(r) || T(r, {
|
|
20
20
|
recursive: !0
|
|
21
|
-
}), c(
|
|
22
|
-
const
|
|
23
|
-
g(
|
|
24
|
-
const
|
|
21
|
+
}), c(v) || u(v, "*");
|
|
22
|
+
const h = c(a) ? JSON.parse(F(a, "utf-8"))?.theme : {};
|
|
23
|
+
g(h);
|
|
24
|
+
const m = j(
|
|
25
25
|
t,
|
|
26
26
|
"CustomColors",
|
|
27
27
|
"DevupThemeTypography",
|
|
28
28
|
"DevupTheme"
|
|
29
29
|
);
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
`(node_modules(?!.*(${["@devup-ui", ...
|
|
30
|
+
m && u(p(e, "theme.d.ts"), m);
|
|
31
|
+
const f = new RegExp(
|
|
32
|
+
`(node_modules(?!.*(${["@devup-ui", ...d].join("|").replaceAll("/", "[\\/\\\\_]")})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`
|
|
33
33
|
);
|
|
34
34
|
process.env.NODE_ENV !== "production" ? (fetch("http://localhost:" + process.env.PORT), fetch("http://localhost:" + process.debugPort).catch(() => {
|
|
35
35
|
setTimeout(() => {
|
|
36
36
|
process.exit(77);
|
|
37
37
|
}, 500);
|
|
38
|
-
}), process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk", u(p(r, "devup-ui.css"), k(null, !1))) : y(
|
|
38
|
+
}), process.env.TURBOPACK_DEBUG_JS = "*", process.env.NODE_OPTIONS ??= "", process.env.NODE_OPTIONS += " --inspect-brk", u(p(r, "devup-ui.css"), k(null, !1))) : y(f, t, n, r, d);
|
|
39
39
|
const b = JSON.parse(P()), N = JSON.parse(M()), S = JSON.parse(w()), l = C();
|
|
40
40
|
l && (process.env.DEVUP_UI_DEFAULT_THEME = l, s.env ??= {}, Object.assign(s.env, {
|
|
41
41
|
DEVUP_UI_DEFAULT_THEME: l
|
|
@@ -66,13 +66,13 @@ function K(s, o = {}) {
|
|
|
66
66
|
watch: process.env.NODE_ENV === "development",
|
|
67
67
|
singleCss: n,
|
|
68
68
|
// for turbopack, load theme is required on loader
|
|
69
|
-
theme:
|
|
69
|
+
theme: h
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
],
|
|
73
73
|
condition: {
|
|
74
74
|
not: {
|
|
75
|
-
path:
|
|
75
|
+
path: f
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -80,7 +80,7 @@ function K(s, o = {}) {
|
|
|
80
80
|
return Object.assign(s.turbopack.rules, _), s;
|
|
81
81
|
}
|
|
82
82
|
const { webpack: i } = s;
|
|
83
|
-
return s.webpack = (t, e) => (o.cssDir ??=
|
|
83
|
+
return s.webpack = (t, e) => (o.cssDir ??= D(
|
|
84
84
|
e.dev ? o.distDir ?? "df" : ".next/cache",
|
|
85
85
|
`devup-ui_${e.buildId}`
|
|
86
86
|
), t.plugins.push(
|
package/dist/preload.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("node:fs"),o=require("node:path"),f=require("@devup-ui/wasm"),d=require("glob"),w=require("./find-top-package-root.cjs"),j=require("./get-package-name.cjs"),y=require("./has-localpackage.cjs");function p(r,l,i,s,a,g=process.cwd()){if(a.length>0&&y.hasLocalPackage()){const n=w.findTopPackageRoot(),t=d.globSync(["package.json","!**/node_modules/**"],{follow:!0,absolute:!0,cwd:n}).filter(e=>a.includes(j.getPackageName(e))).map(e=>o.dirname(e));for(const e of t)p(r,l,i,s,a,e);return}const u=d.globSync(["**/*.tsx","**/*.ts","**/*.js","**/*.mjs"],{follow:!0,absolute:!0,cwd:g});u.sort();for(const n of u){const t=o.relative(process.cwd(),c.realpathSync(n));if(/\.(test(-d)?|d|spec)\.(tsx|ts|js|mjs)$/.test(t)||/^(out|.next)[/\\]/.test(t)||r.test(t))continue;const{cssFile:e,css:m}=f.codeExtract(t,c.readFileSync(t,"utf-8"),l,s,i,!1,!0);e&&c.writeFileSync(o.join(s,o.basename(e)),m??"","utf-8")}c.writeFileSync(o.join(s,"devup-ui.css"),f.getCss(null,!1),"utf-8")}exports.preload=p;
|
package/dist/preload.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function preload(excludeRegex: RegExp, libPackage: string, singleCss: boolean, cssDir: string): void;
|
|
1
|
+
export declare function preload(excludeRegex: RegExp, libPackage: string, singleCss: boolean, cssDir: string, include: string[], pwd?: string): void;
|
|
2
2
|
//# sourceMappingURL=preload.d.ts.map
|
package/dist/preload.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../src/preload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../src/preload.ts"],"names":[],"mappings":"AAUA,wBAAgB,OAAO,CACrB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EAAE,EACjB,GAAG,SAAgB,QAgDpB"}
|
package/dist/preload.js
CHANGED
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
import { realpathSync as
|
|
2
|
-
import { relative as
|
|
3
|
-
import { codeExtract as
|
|
4
|
-
import { globSync as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { realpathSync as d, readFileSync as w, writeFileSync as n } from "node:fs";
|
|
2
|
+
import { dirname as g, relative as j, join as m, basename as h } from "node:path";
|
|
3
|
+
import { codeExtract as k, getCss as y } from "@devup-ui/wasm";
|
|
4
|
+
import { globSync as i } from "glob";
|
|
5
|
+
import { findTopPackageRoot as S } from "./find-top-package-root.js";
|
|
6
|
+
import { getPackageName as b } from "./get-package-name.js";
|
|
7
|
+
import { hasLocalPackage as x } from "./has-localpackage.js";
|
|
8
|
+
function F(c, f, a, e, s, p = process.cwd()) {
|
|
9
|
+
if (s.length > 0 && x()) {
|
|
10
|
+
const r = S(), o = i(["package.json", "!**/node_modules/**"], {
|
|
11
|
+
follow: !0,
|
|
12
|
+
absolute: !0,
|
|
13
|
+
cwd: r
|
|
14
|
+
}).filter((t) => s.includes(b(t))).map((t) => g(t));
|
|
15
|
+
for (const t of o)
|
|
16
|
+
F(c, f, a, e, s, t);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const l = i(["**/*.tsx", "**/*.ts", "**/*.js", "**/*.mjs"], {
|
|
7
20
|
follow: !0,
|
|
8
|
-
absolute: !0
|
|
21
|
+
absolute: !0,
|
|
22
|
+
cwd: p
|
|
9
23
|
});
|
|
10
|
-
|
|
11
|
-
for (const
|
|
12
|
-
const
|
|
13
|
-
if (/\.(test(-d)?|d|spec)\.(tsx|ts|js|mjs)$/.test(
|
|
24
|
+
l.sort();
|
|
25
|
+
for (const r of l) {
|
|
26
|
+
const o = j(process.cwd(), d(r));
|
|
27
|
+
if (/\.(test(-d)?|d|spec)\.(tsx|ts|js|mjs)$/.test(o) || /^(out|.next)[/\\]/.test(o) || c.test(o))
|
|
14
28
|
continue;
|
|
15
|
-
const { cssFile:
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
const { cssFile: t, css: u } = k(
|
|
30
|
+
o,
|
|
31
|
+
w(o, "utf-8"),
|
|
18
32
|
f,
|
|
19
33
|
e,
|
|
20
|
-
|
|
34
|
+
a,
|
|
21
35
|
!1,
|
|
22
36
|
!0
|
|
23
37
|
);
|
|
24
|
-
|
|
38
|
+
t && n(m(e, h(t)), u ?? "", "utf-8");
|
|
25
39
|
}
|
|
26
|
-
|
|
40
|
+
n(m(e, "devup-ui.css"), y(null, !1), "utf-8");
|
|
27
41
|
}
|
|
28
42
|
export {
|
|
29
|
-
|
|
43
|
+
F as preload
|
|
30
44
|
};
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"webpack"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
|
-
"version": "1.0.
|
|
22
|
+
"version": "1.0.59",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"types": "./dist/index.d.ts",
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"next": "^16.0",
|
|
49
|
-
"glob": "^
|
|
49
|
+
"glob": "^13.0",
|
|
50
50
|
"@devup-ui/webpack-plugin": "1.0.49",
|
|
51
|
-
"@devup-ui/wasm": "1.0.
|
|
51
|
+
"@devup-ui/wasm": "1.0.51"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"vite": "^7.2",
|