Skip to content

Commit

Permalink
chore: init
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Nov 12, 2024
1 parent ef50406 commit 1c9f62b
Show file tree
Hide file tree
Showing 54 changed files with 6,436 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
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.0/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@changesets/changelog-github",
{ "repo": "ithacaxyz/oddworld" }
],
"commit": false,
"fixed": [],
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
}
11 changes: 11 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Install dependencies"
description: "Prepare repository and all dependencies"

runs:
using: "composite"
steps:
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Set up pnpm
uses: wevm/actions/.github/actions/pnpm@main
61 changes: 61 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Changesets
on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit

changesets:
name: Changesets
needs: verify
permissions:
contents: write
id-token: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
submodules: 'recursive'

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: PR or publish
uses: changesets/action@v1
with:
title: 'chore: version packages'
commit: 'chore: version packages'
createGithubReleases: ${{ github.ref == 'refs/heads/main' }}
publish: pnpm changeset:publish
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Prerelease
if: steps.changesets.outputs.published != 'true'
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
git reset --hard origin/main
pnpm clean
pnpm changeset version --no-git-tag --snapshot canary
pnpm changeset:prepublish
pnpm changeset publish --no-git-tag --snapshot canary
20 changes: 20 additions & 0 deletions .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Issue Labeled

on:
issues:
types: [labeled]

jobs:
issue-labeled:
if: ${{ github.repository_owner == 'wevm' }}
uses: wevm/actions/.github/workflows/issue-labeled.yml@main
with:
needs-reproduction-body: |
Hello @${{ github.event.issue.user.login }}.
Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using [StackBlitz](https://stackblitz.com), [TypeScript Playground](https://www.typescriptlang.org/play) (for type issues), or a separate minimal GitHub repository.
[Minimal reproductions are required](https://antfu.me/posts/why-reproductions-are-required) as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.
Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.
17 changes: 17 additions & 0 deletions .github/workflows/lock-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lock Issue

on:
schedule:
- cron: '0 0 * * *'

jobs:
lock-issue:
if: ${{ github.repository_owner == 'ithacaxyz' }}
uses: wevm/actions/.github/workflows/lock-issue.yml@main
with:
issue-comment: |
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new [bug report](https://github.com/ithacaxyz/oddworld/issues/new?template=bug_report.yml) with a reproduction against the latest Oddworld version. If you have any questions or comments you can create a new [discussion thread](https://github.com/ithacaxyz/oddworld/discussions).
14 changes: 14 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Pull Request
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
verify:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit
35 changes: 35 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Snapshot
on:
workflow_dispatch:

jobs:
canary:
name: Release snapshot version
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
timeout-minutes: 5

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Publish Snapshots
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
snapshot=$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
pnpm clean
pnpm changeset version --no-git-tag --snapshot $snapshot
pnpm changeset:prepublish
pnpm changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot
88 changes: 88 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Verify
on:
workflow_call:
workflow_dispatch:

jobs:
checks:
name: Checks
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Check code
run: pnpm check

- name: Check types
run: pnpm check:types

- name: Check TSDoc
run: pnpm check:tsdoc

- uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit_message: 'chore: format'
commit_user_name: 'github-actions[bot]'
commit_user_email: 'github-actions[bot]@users.noreply.github.com'

test:
name: Test Runtime
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3]
total-shards: [3]
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run tests
run: pnpm test:ci --shard=${{ matrix.shard }}/${{ matrix.total-shards }}
env:
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }}

test-types:
name: Test Types
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run tests
run: pnpm test:types

vectors:
name: Vectors
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run test vectors
shell: bash
run: pnpm vectors
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# typescript
*.tsbuildinfo
next-env.d.ts

# forge
contracts/cache
contracts/out

# lib
src/_dist
src/_generated

6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/solady"]
path = contracts/lib/solady
url = https://github.com/Vectorized/solady
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
auto-install-peers=false
link-workspace-packages=deep
provenance=false
strict-peer-dependencies=false
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
26 changes: 26 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"javascript.preferences.autoImportFileExcludePatterns": ["**/index.js"],
"typescript.preferences.autoImportFileExcludePatterns": ["**/index.js"],
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[markdown]": {
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
}
}
Loading

0 comments on commit 1c9f62b

Please sign in to comment.