@devup-ui/webpack-plugin 1.0.17 → 1.0.19
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 +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +4 -4
- package/package.json +2 -2
package/dist/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var y=(n,e,i)=>e in n?v(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var f=(n,e,i)=>y(n,typeof e!="symbol"?e+"":e,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),g=require("node:module"),c=require("node:path"),o=require("@devup-ui/wasm");var p=typeof document<"u"?document.currentScript:null;class w{constructor({package:e="@devup-ui/react",devupPath:i="devup.json",interfacePath:a="df",cssFile:r=c.resolve(a,"devup-ui.css"),watch:s=!1,debug:u=!1,include:h=[]}={}){f(this,"options");this.options={package:e,cssFile:r,devupPath:i,interfacePath:a,watch:s,debug:u,include:h}}writeDataFiles(){var i;o.registerTheme((i=JSON.parse(t.readFileSync(this.options.devupPath,"utf-8")))==null?void 0:i.theme);const e=o.getThemeInterface(this.options.package,"DevupThemeColors","DevupThemeTypography","DevupTheme");e&&t.writeFileSync(c.join(this.options.interfacePath,"theme.d.ts"),e,{encoding:"utf-8"}),
|
|
1
|
+
"use strict";var v=Object.defineProperty;var y=(n,e,i)=>e in n?v(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var f=(n,e,i)=>y(n,typeof e!="symbol"?e+"":e,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("node:fs"),g=require("node:module"),c=require("node:path"),o=require("@devup-ui/wasm");var p=typeof document<"u"?document.currentScript:null;class w{constructor({package:e="@devup-ui/react",devupPath:i="devup.json",interfacePath:a="df",cssFile:r=c.resolve(a,"devup-ui.css"),watch:s=!1,debug:u=!1,include:h=[]}={}){f(this,"options");this.options={package:e,cssFile:r,devupPath:i,interfacePath:a,watch:s,debug:u,include:h}}writeDataFiles(){var i;o.registerTheme((i=JSON.parse(t.readFileSync(this.options.devupPath,"utf-8")))==null?void 0:i.theme);const e=o.getThemeInterface(this.options.package,"DevupThemeColors","DevupThemeTypography","DevupTheme");e&&t.writeFileSync(c.join(this.options.interfacePath,"theme.d.ts"),e,{encoding:"utf-8"}),this.options.watch&&t.writeFileSync(this.options.cssFile,`/* ${Date.now()} */`,{encoding:"utf-8"})}apply(e){o.setDebug(this.options.debug);const i=t.existsSync(this.options.devupPath);t.existsSync(this.options.interfacePath)||t.mkdirSync(this.options.interfacePath),t.writeFileSync(c.join(this.options.interfacePath,".gitignore"),"*",{encoding:"utf-8"});const a=c.join(this.options.interfacePath,"sheet.json"),r=c.join(this.options.interfacePath,"classMap.json");if(this.options.watch){try{t.existsSync(a)&&o.importSheet(JSON.parse(t.readFileSync(a,"utf-8"))),t.existsSync(r)&&o.importClassMap(JSON.parse(t.readFileSync(r,"utf-8")))}catch(u){console.error(u)}let s=null;e.hooks.watchRun.tapAsync("DevupUIWebpackPlugin",(u,h)=>{i&&t.stat(this.options.devupPath,(l,m)=>{if(l){console.error(`Error checking ${this.options.devupPath}:`,l);return}const d=m.mtimeMs;s&&s!==d&&this.writeDataFiles(),s=d}),h()})}if(i){try{this.writeDataFiles()}catch(s){console.error(s)}e.hooks.afterCompile.tap("DevupUIWebpackPlugin",s=>{s.fileDependencies.add(c.resolve(this.options.devupPath))})}t.existsSync(this.options.cssFile)||t.writeFileSync(this.options.cssFile,"",{encoding:"utf-8"}),e.options.plugins.push(new e.webpack.DefinePlugin({"process.env.DEVUP_UI_DEFAULT_THEME":JSON.stringify(o.getDefaultTheme())})),this.options.watch||e.hooks.done.tap("DevupUIWebpackPlugin",s=>{s.hasErrors()||t.writeFileSync(this.options.cssFile,o.getCss(),{encoding:"utf-8"})}),e.options.module.rules.push({test:/\.(tsx|ts|js|mjs|jsx)$/,exclude:new RegExp(this.options.include.length?`node_modules(?!.*(${this.options.include.join("|").replaceAll("/","[\\/\\\\]")})([\\/\\\\]|$))`:"node_modules"),enforce:"pre",use:[{loader:g.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("plugin.cjs",document.baseURI).href).resolve("@devup-ui/webpack-plugin/loader"),options:{package:this.options.package,cssFile:this.options.cssFile,sheetFile:a,classMapFile:r,watch:this.options.watch}}]},{test:this.options.cssFile,enforce:"pre",use:[{loader:g.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("plugin.cjs",document.baseURI).href).resolve("@devup-ui/webpack-plugin/css-loader"),options:{watch:this.options.watch}}]})}}exports.DevupUIWebpackPlugin=w;
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,EAAE,2BAA2B,CAAA;gBAExB,EACV,OAAO,EAAE,UAA8B,EACvC,SAAwB,EACxB,aAAoB,EACpB,OAAgD,EAChD,KAAa,EACb,KAAa,EACb,OAAY,GACb,GAAE,OAAO,CAAC,2BAA2B,CAAM;IAY5C,cAAc;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,EAAE,2BAA2B,CAAA;gBAExB,EACV,OAAO,EAAE,UAA8B,EACvC,SAAwB,EACxB,aAAoB,EACpB,OAAgD,EAChD,KAAa,EACb,KAAa,EACb,OAAY,GACb,GAAE,OAAO,CAAC,2BAA2B,CAAM;IAY5C,cAAc;IA4Bd,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAiHzB"}
|
package/dist/plugin.js
CHANGED
|
@@ -43,16 +43,16 @@ class C {
|
|
|
43
43
|
{
|
|
44
44
|
encoding: "utf-8"
|
|
45
45
|
}
|
|
46
|
-
), p(
|
|
47
|
-
encoding: "utf-8"
|
|
48
|
-
}), this.options.watch && p(this.options.cssFile, `/* ${Date.now()} */`, {
|
|
46
|
+
), this.options.watch && p(this.options.cssFile, `/* ${Date.now()} */`, {
|
|
49
47
|
encoding: "utf-8"
|
|
50
48
|
});
|
|
51
49
|
}
|
|
52
50
|
apply(e) {
|
|
53
51
|
T(this.options.debug);
|
|
54
52
|
const t = a(this.options.devupPath);
|
|
55
|
-
a(this.options.interfacePath) || k(this.options.interfacePath)
|
|
53
|
+
a(this.options.interfacePath) || k(this.options.interfacePath), p(c(this.options.interfacePath, ".gitignore"), "*", {
|
|
54
|
+
encoding: "utf-8"
|
|
55
|
+
});
|
|
56
56
|
const o = c(this.options.interfacePath, "sheet.json"), n = c(this.options.interfacePath, "classMap.json");
|
|
57
57
|
if (this.options.watch) {
|
|
58
58
|
try {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"webpack"
|
|
19
19
|
],
|
|
20
20
|
"type": "module",
|
|
21
|
-
"version": "1.0.
|
|
21
|
+
"version": "1.0.19",
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@devup-ui/wasm": "1.0.
|
|
48
|
+
"@devup-ui/wasm": "1.0.19"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@devup-ui/wasm": "*"
|