From 5c740dc7891f6b459c4a8f0d5170306871983354 Mon Sep 17 00:00:00 2001 From: Treecat Date: Thu, 11 May 2023 18:59:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira:=20=E6=89=93=E5=8C=85=E8=B0=83?= =?UTF-8?q?=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