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
37 changes: 37 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Setup
description: Perform standard setup and install dependencies using pnpm.
inputs:
node-version:
description: The version of Node.js to install
required: false
deno-version:
description: The version of Deno to install
required: false
bun-version:
description: The version of Bun to install
required: false

runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Install node
uses: actions/setup-node@v4
if: ${{ inputs.node-version != '' }}
with:
cache: pnpm
node-version: ${{ inputs.node-version }}
- name: Install deno
uses: denoland/setup-deno@v2
if: ${{ inputs.deno-version != '' }}
with:
deno-version: ${{ inputs.deno-version }}
- name: Install bun
uses: oven-sh/setup-bun@v2
if: ${{ inputs.bun-version != '' }}
with:
bun-version: ${{ inputs.bun-version }}
- name: Install dependencies
shell: bash
run: pnpm install
106 changes: 106 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Check

on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

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

permissions: {}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/setup
with:
node-version: 24.10.0
- run: pnpm lint

types:
name: Types
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/setup
with:
node-version: 24.10.0
- run: pnpm check

# TODO: discuss with Sebastian whether we should add Deno / Bun configuration / checks
# types-deno:
# name: Types on Deno
# runs-on: ubuntu-latest
# permissions:
# contents: read
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v4
# - name: Install dependencies
# uses: ./.github/actions/setup
# with:
# deno-version: v2.5.x
# - run: deno check .

test:
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
shard: [1/1]
runtime: [Node] # TODO: Deno
steps:
- uses: actions/checkout@v4

- name: Install dependencies
if: matrix.runtime == 'Node'
uses: ./.github/actions/setup
with:
node-version: 24.10.0
- name: Test
if: matrix.runtime == 'Node'
run: pnpm test --shard ${{ matrix.shard }}

- name: Install dependencies
if: matrix.runtime == 'Deno'
uses: ./.github/actions/setup
with:
deno-version: v2.5.x
- name: Test
if: matrix.runtime == 'Deno'
run: deno task test --shard ${{ matrix.shard }}

# TODO: discuss with Sebastian whether we want circularity checks
# circular:
# name: Circular Dependencies
# runs-on: ubuntu-latest
# permissions:
# contents: read
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v4
# - name: Install dependencies
# uses: ./.github/actions/setup
# with:
# node-version: 24.10.0
# - name: Check for circular dependencies
# run: pnpm circular
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ node_modules/
.DS_Store

# Scratchpad Files
scratchpad/**/*.md
scratchpad/**/*.ts
!scratchpad/index.ts
27 changes: 24 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default defineConfig(
{
plugins: {
"simple-import-sort": simpleImportSort,
"sort-destructure-keys": sortDestructureKeys,
"unused-imports": unusedImports
"sort-destructure-keys": sortDestructureKeys
},

languageOptions: {
Expand Down Expand Up @@ -71,7 +70,6 @@ export default defineConfig(
"import-x/order": "off",
"simple-import-sort/imports": "off",
"sort-destructure-keys/sort-destructure-keys": "error",
"unused-imports/no-unused-imports": "error",
"deprecation/deprecation": "off",

"@typescript-eslint/array-type": [
Expand Down Expand Up @@ -130,5 +128,28 @@ export default defineConfig(
rules: {
"no-console": "error"
}
},
{
files: ["scratchpad/eslint/**/*"],
plugins: {
"unused-imports": unusedImports
},
rules: {
"unused-imports/no-unused-imports": "error",
"@effect/dprint": [
"error",
{
config: {
indentWidth: 2,
lineWidth: 80,
semiColons: "asi",
quoteStyle: "alwaysDouble",
trailingCommas: "never",
operatorPosition: "maintain",
"arrowFunction.useParentheses": "force"
}
}
]
}
}
)
21 changes: 16 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
{
"private": true,
"type": "module",
"packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a",
"packageManager": "pnpm@10.25.0+sha512.5e82639027af37cf832061bcc6d639c219634488e0f2baebe785028a793de7b525ffcd3f7ff574f5e9860654e098fe852ba8ac5dd5cefe1767d23a020a92f501",
"scripts": {
"check": "tspc -b tsconfig.json",
"clean": "node scripts/clean.mjs",
"lint": "eslint \"**/{src,test,examples,dtslint}/**/*.{ts,mjs}\"",
"lint-fix": "pnpm lint --fix"
"lint-fix": "pnpm lint --fix",
"test": "vitest"
},
"devDependencies": {
"@effect/eslint-plugin": "^0.3.2",
"@effect/language-service": "^0.57.1",
"@effect/language-service": "^0.62.0",
"@effect/vitest": "^0.27.0",
"@eslint/js": "^9.39.1",
"@types/node": "^24.10.1",
"@types/node": "^25.0.0",
"@vitest/coverage-v8": "^4.0.15",
"@vitest/ui": "^4.0.15",
"effect": "^3.19.11",
"eslint": "^9.39.1",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"eslint-plugin-unused-imports": "^4.3.0",
"glob": "^13.0.0",
"globals": "^16.5.0",
"ts-patch": "^3.3.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.48.0"
"typescript-eslint": "^8.49.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^4.0.15",
"vitest-mock-express": "^2.2.0"
}
}
9 changes: 9 additions & 0 deletions packages/amp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Amp TypeScript SDK

## Known Issues

**Enabling TypeScript's `erasableSyntaxOnly` Feature**

For some completely absurd reason, the `@bufbuild/protoc-gen-es` plugin does not support generating enum values as anything other than TypeScript enums at this time, so we cannot yet enable this flag.

See the [related `protobuf-es` issue](https://github.com/bufbuild/protobuf-es/issues/1139) for more information.
12 changes: 12 additions & 0 deletions packages/amp/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: v2

inputs:
- git_repo: https://github.com/apache/arrow
subdir: format

plugins:
- local: protoc-gen-es
out: src/Protobuf
opt:
- target=ts
- import_extension=ts
25 changes: 22 additions & 3 deletions packages/amp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"url": "https://github.com/edgeandnode/amp-typescript",
"directory": "packages/amp"
},
"sideEffects": [],
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts",
"./*": "./src/*.ts"
"./*": "./src/*.ts",
"./internal/*.ts": null
},
"files": [
"src/**/*.ts",
Expand All @@ -22,10 +24,27 @@
"dist/**/*.d.ts",
"dist/**/*.d.ts.map"
],
"publishConfig": {
"provenance": true,
"exports": {
"./package.json": "./package.json",
".": "./dist/index.js",
"./*": "./dist/*.js",
"./internal/*.ts": null
}
},
"peerDependencies": {
"effect": "^3.19.8"
"@bufbuild/protobuf": "^2.10.1",
"@connectrpc/connect": "^2.1.1",
"@connectrpc/connect-node": "^2.1.1",
"effect": "^3.19.11"
},
"devDependencies": {
"effect": "^3.19.8"
"@bufbuild/buf": "^1.61.0",
"@bufbuild/protobuf": "^2.10.1",
"@bufbuild/protoc-gen-es": "^2.10.1",
"@connectrpc/connect": "^2.1.1",
"@connectrpc/connect-node": "^2.1.1",
"effect": "^3.19.11"
}
}
Loading