Skip to content

Commit 07a5b71

Browse files
committed
Rename publish packages for web platform
1 parent d416fef commit 07a5b71

19 files changed

Lines changed: 66 additions & 70 deletions

.github/workflows/publish.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ jobs:
4949
run: |
5050
set -euo pipefail
5151
52-
if npm view codex-pets-core version >/dev/null 2>&1; then
53-
npm owner ls codex-pets-core
52+
if npm view codex-pet-web version >/dev/null 2>&1; then
53+
npm owner ls codex-pet-web
5454
else
55-
echo "codex-pets-core is not published yet; first publish is allowed."
55+
echo "codex-pet-web is not published yet; first publish is allowed."
5656
fi
5757
58-
npm owner ls codex-pets-react
58+
if npm view codex-pet-web-react version >/dev/null 2>&1; then
59+
npm owner ls codex-pet-web-react
60+
else
61+
echo "codex-pet-web-react is not published yet; first publish is allowed."
62+
fi
5963
6064
- name: Publish core
6165
run: |

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Changelog
22

3-
## 0.3.0
3+
## 0.1.0
44

55
- Split the project into an npm workspace monorepo.
6-
- Added `codex-pets-core` as a dependency-free TypeScript engine.
7-
- Added `codex-pets-react` as a thin React wrapper over the core animator.
6+
- Added `codex-pet-web` as a dependency-free TypeScript engine.
7+
- Added `codex-pet-web-react` as a thin React wrapper over the core animator.
88
- Added a Vite demo app that can load local pets copied from `~/.codex/pets`.
99
- Added CI, Pages, and manual npm publish workflows.

PUBLISHING.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
This repository publishes two public npm packages:
44

5-
- `codex-pets-core`
6-
- `codex-pets-react`
5+
- `codex-pet-web`
6+
- `codex-pet-web-react`
77

88
## Prerequisites
99

@@ -13,12 +13,11 @@ This repository publishes two public npm packages:
1313
4. Confirm package names are available or already owned by the npm account:
1414

1515
```bash
16-
npm view codex-pets-core version
17-
npm view codex-pets-react version
16+
npm view codex-pet-web version
17+
npm view codex-pet-web-react version
1818
```
1919

20-
`codex-pets-react` already has a historical `0.2.0`, so this monorepo starts
21-
the React package at `0.3.0`. `codex-pets-core` starts at `0.1.0`.
20+
Both public packages start at `0.1.0`.
2221

2322
Trusted Publishing is preferred over long-lived npm tokens. Configure it on
2423
npmjs.com for each published package:
@@ -28,20 +27,14 @@ npmjs.com for each published package:
2827
- Workflow filename: `publish.yml`
2928
- Environment name: leave empty
3029

31-
At the time this repository was prepared, `codex-pets-core` was unclaimed and
32-
`codex-pets-react` was owned by the `backnotprop` npm account. `codex-pets-core`
33-
must be published once before its Trusted Publisher can be configured. Publish
34-
it manually after `npm login`, then add the same Trusted Publisher settings:
30+
At the time this repository was prepared, both package names were unclaimed.
31+
Each package must be published once before its Trusted Publisher can be
32+
configured. Publish them manually after `npm login`, then add the same Trusted
33+
Publisher settings:
3534

3635
```bash
3736
npm publish -w packages/core --access public --tag next
38-
```
39-
40-
For `codex-pets-react`, either configure Trusted Publishing from the
41-
`backnotprop` npm account or add the publishing npm user as an owner first:
42-
43-
```bash
44-
npm owner add <npm-username> codex-pets-react
37+
npm publish -w packages/react --access public --tag next
4538
```
4639

4740
Do not create an automation token with 2FA bypass unless Trusted Publishing is
@@ -81,8 +74,8 @@ npm publish -w packages/react --access public --tag next
8174
mkdir /tmp/codex-pets-consumer
8275
cd /tmp/codex-pets-consumer
8376
npm init -y
84-
npm install codex-pets-core@next codex-pets-react@next react react-dom
85-
node --input-type=module -e "import { CODEX_PET_ATLAS } from 'codex-pets-core'; import { CodexPet } from 'codex-pets-react'; console.log(CODEX_PET_ATLAS.width, typeof CodexPet)"
77+
npm install codex-pet-web@next codex-pet-web-react@next react react-dom
78+
node --input-type=module -e "import { CODEX_PET_ATLAS } from 'codex-pet-web'; import { CodexPet } from 'codex-pet-web-react'; console.log(CODEX_PET_ATLAS.width, typeof CodexPet)"
8679
```
8780

8881
Expected output includes:
@@ -105,7 +98,7 @@ npm publish -w packages/react --access public --tag latest
10598

10699
## Versioning Notes
107100

108-
- Keep `codex-pets-react` dependent on the matching compatible
109-
`codex-pets-core` range.
101+
- Keep `codex-pet-web-react` dependent on the matching compatible
102+
`codex-pet-web` range.
110103
- Update `CHANGELOG.md` before each release.
111104
- Run `npm run pack:dry` and inspect tarball contents before publishing.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Production-ready web renderers for Codex pet spritesheets.
44

55
This repository is an npm workspace with:
66

7-
- [`codex-pets-core`](./packages/core): dependency-free TypeScript engine.
8-
- [`codex-pets-react`](./packages/react): React wrapper around the core engine.
7+
- [`codex-pet-web`](./packages/core): dependency-free TypeScript engine.
8+
- [`codex-pet-web-react`](./packages/react): React wrapper around the core engine.
99
- [`apps/demo`](./apps/demo): Vite playground for local pets from `~/.codex/pets`.
1010

1111
## Sprite Contract
@@ -84,5 +84,4 @@ npm publish -w packages/core --access public
8484
npm publish -w packages/react --access public
8585
```
8686

87-
`codex-pets-react` already exists on npm at `0.2.0`, so this workspace uses
88-
`0.3.0` for the React package. `codex-pets-core` starts at `0.1.0`.
87+
Both public packages start at `0.1.0`.

apps/demo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"typecheck": "tsc -p tsconfig.json --noEmit"
1010
},
1111
"dependencies": {
12-
"codex-pets-core": "^0.1.0",
13-
"codex-pets-react": "^0.3.0",
12+
"codex-pet-web": "^0.1.0",
13+
"codex-pet-web-react": "^0.1.0",
1414
"react": "^19.0.0",
1515
"react-dom": "^19.0.0"
1616
},

apps/demo/src/main.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useMemo, useRef, useState } from "react";
22
import { createRoot } from "react-dom/client";
3-
import { CODEX_PET_STATES, type CodexPetManifest, type CodexPetState } from "codex-pets-core";
4-
import { CodexPet, type CodexPetHandle } from "codex-pets-react";
3+
import { CODEX_PET_STATES, type CodexPetManifest, type CodexPetState } from "codex-pet-web";
4+
import { CodexPet, type CodexPetHandle } from "codex-pet-web-react";
55
import "./styles.css";
66

77
type DemoPet = CodexPetManifest & {
@@ -108,7 +108,7 @@ function App() {
108108
<aside className="controls" aria-label="Pet controls">
109109
<div>
110110
<h1>Codex Pets</h1>
111-
<p>Preview local Codex pet packages through codex-pets-react.</p>
111+
<p>Preview local Codex pet packages through codex-pet-web-react.</p>
112112
</div>
113113

114114
{error ? <div className="notice">{error}</div> : null}

apps/demo/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"types": ["vite/client"],
88
"tsBuildInfoFile": ".tsbuildinfo",
99
"paths": {
10-
"codex-pets-core": ["../../packages/core/src/index.ts"],
11-
"codex-pets-react": ["../../packages/react/src/index.ts"]
10+
"codex-pet-web": ["../../packages/core/src/index.ts"],
11+
"codex-pet-web-react": ["../../packages/react/src/index.ts"]
1212
}
1313
},
1414
"include": ["src", "vite.config.ts"],

apps/demo/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export default defineConfig({
66
plugins: [react()],
77
resolve: {
88
alias: {
9-
"codex-pets-core": new URL("../../packages/core/src/index.ts", import.meta.url)
9+
"codex-pet-web": new URL("../../packages/core/src/index.ts", import.meta.url)
1010
.pathname,
11-
"codex-pets-react": new URL("../../packages/react/src/index.ts", import.meta.url)
11+
"codex-pet-web-react": new URL("../../packages/react/src/index.ts", import.meta.url)
1212
.pathname
1313
}
1414
}

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codex-pets-web",
3-
"version": "0.3.0",
3+
"version": "0.1.0",
44
"private": true,
55
"description": "Framework-neutral and React renderers for Codex pet spritesheets.",
66
"license": "MIT",

0 commit comments

Comments
 (0)