first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
"use strict";var _md=_interopRequireDefault(require("md5")),_compiler=require("@hap-toolkit/compiler"),_sharedUtils=require("@hap-toolkit/shared-utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const fileCache=new Map;module.exports=function(e){this.cacheable&&this.cacheable();const t=this.resourcePath;if(fileCache.has((0,_md.default)(e)))return e;fileCache.set((0,_md.default)(e),e);const l=require("vue-template-compiler").parseComponent(e,{pad:!0});if(l.template){const{log:e}=(0,_compiler.parseTemplate)(l.template.content,{filePath:t});e&&e.length&&(0,_sharedUtils.logWarn)(this,e)}return l.styles.length>0&&l.styles.forEach(e=>{if(e.lang||"css"!==e.lang)return;const{log:l}=(0,_compiler.parseStyle)({filePath:t,code:e.content});l&&l.length&&(0,_sharedUtils.logWarn)(this,l,!1)}),e};
//# sourceMappingURL=validator-loader.js.map
+2
View File
@@ -0,0 +1,2 @@
"use strict";var _compiler=require("@hap-toolkit/compiler");class Css2jsonPlugin{constructor(s){this.options=s}apply(s){s.hooks.emit.tapAsync("Css2jsonPlugin",(s,t)=>{for(const t in s.assets)if(t.match(/css\.json$/)){const e=s.assets[t]._source.children.filter(s=>s._value),o=e.length;e.map((s,e)=>{this.css2Json({code:s._value,filePath:t},t=>{let c="";0===e?(c='{"list":['+t,c+=e===o-1?"]}":","):(c=t,c+=e<o-1?",":"]}"),s._value=c})})}t()}),s.hooks.afterEmit.tapAsync("Css2jsonPlugin",(s,t)=>{for(const t in s.assets)t.match(/css\.json$/)&&(s.assets[t]._source.children=[]);t()})}css2Json(s,t){const e=String(s.code).match(/\[(.*)\]/);let o={};const{parsed:c}=(0,_compiler.parseStyle)(s);let n=c;if(e&&e[1]){o[e[1]]=n}else o=n;t&&t(o)}}module.exports=Css2jsonPlugin;
//# sourceMappingURL=css2json-plugin.js.map
+2
View File
@@ -0,0 +1,2 @@
"use strict";var _path=_interopRequireDefault(require("path")),_webpackSources=require("webpack-sources");function _interopRequireDefault(n){return n&&n.__esModule?n:{default:n}}const extList=[".mix",".ux",".vue"];class InstVuePlugin{constructor(n){this.options=n}apply(n){const e=this;n.hooks.compilation.tap("InstVuePlugin",(function(n){n.hooks.optimizeChunkAssets.tapAsync("InstVuePlugin",(function(t,o){t.forEach((function(t){_path.default.extname(Array.from(t.entryModule.buildInfo.fileDependencies)[0])===extList[2]&&t.files.forEach((function(t){const o=e.instVue(t,n);o&&(n.assets[t]=o)}))})),o()}))}))}instVue(n,e){if(/\.js$/.test(n))return n.match(/\bapp\.js$/)?new _webpackSources.ConcatSource("(function(){\n var handler = function() {\n return ",e.assets[n],`\n };\n if (typeof window === "undefined") {\n let options = handler();\n options.default['manifest'] = ${JSON.stringify(global.framework.manifest)}\n $app_define$(options.default)\n $app_bootstrap$()\n }\n })();`):new _webpackSources.ConcatSource("(function(){\n var handler = function() {\n return ",e.assets[n],"\n };\n if (typeof window === \"undefined\") {\n let options = handler();\n options = options.default ? options.default: options\n options['type'] = 'page'\n new Vue({render: function(h) {return h(options)}}).$mount('#app')\n }\n })();")}}module.exports=InstVuePlugin;
//# sourceMappingURL=instvue-plugin.js.map
+2
View File
@@ -0,0 +1,2 @@
"use strict";const path=require("path");module.exports={app:{demo:path.resolve(__dirname,"../templates/app/demo")}};
//# sourceMappingURL=template.js.map
+2
View File
@@ -0,0 +1,2 @@
"use strict";const VueLoaderPlugin=require("vue-loader/lib/plugin"),MiniCssExtractPlugin=require("mini-css-extract-plugin"),Css2jsonPlugin=require("./plugin/css2json-plugin"),InstVuePlugin=require("./plugin/instvue-plugin");module.exports.postHook=function(e,{cwd:s},r){let o;r.hapConfig?(o=r.hapConfig,o.webpack&&(o=o.webpack)):o={module:{rules:[{test:/\.css$/,use:[MiniCssExtractPlugin.loader,"css-loader"]},{test:/\.vue$/,use:{loader:require.resolve("vue-loader"),options:{hotReload:!1,compilerOptions:{preserveWhitespace:!1}}}},{test:/\.(png|jpe?g|gif|svg|bmp|webp|mp4|wmv|avi|mpg|rmvb|mov|flv|otf|ttf|ttc|woff|eot)$/i,use:{loader:require.resolve("url-loader")}}]},plugins:[new VueLoaderPlugin,new MiniCssExtractPlugin({filename:"[name].css.json"})]},(o&&o.module&&o.module.rules||[]).forEach(s=>{s.test.exec(".vue")&&(r.loaderWrapper(s),r.enableE2e&&s.use.push({loader:require.resolve("@hap-toolkit/packager/lib/loader/inject-suite-loader.js"),options:{hookName:"beforeCreate"}}),s.use.push({loader:require.resolve("./loader/validator-loader")})),s.test.exec(".ts")&&r.loaderWrapper(s),e.module.rules.push(s)}),e.plugins.push(...o&&o.plugins||[]),e.plugins.push(new Css2jsonPlugin,new InstVuePlugin),Object.keys(e.resolve).forEach(s=>{const r=e.resolve[s];r instanceof Array?r.push(...o.resolve&&o.resolve[s]||[]):"object"==typeof r&&null!==r&&Object.assign(r,o.resolve&&o.resolve[s]||{})}),Object.keys(o&&o.resolve||{}).forEach(s=>{s in e.resolve||(e.resolve[s]=o.resolve[s])})};
//# sourceMappingURL=webpack.post.js.map