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 006472e
Show file tree
Hide file tree
Showing 20 changed files with 890 additions and 1,106 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"version": "3",
"packages": {
"specifiers": {
"npm:@marais/bench": "npm:@marais/bench@0.0.8",
"npm:json-stable-stringify": "npm:json-stable-stringify@1.1.1",
"npm:object-hash": "npm:object-hash@3.0.0"
},
"npm": {
"@marais/bench@0.0.8": {
"integrity": "sha512-DZ3TqK1eUN77E2nV2Aj2aady61rveJGqGAPNQglzoJL001HJq9elFLRS6pw25e6geIEmRld9cJ5F/EHFUYa+DQ==",
"dependencies": {
"@thi.ng/bench": "@thi.ng/bench@3.5.1"
}
},
"@thi.ng/api@8.9.31": {
"integrity": "sha512-YuodNQ4TnxV8OIa8xiF9JQ+vBam16W3Z9EbTAAgX/VlQUQ7NEVBbFO8eNGcpyrfOoWdSX4b9JcPbAXuB1dfg1g==",
"dependencies": {}
},
"@thi.ng/bench@3.5.1": {
"integrity": "sha512-ekueeRFmWdXiCB9vnZxzOXKJ9s6ol3injV79hHZXrL+XqjPiP9VyX4fnVvQ/vTCzR27+wYM8fbz3S1veUEF84w==",
"dependencies": {
"@thi.ng/api": "@thi.ng/api@8.9.31"
}
},
"call-bind@1.0.7": {
"integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
"dependencies": {
"es-define-property": "es-define-property@1.0.0",
"es-errors": "es-errors@1.3.0",
"function-bind": "function-bind@1.1.2",
"get-intrinsic": "get-intrinsic@1.2.4",
"set-function-length": "set-function-length@1.2.2"
}
},
"define-data-property@1.1.4": {
"integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
"dependencies": {
"es-define-property": "es-define-property@1.0.0",
"es-errors": "es-errors@1.3.0",
"gopd": "gopd@1.0.1"
}
},
"es-define-property@1.0.0": {
"integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
"dependencies": {
"get-intrinsic": "get-intrinsic@1.2.4"
}
},
"es-errors@1.3.0": {
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"dependencies": {}
},
"function-bind@1.1.2": {
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"dependencies": {}
},
"get-intrinsic@1.2.4": {
"integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
"dependencies": {
"es-errors": "es-errors@1.3.0",
"function-bind": "function-bind@1.1.2",
"has-proto": "has-proto@1.0.3",
"has-symbols": "has-symbols@1.0.3",
"hasown": "hasown@2.0.2"
}
},
"gopd@1.0.1": {
"integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
"dependencies": {
"get-intrinsic": "get-intrinsic@1.2.4"
}
},
"has-property-descriptors@1.0.2": {
"integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
"dependencies": {
"es-define-property": "es-define-property@1.0.0"
}
},
"has-proto@1.0.3": {
"integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
"dependencies": {}
},
"has-symbols@1.0.3": {
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
"dependencies": {}
},
"hasown@2.0.2": {
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"dependencies": {
"function-bind": "function-bind@1.1.2"
}
},
"isarray@2.0.5": {
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
"dependencies": {}
},
"json-stable-stringify@1.1.1": {
"integrity": "sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==",
"dependencies": {
"call-bind": "call-bind@1.0.7",
"isarray": "isarray@2.0.5",
"jsonify": "jsonify@0.0.1",
"object-keys": "object-keys@1.1.1"
}
},
"jsonify@0.0.1": {
"integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==",
"dependencies": {}
},
"object-hash@3.0.0": {
"integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",
"dependencies": {}
},
"object-keys@1.1.1": {
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
"dependencies": {}
},
"set-function-length@1.2.2": {
"integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
"dependencies": {
"define-data-property": "define-data-property@1.1.4",
"es-errors": "es-errors@1.3.0",
"function-bind": "function-bind@1.1.2",
"get-intrinsic": "get-intrinsic@1.2.4",
"gopd": "gopd@1.0.1",
"has-property-descriptors": "has-property-descriptors@1.0.2"
}
}
}
},
"remote": {}
}
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"
]
}

0 comments on commit 006472e

Please sign in to comment.