0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-08 16:00:27 -05:00
penpot-plugins/docs/publish-package.md

74 lines
2.2 KiB
Markdown
Raw Normal View History

2024-03-27 07:57:02 -05:00
# Publishing Packages
## Introduction
2024-07-04 02:29:27 -05:00
This guide details the process of publishing `plugin-types` and `plugins-styles` packages, which are essential for plugin development. Below is a walkthrough for publishing these packages and managing releases.
2024-03-27 07:57:02 -05:00
## Publishing Libraries
2024-07-04 02:29:27 -05:00
Publishing packages enables the distribution of types and styles libraries. Currently, all packages share the same version, meaning some releases might not contain updates but will still increment the version. Follow the steps below for the automated publishing processes.
2024-03-27 07:57:02 -05:00
2024-07-04 02:29:27 -05:00
### Previewing a Release
2024-03-27 07:57:02 -05:00
2024-07-04 02:29:27 -05:00
To generate a preview of the release to check if everything is as expected, run the following command:
2024-03-27 07:57:02 -05:00
```shell
2024-07-04 02:29:27 -05:00
npm run release
2024-03-27 07:57:02 -05:00
```
2024-07-04 02:29:27 -05:00
### Generating a Real Release
2024-03-27 07:57:02 -05:00
2024-07-04 02:29:27 -05:00
To create an actual release, disable the dry-run option:
2024-03-27 07:57:02 -05:00
```shell
2024-07-04 02:29:27 -05:00
npm run release -- --dry-run false
2024-03-27 07:57:02 -05:00
```
2024-07-04 02:29:27 -05:00
This command will:
2024-03-27 07:57:02 -05:00
2024-07-04 02:29:27 -05:00
- Update the `CHANGELOG.md`
- Update libraries `package.json` file version
- Generate a commit
- Create a new git tag
- Publish to NPM with the `latest` tag
2024-06-10 07:38:39 -05:00
2024-07-10 07:49:02 -05:00
Ensure everything is correct before proceeding with the git push. Once verified, execute the following commands:
```shell
git push
git push origin v0.0.0
```
Replace v0.0.0 with the new version number.
2024-07-04 02:29:27 -05:00
For detailed information, refer to the [Nx Release Documentation](https://nx.dev/recipes/nx-release/get-started-with-nx-release).
2024-06-10 07:38:39 -05:00
2024-07-04 02:29:27 -05:00
### Creating a Preview Version
2024-03-27 07:57:02 -05:00
2024-07-04 02:29:27 -05:00
To generate a preview version and avoid publishing it as the latest release, use:
2024-03-27 07:57:02 -05:00
```shell
2024-07-04 02:29:27 -05:00
npm run release -- --dry-run false --latest false --preid next
2024-03-27 07:57:02 -05:00
```
2024-07-04 02:29:27 -05:00
For example, if the current version is `0.8.0` and you select the `prepatch` option as a version specifier, it will generate the version `0.8.1-next.0` and publish it with the next tag on npm.
2024-03-27 07:57:02 -05:00
2024-07-04 02:29:27 -05:00
### Help
2024-03-27 07:57:02 -05:00
2024-07-04 02:29:27 -05:00
To see more options, run:
2024-03-27 07:57:02 -05:00
```shell
2024-07-04 02:29:27 -05:00
npm run release -- --help
2024-03-27 07:57:02 -05:00
```
## Important Reminders
Ensure to update the [penpot-plugin-starter-template](https://github.com/penpot/penpot-plugin-starter-template) with every release to provide developers with the latest configuration and features.
## Relevant Files and Scripts
- **CSS Build Script**: `./tools/scripts/build-css.mjs`
- **Types Build Script**: `./tools/scripts/build-types.mjs`
2024-07-04 02:29:27 -05:00
- **Release Script**: `./tools/scripts/publish.ts`
- **Publish config**: `./nx.json`