Shared libraries for the PROMPT project
This repository contains two npm packages:
@tumaet/prompt-shared-state
- Shared state management and interfaces@tumaet/prompt-ui-components
- Reusable UI components
This project uses Yarn 4.1.0 as specified in the packageManager
field of each package.json. To work with this repository, you need to enable Corepack, which will automatically use the correct Yarn version.
corepack enable
Corepack is included by default with Node.js 16.9+ and 14.19+. If you encounter this error:
error This project's package.json defines "packageManager": "yarn@4.1.0". However the current global version of Yarn is 1.22.22.
Run corepack enable
to fix it. This tells your system to use the project-specific Yarn version instead of the global one.
Both packages are automatically published to npm when you create a GitHub release. Follow these steps:
Before creating a release, ensure both package.json
files have the same version number that matches your intended release tag.
You can update the version using yarn commands:
# Update both packages with semantic versioning
cd prompt-shared-state
yarn version patch # 1.2.3 -> 1.2.4
# or yarn version minor # 1.2.3 -> 1.3.0
# or yarn version major # 1.2.3 -> 2.0.0
cd ../prompt-ui-components
yarn version patch # Use the same increment type
# or yarn version minor
# or yarn version major
Or manually edit the package.json files:
# Update prompt-shared-state/package.json
{
"name": "@tumaet/prompt-shared-state",
"version": "1.2.3", // ← This version
...
}
# Update prompt-ui-components/package.json
{
"name": "@tumaet/prompt-ui-components",
"version": "1.2.3", // ← Must match exactly
...
}
- Go to the Releases page
- Click "Create a new release"
- Create a new tag with the format
v{version}
(e.g.,v1.2.3
) - Set the release title (e.g., "Release v1.2.3")
- Add release notes describing the changes
- Click "Publish release"
Once you publish the release:
- The GitHub Action workflow will automatically trigger
- It validates that each package.json version matches the release tag (in parallel)
- Both packages are built and published to npm simultaneously in parallel
- If there's a version mismatch, the workflow will fail with a clear error message for the specific package
- The release tag version doesn't match
prompt-shared-state/package.json
version - The release tag version doesn't match
prompt-ui-components/package.json
version - Either package fails to build
If versions don't match, you'll see:
❌ ERROR: Version mismatch in prompt-shared-state!
Release tag version: 1.2.3
Package.json version: 1.2.2
Please update the version in prompt-shared-state/package.json to match the release tag.
Expected: "version": "1.2.3"
This repository uses GitHub Actions for automated building and publishing:
- Trigger: On pull requests to main branch
- Purpose: Validates that both packages build successfully
- Trigger: On GitHub releases
- Purpose: Validates versions and publishes both packages to npm
- Strategy: Two-stage process with matrix builds
- Validate stage: Checks version consistency in parallel
- Publish stage: Builds and publishes both packages in parallel
# Build prompt-shared-state
cd prompt-shared-state
yarn install
yarn build
# Build prompt-ui-components
cd prompt-ui-components
yarn install
yarn build
Before creating a release, always test that both packages build successfully:
# Test both packages
cd prompt-shared-state && yarn build && cd ../prompt-ui-components && yarn build
Package | Latest Version | Description |
---|---|---|
@tumaet/prompt-shared-state | Shared state management and TypeScript interfaces | |
@tumaet/prompt-ui-components | Reusable React UI components |