Skip to content
Draft
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
3 changes: 2 additions & 1 deletion .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ symbols.
If you find a bug a test case is the right place to start. Test example:

```ts
import { assertEquals } from "@std/assert";
import { assertEquals } from "@std/assert/equals";

import { Serializable, SerializeProperty } from "../mod.ts";

Deno.test({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,33 @@

name: tests

on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
on: [push, pull_request]

jobs:
deno_v1:
tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
deno: [v1.x]
deno: [v1.x, canary]
os: [macOS-latest, windows-latest, ubuntu-latest]

steps:
- name: Setup repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup deno
uses: denolib/setup-deno@v2
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.deno }}

- name: Deno test
run: deno test

deno_v2_and_up:
runs-on: ${{ matrix.os }}

needs: deno_v1

strategy:
matrix:
deno: [v2.x]
os: [macOS-latest, windows-latest, ubuntu-latest]

steps:
- name: Setup repo
uses: actions/checkout@v2

- name: Setup deno
uses: denolib/setup-deno@v2
with:
deno-version: ${{ matrix.deno }}

- name: Deno lint
run: deno task lint

- name: Deno format check
run: deno task fmt --check
run: deno fmt --check
if: matrix.os != 'windows-latest'

- name: Deno lint
run: deno lint

- name: Deno test
run: deno task test:coverage

Expand All @@ -70,12 +44,6 @@ jobs:
path: ./coverage/lcov.info
min_coverage: 100

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 22
registry-url: https://registry.npmjs.org/

- name: Build and test NPM module
run: deno task build
- name: Publish module to jsr.io
run: deno publish --dry-run
if: matrix.os == 'ubuntu-latest'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we publish to both jsr and npm? Is that a typical thing to do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is pretty normal to publish to both. NPM adoption is important, and JSR is described as a superset of NPM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although in my eagerness, I removed NPM publish, I can easily put it back

25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
# using npx to avoid needing to install deno

# --dry-run is used to avoid publishing the
# module until we can figure out how to handle
# the jsr.io publishing with the @gamebridge account admin.

# When we decide to publish to JSR we'll need to rename the
# module to @gamebridge/serialize or something similar
# because `_` is not allowed in module names.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's interesting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeaa! Man it was a gut punch to hear that

- run: npx jsr publish --dry-run
84 changes: 0 additions & 84 deletions .github/workflows/ts_serialize_release.yml

This file was deleted.

101 changes: 0 additions & 101 deletions _build_npm.ts

This file was deleted.

70 changes: 25 additions & 45 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,33 @@
{
"name": "@gamebridge/ts_serialize",
"version": "v2.1.0",
"exports": {
".": "./mod.ts"
},
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.42.1",
"@std/assert": "jsr:@std/assert@^1.0.13",
"@std/cli": "jsr:@std/cli@^1.0.17"
"@std/assert": "jsr:@std/assert@^1.0/assert",
"@std/assert/equals": "jsr:@std/assert@^1.0/equals",
"@std/assert/assertStrictEquals": "jsr:@std/assert@^1.0/strict-equals",
"@std/assert/assertNotEquals": "jsr:@std/assert@^1.0/not-equals",
"@std/assert/fail": "jsr:@std/assert@^1.0/fail"
},
"lock": false,
"compilerOptions": {
"experimentalDecorators": true
},
"fmt": {
"include": ["./"],
"exclude": ["./dist"]
},
"test": {
"include": ["./"],
"exclude": ["./dist"]
},
"lint": {
"include": ["./"],
"exclude": ["./dist"]
},
"typeCheck": {
"include": ["./"],
"exclude": ["./dist"]
"publish": {
"exclude": [
".github",
".vim",
".vscode",
"coverage",
".editorconfig",
"**/*.test.ts"
]
},
"tasks": {
"build": {
"description": "Build the project for npm, pass in your flags to override the defaults",
"command": "./_build_npm.ts -v v0.0.0-test -e ./mod.ts -o ./dist"
},
"lint": {
"description": "Run linting",
"command": "deno lint"
},
"fmt": {
"description": "Run formatting",
"command": "deno fmt"
},
"test": {
"description": "Run tests",
"command": "deno test --doc"
},
"test:coverage": {
"description": "Run tests with coverage",
"command": "deno test --coverage=coverage --doc"
},
"test:coverage:report": {
"description": "Generate coverage report",
"command": "deno coverage --lcov coverage > coverage/lcov.info"
}
"test": "deno test --doc --parallel",
"test:coverage": "deno test --doc --parallel --coverage=./coverage",
"test:coverage:report": "deno coverage --lcov ./coverage > ./coverage/lcov.info"
},
"compilerOptions": {
"experimentalDecorators": true
}
}
4 changes: 3 additions & 1 deletion error_messages_test.ts → error_messages.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2018-2025 Gamebridge.ai authors. All rights reserved. MIT license.

import { assert, assertEquals } from "@std/assert";
import { assert } from "@std/assert";
import { assertEquals } from "@std/assert/equals";

import * as mod from "./error_messages.ts";

Deno.test({
Expand Down
Loading