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
6 changes: 6 additions & 0 deletions .changeset/mastodon-status-urls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@fujocoded/zod-transform-socials": patch
---

- mastodon match now accepts post urls in addition to profile mathes (e.g. urls like `/@user/112050937942786185`).
- warn at import time when the default (zod 3) entry is used but zod 4 is installed (for example an astro 6 upgrade that forgot to switch to `/zod4`).
24 changes: 24 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"mode": "exit",
"tag": "zod4-test",
"initialVersions": {
"@fujocoded/astro-alt-text-toolkit": "0.0.1",
"@fujocoded/astro-ao3-loader": "0.0.4",
"@fujocoded/astro-atproto-loader": "0.2.1",
"@fujocoded/authproto": "0.3.1",
"@fujocoded/astro-dev-only": "0.0.4",
"@fujocoded/astro-rehype-html-headings": "0.0.2",
"@fujocoded/astro-remark-collect-components": "0.0.6",
"@fujocoded/astro-smooth-action": "0.0.1",
"@fujocoded/atproto-badges": "0.2.0",
"@fujocoded/expressive-code-caption": "0.0.3",
"@fujocoded/expressive-code-output": "0.1.0",
"@fujocoded/rehype-code-params": "0.0.5",
"@fujocoded/remark-alt-text-files": "0.0.2",
"@fujocoded/remark-capitalize-titles": "0.1.0",
"@fujocoded/remark-excalidraw": "0.0.2",
"@fujocoded/remark-jsx-auto-slug": "0.0.1",
"@fujocoded/zod-transform-socials": "0.0.14"
},
"changesets": ["socials-zod-4"]
}
14 changes: 14 additions & 0 deletions .changeset/socials-zod-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@fujocoded/zod-transform-socials": minor
---

### New

- **Zod 4 / Astro 6 support**: `import { SocialLinks } from "@fujocoded/zod-transform-socials/zod4"`. Default entry is still Zod 3.
- **Examples**: `__examples__/` now has one runnable project per combo (Astro 5, Astro 6, plain Zod 3, plain Zod 4).
- **`"sideEffects": false`** in `package.json` so you can treeshake away the half you don't use.

### Breaking

- **`zod` is now a peer dep** (`^3.25.0 || ^4.0.0`).
- **Minimum Zod 3 is now `3.25.0`** (was `3.23.8`) so we can access `zod/v4`.
46 changes: 27 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ on:
- main
workflow_dispatch:
inputs:
npm_tag:
description: "npm dist-tag to publish under. Manual releases cannot use latest."
required: true
type: string
publish_latest:
description: "Retry a failed latest publish (skips pre-mode check, publishes whatever's in package.json under the 'latest' tag). Leave off for normal prerelease dispatch."
required: false
default: false
type: boolean

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down Expand Up @@ -48,29 +49,36 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate manual npm tag
- name: Validate dispatch mode
if: github.event_name == 'workflow_dispatch'
env:
NPM_TAG: ${{ inputs.npm_tag }}
PUBLISH_LATEST: ${{ inputs.publish_latest }}
run: |
if [ "$NPM_TAG" = "latest" ]; then
echo "::error::Manual releases cannot publish to latest. Pushes to main publish to latest automatically."
exit 1
if [ "$PUBLISH_LATEST" = "true" ]; then
if [ -f .changeset/pre.json ]; then
echo "::error::publish_latest is true but .changeset/pre.json exists. Exit pre mode before publishing to latest."
exit 1
fi
echo "publish_latest=true: will publish under 'latest' (retry path)."
exit 0
fi
if ! echo "$NPM_TAG" | grep -Eq '^[a-z][a-z0-9-]*$'; then
echo "::error::npm_tag must match ^[a-z][a-z0-9-]*$."
if [ ! -f .changeset/pre.json ]; then
echo "::error::Prerelease dispatch requires changesets pre mode. Run 'npx changeset pre enter <tag>' on the branch first, or re-dispatch with publish_latest=true to retry a latest publish."
exit 1
fi

- name: Build
if: github.event_name == 'workflow_dispatch'
run: npm run build

# Manual dispatch publishes packages from the selected ref that are not
# already on the registry under a non-latest npm dist-tag, for compatibility
# or preview channels. It does not retag already-published versions.
- name: Publish with manual npm tag
if: github.event_name == 'workflow_dispatch'
run: ./node_modules/.bin/changeset publish --tag "$NPM_TAG"
env:
NPM_TAG: ${{ inputs.npm_tag }}
# Manual dispatch publishes whatever's already versioned on the branch.
# In pre mode, the dist-tag comes from .changeset/pre.json.
# With publish_latest=true, it retries a failed latest publish (--provenance
# mirrors the push-trigger path).
- name: Publish (prerelease)
if: github.event_name == 'workflow_dispatch' && inputs.publish_latest != true
run: ./node_modules/.bin/changeset publish

- name: Publish (latest retry)
if: github.event_name == 'workflow_dispatch' && inputs.publish_latest == true
run: ./node_modules/.bin/changeset publish --provenance
Loading