Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 13 additions & 0 deletions .github/scripts/published.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { readFile, appendFile } from 'node:fs/promises';
const manifest = JSON.parse(await readFile('package.json', 'utf8'));
const url = `https://registry.npmjs.org/${manifest.name.replace('/', '%2F')}/${manifest.version}`;
const response = await fetch(url, { headers: { 'Cache-Control': 'no-cache' } });
if (response.status === 404) {
await appendFile(process.env.GITHUB_OUTPUT, 'published=false\n');
} else {
if (!response.ok) throw new Error(`Registry check failed: ${response.status}`);
const published = await response.json();
if (published.pi?.image !== manifest.pi?.image) throw new Error('The existing npm version has different preview metadata; bump the package version.');
await appendFile(process.env.GITHUB_OUTPUT, 'published=true\n');
console.log(`${manifest.name}@${manifest.version} is already published with the expected cover metadata.`);
}
20 changes: 20 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Checks
on: [push, pull_request]
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
- run: npm ci --ignore-scripts
- run: npm run check
- run: npm test --if-present
- run: npm run check:package
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish package
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: publish-${{ github.repository }}-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-node@v5
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Verify release tag
run: node --input-type=module -e 'import fs from "node:fs"; const p = JSON.parse(fs.readFileSync("package.json")); if (process.env.GITHUB_REF !== `refs/tags/v${p.version}`) throw new Error("Publish from the matching version tag");'
- name: Check an existing release
id: registry
run: node .github/scripts/published.mjs
- if: steps.registry.outputs.published != 'true'
run: npm ci --ignore-scripts
- if: steps.registry.outputs.published != 'true'
run: npm run check
- if: steps.registry.outputs.published != 'true'
run: npm test --if-present
- if: steps.registry.outputs.published != 'true'
run: npm run check:package
- if: steps.registry.outputs.published != 'true'
run: npm publish --provenance --access public
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.2.1

- Add the English package cover to the README, npm archive, and Pi gallery metadata.
- Publish matching version tags through the package GitHub Actions workflow.


## 0.2.0

- `/sync` opens the shared docked panel: connection status, the last sync's file changes, pending and failed packages, and the one action to take. Press `l` to login, `s` to sync (preview only), `y` to sync and install new packages, `x` to logout. Login still uses the link+code flow, surfaced through a notice. Replaces the old `/pi-sync` text-only command.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pi-sync

[![pi-sync — for PI Agent](https://raw.githubusercontent.com/prjct-app/pi-sync/main/docs/cover.png)](https://pi.dev)

Keeps Pi's portable configuration the same on every machine you use: settings, `AGENTS.md`, MCP and model config, and the extensions that are on. It also installs the packages listed in `settings.json`.

## Commands
Expand Down
Binary file added docs/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

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

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prjct.app/pi-sync",
"version": "0.2.0",
"version": "0.2.1",
"description": "Export and import the portable Pi configuration (settings, AGENTS.md, extensions, MCP and model config) between machines. Never exports auth or sessions.",
"type": "module",
"keywords": [
Expand All @@ -13,12 +13,14 @@
"pi": {
"extensions": [
"./index.ts"
]
],
"image": "https://raw.githubusercontent.com/prjct-app/pi-sync/main/docs/cover.png"
},
"scripts": {
"test": "export PI_CODING_AGENT_DIR=\"$(mktemp -d)\" PRJCT_HOME=\"$(mktemp -d)\" && node --import tsx --test tests/*.test.ts",
"check": "tsc --noEmit && npm run check:immutable",
"check:immutable": "! grep -rn '\\blet\\b' src/ index.ts || (echo 'Use const and immutable values: no let bindings in src/ or index.ts' && exit 1)"
"check:immutable": "! grep -rn '\\blet\\b' src/ index.ts || (echo 'Use const and immutable values: no let bindings in src/ or index.ts' && exit 1)",
"check:package": "npm pack --dry-run --ignore-scripts"
},
"engines": {
"node": ">=22.19.0"
Expand All @@ -38,7 +40,8 @@
"LICENSE",
"README.md",
"index.ts",
"src"
"src",
"docs/cover.png"
],
"exports": {
".": "./index.ts"
Expand Down
Loading