Skip to content

Commit

Permalink
feat: author package with deno
Browse files Browse the repository at this point in the history
  • Loading branch information
maraisr committed Mar 30, 2024
1 parent 65f5ee8 commit d091e0a
Show file tree
Hide file tree
Showing 20 changed files with 891 additions and 1,114 deletions.
53 changes: 32 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,43 @@ name: CI

on:
push:
branches: [main]
pull_request: {}
workflow_call:

jobs:
test:
name: Node.js v${{ matrix.node }}
deno:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18, 20]
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v3

- name: (env) setup pnpm
uses: pnpm/action-setup@master
- uses: denoland/setup-deno@v1
with:
version: 8.6.5
deno-version: v1.x

- name: (env) setup node v${{ matrix.node }}
uses: actions/setup-node@main
- run: deno fmt --check
- run: deno lint
- run: deno check scripts/*.ts *.ts

- name: Tests
run: |-
deno test --coverage=cov/
deno coverage cov/
npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- run: deno task build

bencmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
node-version: ${{ matrix.node }}
cache: pnpm
check-latest: true

- run: pnpm install --ignore-scripts
- run: pnpm run build
- run: pnpm run test
- run: pnpm run typecheck
deno-version: v1.x

- run: deno run bench/index.ts
20 changes: 4 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
node_modules
.DS_Store
*-lock.json
*.lock
*.log

/coverage
/.nyc_output

# Editors
*.iml
/.idea
/.vscode

/index.js
/index.mjs
/index.d.ts
node_modules
/npm
*.lcov
/cov
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

1 change: 1 addition & 0 deletions bench/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
133 changes: 133 additions & 0 deletions bench/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions bench/index.js → bench/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { suite } from '@marais/bench';
import { suite } from 'npm:@marais/bench';

import objectHash from 'object-hash';
import { identify } from 'object-identity';
import jsonStableStringify from 'json-stable-stringify';
import objectHash from 'npm:object-hash';
import jsonStableStringify from 'npm:json-stable-stringify';

import { identify } from '../mod.ts';

const getObject = () => {
const c = [1];
// @ts-ignore
// @ts-expect-error circular
c.push(c);
return {
a: { b: ['c', new Set(['d', new Map([['e', 'f']]), c, 'g'])] },
Expand All @@ -15,7 +16,7 @@ const getObject = () => {
};
};

suite(
suite<any>(
{
'object-identity'() {
return (o) => identify(o);
Expand Down
9 changes: 0 additions & 9 deletions bench/package.json

This file was deleted.

59 changes: 0 additions & 59 deletions bench/pnpm-lock.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": "0.1.2",
"name": "@mr/object-identity",
"tasks": {
"build": "deno run -A scripts/build.ts"
},
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.0",
"@std/assert": "jsr:@std/assert@^0.221.0"
},
"lint": {
"rules": {
"exclude": [
"no-var",
"prefer-const",
"no-cond-assign",
"no-inner-declarations",
"no-explicit-any",
"no-fallthrough"
]
}
},
"fmt": {
"lineWidth": 100,
"singleQuote": true,
"useTabs": true
},
"exclude": [
"npm"
]
}
Loading

0 comments on commit d091e0a

Please sign in to comment.