diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e2a7cd7..dd96ab9e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -263,6 +263,9 @@ importers: tools/changelog-parser: devDependencies: + '@terwer/esbuild-config-custom': + specifier: workspace:* + version: link:../esbuild-config-custom ts-node: specifier: ^10.9.1 version: registry.npmjs.org/ts-node@10.9.1(@types/node@18.15.11)(typescript@5.0.4) diff --git a/tools/changelog-parser/CHANGELOG.md b/tools/changelog-parser/CHANGELOG.md deleted file mode 100644 index bc8b6135..00000000 --- a/tools/changelog-parser/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -## [1.1.0](https://github.com/terwer/publish-bridge/compare/v1.0.0...v1.1.0) (2023-05-09) - -### Features -* add publisherHook ([242fe9b](https://github.com/terwer/publish-bridge/commit/242fe9b18f4820f70804dba7cb6c8ae0d95bf0c5)) -* add release please ([e9fdcfc](https://github.com/terwer/publish-bridge/commit/e9fdcfcedfaf9012e3d6e0a8a64c4762470afc75)) -* add semantic release ([42baabd](https://github.com/terwer/publish-bridge/commit/42baabdc66add92a79cee457eb52c5ba6bb31722)) -* auto release and package ([ccbfd75](https://github.com/terwer/publish-bridge/commit/ccbfd75f37b567cbcc02dcde295080bc1a80caa9)) -* init post bridge ([b2d9fa0](https://github.com/terwer/publish-bridge/commit/b2d9fa0d831ef39d399f745253e63bdc6ade4ac1)) -* init publisher bridge ([77802aa](https://github.com/terwer/publish-bridge/commit/77802aa017eb1facc76d6d093f8042e567baabf2)) -### Miscellaneous -* **main:** release 1.0.0 ([8c87bb4](https://github.com/terwer/publish-bridge/commit/8c87bb4bfc743d6584bf232a0779c580440e0121)) -* **release:** 1.0.0 [skip ci] ([8d8cb4d](https://github.com/terwer/publish-bridge/commit/8d8cb4d677019266b7f3c7b23187dd6b3eebc270)) \ No newline at end of file diff --git a/tools/changelog-parser/CHANGELOG_backup.md b/tools/changelog-parser/CHANGELOG_backup.md deleted file mode 100644 index 594dcd30..00000000 --- a/tools/changelog-parser/CHANGELOG_backup.md +++ /dev/null @@ -1,27 +0,0 @@ -## [1.1.0](https://github.com/terwer/publish-bridge/compare/v1.0.0...v1.1.0) (2023-05-09) - - -### Features - -* add publisherHook ([0b3da59](https://github.com/terwer/publish-bridge/commit/0b3da59c620b8670f99dce9075614f5be1c0df2d)) -* add publisherHook ([4bec664](https://github.com/terwer/publish-bridge/commit/4bec6643b5fbd859985f7e186b94b464d4f600cc)) -* add publisherHook ([9dc9ba1](https://github.com/terwer/publish-bridge/commit/9dc9ba18e9355f4bcbc0f836400f8708b31d88f9)) -* add publisherHook ([9b710b9](https://github.com/terwer/publish-bridge/commit/9b710b94d5626f913a2f98c83e41c55970322407)) -* add publisherHook ([fe229a4](https://github.com/terwer/publish-bridge/commit/fe229a4a9436287c5b68bda26ba73f81d5920636)) -* add publisherHook ([ad843ad](https://github.com/terwer/publish-bridge/commit/ad843ad9b3d8c88acaa6d7bcd62846ae735db955)) -* add publisherHook ([8a307a5](https://github.com/terwer/publish-bridge/commit/8a307a561102b98c920f5fdc6c1d1445ace2b86a)) -* add publisherHook ([242fe9b](https://github.com/terwer/publish-bridge/commit/242fe9b18f4820f70804dba7cb6c8ae0d95bf0c5)) -* add release please ([e9fdcfc](https://github.com/terwer/publish-bridge/commit/e9fdcfcedfaf9012e3d6e0a8a64c4762470afc75)) -* add semantic release ([2367329](https://github.com/terwer/publish-bridge/commit/23673290855132951574046cb453d4e26b8950b2)) -* add semantic release ([332c10e](https://github.com/terwer/publish-bridge/commit/332c10ef02487db84b8bdfb2b4d8c42aa9e98110)) -* add semantic release ([d84f585](https://github.com/terwer/publish-bridge/commit/d84f585b417b075efbc75b466203adfb10e95810)) -* add semantic release ([42baabd](https://github.com/terwer/publish-bridge/commit/42baabdc66add92a79cee457eb52c5ba6bb31722)) -* auto release and package ([ccbfd75](https://github.com/terwer/publish-bridge/commit/ccbfd75f37b567cbcc02dcde295080bc1a80caa9)) -* init post bridge ([b2d9fa0](https://github.com/terwer/publish-bridge/commit/b2d9fa0d831ef39d399f745253e63bdc6ade4ac1)) -* init publisher bridge ([77802aa](https://github.com/terwer/publish-bridge/commit/77802aa017eb1facc76d6d093f8042e567baabf2)) - - -### Miscellaneous - -* **main:** release 1.0.0 ([8c87bb4](https://github.com/terwer/publish-bridge/commit/8c87bb4bfc743d6584bf232a0779c580440e0121)) -* **release:** 1.0.0 [skip ci] ([8d8cb4d](https://github.com/terwer/publish-bridge/commit/8d8cb4d677019266b7f3c7b23187dd6b3eebc270)) \ No newline at end of file diff --git a/tools/changelog-parser/esbuild.config.cjs b/tools/changelog-parser/esbuild.config.cjs new file mode 100644 index 00000000..6ea8aa19 --- /dev/null +++ b/tools/changelog-parser/esbuild.config.cjs @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023, Terwer . All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Terwer designates this + * particular file as subject to the "Classpath" exception as provided + * by Terwer in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com + * or visit www.terwer.space if you need additional information or have any + * questions. + */ + +const { dtsPlugin } = require("esbuild-plugin-d.ts") + +/** + * 构建配置 + */ +module.exports = { + esbuildConfig: { + entryPoints: ["src/index.ts"], + outfile: "dist/index.js", + bundle: true, + format: "esm", + platform: "node", + plugins: [dtsPlugin()], + }, +} diff --git a/tools/changelog-parser/package.json b/tools/changelog-parser/package.json index 4a7be073..0939a8da 100644 --- a/tools/changelog-parser/package.json +++ b/tools/changelog-parser/package.json @@ -1,8 +1,9 @@ { "name": "@terwer/changelog-parser", - "version": "1.0.0", + "version": "1.1.0", "type": "module", - "main": "index.ts", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", "description": "a changelog parser", "keywords": [ "changelog", @@ -11,9 +12,11 @@ "author": "terwer", "license": "GPL", "scripts": { - "dev": "ts-node-esm --experimental-specifier-resolution=node changelogParser.ts" + "dev": "zhi-build --watch", + "build": "zhi-build --production" }, "devDependencies": { + "@terwer/esbuild-config-custom": "workspace:*", "ts-node": "^10.9.1" }, "publishConfig": { diff --git a/tools/changelog-parser/changelogParser.ts b/tools/changelog-parser/src/changelogParser.ts similarity index 97% rename from tools/changelog-parser/changelogParser.ts rename to tools/changelog-parser/src/changelogParser.ts index c567e36f..61970f22 100644 --- a/tools/changelog-parser/changelogParser.ts +++ b/tools/changelog-parser/src/changelogParser.ts @@ -61,7 +61,7 @@ class ChangelogParser { // save new file fs.writeFileSync(originalFile, uniqueCommits.join("\n"), "utf-8") - console.log(`comment parsed.saved to => ${originalFile}`) + console.log(`comment changelog parsed.saved to => ${originalFile}`) } private removeSameCommit(commitList: string[]): string[] { diff --git a/tools/changelog-parser/index.ts b/tools/changelog-parser/src/index.ts similarity index 100% rename from tools/changelog-parser/index.ts rename to tools/changelog-parser/src/index.ts diff --git a/tools/changelog-parser/tsconfig.json b/tools/changelog-parser/tsconfig.json index 70bfbb3b..d7365ca4 100644 --- a/tools/changelog-parser/tsconfig.json +++ b/tools/changelog-parser/tsconfig.json @@ -6,8 +6,8 @@ "isolatedModules": false, "esModuleInterop": true, "resolveJsonModule": true, - "outDir": "./lib" + "outDir": "./dist" }, - "include": ["env.d.ts", "*.ts"], + "include": ["env.d.ts", "src/*.ts"], "exclude": ["node_modules"] }