From a304dc632bd2b6f213b4bc79d093a760c69b34d7 Mon Sep 17 00:00:00 2001 From: linbudu Date: Thu, 17 Nov 2022 20:57:48 +0800 Subject: [PATCH] feat: release --- README.md | 15 +++++++++------ packages/esbuild-plugin-alias-path/package.json | 2 +- .../tests/plugin.spec.ts | 11 ++++++++++- packages/esbuild-plugin-clean/package.json | 2 +- packages/esbuild-plugin-compress/package.json | 2 +- packages/esbuild-plugin-copy/package.json | 4 ++-- .../esbuild-plugin-node-externals/package.json | 2 +- scripts/release/handlers.ts | 2 +- scripts/release/index.ts | 2 +- 9 files changed, 27 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fe6978f..bcaccaa 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,14 @@ ESBuild Plugins by @LinbuduLab -| Package | Version | Downloads | -| -------------------------------------------------------- | :----------------------------------------------------------- | ------------------------------------------------------------ | -| [alias-path](packages/esbuild-plugin-alias-path) | ![alias-path version](https://img.shields.io/npm/v/esbuild-plugin-alias-path.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-alias-path) | -| [clean](packages/esbuild-plugin-clean) | ![clean version](https://img.shields.io/npm/v/esbuild-plugin-clean.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-clean) | -| [compress](packages/esbuild-plugin-compress) | ![compress version](https://img.shields.io/npm/v/esbuild-plugin-compress.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-compress) | -| [copy](packages/esbuild-plugin-copy) | ![copy version](https://img.shields.io/npm/v/esbuild-plugin-copy.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-copy) | +| Package | Version | Downloads | +| -------------------------------------------------------- | :-------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| [alias-path](packages/esbuild-plugin-alias-path) | ![alias-path version](https://img.shields.io/npm/v/esbuild-plugin-alias-path.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-alias-path) | +| [clean](packages/esbuild-plugin-clean) | ![clean version](https://img.shields.io/npm/v/esbuild-plugin-clean.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-clean) | +| [compress](packages/esbuild-plugin-compress) | ![compress version](https://img.shields.io/npm/v/esbuild-plugin-compress.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-compress) | +| [copy](packages/esbuild-plugin-copy) | ![copy version](https://img.shields.io/npm/v/esbuild-plugin-copy.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-copy) | | [node-externals](packages/esbuild-plugin-node-externals) | ![node-externals version](https://img.shields.io/npm/v/esbuild-plugin-node-externals.svg?label=%20) | ![npm](https://img.shields.io/npm/dw/esbuild-plugin-node-externals) | +## License + +[MIT](LICENSE) diff --git a/packages/esbuild-plugin-alias-path/package.json b/packages/esbuild-plugin-alias-path/package.json index d916db3..cec3e6c 100644 --- a/packages/esbuild-plugin-alias-path/package.json +++ b/packages/esbuild-plugin-alias-path/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-plugin-alias-path", - "version": "1.1.1", + "version": "2.0.0", "description": "ESBuild plugin for alias path.", "keywords": [ "ESBuild", diff --git a/packages/esbuild-plugin-alias-path/tests/plugin.spec.ts b/packages/esbuild-plugin-alias-path/tests/plugin.spec.ts index 2d569d0..d45ab50 100644 --- a/packages/esbuild-plugin-alias-path/tests/plugin.spec.ts +++ b/packages/esbuild-plugin-alias-path/tests/plugin.spec.ts @@ -109,7 +109,16 @@ describe('aliasPath', () => { it('should throw when no alias path is provided', async () => { const buildFile = tmp.fileSync(); - await expect(builder(buildFile.name, {})).rejects.toThrow(); + try { + await builder(buildFile.name, {}); + } catch (error) { + expect(JSON.stringify(error.stack)).toContain( + 'Could not resolve \\"@alias/foo\\"' + ); + expect(JSON.stringify(error.stack)).toContain( + 'Could not resolve \\"@alias/bar\\"' + ); + } }); it('should apply alias transform', async () => { diff --git a/packages/esbuild-plugin-clean/package.json b/packages/esbuild-plugin-clean/package.json index e889a18..e3e8732 100644 --- a/packages/esbuild-plugin-clean/package.json +++ b/packages/esbuild-plugin-clean/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-plugin-clean", - "version": "0.9.0", + "version": "1.0.0", "description": "ESBuild plugin for cleaning up assets before building.", "keywords": [ "esbuild", diff --git a/packages/esbuild-plugin-compress/package.json b/packages/esbuild-plugin-compress/package.json index 5135109..87506cc 100644 --- a/packages/esbuild-plugin-compress/package.json +++ b/packages/esbuild-plugin-compress/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-plugin-compress", - "version": "0.3.0", + "version": "1.0.0", "description": "ESBuild plugin for output compression", "keywords": [ "esbuild", diff --git a/packages/esbuild-plugin-copy/package.json b/packages/esbuild-plugin-copy/package.json index 873993f..0fd97ae 100644 --- a/packages/esbuild-plugin-copy/package.json +++ b/packages/esbuild-plugin-copy/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-plugin-copy", - "version": "1.2.0", + "version": "2.0.0", "description": "ESBuild plugin for assets copy.", "keywords": [ "esbuild", @@ -46,4 +46,4 @@ "sourcemap": false, "clean": true } -} +} \ No newline at end of file diff --git a/packages/esbuild-plugin-node-externals/package.json b/packages/esbuild-plugin-node-externals/package.json index feaf489..7097877 100644 --- a/packages/esbuild-plugin-node-externals/package.json +++ b/packages/esbuild-plugin-node-externals/package.json @@ -1,6 +1,6 @@ { "name": "esbuild-plugin-node-externals", - "version": "0.3.0", + "version": "1.0.0", "description": "ESBuild plugin for node externals.", "keywords": [ "ESBuild", diff --git a/scripts/release/handlers.ts b/scripts/release/handlers.ts index 3924eb6..ca4c2cb 100644 --- a/scripts/release/handlers.ts +++ b/scripts/release/handlers.ts @@ -46,7 +46,7 @@ export class ReleaseHandlers { const [plainVersion, betaCount] = currentVersion.split('-beta.'); return isBeta - ? `${plainVersion}-beta.${betaCount + 1}` + ? `${plainVersion}-beta.${Number(betaCount) + 1}` : `${currentVersion}-beta.0`; } diff --git a/scripts/release/index.ts b/scripts/release/index.ts index 358dbe7..b5af3be 100644 --- a/scripts/release/index.ts +++ b/scripts/release/index.ts @@ -71,7 +71,7 @@ export default function useReleaseProject(cli: CAC) { const { version: inputVersion, skipGit, - dry: dryRun, + dry: dryRun = false, publishTag: _publishTag, beta = false, } = options;