Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c555ac4
chore: add implementation plan and gitignore ad-hoc plans
py-zoid May 1, 2026
cc8a374
chore: migrate from npm to pnpm
py-zoid May 1, 2026
241fdf7
feat: add TypeScript toolchain
py-zoid May 1, 2026
1215e15
feat: add JSON->TS codegen and ESM Network class
py-zoid May 1, 2026
3ef1f8b
feat!: rename package to @polygonlabs/meta with subpath exports
py-zoid May 1, 2026
0c1d7e5
feat: adopt changesets and tag-driven npm release
py-zoid May 1, 2026
093f56f
docs: correct RootChain path in MIGRATION and note CORS on HTTP endpoint
py-zoid May 1, 2026
fcac949
chore: scaffold first-release for canonical changesets math
py-zoid May 2, 2026
30c862d
feat(plasma): add EventsHub ABI for mainnet/v1 and testnet/amoy
py-zoid May 3, 2026
9481661
fix: validate dynamic-import inputs and confine codegen paths
py-zoid May 3, 2026
6bf5bbe
chore: remove refactoring plan from repo
py-zoid May 7, 2026
3f5cd0d
refactor: nest codegen output under src/generated/
py-zoid May 7, 2026
ea2582c
refactor!: drop Network class in favour of subpath exports
py-zoid May 7, 2026
06792b9
chore: convert to pnpm monorepo with @polygonlabs/meta under packages…
py-zoid May 11, 2026
77febff
refactor: convert codegen script from .mjs to .ts
py-zoid May 11, 2026
93fe207
chore: track src/generated/ and gate drift in CI
py-zoid May 11, 2026
7257e2f
chore: adopt team-standard dev tooling
py-zoid May 11, 2026
f38ae79
refactor(codegen): drive from repo-root network/ and hard-fail on inc…
py-zoid May 12, 2026
31dd69d
docs(meta): clarify ESM-only doesn't lock out CJS apps
py-zoid May 12, 2026
b11fb06
chore(ci): add team-standard shared-workflow triggers
py-zoid May 15, 2026
06d3bcb
chore(ci): tighten legacy AWS deploy workflows
py-zoid May 15, 2026
1d36990
chore(governance): add CODEOWNERS for product-applications
py-zoid May 15, 2026
215120f
chore(claude): add CLAUDE.md and .claude/settings.json
py-zoid May 15, 2026
838eaeb
chore(supply-chain): bump minimumReleaseAge to 1 week
py-zoid May 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .changeset/add-claude-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/add-codeowners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/add-shared-workflow-triggers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/adopt-team-dev-tooling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/codegen-from-repo-root.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/codegen-script-typescript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/commit-generated-content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"baseBranch": "master",
"updateInternalDependencies": "patch",
"bumpVersionsWithWorkspaceProtocolOnly": false,
"privatePackages": {
"version": true,
"tag": true
}
}
2 changes: 2 additions & 0 deletions .changeset/harden-legacy-deploy-workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
22 changes: 22 additions & 0 deletions .changeset/initial-rename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@polygonlabs/meta": major
---

Initial release of `@polygonlabs/meta`, replacing the legacy `@maticnetwork/meta@2.x` package.

## What's new

- **Per-contract typed deep imports.** `import { abi } from '@polygonlabs/meta/abi/<chain>/<network>/<type>/<Contract>'` pulls exactly one ABI; the rest of the package is tree-shaken at bundle time.
- **`as const` literal ABI types.** Each ABI is exported as a literal tuple so `viem`, `wagmi`, and `abitype` can extract function names, argument types, and return types at the call site. Without `as const` the type widens to `{ name: string }[]` and consumer-side type inference disappears entirely — the typed-ABI value proposition exists only because of `as const`.
- **Typed network metadata** under `/info/<chain>/<network>` and `/info/networks`, also `as const`.
- **Raw JSON access preserved.** The `./network/*` subpath export keeps the same path scheme as `@maticnetwork/meta@2.x`, so consumers who only want JSON migrate by changing the package name.
- **Provenance-stamped publishes** via npm OIDC trusted publishing, driven by changesets-on-merge.

## Breaking changes vs `@maticnetwork/meta@2.x`

- **Package renamed**: `@maticnetwork/meta` → `@polygonlabs/meta`.
- **ESM-only.** `require()` is no longer supported. Consumers must be ESM and on Node ≥ 24.
- **The `Network` class is gone.** Replace `new Network(chain, version).abi(name)` with the typed deep imports under `./abi/<chain>/<network>/<type>/<Contract>` — same data, fully typed, sync, tree-shakable.
- **Mumbai testnet** is gone (already removed upstream); use Amoy.

The HTTP endpoint at `static.polygon.technology` is unchanged. See `MIGRATION.md` for full before/after import examples.
2 changes: 2 additions & 0 deletions .changeset/migration-cjs-guidance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/raise-minimum-release-age.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/repo-restructure-monorepo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"permissions": {
"allow": ["WebFetch(domain:gist.githubusercontent.com)"]
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/meta/src/generated/** linguist-generated=true
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
#
# Every PR against `master` requires approval from a member of
# @0xPolygon/product-applications. The team also owns the
# static.polygon.technology HTTP endpoint and the @polygonlabs/meta
# npm package, so a single owner block at the repo root is intentional.

* @0xPolygon/product-applications
73 changes: 41 additions & 32 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,51 @@ on:
environment:
required: false
type: string
default: "dev"
default: 'dev'
core_app:
required: false
type: string
description: "Core app name"
default: "static"
description: 'Core app name'
default: 'static'
secrets:
build_params_gh_secret_keys:
required: false
description: 'JSON-encoded build-time secrets forwarded to the ECS deploy workflow.'

permissions:
contents: read
id-token: write

jobs:
set-env-variable:
runs-on: ubuntu-latest
outputs:
ACCOUNT_NUMBER: ${{ steps.set-env-var.outputs.ACCOUNT_NUMBER }}
APP_NAME: ${{ steps.set-env-var.outputs.APP_NAME }}
steps:
- name: Set Environment Variable
id: set-env-var
run: |
if [ "${{ inputs.environment }}" == "dev" ]; then
echo "ACCOUNT_NUMBER=058264511034" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}-dev" >> $GITHUB_OUTPUT
elif [ "${{ inputs.environment }}" == "staging" ]; then
echo "ACCOUNT_NUMBER=070528468658" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}-staging" >> $GITHUB_OUTPUT
elif [ "${{ inputs.environment }}" == "prod" ]; then
echo "ACCOUNT_NUMBER=042947190491" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}" >> $GITHUB_OUTPUT
fi
runs-on: ubuntu-latest
outputs:
ACCOUNT_NUMBER: ${{ steps.set-env-var.outputs.ACCOUNT_NUMBER }}
APP_NAME: ${{ steps.set-env-var.outputs.APP_NAME }}
steps:
- name: Set Environment Variable
id: set-env-var
run: |
if [ "${{ inputs.environment }}" == "dev" ]; then
echo "ACCOUNT_NUMBER=058264511034" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}-dev" >> $GITHUB_OUTPUT
elif [ "${{ inputs.environment }}" == "staging" ]; then
echo "ACCOUNT_NUMBER=070528468658" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}-staging" >> $GITHUB_OUTPUT
elif [ "${{ inputs.environment }}" == "prod" ]; then
echo "ACCOUNT_NUMBER=042947190491" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}" >> $GITHUB_OUTPUT
fi

deploy:
uses: 0xPolygon/pipelines/.github/workflows/ecs_deploy_docker_taskdef.yaml@main
needs: set-env-variable
with:
app_name: ${{ needs.set-env-variable.outputs.APP_NAME }}
taskdef_file_vars: .github/taskdef/${{ inputs.environment }}-taskdef.yaml
aws_region: eu-west-1
environment: ${{ inputs.environment }}
cluster_name: frontend-${{ inputs.environment }}-ecs-cluster
account_number: "${{ needs.set-env-variable.outputs.ACCOUNT_NUMBER }}"
secrets: inherit
uses: 0xPolygon/pipelines/.github/workflows/ecs_deploy_docker_taskdef.yaml@main
needs: set-env-variable
with:
app_name: ${{ needs.set-env-variable.outputs.APP_NAME }}
taskdef_file_vars: .github/taskdef/${{ inputs.environment }}-taskdef.yaml
aws_region: eu-west-1
environment: ${{ inputs.environment }}
cluster_name: frontend-${{ inputs.environment }}-ecs-cluster
account_number: '${{ needs.set-env-variable.outputs.ACCOUNT_NUMBER }}'
secrets:
build_params_gh_secret_keys: ${{ secrets.build_params_gh_secret_keys }}
13 changes: 13 additions & 0 deletions .github/workflows/changeset-check-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Changeset check

on:
pull_request:
branches: [master]

permissions:
contents: read
pull-requests: write

jobs:
check:
uses: 0xPolygon/pipelines/.github/workflows/apps-changeset-check.yml@main
15 changes: 15 additions & 0 deletions .github/workflows/ci-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on:
pull_request:
branches: [master]

permissions:
contents: read

jobs:
ci:
name: CI - lint / typecheck / test
runs-on: ubuntu-latest
steps:
- uses: 0xPolygon/pipelines/.github/actions/ci@main
18 changes: 18 additions & 0 deletions .github/workflows/claude-code-review-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]

permissions:
contents: read
pull-requests: write
issues: read
id-token: write
actions: read

jobs:
claude-review:
uses: 0xPolygon/pipelines/.github/workflows/apps-claude-code-review.yml@main
secrets:
CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
24 changes: 24 additions & 0 deletions .github/workflows/claude-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

permissions:
contents: read
pull-requests: write
issues: write
id-token: write
actions: read

jobs:
claude:
uses: 0xPolygon/pipelines/.github/workflows/apps-claude.yml@main
secrets:
CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
12 changes: 12 additions & 0 deletions .github/workflows/codegen-drift-check-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Codegen drift check

on:
pull_request:
branches: [master]

permissions:
contents: read

jobs:
drift-check:
uses: 0xPolygon/pipelines/.github/workflows/apps-codegen-drift-check.yml@main
9 changes: 7 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ on:
environment:
required: false
type: choice
description: "Select the environment to deploy to (optional for pushes)"
description: 'Select the environment to deploy to (optional for pushes)'
options:
- staging
- prod

permissions:
contents: read
id-token: write

jobs:
deploy:
uses: ./.github/workflows/build_and_deploy.yml
with:
environment: ${{ inputs.environment || 'dev' }}
secrets: inherit
secrets:
build_params_gh_secret_keys: ${{ secrets.build_params_gh_secret_keys }}
12 changes: 6 additions & 6 deletions .github/workflows/deployment_gcp.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy docker image to GCP
on:
push:
branches:
branches:
- master
workflow_dispatch:
inputs:
Expand All @@ -20,9 +20,9 @@ jobs:

docker-release:
needs:
- generate-version
uses: 0xPolygon/pipelines/.github/workflows/gcp_pipeline_release_image.yaml@main
- generate-version
uses: 0xPolygon/pipelines/.github/workflows/gcp_pipeline_release_image.yaml@main
with:
image_name: "static"
image_tag: ${{ inputs.tag || needs.generate-version.outputs.version }}
checkout_ref: ${{ github.ref_name }}
image_name: 'static'
image_tag: ${{ inputs.tag || needs.generate-version.outputs.version }}
checkout_ref: ${{ github.ref_name }}
17 changes: 17 additions & 0 deletions .github/workflows/npm-release-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release

on:
push:
branches: [master]

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release:
uses: 0xPolygon/pipelines/.github/workflows/apps-npm-release.yml@main
secrets:
CHANGESET_RELEASE_BOT_APP_ID: ${{ secrets.CHANGESET_RELEASE_BOT_APP_ID }}
CHANGESET_RELEASE_BOT_APP_PRIVATE_KEY: ${{ secrets.CHANGESET_RELEASE_BOT_APP_PRIVATE_KEY }}
17 changes: 0 additions & 17 deletions .github/workflows/npm-release.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
.DS_Store
node_modules
node_modules/
dist/
# Codegen mirror of the repo-root network/ tree, materialised by
# scripts/codegen.ts before publish. Pure publish artifact; the canonical
# tree at repo root is the source of truth.
packages/meta/network/
pnpm-debug.log
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec commitlint --edit $1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm exec lint-staged
pnpm run typecheck
33 changes: 33 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
# Require at least one changeset per push — mirrors the changeset-check CI gate so
# the gap is caught locally while there is still time to amend it into the right commit.
# Skip on changeset-release/* branches (automated version-bump PRs have no code to describe).

branch=$(git rev-parse --abbrev-ref HEAD)
case "$branch" in
changeset-release/*) exit 0 ;;
esac

base_branch=$(grep '"baseBranch"' .changeset/config.json | sed 's/.*"baseBranch"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/')

[ "$branch" = "$base_branch" ] && exit 0

# If origin/<base_branch> doesn't exist yet (brand-new repo), nothing to compare against.
git rev-parse --verify "origin/$base_branch" > /dev/null 2>&1 || exit 0

# Git sets GIT_DIR / GIT_WORK_TREE to the worktree's gitdir when running hooks
# inside a linked worktree (e.g. one created via `git worktree add`). Those vars
# break `changeset status` — it invokes its own `git` subprocesses, which then
# read from the linked gitdir rather than the worktree's actual tree, and report
# "no changesets found" even when a valid one exists. Unset both so changeset's
# git calls resolve against the CWD the hook is running in.
unset GIT_DIR GIT_WORK_TREE

if ! pnpm exec changeset status --since="origin/$base_branch" 2>/dev/null; then
echo ""
echo " No changeset found. Add one before pushing:"
echo " pnpm exec changeset add # for code/behaviour changes"
echo " pnpm exec changeset add --empty # for CI, docs, or tooling changes"
echo ""
exit 1
fi
Loading
Loading