From 5c740dc7891f6b459c4a8f0d5170306871983354 Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 11 May 2023 18:59:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A0jira:=20=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/lib/prepublish.js | 23 ++++++ packages/fineui/package.json | 112 +++++++++++++++--------------- publish.bat | 2 + publish.sh | 2 + 4 files changed, 83 insertions(+), 56 deletions(-) create mode 100644 packages/fineui/lib/prepublish.js create mode 100644 publish.bat create mode 100644 publish.sh diff --git a/packages/fineui/lib/prepublish.js b/packages/fineui/lib/prepublish.js new file mode 100644 index 000000000..d88a1958e --- /dev/null +++ b/packages/fineui/lib/prepublish.js @@ -0,0 +1,23 @@ +const { resolve } = require("path"); +const { writeFileSync } = require("fs"); + +function pad2(n) { + // always returns a string + return (n < 10 ? "0" : "") + n; +} +const d = new Date(); +const version = + d.getFullYear() + + pad2(d.getMonth() + 1) + + pad2(d.getDate()) + + pad2(d.getHours()) + + pad2(d.getMinutes()) + + pad2(d.getSeconds()); + +const packageJSON = require("../package.json"); +const versionChars = packageJSON.version.split("."); +versionChars[versionChars.length - 1] = version; +packageJSON.version = versionChars.join("."); +packageJSON.publishConfig.registry = "https://npm.fineres.com/"; +packageJSON.name = "@fui/core"; +writeFileSync(resolve(__dirname, "../package.json"), JSON.stringify(packageJSON, null, 2)); diff --git a/packages/fineui/package.json b/packages/fineui/package.json index 325ce2849..a10485cfc 100644 --- a/packages/fineui/package.json +++ b/packages/fineui/package.json @@ -1,57 +1,57 @@ { - "name": "@fui/core", - "version": "3.0.20230426142647", - "description": "fineui", - "main": "dist/fineui.min.js", - "module": "dist/es/index.js", - "types": "dist/lib/index.d.ts", - "sideEffects": [ - "**/*.less", - "src/**/*.js", - "dist/es/index.js", - "dist/es/core/element/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" - ], - "scripts": { - "dev": "tsc && run-p dev:*", - "dev:es": "babel src -d dist/es --config-file ./esm.babel.js -w", - "dev:fineui": "webpack-dev-server --progress --config=webpack/webpack.dev.js", - "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", - "link": "pnpm link --global", - "tsc": "tsc" - }, - "files": [ - "dist", - "src/less" - ], - "repository": { - "type": "git", - "url": "https://git.coding.net/fanruan/fineui.git" - }, - "keywords": [ - "ui", - "fineui", - "finebi" - ], - "publishConfig": { - "registry": "https://npm.fineres.com/", - "access": "public" - }, - "author": "fanruan", - "license": "MIT", - "dependencies": { - "@juggle/resize-observer": "^3.4.0", - "@popperjs/core": "2.11.6", - "jquery": "3.6.3" - }, - "devDependencies": { - "cross-env": "^7.0.3" - } -} + "name": "@fui/core", + "version": "3.0.20230511185107", + "description": "fineui", + "main": "dist/fineui.min.js", + "module": "dist/lib/index.js", + "types": "dist/lib/index.d.ts", + "sideEffects": [ + "**/*.less", + "src/**/*.js", + "dist/lib/index.js", + "dist/lib/core/element/index.js", + "dist/lib/core/system.js", + "dist/lib/core/platform/web/config.js", + "dist/lib/core/platform/web/jquery/*.js", + "dist/lib/polyfill/**/*.js", + "dist/lib/case/ztree/jquery.ztree.core-3.5.js", + "dist/lib/case/ztree/jquery.ztree.excheck-3.5.js" + ], + "scripts": { + "dev": "tsc && run-p dev:*", + "dev:es": "babel src -d dist/lib --config-file ./esm.babel.js -w --source-maps", + "dev:fineui": "webpack-dev-server --progress --config=webpack/webpack.dev.js", + "build": "tsc && run-p build:*", + "build:es": "babel src -d dist/lib --config-file ./esm.babel.js", + "build:fineui": "webpack --progress --config=webpack/webpack.prod.js", + "prepublishToPrivate": "npm run build && node ./lib/prepublish.js", + "publishToPrivate": "npm publish" + }, + "files": [ + "dist", + "src/less" + ], + "repository": { + "type": "git", + "url": "https://git.coding.net/fanruan/fineui.git" + }, + "keywords": [ + "ui", + "fineui", + "finebi" + ], + "publishConfig": { + "registry": "https://npm.fineres.com/", + "access": "public" + }, + "author": "fanruan", + "license": "MIT", + "dependencies": { + "@juggle/resize-observer": "^3.4.0", + "@popperjs/core": "2.11.6", + "jquery": "3.6.3" + }, + "devDependencies": { + "cross-env": "^7.0.3" + } +} \ No newline at end of file diff --git a/publish.bat b/publish.bat new file mode 100644 index 000000000..4fab82770 --- /dev/null +++ b/publish.bat @@ -0,0 +1,2 @@ +cd packages/fineui +npm run publishToPrivate \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100644 index 000000000..6a9deae69 --- /dev/null +++ b/publish.sh @@ -0,0 +1,2 @@ +cd packages/fineui +npm run publishToPrivate \ No newline at end of file From f315a39ad7c9f3d9def13712e5f77dde311c6bfb Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 11 May 2023 19:14:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0jira=20fix:=E6=8C=89=E9=9C=80?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E4=B9=9F=E5=AF=BC=E5=87=BADecorators?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/bundle.js | 3 +-- packages/fineui/src/index.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/fineui/src/bundle.js b/packages/fineui/src/bundle.js index e3215520a..92ba6cfcf 100644 --- a/packages/fineui/src/bundle.js +++ b/packages/fineui/src/bundle.js @@ -1,10 +1,9 @@ import * as fuiExport from "./index"; import * as injectFn from "@/core/5.inject"; import { _global } from "@/core/0.foundation"; -import * as Decorators from "@/core/decorator"; _global.BI = _global.BI || {}; -_global.BI.Decorators = { ...Decorators, Model: fuiExport.Fix.Model }; + Object.assign(_global, { Fix: fuiExport.Fix, diff --git a/packages/fineui/src/index.js b/packages/fineui/src/index.js index 76dbf84ff..e84b98d9e 100644 --- a/packages/fineui/src/index.js +++ b/packages/fineui/src/index.js @@ -13,3 +13,7 @@ export * from "./router"; export * as Popper from "@popperjs/core"; export const jQuery = jquery; export const $ = jquery; + +import * as D from "@/core/decorator"; +import { Fix } from "./fix"; +export const Decorators = { ...D, Model: Fix.Model }; From f375e88fd6eb3002d1abc7413922a21e7da954fc Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 11 May 2023 19:14:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0jira=20fix:=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=94=A8=E5=88=B0=E7=9A=84=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/demo/src/demo/slides.js | 0 packages/fineui/src/bundle.js | 3 +-- packages/fineui/src/index.js | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 packages/demo/src/demo/slides.js diff --git a/packages/demo/src/demo/slides.js b/packages/demo/src/demo/slides.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/fineui/src/bundle.js b/packages/fineui/src/bundle.js index e3215520a..92ba6cfcf 100644 --- a/packages/fineui/src/bundle.js +++ b/packages/fineui/src/bundle.js @@ -1,10 +1,9 @@ import * as fuiExport from "./index"; import * as injectFn from "@/core/5.inject"; import { _global } from "@/core/0.foundation"; -import * as Decorators from "@/core/decorator"; _global.BI = _global.BI || {}; -_global.BI.Decorators = { ...Decorators, Model: fuiExport.Fix.Model }; + Object.assign(_global, { Fix: fuiExport.Fix, diff --git a/packages/fineui/src/index.js b/packages/fineui/src/index.js index 76dbf84ff..e84b98d9e 100644 --- a/packages/fineui/src/index.js +++ b/packages/fineui/src/index.js @@ -13,3 +13,7 @@ export * from "./router"; export * as Popper from "@popperjs/core"; export const jQuery = jquery; export const $ = jquery; + +import * as D from "@/core/decorator"; +import { Fix } from "./fix"; +export const Decorators = { ...D, Model: Fix.Model };