Update README.md

This commit is contained in:
Joseph Garrone 2022-10-25 21:39:37 +02:00 committed by GitHub
parent 8390339b52
commit f16faec335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,11 +12,18 @@ https://user-images.githubusercontent.com/6702424/197344513-065246b9-8823-4894-a
`ts-ci` is a project starter like [TSDX](https://github.com/formium/tsdx) or [typescript-starter](https://github.com/bitjson/typescript-starter) but (arguably) better because:
- It's not a CLI tool, the automation happens with Github Actions.
Update your `package.json` version number, push. Voila, your new version is published on NPM.
- It enables you to publish prerelease simply by updating your package version to something like '1.2.3-rc.3'.
- The workflow runs on the main branch and on branches that have a PR open on main.
- It doesn't bundle your library into a single file so users can cherry-pick what they want to import from your lib, your modules will be tree shakable.
- It enables you to publish prerelease simply by updating your package version to something like `1.2.3-rc.3`.
- When someone opens submit a PR the tests are run agaist their fork.
- It doesn't bundle your library into a single file so users can cherry-pick what they want to import from your lib, your modules will be tree shakable.
E.g: `import { aSpecificFunction } from "your-module/aSpecificFile"`
# Examples of project using this template
- [Keycloakify](https://github.com/garronej/keycloakify)
- [Denoify](https://github.com/garronej/denoify)
- [tss-react](https://github.com/garronej/tss-react)
- [EVT](https://github.com/garronej/evt)
# How to use
@ -44,12 +51,18 @@ Besides, good stuff that comes with using this template:
``import {...} from "my_module/dist/theFile"``
- ESlint and Prettier are automatically run against files staged for commit. (Optional, you can [disable](#disable-linting-and-formatting) this feature)
# Examples of project using this template
- [keycloakify](https://github.com/garronej/keycloakify)
- [denoify](https://github.com/garronej/denoify)
- [tss-react](https://github.com/garronej/tss-react)
- [EVT](https://github.com/garronej/evt)
# Relase in CJS, ESM or both
By default your module relase [in CJS](https://github.com/garronej/ts-ci/blob/8390339b52c98cdbd458d4b945286f999358a1ff/tsconfig.json#L3) with [ESM module interop](https://github.com/garronej/ts-ci/blob/8390339b52c98cdbd458d4b945286f999358a1ff/tsconfig.json#L6).
If you want to **only** release as ESM just set `"module": "ES2020"` in your `tsconfig.json` (and remove `esModuleInterop`).
If you want to release for both CJS and ESM, it's a bit less straign forward. You have to:
- Have a `tsconfig.json` that targets CSM (as by default): [example](https://github.com/garronej/tss-react/blob/main/tsconfig.json)
- Perfome two build, one for CJS, one for ESM. [example](https://github.com/garronej/tss-react/blob/3cab4732edaff7ba41e3f01b7524b8db47cf7f25/package.json#L43)
- Explicitely `module` and `exports` in `package.json`, [example](https://github.com/garronej/tss-react/blob/3cab4732edaff7ba41e3f01b7524b8db47cf7f25/package.json#L11-L41).
# FAQ
@ -63,6 +76,7 @@ Yes, just remove the `yarn.lock` file and edit `.github/workflows/ci.yaml`, repl
All filles listed in [the files property of your package JSON](https://github.com/garronej/ts_ci/blob/974054f2b83f8170317f2b2fa60b5f78e9336c0b/package.json#L35-L41).
## How to debug the action
You can increase the verbosity by creating a new secret `ACTIONS_STEP_DEBUG` and setting it to true.