Skip to content

Commit 006472e

Browse files
committed
feat: author package with deno
1 parent 65f5ee8 commit 006472e

20 files changed

+890
-1106
lines changed

.github/workflows/ci.yml

+32-21
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,43 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
6-
pull_request: {}
5+
workflow_call:
76

87
jobs:
9-
test:
10-
name: Node.js v${{ matrix.node }}
8+
deno:
119
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
node: [16, 18, 20]
1510
steps:
16-
- uses: actions/checkout@main
11+
- uses: actions/checkout@v3
1712

18-
- name: (env) setup pnpm
19-
uses: pnpm/action-setup@master
13+
- uses: denoland/setup-deno@v1
2014
with:
21-
version: 8.6.5
15+
deno-version: v1.x
2216

23-
- name: (env) setup node v${{ matrix.node }}
24-
uses: actions/setup-node@main
17+
- run: deno fmt --check
18+
- run: deno lint
19+
- run: deno check scripts/*.ts *.ts
20+
21+
- name: Tests
22+
run: |-
23+
deno test --coverage=cov/
24+
deno coverage cov/
25+
26+
npm:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: denoland/setup-deno@v1
31+
with:
32+
deno-version: v1.x
33+
34+
- run: deno task build
35+
36+
bencmark:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
- uses: denoland/setup-deno@v1
2541
with:
26-
node-version: ${{ matrix.node }}
27-
cache: pnpm
28-
check-latest: true
29-
30-
- run: pnpm install --ignore-scripts
31-
- run: pnpm run build
32-
- run: pnpm run test
33-
- run: pnpm run typecheck
42+
deno-version: v1.x
43+
44+
- run: deno run bench/index.ts

.gitignore

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
node_modules
21
.DS_Store
3-
*-lock.json
4-
*.lock
5-
*.log
6-
7-
/coverage
8-
/.nyc_output
9-
10-
# Editors
11-
*.iml
12-
/.idea
13-
/.vscode
14-
15-
/index.js
16-
/index.mjs
17-
/index.d.ts
2+
node_modules
3+
/npm
4+
*.lcov
5+
/cov

.prettierignore

-1
This file was deleted.

bench/deno.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

bench/deno.lock

+133
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bench/index.js bench/index.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { suite } from '@marais/bench';
1+
import { suite } from 'npm:@marais/bench';
22

3-
import objectHash from 'object-hash';
4-
import { identify } from 'object-identity';
5-
import jsonStableStringify from 'json-stable-stringify';
3+
import objectHash from 'npm:object-hash';
4+
import jsonStableStringify from 'npm:json-stable-stringify';
5+
6+
import { identify } from '../mod.ts';
67

78
const getObject = () => {
89
const c = [1];
9-
// @ts-ignore
10+
// @ts-expect-error circular
1011
c.push(c);
1112
return {
1213
a: { b: ['c', new Set(['d', new Map([['e', 'f']]), c, 'g'])] },
@@ -15,7 +16,7 @@ const getObject = () => {
1516
};
1617
};
1718

18-
suite(
19+
suite<any>(
1920
{
2021
'object-identity'() {
2122
return (o) => identify(o);

bench/package.json

-9
This file was deleted.

bench/pnpm-lock.yaml

-59
This file was deleted.

deno.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"version": "0.1.2",
3+
"name": "@mr/object-identity",
4+
"tasks": {
5+
"build": "deno run -A scripts/build.ts"
6+
},
7+
"imports": {
8+
"@deno/dnt": "jsr:@deno/dnt@^0.41.0",
9+
"@std/assert": "jsr:@std/assert@^0.221.0"
10+
},
11+
"lint": {
12+
"rules": {
13+
"exclude": [
14+
"no-var",
15+
"prefer-const",
16+
"no-cond-assign",
17+
"no-inner-declarations",
18+
"no-explicit-any",
19+
"no-fallthrough"
20+
]
21+
}
22+
},
23+
"fmt": {
24+
"lineWidth": 100,
25+
"singleQuote": true,
26+
"useTabs": true
27+
},
28+
"exclude": [
29+
"npm"
30+
]
31+
}

0 commit comments

Comments
 (0)