Skip to content

Commit a248b5a

Browse files
committed
first commit
0 parents  commit a248b5a

File tree

9 files changed

+147
-0
lines changed

9 files changed

+147
-0
lines changed

.github/workflows/ci.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
deno-version: [v1.x]
15+
steps:
16+
- name: Git Checkout Deno Module
17+
uses: actions/checkout@v2
18+
- name: Use Deno Version ${{ matrix.deno-version }}
19+
uses: denoland/setup-deno@v1
20+
with:
21+
deno-version: ${{ matrix.deno-version }}
22+
- name: Format
23+
run: deno fmt --check
24+
- name: Lint
25+
run: deno lint
26+
- name: Unit Test
27+
run: deno test --coverage=coverage
28+
- name: Create coverage report
29+
run: deno coverage ./coverage --lcov > coverage.lcov
30+
- name: Collect coverage
31+
uses: codecov/[email protected]
32+
with:
33+
file: ./coverage.lcov
34+
- name: Build Module
35+
run: deno task build:npm

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.npm
2+
deno.lock

.vscode/extensions.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"denoland.vscode-deno",
4+
"streetsidesoftware.code-spell-checker"
5+
]
6+
}

.vscode/settings.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"deno.enable": true,
3+
"deno.lint": true,
4+
"deno.unstable": true,
5+
"editor.formatOnSave": true,
6+
"editor.defaultFormatter": "denoland.vscode-deno",
7+
"cSpell.words": []
8+
}

LICENSE

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2022-2022 Changwan Jun
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# weakref
2+
3+
<a href="https://github.com/denostack"><img src="https://raw.githubusercontent.com/denostack/images/main/logo.svg" width="240" /></a>
4+
5+
<p>
6+
<a href="https://github.com/denostack/weakref/actions"><img alt="Build" src="https://img.shields.io/github/actions/workflow/status/denostack/weakref/ci.yml?branch=main&logo=github&style=flat-square" /></a>
7+
<a href="https://codecov.io/gh/denostack/weakref"><img alt="Coverage" src="https://img.shields.io/codecov/c/gh/denostack/weakref?style=flat-square" /></a>
8+
<img alt="License" src="https://img.shields.io/npm/l/weakref.svg?style=flat-square" />
9+
<img alt="Language Typescript" src="https://img.shields.io/badge/language-Typescript-007acc.svg?style=flat-square" />
10+
<br />
11+
<a href="https://deno.land/x/weakref"><img alt="deno.land/x/weakref" src="https://img.shields.io/badge/dynamic/json?url=https://api.github.com/repos/denostack/weakref/tags&query=$[0].name&display_name=tag&label=deno.land/x/weakref@&style=flat-square&logo=deno&labelColor=000&color=777" /></a>
12+
<a href="https://www.npmjs.com/package/weakref"><img alt="Version" src="https://img.shields.io/npm/v/weakref.svg?style=flat-square&logo=npm" /></a>
13+
<a href="https://npmcharts.com/compare/weakref?minimal=true"><img alt="Downloads" src="https://img.shields.io/npm/dt/weakref.svg?style=flat-square" /></a>
14+
</p>

deno.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"imports": {
3+
"dnt/": "https://deno.land/x/[email protected]/",
4+
"fmt/": "https://deno.land/[email protected]/fmt/",
5+
"testing/": "https://deno.land/[email protected]/testing/"
6+
},
7+
"lint": {
8+
"files": {
9+
"exclude": [".npm"]
10+
}
11+
},
12+
"fmt": {
13+
"files": {
14+
"exclude": [".npm"]
15+
}
16+
},
17+
"tasks": {
18+
"test": "deno task test:unit && deno task test:lint && deno task test:format && deno task test:types",
19+
"test:format": "deno fmt --check",
20+
"test:lint": "deno lint",
21+
"test:unit": "deno test -A",
22+
"test:types": "deno check mod.ts",
23+
"build:npm": "deno run --allow-env --allow-read --allow-write --allow-net --allow-run scripts/build_npm.ts"
24+
}
25+
}

mod.ts

Whitespace-only changes.

scripts/build_npm.ts

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { build, emptyDir } from "dnt/mod.ts";
2+
import { bgGreen } from "fmt/colors.ts";
3+
4+
const cmd = Deno.run({
5+
cmd: ["git", "describe", "--tags", "--abbrev=0"],
6+
stdout: "piped",
7+
});
8+
const version = new TextDecoder().decode(await cmd.output()).trim();
9+
cmd.close();
10+
11+
console.log(bgGreen(`version: ${version}`));
12+
13+
await emptyDir("./.npm");
14+
15+
await build({
16+
entryPoints: [
17+
"./mod.ts",
18+
],
19+
outDir: "./.npm",
20+
test: false,
21+
compilerOptions: {
22+
lib: ["es2022"],
23+
},
24+
package: {
25+
name: "weakref",
26+
version,
27+
description:
28+
"weakref is a library for weak references. It provides IterableWeakSet, and IterableWeakMap",
29+
keywords: [
30+
"weakref",
31+
"weakset",
32+
"weakmap",
33+
"weak",
34+
"iterable",
35+
],
36+
license: "MIT",
37+
repository: {
38+
type: "git",
39+
url: "git+https://github.com/denostack/weakref.git",
40+
},
41+
bugs: {
42+
url: "https://github.com/denostack/weakref/issues",
43+
},
44+
},
45+
});
46+
47+
// post build steps
48+
Deno.copyFileSync("README.md", ".npm/README.md");

0 commit comments

Comments
 (0)