Skip to content

Commit c0bee88

Browse files
committed
added temp boilerplate codes and shims.
1 parent 5000746 commit c0bee88

36 files changed

+381
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ etc/coverage/*.json
2626
etc/coverage/cov_profile.lcov
2727

2828
# hidden
29-
tmp/
29+
tmp/_hidden/

src/shims/error-event/error-event.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Taken from: https://github.com/oakserver/oak/blob/main/node_shims.ts
2+
// Copyright 2018-2022 the oak authors. All rights reserved. MIT license.
3+
4+
export class ErrorEvent extends Event {
5+
#message: string;
6+
#filename: string;
7+
#lineno: number;
8+
#colno: number;
9+
// deno-lint-ignore no-explicit-any
10+
#error: any;
11+
12+
get message(): string {
13+
return this.#message;
14+
}
15+
get filename(): string {
16+
return this.#filename;
17+
}
18+
get lineno(): number {
19+
return this.#lineno;
20+
}
21+
get colno(): number {
22+
return this.#colno;
23+
}
24+
// deno-lint-ignore no-explicit-any
25+
get error(): any {
26+
return this.#error;
27+
}
28+
29+
constructor(type: string, eventInitDict: ErrorEventInit = {}) {
30+
super(type, eventInitDict);
31+
const { message = "error", filename = "", lineno = 0, colno = 0, error } =
32+
eventInitDict;
33+
this.#message = message;
34+
this.#filename = filename;
35+
this.#lineno = lineno;
36+
this.#colno = colno;
37+
this.#error = error;
38+
}
39+
}

src/shims/error-event/oak-LICENSE

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

tmp/boilerplate/.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*.md]
4+
trim_trailing_whitespace = false
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

tmp/boilerplate/.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text eol=lf
3+
4+
*.png binary
5+
*.jpg binary
6+
*.ico binary
7+
*.jpg binary
8+
*.eot binary
9+
*.ttf binary
10+
*.woff binary
11+
*.woff2 binary

tmp/boilerplate/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# OS-specific files
4+
.DS_Store
5+
Thumbs.db
6+
7+
# Editor metadata
8+
.vscode/*
9+
!.vscode/extensions.json
10+
!.vscode/settings.json
11+
.idea/
12+
13+
# local API keys and secrets
14+
.env.local
15+
.env.*.local
16+
17+
# sensitive files
18+
*.pem
19+
*.swp
20+
21+
# typescript
22+
*.tsbuildinfo
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"denoland.vscode-deno"
4+
]
5+
}

tmp/boilerplate/.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"deno.enable": true,
3+
"deno.lint": true,
4+
"deno.unstable": true,
5+
"editor.defaultFormatter": "denoland.vscode-deno"
6+
}

tmp/boilerplate/deno.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true
4+
},
5+
"lint": {
6+
"files": {
7+
"include": [
8+
"src/",
9+
"mod.ts",
10+
"*.md",
11+
"*.json"
12+
],
13+
"exclude": []
14+
},
15+
"rules": {
16+
"tags": [
17+
"recommended"
18+
],
19+
"include": [],
20+
"exclude": []
21+
}
22+
},
23+
"fmt": {
24+
"files": {
25+
"include": [
26+
"src/",
27+
"mod.ts",
28+
"*.md",
29+
"*.json"
30+
],
31+
"exclude": []
32+
}
33+
},
34+
"test": {
35+
"files": {
36+
"include": [
37+
"src/"
38+
],
39+
"exclude": []
40+
}
41+
},
42+
"tasks": {
43+
"test": "deno test ./src/ --coverage=./etc/cov_profile",
44+
"test:coverage": "deno coverage ./etc/cov_profile",
45+
"test:generate-lcov": "deno coverage ./etc/cov_profile --lcov > ./etc/cov_profile/cov_profile.lcov",
46+
"bench": "deno bench ./src/ --unstable",
47+
"start": "deno run -A --watch=src/,public/ dev.ts"
48+
},
49+
"importMap": "./import_map.json"
50+
}

tmp/boilerplate/dev.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)