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
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
push:
branches: [main]
pull_request:

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

jobs:
build-and-test:
name: Build, Typecheck, Lint, Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: pnpm/action-setup@v6
with:
package_json_file: package.json

- uses: actions/setup-node@v7
with:
node-version-file: .tool-versions
cache: pnpm

- name: Install
run: pnpm install --frozen-lockfile

- name: Compile the vendored parser
run: pnpm run vendor:build

- name: Build the library (dual ESM/CJS, verified with attw)
run: pnpm run build

- name: Typecheck
run: pnpm run typecheck

- name: Lint
run: pnpm run lint

- name: Round-trip wire-mesh's conformance vectors through the generated schemas
run: pnpm run test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
.turbo/
.eslintcache
coverage/
test/fixtures/generated/protocol.ts
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 26
35 changes: 35 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { exadevConfig } from "@exadev/eslint-config";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";

export default exadevConfig(
{},
{
ignores: [
"dist",
"coverage",
"node_modules",
".turbo",
"vendor",
"test/fixtures/generated",
],
},
{
languageOptions: {
parserOptions: {
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: import.meta.dirname,
},
globals: { ...globals.node },
},
},
{
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
{ fixStyle: "inline-type-imports" },
],
},
},
eslintPluginPrettierRecommended,
);
53 changes: 53 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "cddl.js",
"version": "0.0.0",
"private": true,
"type": "module",
"packageManager": "pnpm@10.33.0",
"files": [
"dist"
],
"scripts": {
"build": "turbo run _build",
"_build": "tsdown",
"vendor:build": "turbo run _vendor:build",
"_vendor:build": "tsc -p vendor/cddl/tsconfig.json",
"test": "turbo run _test",
"_test": "vitest run",
"typecheck": "turbo run _typecheck",
"_typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.node.json --noEmit && tsc -p vendor/cddl/tsconfig.json --noEmit",
"lint": "turbo run _lint",
"_lint": "eslint . --fix --cache --max-warnings 0"
},
"dependencies": {
"camelcase": "9.0.0",
"cbor2": "2.3.0",
"zod": "4.5.4"
},
"devDependencies": {
"@arethetypeswrong/cli": "0.18.5",
"@exadev/eslint-config": "2.10.6",
"@types/node": "26.4.1",
"eslint": "10.10.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-prettier": "5.5.6",
"globals": "17.12.0",
"jiti": "2.7.0",
"prettier": "3.9.6",
"tsdown": "0.23.0",
"turbo": "2.10.12",
"typescript": "6.0.3",
"vitest": "5.0.0"
},
"exports": {
"./emitter": {
"import": "./dist/emitter.mjs",
"require": "./dist/emitter.cjs"
},
"./runtime": {
"import": "./dist/runtime.mjs",
"require": "./dist/runtime.cjs"
},
"./package.json": "./package.json"
}
}
Loading