Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion renderers/lit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@a2ui/lit",
"version": "0.8.1",
"version": "0.8.2",
"description": "A2UI Lit Library",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions renderers/web_core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
.wireit/
.npmrc
75 changes: 75 additions & 0 deletions renderers/web_core/PUBLISHING.md
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait to deprecate this flow :P

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Publishing Guide

This guide details the process for manually publishing `@a2ui/web_core` to npm. It is intended for project maintainers and is deliberately kept separate from the main `README.md` to ensure these internal instructions are not published as part of the package.

## 1. Prerequisites

Before publishing, ensure you have an **NPM Access Token** with publishing rights for the `@a2ui` organization or package.

### Setting up `.npmrc`

We use a local `.npmrc` file (or environment variables) for providing credentials without committing them to the repository.

1. Create an `.npmrc` file in the root of `web_core` (it is ignored by Git):
```sh
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
```
2. Set the `NPM_TOKEN` environment variable in your terminal session with your actual token:
```sh
export NPM_TOKEN="npm_YourSecretTokenHere"
```

*Alternative:* You can also directly replace `${NPM_TOKEN}` in the `.npmrc` file with your token, but using environment variables is the safest approach.

## 2. Pre-flight Checks

Ensure your local repository is clean and on the correct branch (e.g., `main`).

1. **Check Version:** Ensure the `version` in `package.json` is set correctly. For the current release, it should be `"0.8.0"`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the version number "0.8.0" in the documentation can lead to errors in future releases if a developer forgets to update this line. It's better to provide a general instruction without a specific, hardcoded version.

Suggested change
1. **Check Version:** Ensure the `version` in `package.json` is set correctly. For the current release, it should be `"0.8.0"`.
1. **Check Version:** Ensure the `version` in `package.json` is set to the correct version for the release.

2. **Run Tests:** Validate that all tests pass locally.
```sh
npm run test
```

## 3. The `dist/` Directory

**Do I need to generate the `/dist` folder before publishing?**
*No.* Our `package.json` includes a `prepack` script (`"prepack": "npm run build"`). When you run `npm pack` or `npm publish`, NPM automatically executes the `prepack` script, which compiles the TypeScript code and generates the `dist/` directory immediately before creating the publishable tarball.

## 4. Package Contents & License

- **Files Published:** Only the `dist/` and `src/` directories, alongside `package.json`, `README.md`, and `LICENSE` are published. This is controlled by the `"files"` array in `package.json`.
- **License:** The package is configured with the `Apache-2.0` open-source license in `package.json`.

## 5. Publishing

Since this package is scoped under `@a2ui`, it will be published as **private by default**.

**Note:** Publishing private scoped packages requires a paid npm subscription (Pro or Teams).

### Option A: Publish Private, then Promote to Public (Recommended for Testing)

1. **Publish as private:**
```sh
npm publish
```
2. **Verify the package:** Check the npm registry (while logged in) to ensure everything looks correct.
3. **Promote to public:**
```sh
npm access public @a2ui/web_core
```

### Option B: Publish Directly as Public

If you want to skip the private step (or do not have a paid npm account), you can publish it publicly immediately:

```sh
npm publish --access public
```

## 6. Post-publish (Optional but recommended)

After a successful publish:
1. Create a git tag for the release (e.g., `git tag v0.8.0`).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the version check, this hardcoded version in the git tag example will become outdated. Using a generic placeholder or a non-specific example is more maintainable and less prone to causing confusion for future releases.

Suggested change
1. Create a git tag for the release (e.g., `git tag v0.8.0`).
1. Create a git tag for the release (e.g., `git tag v1.2.3`).

2. Push the tag to the remote repository (`git push origin v0.8.0`).
3. Create a GitHub Release mapping to that tag.
13 changes: 13 additions & 0 deletions renderers/web_core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @a2ui/web_core

This is the Core Library for A2UI web renderers.

## Installation

```sh
npm install @a2ui/web_core
```

## Usage

Please refer to the A2UI documentation for usage instructions.
4 changes: 2 additions & 2 deletions renderers/web_core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion renderers/web_core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@a2ui/web_core",
"version": "0.8.2",
"version": "0.8.0",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to call this fix 0.8.1 and publish the package, so the package.json version matches what's published (not retroactively? :P)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm this is probably a good idea. Though we need to think this all through and probably switch to a different versioning system anyway.

"description": "A2UI Core Library",
"main": "./dist/src/v0_8/index.js",
"types": "./dist/src/v0_8/index.d.ts",
Expand Down Expand Up @@ -31,6 +31,10 @@
},
"type": "module",
"sideEffects": false,
"files": [
"dist",
"src"
],
"scripts": {
"prepack": "npm run build",
"build": "wireit",
Expand Down
Loading