From 03ae0474cacebb3f74214f86a96961e349bb14e4 Mon Sep 17 00:00:00 2001 From: Treecat Date: Fri, 7 Apr 2023 10:21:45 +0800 Subject: [PATCH 1/9] =?UTF-8?q?KERNEL-14316=20fix:=20jQuery=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=8F=8A=20worker=20=E7=BC=BA=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/platform/web/jquery/fn.js | 6 ++++++ packages/fineui/webpack/attachments.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/fineui/src/core/platform/web/jquery/fn.js b/packages/fineui/src/core/platform/web/jquery/fn.js index 2403d95b6..2edb1545d 100644 --- a/packages/fineui/src/core/platform/web/jquery/fn.js +++ b/packages/fineui/src/core/platform/web/jquery/fn.js @@ -252,3 +252,9 @@ $.fn.extend({ }, }); + +$.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), (function(e, t) { + $.fn[t] = function(e, i) { + return arguments.length > 0 ? this.on(t, null, e, i) : this.trigger(t) + } +})) \ No newline at end of file diff --git a/packages/fineui/webpack/attachments.js b/packages/fineui/webpack/attachments.js index c46279897..4644a068e 100644 --- a/packages/fineui/webpack/attachments.js +++ b/packages/fineui/webpack/attachments.js @@ -168,7 +168,7 @@ const fineui = [].concat( bundleCss, basicAttachmentMap.js_bundle, basicAttachmentMap.ui, - // basicAttachmentMap.ts, + basicAttachmentMap.ts, ); const fineuiWithoutConflict = [].concat( From 70ce2bf293d0abc0a4eab1b695764beb11dc90f8 Mon Sep 17 00:00:00 2001 From: Treecat Date: Tue, 11 Apr 2023 13:57:25 +0800 Subject: [PATCH 2/9] =?UTF-8?q?KERNEL-14316=20chore:=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/polyfill/event.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/fineui/src/polyfill/event.js b/packages/fineui/src/polyfill/event.js index 346ec16c8..decca0f7f 100644 --- a/packages/fineui/src/polyfill/event.js +++ b/packages/fineui/src/polyfill/event.js @@ -1,9 +1,9 @@ -(function () { - if (typeof window.CustomEvent === "function") return false; // If not IE +const isIE = () => typeof window.CustomEvent !== "function"; - function CustomEvent (event, params) { +if (isIE()) { + function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; - var evt = document.createEvent("CustomEvent"); + const evt = document.createEvent("CustomEvent"); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; @@ -12,4 +12,4 @@ CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; -}()); +} From 881b2e1fd45141c06f47c9b6bea6e93ae73bddc3 Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 13 Apr 2023 14:12:47 +0800 Subject: [PATCH 3/9] =?UTF-8?q?KERNEL-14512=20chore:=20demo=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/demo/package.json | 3 +- packages/demo/webpack.prod.js | 58 +++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 packages/demo/webpack.prod.js diff --git a/packages/demo/package.json b/packages/demo/package.json index deaabb82e..feadc29f9 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "dev": "webpack-dev-server --open --config=webpack.dev.js" + "dev": "webpack-dev-server --open --config=webpack.dev.js", + "build": "webpack --config=webpack.prod.js" }, "keywords": [], "author": "", diff --git a/packages/demo/webpack.prod.js b/packages/demo/webpack.prod.js new file mode 100644 index 000000000..20bc06a53 --- /dev/null +++ b/packages/demo/webpack.prod.js @@ -0,0 +1,58 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const path = require('path'); +const TerserPlugin = require("terser-webpack-plugin"); +const webpack = require("webpack"); +const childProcess = require("child_process"); + +function git(command) { + return childProcess.execSync(`git ${command}`).toString().trim(); +} + +module.exports = { + mode: 'production', + entry: { + "demo.min": './src/index.js' + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + }, + }, + { + test: /\.less$/i, + use: ['style-loader', 'css-loader', 'less-loader'], + }, + ], + }, + devtool: 'source-map', + resolve: { + extensions: ['.js', '.ts'], + alias: { + '@': path.resolve(__dirname, './src'), + }, + }, + optimization: { + usedExports: false, + minimize: true, + minimizer: [ + new TerserPlugin({ + include: /\.min/, + parallel: true, + terserOptions: { + output: { + comments: false, + }, + }, + }), + new webpack.BannerPlugin({ + banner: `time: ${new Date().toLocaleString("en-US")}; branch: ${git( + "name-rev --name-only HEAD" + )} commit: ${git("rev-parse HEAD")}`, + }) + ], + }, +}; From 661a1b36b45642ecae8d30bea950c65d897ee99e Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 13 Apr 2023 14:20:07 +0800 Subject: [PATCH 4/9] KERNEL-14512 chore: fineui.worker.js --- package.json | 3 +- .../src/core/platform/web/jquery/_jquery.js | 7 - .../src/core/platform/web/jquery/index.js | 1 - .../platform/web/jquery/jquery.polyfill.js | 81 +++++++++++ packages/fineui/src/index.js | 1 - packages/fineui/webpack/attachments.js | 137 +++++++----------- packages/fineui/webpack/webpack.prod.js | 4 +- 7 files changed, 136 insertions(+), 98 deletions(-) delete mode 100644 packages/fineui/src/core/platform/web/jquery/_jquery.js create mode 100644 packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js diff --git a/package.json b/package.json index ec5184e96..e5313ec82 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "dev": "npm-run-all --parallel dev:*", "dev:demo": "pnpm --dir packages/demo dev", "dev:fineui": "pnpm --dir packages/fineui dev", - "build": "pnpm --dir packages/fineui build" + "build": "pnpm --dir packages/fineui build", + "build:demo": "pnpm --dir packages/demo build" }, "devDependencies": { "@babel/cli": "^7.21.0", diff --git a/packages/fineui/src/core/platform/web/jquery/_jquery.js b/packages/fineui/src/core/platform/web/jquery/_jquery.js deleted file mode 100644 index 52f4c1ef3..000000000 --- a/packages/fineui/src/core/platform/web/jquery/_jquery.js +++ /dev/null @@ -1,7 +0,0 @@ -// import jQuery from "jquery"; -// import { _global } from "@/core/0.foundation"; - -// // todo:先垫着,不然开发会崩 -// _global.BI = _global.BI || {}; - -// _global.BI.jQuery = _global.BI.$ = jQuery; diff --git a/packages/fineui/src/core/platform/web/jquery/index.js b/packages/fineui/src/core/platform/web/jquery/index.js index 4c523e052..adc0e96a7 100644 --- a/packages/fineui/src/core/platform/web/jquery/index.js +++ b/packages/fineui/src/core/platform/web/jquery/index.js @@ -1,4 +1,3 @@ -import "./_jquery"; import "./event"; import "./fn"; import "./jquery.mousewheel"; diff --git a/packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js b/packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js new file mode 100644 index 000000000..7564b7855 --- /dev/null +++ b/packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js @@ -0,0 +1,81 @@ +/** + * 用于 jquery 在 worker 环境或者 V8 引擎的 polyfill + */ +import { _global } from "@/core/0.foundation"; +if (!_global.window) { + _global.window = _global; + const document = (_global.document = {}); + const fakeElement = Object.create(document); + + Object.assign(document, { + parentNode: null, + nodeType: 9, + head: fakeElement, + body: fakeElement, + ownerDocument: document, + documentElement: document, + toString() { + return "FakeDocument"; + }, + appendChild(child) { + return child; + }, + implementation: { + createHTMLDocument() { + return { + body: { + childNodes: [], + }, + }; + }, + createDocumentFragment() { + return this; + }, + }, + getElementById() { + return fakeElement; + }, + createElement() { + return fakeElement; + }, + createDocumentFragment() { + return this; + }, + cloneNode() { + return this; + }, + getElementsByTagName() { + return [fakeElement]; + }, + getElementsByClassName() { + return [fakeElement]; + }, + setAttribute() { + return null; + }, + getAttribute() { + return null; + }, + removeChild() { + return null; + }, + addEventListener() { + return null; + }, + removeEventListener() { + return null; + }, + }); + + Object.assign(fakeElement, { + nodeType: 1, + style: {}, + ownerDocument: document, + parentNod: fakeElement, + firstChild: fakeElement, + lastChild: fakeElement, + toString() { + return "FakeElement"; + }, + }); +} diff --git a/packages/fineui/src/index.js b/packages/fineui/src/index.js index 718910771..8458c1264 100644 --- a/packages/fineui/src/index.js +++ b/packages/fineui/src/index.js @@ -1,5 +1,4 @@ // sideEffects -import "./polyfill"; import "./core/system"; import "./core/element"; import "./core/platform"; diff --git a/packages/fineui/webpack/attachments.js b/packages/fineui/webpack/attachments.js index 4644a068e..58ea3107c 100644 --- a/packages/fineui/webpack/attachments.js +++ b/packages/fineui/webpack/attachments.js @@ -1,19 +1,16 @@ const { sync, uniq } = require("./utils"); const fixJs = "./dist/fix/fix.js"; -const fixProxyJs = './dist/fix/fix.proxy.js'; +const fixProxyJs = "./dist/fix/fix.proxy.js"; const fixCompact = "./dist/fix/fix.compact.js"; -const workerCompact = './dist/fix/worker.compact.js'; +const workerCompact = "./dist/fix/worker.compact.js"; const lodashJs = "src/core/1.lodash.js"; -const jqueryJs = "src/core/platform/web/jquery/_jquery.js"; +const jqueryPolyfill = "./src/core/platform/web/jquery/jquery.polyfill.js"; -const runtimePolyfill = ["core-js/stable"]; +const runtimePolyfill = []; const basicAttachmentMap = { - polyfill: sync([ - "src/core/0.foundation.js", - "src/polyfill/**/*.js", - ]).concat(runtimePolyfill), + polyfill: sync(["src/core/0.foundation.js", "src/polyfill/**/*.js"]).concat(runtimePolyfill), core: sync([ "src/less/core/**/*.less", "src/less/theme/**/*.less", @@ -39,38 +36,23 @@ const basicAttachmentMap = { // "src/widget/**/*.js", // "src/component/**/*.js", ]), - router: sync([ - "src/router/**/*.js", - ]), - core_without_platform: sync([ - "src/core/0.foundation.js", - lodashJs, - "src/core/**/*.js", - "src/data/**/*.js", - ], [ - "src/core/platform/**/*.js", - "src/core/controller/**/*.js", - ]), + router: sync(["src/router/**/*.js"]), + core_without_platform: sync( + ["src/core/0.foundation.js", lodashJs, "src/core/**/*.js", "src/data/**/*.js"], + ["src/core/platform/**/*.js", "src/core/controller/**/*.js"] + ), core_without_normalize: sync( - ["src/less/core/**/*.less", "src/less/theme/**/*.less"], ["src/less/core/normalize.less", "src/less/core/normalize2.less"] + ["src/less/core/**/*.less", "src/less/theme/**/*.less"], + ["src/less/core/normalize.less", "src/less/core/normalize2.less"] + ), + core_without_conflict: sync( + ["src/less/core/**/*.less", "src/less/theme/**/*.less", lodashJs, "src/core/**/*.js", "src/data/**/*.js"], + ["src/core/conflict.js"] ), - core_without_conflict: sync([ - "src/less/core/**/*.less", - "src/less/theme/**/*.less", - lodashJs, - "src/core/**/*.js", - "src/data/**/*.js", - ], [ - "src/core/conflict.js", - ]), resource: sync(["src/less/resource/**/*.less"]), font: sync(["public/less/font.less"]), - ts: ['./typescript/bundle.ts'], - ui: sync([ - 'ui/less/app.less', - 'ui/less/**/*.less', - 'ui/js/**/*.js', - ]), + ts: ["./typescript/bundle.ts"], + ui: sync(["ui/less/app.less", "ui/less/**/*.less", "ui/js/**/*.js"]), config: sync(["demo/version.js", "i18n/i18n.cn.js"]), utils: sync([ "src/core/0.foundation.js", @@ -95,7 +77,7 @@ const basicAttachmentMap = { "src/less/widget/**/*.less", "src/less/component/**/*.less", ]), - js_bundle: sync(["src/bundle.js"]) + js_bundle: sync(["src/bundle.js"]), }; const bundle = [].concat( @@ -109,13 +91,10 @@ const bundle = [].concat( [fixCompact, workerCompact], basicAttachmentMap.router, sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]), - basicAttachmentMap.ts, + basicAttachmentMap.ts ); -const bundleCss = [].concat( - basicAttachmentMap.less, - sync(["public/less/app.less", "public/less/**/*.less"]), -); +const bundleCss = [].concat(basicAttachmentMap.less, sync(["public/less/app.less", "public/less/**/*.less"])); // const bundleModern = [].concat( // sync(["src/less/modern.less"]), @@ -129,9 +108,9 @@ const coreJs = [].concat( basicAttachmentMap.base, basicAttachmentMap.case, basicAttachmentMap.widget, - ['./dist/fix/fix.compact.js'], + ["./dist/fix/fix.compact.js"], basicAttachmentMap.router, - basicAttachmentMap.ts, + basicAttachmentMap.ts ); const resource = sync(["private/less/app.less", "private/less/**/*.less"]); @@ -140,16 +119,17 @@ const config = sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js const bundleWithoutNormalize = [].concat( basicAttachmentMap.core_without_normalize, - sync([ - "src/less/base/**/*.less", - "src/less/case/**/*.less", - "src/less/widget/**/*.less", - "src/less/component/**/*.less", - "public/less/**/*.less", - // ts的less - ], [ - "public/less/app.less", - ]), + sync( + [ + "src/less/base/**/*.less", + "src/less/case/**/*.less", + "src/less/widget/**/*.less", + "src/less/component/**/*.less", + "public/less/**/*.less", + // ts的less + ], + ["public/less/app.less"] + ) ); const fineuiWithoutNormalize = [].concat( @@ -159,20 +139,27 @@ const fineuiWithoutNormalize = [].concat( "src/less/case/**/*.less", "src/less/widget/**/*.less", "src/less/component/**/*.less", - 'ui/less/app.less', - 'ui/less/**/*.less', - ]), + "ui/less/app.less", + "ui/less/**/*.less", + ]) ); const fineui = [].concat( bundleCss, + basicAttachmentMap.polyfill, basicAttachmentMap.js_bundle, basicAttachmentMap.ui, - basicAttachmentMap.ts, + basicAttachmentMap.ts +); + +const fineuiForWorker = [].concat( + jqueryPolyfill, + basicAttachmentMap.js_bundle, + basicAttachmentMap.ui, + basicAttachmentMap.ts ); const fineuiWithoutConflict = [].concat( - basicAttachmentMap.polyfill, basicAttachmentMap.core_without_conflict, basicAttachmentMap.fix, basicAttachmentMap.base, @@ -182,6 +169,7 @@ const fineuiWithoutConflict = [].concat( [fixCompact, workerCompact], basicAttachmentMap.ui, basicAttachmentMap.ts, + basicAttachmentMap.polyfill ); // const fineuiModern = [].concat( @@ -202,30 +190,7 @@ const fineuiProxy = [].concat( basicAttachmentMap.router, [fixCompact, workerCompact], basicAttachmentMap.ui, - basicAttachmentMap.ts, -); - -const fineuiWithoutJqueryAndPolyfillJs = [].concat( - runtimePolyfill, - sync([ - "src/core/0.foundation.js", - lodashJs, - "src/core/**/*.js", - "src/data/**/*.js", - ], [ - "src/core/platform/web/**/*.js", - ]), - basicAttachmentMap.fix, - sync([ - "src/base/**/*.js", - "src/case/**/*.js", - ], [ - "src/base/single/input/file.js", - "src/case/ztree/**/*.js", - ]), - basicAttachmentMap.widget, - sync([fixCompact, workerCompact, "ui/js/**/*.js"]), - basicAttachmentMap.ts, + basicAttachmentMap.ts ); const demo = [].concat( @@ -240,7 +205,7 @@ const demo = [].concat( sync(["public/less/app.less", "public/less/**/*.less"]), [fixCompact, workerCompact], basicAttachmentMap.ts, - sync(["demo/less/*.less", "demo/less/**/*.less", "demo/app.js", "demo/js/**/*.js", "demo/config.js"]), + sync(["demo/less/*.less", "demo/less/**/*.less", "demo/app.js", "demo/js/**/*.js", "demo/config.js"]) ); module.exports = { @@ -254,12 +219,12 @@ module.exports = { bundleWithoutNormalize: uniq(bundleWithoutNormalize), fineui: uniq(fineui), fineuiProxy: uniq(fineuiProxy), - fineuiWithoutJqueryAndPolyfillJs: uniq(fineuiWithoutJqueryAndPolyfillJs), + fineuiForWorker: uniq(fineuiForWorker), utils: uniq(basicAttachmentMap.utils), demo: uniq(demo), coreWithoutPlatform: uniq(basicAttachmentMap.core_without_platform), coreJs: uniq(coreJs), - resource: uniq((resource)), + resource: uniq(resource), config: uniq(config), bundleCss: uniq(bundleCss), }; diff --git a/packages/fineui/webpack/webpack.prod.js b/packages/fineui/webpack/webpack.prod.js index d5eab3742..991d535f2 100644 --- a/packages/fineui/webpack/webpack.prod.js +++ b/packages/fineui/webpack/webpack.prod.js @@ -17,7 +17,8 @@ module.exports = merge(common, { mode: "production", entry: { - "fineui.min": attachments.fineui + "fineui.min": attachments.fineui, + "fineui.worker.min": attachments.fineuiForWorker, }, output: { @@ -49,7 +50,6 @@ module.exports = merge(common, { ], }, - plugins: [ new MiniCssExtractPlugin({ filename: "[name].css", From 4f0523e2e4216b6966f8169d780c29c0b6a74d93 Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 13 Apr 2023 14:43:56 +0800 Subject: [PATCH 5/9] =?UTF-8?q?KERNEL-14512=20chore:=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/cli.js | 21 +++++ bin/cli/worker/cli.worker.js | 76 +++++++++++++++++++ bin/cli/worker/template/main_thread.helper.t | 48 ++++++++++++ .../action/action.worker_ability_test.t | 13 ++++ .../worker/template/main_thread/main_thread.t | 13 ++++ bin/cli/worker/template/utils/action_type.t | 8 ++ bin/cli/worker/template/utils/payload_type.t | 13 ++++ .../action/action.worker_ability_test.t | 24 ++++++ .../template/worker_thread/worker_thread.t | 12 +++ packages/demo/package.json | 2 +- packages/fineui/package.json | 2 +- {script => scripts}/chinese.js | 0 {script => scripts}/code.static.js | 0 {script => scripts}/lib/fui.component.json | 0 {script => scripts}/lib/fui.export.txt | 0 {script => scripts}/lib/utils.js | 0 {script => scripts}/rename.js | 0 17 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 bin/cli/cli.js create mode 100644 bin/cli/worker/cli.worker.js create mode 100644 bin/cli/worker/template/main_thread.helper.t create mode 100644 bin/cli/worker/template/main_thread/action/action.worker_ability_test.t create mode 100644 bin/cli/worker/template/main_thread/main_thread.t create mode 100644 bin/cli/worker/template/utils/action_type.t create mode 100644 bin/cli/worker/template/utils/payload_type.t create mode 100644 bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t create mode 100644 bin/cli/worker/template/worker_thread/worker_thread.t rename {script => scripts}/chinese.js (100%) rename {script => scripts}/code.static.js (100%) rename {script => scripts}/lib/fui.component.json (100%) rename {script => scripts}/lib/fui.export.txt (100%) rename {script => scripts}/lib/utils.js (100%) rename {script => scripts}/rename.js (100%) diff --git a/bin/cli/cli.js b/bin/cli/cli.js new file mode 100644 index 000000000..513024023 --- /dev/null +++ b/bin/cli/cli.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +const yargs = require('yargs/yargs'); +const { hideBin } = require('yargs/helpers'); + +const workerCmd = require('./worker/cli.worker'); + +const argv = yargs(hideBin(process.argv)).argv; + +const cmd = argv._[0]; + +const cmds = new Map([ + ['worker', workerCmd], +]); + +if (!cmd) throw new Error('Command is undefined!'); + +if (cmds.has(cmd)) { + cmds.get(cmd)?.exec(argv); +} else { + throw new Error(`Command ${cmd} not supported`); +} diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js new file mode 100644 index 000000000..b67513fbb --- /dev/null +++ b/bin/cli/worker/cli.worker.js @@ -0,0 +1,76 @@ +const fs = require('fs'); +const path = require('path'); + +function first2UpperCase(str) { + return str.toLowerCase().replace(/( |^)[a-z]/g, L => L.toUpperCase()); +} + +function scanAndCreate(structure, workerName, root) { + Object.keys(structure) + .forEach(name => { + if (typeof structure[name] === 'object') { + fs.mkdirSync(path.resolve(root, name)); + + scanAndCreate(structure[name], workerName, path.resolve(root, `./${name}`)); + } else if (structure[name] === '') { + fs.appendFileSync(path.resolve(root, name), ''); + } else if (typeof structure[name] === 'string') { + let content = fs.readFileSync(structure[name]).toString(); + + content = content + .replace(/\${WorkerName}/g, first2UpperCase(workerName)) + .replace(/\${workerName}/g, workerName); + + fs.appendFileSync(path.resolve(root, name), content); + } + }); +} + +module.exports = { + exec: async args => { + if (!args.init) { + throw new Error(`Command init not found in args`); + } + + if (!args.name) { + throw new Error('Command --name=... not found in args'); + } + + const name = args.name; + + const structure = { + [`${name}_worker`]: { + 'main_thread': { + action: { + 'action.worker_ability_test.ts': path.resolve(__dirname, './template/main_thread/action/action.worker_ability_test.t'), + }, + [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread/main_thread.t'), + }, + utils: { + 'action_type.ts': path.resolve(__dirname, './template/utils/action_type.t'), + 'payload_type.ts': path.resolve(__dirname, './template/utils/payload_type.t'), + }, + 'worker_thread': { + action: { + 'action.worker_ability_test.ts': path.resolve(__dirname, './template/worker_thread/action/action.worker_ability_test.t'), + }, + [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread/worker_thread.t'), + }, + [`${name}_main_thread.helper.ts`]: path.resolve(__dirname, './template/main_thread.helper.t'), + }, + }; + + scanAndCreate(structure, name, args.where ? path.resolve(args.where) : process.cwd()); + }, +}; + +// 结构 +// -xxx_worker +// -|--main_thread +// -|--|--action +// -|--|--xxx_main_thread.ts +// -|--utils +// -|--|--action_type.ts +// -|--worker_thread +// -|--|--action +// -|--|--worker_main_thread.ts diff --git a/bin/cli/worker/template/main_thread.helper.t b/bin/cli/worker/template/main_thread.helper.t new file mode 100644 index 000000000..2ee06acb7 --- /dev/null +++ b/bin/cli/worker/template/main_thread.helper.t @@ -0,0 +1,48 @@ +import { ${WorkerName}MainThreadWorker } from './main_thread/${workerName}_main_thread'; +// 不需要一起打包的话则不需要引入这行 +// FuiWorkerPlugin中的属性会同步到fui-worker中,同时支持loader行内传入属性 +// 根据实际需求传入inline,返回格式 true -> blob url,false -> servicePath +import workerUrl from 'fui-worker!./worker_thread/${workerName}_worker_thread'; + +export class ${WorkerName}WorkerHelper { + private worker: ${WorkerName}MainThreadWorker; + + /** + * 拿到helper中的worker + */ + public getWorker() { + if (this.worker) { + return this.worker; + } + + this.worker = BI.Workers.createWorker(${WorkerName}MainThreadWorker, { + workerUrl: this.urlFormatter(workerUrl), + workerName: BI.UUID(), + }); + + return this.worker; + } + + /** + * 格式化worker url,比如补充一些环境信息到参数里 + * 可通过 #hash 将参数传入blob url + * @param url worker url + */ + private urlFormatter(url: string) { + return url; + } + + /** + * 终止worker + */ + public terminate() { + this.worker?.terminate(); + } +} + +// 使用示例 +// const workerHelper = new ${WorkerName}WorkerHelper(); + +// workerHelper.getWorker() +// .testCommunication() +// .then(res => console.log(res)); diff --git a/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t b/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t new file mode 100644 index 000000000..42425b859 --- /dev/null +++ b/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t @@ -0,0 +1,13 @@ +import { WorkerAbilityTestActionType } from '../../utils/action_type'; +import { WorkerAbilityTestPayload, WorkerAbilityTestReponse } from '../../utils/payload_type'; + +export class WorkerAbilityTestMainThreadAction extends BI.Workers.WorkerBaseAction { + /** + * 通信能力检测 + */ + public communicationTest(): Promise { + const mainThreadPostTime: WorkerAbilityTestPayload['CommunicationTest'] = Date.now(); + + return this.controller.requestPromise(WorkerAbilityTestActionType.CommunicationTest, mainThreadPostTime); + } +} diff --git a/bin/cli/worker/template/main_thread/main_thread.t b/bin/cli/worker/template/main_thread/main_thread.t new file mode 100644 index 000000000..00fb09177 --- /dev/null +++ b/bin/cli/worker/template/main_thread/main_thread.t @@ -0,0 +1,13 @@ +import { WorkerAbilityTestMainThreadAction } from './action/action.worker_ability_test'; + +export class ${WorkerName}MainThreadWorker extends BI.Workers.MainThreadWorker { + private communicationTest: WorkerAbilityTestMainThreadAction; + + public initActions(): void { + this.communicationTest = this.createAction(WorkerAbilityTestMainThreadAction); + } + + public testCommunication() { + return this.communicationTest.communicationTest(); + } +} diff --git a/bin/cli/worker/template/utils/action_type.t b/bin/cli/worker/template/utils/action_type.t new file mode 100644 index 000000000..c92de897a --- /dev/null +++ b/bin/cli/worker/template/utils/action_type.t @@ -0,0 +1,8 @@ +/* + * Worker 事务标识 + * 每类事务有命名空间, 包含多个具体事务 + */ + +export const enum WorkerAbilityTestActionType { + CommunicationTest = 'CommunicationTest', +} diff --git a/bin/cli/worker/template/utils/payload_type.t b/bin/cli/worker/template/utils/payload_type.t new file mode 100644 index 000000000..6b9a71509 --- /dev/null +++ b/bin/cli/worker/template/utils/payload_type.t @@ -0,0 +1,13 @@ +/** + * 跨线程通信各事务的发送数据类型声明 + */ +export interface WorkerAbilityTestPayload { + CommunicationTest: number; +} + +/** + * 跨线程通信各事务的响应数据类型声明 + */ +export interface WorkerAbilityTestReponse { + CommunicationTest: number; +} diff --git a/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t b/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t new file mode 100644 index 000000000..f7d1248f4 --- /dev/null +++ b/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t @@ -0,0 +1,24 @@ +import { WorkerAbilityTestActionType } from '../../utils/action_type'; +import { WorkerAbilityTestPayload, WorkerAbilityTestReponse } from '../../utils/payload_type'; + +export class WorkerAbilityTestWorkerThreadAction extends BI.Workers.WorkerBaseAction { + protected addActionHandler(): void { + this.controller.addActionHandler( + WorkerAbilityTestActionType.CommunicationTest, + this.communicationTest.bind(this) + ); + } + + /** + * 通信能力检测的处理器 + */ + private communicationTest( + payload: WorkerAbilityTestPayload['CommunicationTest'] + ): WorkerAbilityTestReponse['CommunicationTest'] { + const mainThreadPostTime = payload; + // 收到主线程信息的耗时 + const workerGetMessageDuration = Date.now() - mainThreadPostTime; + + return workerGetMessageDuration; + } +} diff --git a/bin/cli/worker/template/worker_thread/worker_thread.t b/bin/cli/worker/template/worker_thread/worker_thread.t new file mode 100644 index 000000000..f437bbc23 --- /dev/null +++ b/bin/cli/worker/template/worker_thread/worker_thread.t @@ -0,0 +1,12 @@ +// TODO: 这边需要先import fineui资源 +import { WorkerAbilityTestWorkerThreadAction } from './action/action.worker_ability_test'; + +class ${WorkerName}WorkerTreadWorker extends BI.Workers.WorkerThreadWorker { + public communicationTest: WorkerAbilityTestWorkerThreadAction; + + public initActions(): void { + this.communicationTest = this.createAction(WorkerAbilityTestWorkerThreadAction); + } +} + +export const ${workerName}WorkerTreadWorker = BI.Workers.createWorker(${WorkerName}WorkerTreadWorker); diff --git a/packages/demo/package.json b/packages/demo/package.json index feadc29f9..67c18d5f7 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "dev": "webpack-dev-server --open --config=webpack.dev.js", + "dev": "webpack-dev-server --open --config=webpack.dev.js --progress", "build": "webpack --config=webpack.prod.js" }, "keywords": [], diff --git a/packages/fineui/package.json b/packages/fineui/package.json index 707b58a46..217d64e51 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -20,7 +20,7 @@ ], "scripts": { "dev": "babel src -d dist/es --config-file ./esm.babel.js -w", - "build": "webpack --config=webpack/webpack.prod.js", + "build": "webpack --progress --config=webpack/webpack.prod.js", "webpack:css": "webpack --config=webpack/webpack.css.js --mode production", "biCss": "cross-env LESS_CONFIG_PATH=lessconfig/bi.lessconfig.json LESS_FILE_NAME=bi npm run webpack:css", "jsyCss": "cross-env LESS_CONFIG_PATH=lessconfig/jsy.lessconfig.json LESS_FILE_NAME=jsy npm run webpack:css" diff --git a/script/chinese.js b/scripts/chinese.js similarity index 100% rename from script/chinese.js rename to scripts/chinese.js diff --git a/script/code.static.js b/scripts/code.static.js similarity index 100% rename from script/code.static.js rename to scripts/code.static.js diff --git a/script/lib/fui.component.json b/scripts/lib/fui.component.json similarity index 100% rename from script/lib/fui.component.json rename to scripts/lib/fui.component.json diff --git a/script/lib/fui.export.txt b/scripts/lib/fui.export.txt similarity index 100% rename from script/lib/fui.export.txt rename to scripts/lib/fui.export.txt diff --git a/script/lib/utils.js b/scripts/lib/utils.js similarity index 100% rename from script/lib/utils.js rename to scripts/lib/utils.js diff --git a/script/rename.js b/scripts/rename.js similarity index 100% rename from script/rename.js rename to scripts/rename.js From 2bea8ea336c3932366952655355d2dfca36ebf75 Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 13 Apr 2023 14:49:30 +0800 Subject: [PATCH 6/9] =?UTF-8?q?KERNEL-14512=20chore:=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/fineui/package.json b/packages/fineui/package.json index 217d64e51..1d9d5143a 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -20,10 +20,12 @@ ], "scripts": { "dev": "babel src -d dist/es --config-file ./esm.babel.js -w", - "build": "webpack --progress --config=webpack/webpack.prod.js", + "build": "run-p build:*", + "build:es": "babel src -d dist/es --config-file ./esm.babel.js", + "build:fineui": "webpack --progress --config=webpack/webpack.prod.js", "webpack:css": "webpack --config=webpack/webpack.css.js --mode production", - "biCss": "cross-env LESS_CONFIG_PATH=lessconfig/bi.lessconfig.json LESS_FILE_NAME=bi npm run webpack:css", - "jsyCss": "cross-env LESS_CONFIG_PATH=lessconfig/jsy.lessconfig.json LESS_FILE_NAME=jsy npm run webpack:css" + "build:biCss": "cross-env LESS_CONFIG_PATH=lessconfig/bi.lessconfig.json LESS_FILE_NAME=bi npm run webpack:css", + "build:jsyCss": "cross-env LESS_CONFIG_PATH=lessconfig/jsy.lessconfig.json LESS_FILE_NAME=jsy npm run webpack:css" }, "repository": { "type": "git", From 017e9363d0b7bc43c672e360acabb01186c185a3 Mon Sep 17 00:00:00 2001 From: Treecat Date: Fri, 14 Apr 2023 14:31:22 +0800 Subject: [PATCH 7/9] =?UTF-8?q?KERNEL-14512=20chore:=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 +++++ packages/fineui/package.json | 14 +++++++++----- packages/fineui/tsconfig.json | 7 +++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e5313ec82..06c697c02 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,11 @@ "keywords": [], "author": "", "license": "ISC", + "engines": { + "node": ">=16.0.0", + "yarn": "please-use-pnpm", + "pnpm": ">=7.0.0" + }, "scripts": { "dev": "npm-run-all --parallel dev:*", "dev:demo": "pnpm --dir packages/demo dev", diff --git a/packages/fineui/package.json b/packages/fineui/package.json index 1d9d5143a..8977c42fd 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -2,9 +2,9 @@ "name": "@fui/core", "version": "2.0.20230208163847", "description": "fineui", - "main": "dist/fineui_without_conflict.min.js", + "main": "dist/fineui.min.js", "module": "dist/es/index.js", - "types": "dist/type/index.d.ts", + "types": "dist/lib/index.d.ts", "bin": { "fui-cli": "./bin/cli/cli.js" }, @@ -19,14 +19,17 @@ "dist/es/case/ztree/jquery.ztree.excheck-3.5.js" ], "scripts": { - "dev": "babel src -d dist/es --config-file ./esm.babel.js -w", - "build": "run-p build:*", + "dev": "tsc && babel src -d dist/es --config-file ./esm.babel.js -w", + "build": "tsc && run-p build:*", "build:es": "babel src -d dist/es --config-file ./esm.babel.js", "build:fineui": "webpack --progress --config=webpack/webpack.prod.js", "webpack:css": "webpack --config=webpack/webpack.css.js --mode production", "build:biCss": "cross-env LESS_CONFIG_PATH=lessconfig/bi.lessconfig.json LESS_FILE_NAME=bi npm run webpack:css", "build:jsyCss": "cross-env LESS_CONFIG_PATH=lessconfig/jsy.lessconfig.json LESS_FILE_NAME=jsy npm run webpack:css" }, + "files": [ + "dist" + ], "repository": { "type": "git", "url": "https://git.coding.net/fanruan/fineui.git" @@ -37,7 +40,8 @@ "finebi" ], "publishConfig": { - "registry": "https://registry.npmjs.org" + "registry": "https://registry.npmjs.org", + "access": "public" }, "author": "fanruan", "license": "MIT", diff --git a/packages/fineui/tsconfig.json b/packages/fineui/tsconfig.json index c4d27c622..5a888d48a 100644 --- a/packages/fineui/tsconfig.json +++ b/packages/fineui/tsconfig.json @@ -4,10 +4,13 @@ "target": "es2017", "module": "es2015", "moduleResolution": "node", - "lib": ["es2017", "dom"], + "lib": [ + "es2017", + "dom" + ], "declaration": true, "experimentalDecorators": true, - "outDir": "./type/lib", + "outDir": "./dist/lib", "baseUrl": ".", // "strict": true, "strictNullChecks": true, From bc8f19f5891c6493f865569f2436b5c6a1f345e1 Mon Sep 17 00:00:00 2001 From: Treecat Date: Fri, 14 Apr 2023 15:05:24 +0800 Subject: [PATCH 8/9] =?UTF-8?q?KERNEL-14512=20chore:=E6=89=93=E5=8C=85?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/demo/package.json | 2 +- packages/fineui/package.json | 7 ++++--- packages/fineui/src/core/index.js | 11 ++++------- packages/fineui/src/index.js | 9 +++------ 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/demo/package.json b/packages/demo/package.json index 67c18d5f7..01fe03056 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "dev": "webpack-dev-server --open --config=webpack.dev.js --progress", - "build": "webpack --config=webpack.prod.js" + "build": "webpack --config=webpack.prod.js --progress" }, "keywords": [], "author": "", diff --git a/packages/fineui/package.json b/packages/fineui/package.json index 8977c42fd..7551b66e4 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -11,9 +11,10 @@ "sideEffects": [ "**/*.less", "src/**/*.js", - "dist/es/core/*.js", - "dist/es/core/element/**/*.js", - "dist/es/core/platform/**/*.js", + "dist/es/index.js", + "dist/es/core/system.js", + "dist/es/core/platform/web/config.js", + "dist/es/core/platform/web/jquery/*.js", "dist/es/polyfill/**/*.js", "dist/es/case/ztree/jquery.ztree.core-3.5.js", "dist/es/case/ztree/jquery.ztree.excheck-3.5.js" diff --git a/packages/fineui/src/core/index.js b/packages/fineui/src/core/index.js index b754913f6..6dbdf43c9 100644 --- a/packages/fineui/src/core/index.js +++ b/packages/fineui/src/core/index.js @@ -1,5 +1,5 @@ export * from './system'; -export { Plugin } from './6.plugin'; + export { StyleLoaderManager } from './loader/loader.style'; export { ShowListener } from './listener/listener.show'; export { useInWorker } from './worker'; @@ -15,16 +15,14 @@ export { PopoverController } from './controller/controller.popover'; export { ResizeController } from './controller/controller.resizer'; export { TooltipsController } from './controller/controller.tooltips'; -export * from './4.widget'; +export * as _ from './1.lodash'; export * from './2.base'; export * from './3.ob'; - +export * from './4.widget'; export * from './5.inject'; export * from './6.plugin'; export * from './action'; -// export * from "./behavior"; -// export * from "./controller"; export * from './func'; export * from './structure'; export * from './h'; @@ -36,6 +34,5 @@ export * from './utils'; export { shortcut, provider, store, model, mixin, mixins } from './decorator'; -import _ from './1.lodash'; -export { _ }; + diff --git a/packages/fineui/src/index.js b/packages/fineui/src/index.js index 8458c1264..e0600bc9e 100644 --- a/packages/fineui/src/index.js +++ b/packages/fineui/src/index.js @@ -1,12 +1,9 @@ // sideEffects import "./core/system"; -import "./core/element"; -import "./core/platform"; import "./core/platform/web/jquery" -// 必须要等上面的准备好, 才初始化 config import "./core/platform/web/config"; -import _jquery from "jquery"; +import jquery from "jquery"; export * from "./core"; export * from "./base"; @@ -16,5 +13,5 @@ export * from "./component"; export * from "./fix"; export * from "./router"; export * as Popper from "@popperjs/core"; -export const jQuery = _jquery; -export const $ = _jquery; +export const jQuery = jquery; +export const $ = jquery; From bd0fa19431e9a994c24de117c69bc2265508c2db Mon Sep 17 00:00:00 2001 From: Treecat Date: Fri, 14 Apr 2023 15:05:24 +0800 Subject: [PATCH 9/9] =?UTF-8?q?KERNEL-14512=20chore:=E6=89=93=E5=8C=85?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/demo/package.json | 2 +- {bin => packages/fineui/bin}/cli/cli.js | 0 {bin => packages/fineui/bin}/cli/worker/cli.worker.js | 0 .../bin}/cli/worker/template/main_thread.helper.t | 0 .../main_thread/action/action.worker_ability_test.t | 0 .../cli/worker/template/main_thread/main_thread.t | 0 .../bin}/cli/worker/template/utils/action_type.t | 0 .../bin}/cli/worker/template/utils/payload_type.t | 0 .../worker_thread/action/action.worker_ability_test.t | 0 .../cli/worker/template/worker_thread/worker_thread.t | 0 packages/fineui/package.json | 7 ++++--- packages/fineui/src/core/index.js | 11 ++++------- packages/fineui/src/index.js | 9 +++------ 13 files changed, 12 insertions(+), 17 deletions(-) rename {bin => packages/fineui/bin}/cli/cli.js (100%) rename {bin => packages/fineui/bin}/cli/worker/cli.worker.js (100%) rename {bin => packages/fineui/bin}/cli/worker/template/main_thread.helper.t (100%) rename {bin => packages/fineui/bin}/cli/worker/template/main_thread/action/action.worker_ability_test.t (100%) rename {bin => packages/fineui/bin}/cli/worker/template/main_thread/main_thread.t (100%) rename {bin => packages/fineui/bin}/cli/worker/template/utils/action_type.t (100%) rename {bin => packages/fineui/bin}/cli/worker/template/utils/payload_type.t (100%) rename {bin => packages/fineui/bin}/cli/worker/template/worker_thread/action/action.worker_ability_test.t (100%) rename {bin => packages/fineui/bin}/cli/worker/template/worker_thread/worker_thread.t (100%) diff --git a/packages/demo/package.json b/packages/demo/package.json index 67c18d5f7..01fe03056 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "dev": "webpack-dev-server --open --config=webpack.dev.js --progress", - "build": "webpack --config=webpack.prod.js" + "build": "webpack --config=webpack.prod.js --progress" }, "keywords": [], "author": "", diff --git a/bin/cli/cli.js b/packages/fineui/bin/cli/cli.js similarity index 100% rename from bin/cli/cli.js rename to packages/fineui/bin/cli/cli.js diff --git a/bin/cli/worker/cli.worker.js b/packages/fineui/bin/cli/worker/cli.worker.js similarity index 100% rename from bin/cli/worker/cli.worker.js rename to packages/fineui/bin/cli/worker/cli.worker.js diff --git a/bin/cli/worker/template/main_thread.helper.t b/packages/fineui/bin/cli/worker/template/main_thread.helper.t similarity index 100% rename from bin/cli/worker/template/main_thread.helper.t rename to packages/fineui/bin/cli/worker/template/main_thread.helper.t diff --git a/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t b/packages/fineui/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t similarity index 100% rename from bin/cli/worker/template/main_thread/action/action.worker_ability_test.t rename to packages/fineui/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t diff --git a/bin/cli/worker/template/main_thread/main_thread.t b/packages/fineui/bin/cli/worker/template/main_thread/main_thread.t similarity index 100% rename from bin/cli/worker/template/main_thread/main_thread.t rename to packages/fineui/bin/cli/worker/template/main_thread/main_thread.t diff --git a/bin/cli/worker/template/utils/action_type.t b/packages/fineui/bin/cli/worker/template/utils/action_type.t similarity index 100% rename from bin/cli/worker/template/utils/action_type.t rename to packages/fineui/bin/cli/worker/template/utils/action_type.t diff --git a/bin/cli/worker/template/utils/payload_type.t b/packages/fineui/bin/cli/worker/template/utils/payload_type.t similarity index 100% rename from bin/cli/worker/template/utils/payload_type.t rename to packages/fineui/bin/cli/worker/template/utils/payload_type.t diff --git a/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t b/packages/fineui/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t similarity index 100% rename from bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t rename to packages/fineui/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t diff --git a/bin/cli/worker/template/worker_thread/worker_thread.t b/packages/fineui/bin/cli/worker/template/worker_thread/worker_thread.t similarity index 100% rename from bin/cli/worker/template/worker_thread/worker_thread.t rename to packages/fineui/bin/cli/worker/template/worker_thread/worker_thread.t diff --git a/packages/fineui/package.json b/packages/fineui/package.json index 8977c42fd..7551b66e4 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -11,9 +11,10 @@ "sideEffects": [ "**/*.less", "src/**/*.js", - "dist/es/core/*.js", - "dist/es/core/element/**/*.js", - "dist/es/core/platform/**/*.js", + "dist/es/index.js", + "dist/es/core/system.js", + "dist/es/core/platform/web/config.js", + "dist/es/core/platform/web/jquery/*.js", "dist/es/polyfill/**/*.js", "dist/es/case/ztree/jquery.ztree.core-3.5.js", "dist/es/case/ztree/jquery.ztree.excheck-3.5.js" diff --git a/packages/fineui/src/core/index.js b/packages/fineui/src/core/index.js index b754913f6..6dbdf43c9 100644 --- a/packages/fineui/src/core/index.js +++ b/packages/fineui/src/core/index.js @@ -1,5 +1,5 @@ export * from './system'; -export { Plugin } from './6.plugin'; + export { StyleLoaderManager } from './loader/loader.style'; export { ShowListener } from './listener/listener.show'; export { useInWorker } from './worker'; @@ -15,16 +15,14 @@ export { PopoverController } from './controller/controller.popover'; export { ResizeController } from './controller/controller.resizer'; export { TooltipsController } from './controller/controller.tooltips'; -export * from './4.widget'; +export * as _ from './1.lodash'; export * from './2.base'; export * from './3.ob'; - +export * from './4.widget'; export * from './5.inject'; export * from './6.plugin'; export * from './action'; -// export * from "./behavior"; -// export * from "./controller"; export * from './func'; export * from './structure'; export * from './h'; @@ -36,6 +34,5 @@ export * from './utils'; export { shortcut, provider, store, model, mixin, mixins } from './decorator'; -import _ from './1.lodash'; -export { _ }; + diff --git a/packages/fineui/src/index.js b/packages/fineui/src/index.js index 8458c1264..e0600bc9e 100644 --- a/packages/fineui/src/index.js +++ b/packages/fineui/src/index.js @@ -1,12 +1,9 @@ // sideEffects import "./core/system"; -import "./core/element"; -import "./core/platform"; import "./core/platform/web/jquery" -// 必须要等上面的准备好, 才初始化 config import "./core/platform/web/config"; -import _jquery from "jquery"; +import jquery from "jquery"; export * from "./core"; export * from "./base"; @@ -16,5 +13,5 @@ export * from "./component"; export * from "./fix"; export * from "./router"; export * as Popper from "@popperjs/core"; -export const jQuery = _jquery; -export const $ = _jquery; +export const jQuery = jquery; +export const $ = jquery;