From de24970be8d26eb2515179e96cbc8cddb7a879f6 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Mon, 22 May 2023 17:04:29 +0200 Subject: [PATCH 1/6] Update README.md --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8e922d3..6952602 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,6 @@ publishing `.js` files and types declaration `.d.ts` files, which are the output And that's all there is to it! -> 🗣️ Since a recent GitHub update you need to manually allow GitHub Action to push on your repo. -> Fo this reason the initial setup will fail. -> You need to enabled permission and re-run failed job: [see video](https://user-images.githubusercontent.com/6702424/213480604-0aac0ea7-487f-491d-94ae-df245b2c7ee8.mov) - Key features: - Unlike traditional CLI tools, `ts-ci` utilizes automation within Github Actions. Simply update your `package.json` version number and push. Your new version is automatically published on NPM. @@ -36,8 +32,6 @@ Key features: https://user-images.githubusercontent.com/6702424/197344513-065246b9-8823-4894-a9a7-6c539da10655.mp4 - - # Examples of project using this template - [Keycloakify](https://github.com/garronej/keycloakify) @@ -46,7 +40,11 @@ https://user-images.githubusercontent.com/6702424/197344513-065246b9-8823-4894-a - [EVT](https://github.com/garronej/evt) - [i18nifty](https://github.com/etalab/i18nifty) -# How to use +# How to use + +> 🗣️ Since a recent GitHub update you need to manually allow GitHub Action to push on your repo. +> Fo this reason the initial setup will fail. +> You need to enabled permission and re-run failed job: [see video](https://user-images.githubusercontent.com/6702424/213480604-0aac0ea7-487f-491d-94ae-df245b2c7ee8.mov) - Click on ![image](https://user-images.githubusercontent.com/6702424/127756563-ec5f2d07-d758-43f1-8fac-387847c0d064.png) - The repo name you will choose will be used as a module name for NPM. From fa27fe245b6d71435c8e9b9261e3ed8310c8f368 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Mon, 22 May 2023 17:05:58 +0200 Subject: [PATCH 2/6] Remove rambling about rollup --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index 6952602..3a34c7c 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,8 @@ Have you written some functions or React component that you're proud of? Do you but find yourself unsure about the publishing process or how to manage the lifecycle of an open-source library? Look no further - ts-ci is here to jumpstart your journey towards becoming a proficient NPM module author. - -Contrary to what other guides or project starters may suggest, you don't necessarily need Vite/rollup to bundle your library, -nor do you need to fragment your modules into smaller, independently published units on NPM under the package/ directory for your module -to be tree-shakable (e.g., `@your-module/submodule1`, `@your-module/submodule2`). - -The reality is much simpler. The responsibility of bundling lies with the final application; your role involves merely -publishing `.js` files and types declaration `.d.ts` files, which are the output of `tsc`. - -And that's all there is to it! -Key features: +Main selling points: - Unlike traditional CLI tools, `ts-ci` utilizes automation within Github Actions. Simply update your `package.json` version number and push. Your new version is automatically published on NPM. - It offers the convenience of publishing prereleases. All you need to do is update your package version to a prerelease format like `1.2.3-rc.3`. From c04d0ba667f7627af17816e7185919ade4eb0b51 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sun, 28 May 2023 14:15:54 +0200 Subject: [PATCH 3/6] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a34c7c..a40764a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,16 @@ https://user-images.githubusercontent.com/6702424/197344513-065246b9-8823-4894-a - ⚙️ ESlint and Prettier are automatically triggered against files staged for commit. Despite what [t3dotgg](https://github.com/t3dotgg) says, it's the correct way of doing it, that being said, this feature is optional and can be [disabled](https://github.com/garronej/ts-ci/blob/8da207622e51a248542cf013707198cd7cad1d09/README.md?plain=1#L87-L91) if desired. -# Release in CJS, ESM or both +# Release in CJS, ESM or both + +Contrary to what other guides or project starters may suggest, you don't necessarily need Vite/rollup to bundle your library, +nor do you need to fragment your modules into smaller, independently published units on NPM under the package/ directory for your module +to be tree-shakable (e.g., `@your-module/submodule1`, `@your-module/submodule2`). + +The reality is much simpler. The responsibility of bundling lies with the final application; your role involves merely +publishing `.js` files and types declaration `.d.ts` files, which are the output of `tsc`. + +And that's all there is to it! ## CJS only (default) From d2d84c394873c089a4278b7b607621676c569810 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sun, 28 May 2023 14:30:23 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a40764a..dad5ab5 100644 --- a/README.md +++ b/README.md @@ -58,14 +58,14 @@ that being said, this feature is optional and can be [disabled](https://github.c # Release in CJS, ESM or both -Contrary to what other guides or project starters may suggest, you don't necessarily need Vite/rollup to bundle your library, +Contrary to what other guides or project starters may suggest, you don't need to bundle your library with something like Vite/Rollup, nor do you need to fragment your modules into smaller, independently published units on NPM under the package/ directory for your module to be tree-shakable (e.g., `@your-module/submodule1`, `@your-module/submodule2`). The reality is much simpler. The responsibility of bundling lies with the final application; your role involves merely publishing `.js` files and types declaration `.d.ts` files, which are the output of `tsc`. -And that's all there is to it! +Your role is to decide what flavor of JS you want to distribute, that's all there is to it! ## CJS only (default) From fe9de980aa845f0e98dad81a667b1cd7055eca9c Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sun, 28 May 2023 14:52:46 +0200 Subject: [PATCH 5/6] Update README.md --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dad5ab5..e0d6a2a 100644 --- a/README.md +++ b/README.md @@ -56,16 +56,22 @@ https://user-images.githubusercontent.com/6702424/197344513-065246b9-8823-4894-a - ⚙️ ESlint and Prettier are automatically triggered against files staged for commit. Despite what [t3dotgg](https://github.com/t3dotgg) says, it's the correct way of doing it, that being said, this feature is optional and can be [disabled](https://github.com/garronej/ts-ci/blob/8da207622e51a248542cf013707198cd7cad1d09/README.md?plain=1#L87-L91) if desired. -# Release in CJS, ESM or both +# Release in CJS, ESM or both (but don't bundle!) -Contrary to what other guides or project starters may suggest, you don't need to bundle your library with something like Vite/Rollup, -nor do you need to fragment your modules into smaller, independently published units on NPM under the package/ directory for your module -to be tree-shakable (e.g., `@your-module/submodule1`, `@your-module/submodule2`). +Contrary to what other guides or project starters may suggest, you don't need to bundle your library (or in other words you don't need to use Vite/Rollup), +nor do you need to fragment your modules into smaller, independently published units on NPM under the `packages/` directory for your module +to be tree-shakable (e.g., `@your-module/submodule1`, `@your-module/submodule2`). + +When you bundle your library, you incorporate __all your dependencies__ into the `.js` code you distribute. This could potentially lead to duplication of dependencies. + +For instance, if your library depends on the [classnames](https://www.npmjs.com/package/classnames) package, the entirety of `classnames` source code will be included in your bundle. Subsequently, if a user of your library is also directly using `classnames`, there will be two copies of `classnames` in their final application bundle. + +Another disadvantage of bundling is the lack of selective importing. For example, if a user wishes to import only a specific component or functionality from your module, they would be unable to do so. Instead, they are required to import the entire library. The reality is much simpler. The responsibility of bundling lies with the final application; your role involves merely -publishing `.js` files and types declaration `.d.ts` files, which are the output of `tsc`. +publishing types declaration (`.d.ts`) and the correct flavor of JavaScript files, which are the output of `tsc`. -Your role is to decide what flavor of JS you want to distribute, that's all there is to it! +That's all there is to it! ## CJS only (default) From 5d0619f5be698ceb2b0767bbac3504cb8fc27c1f Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Mon, 29 May 2023 16:44:06 +0200 Subject: [PATCH 6/6] Update ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e00590..54049e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,7 +99,7 @@ jobs: registry-url: https://registry.npmjs.org/ - uses: bahmutov/npm-install@v1 - run: yarn build - - run: npx -y -p denoify@1.3.0 enable_short_npm_import_path + - run: npx -y -p denoify@1.5.7 enable_short_npm_import_path env: DRY_RUN: "0" - uses: garronej/ts-ci@v2.1.0