Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 26096ee

Browse files
Merge pull request #5 from Tsukina-7mochi/refactor
Refactored and re-implemented all scripts
2 parents 609949b + 3790425 commit 26096ee

File tree

143 files changed

+4873
-2725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4873
-2725
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# test coverage
2+
coverage
3+
14
*.orig
25
*.pyc
36
*.swp
@@ -36,4 +39,4 @@ cli/tests/.test_coverage/
3639

3740
# WPT generated cert files
3841
/tools/wpt/certs/index.txt*
39-
/tools/wpt/certs/serial*
42+
/tools/wpt/certs/serial*

deno.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
{
2+
"importMap": "import_map.json",
23
"compilerOptions": {
34
"allowJs": true,
45
"strict": true,
56
"strictNullChecks": true,
67
"noImplicitThis": true,
78
"noImplicitAny": true,
89
"noUnusedParameters": true,
10+
"noImplicitReturns": true,
911
"lib": [
1012
"ESNext",
1113
"deno.window"
1214
]
1315
},
16+
"exclude": [
17+
"example/*/bundle.js"
18+
],
1419
"lint": {
1520
"include": [
1621
"mod.ts",
17-
"deps.ts"
22+
"deps.ts",
23+
"src/"
1824
],
1925
"rules": {
2026
"tags": [
2127
"recommended"
28+
],
29+
"include": [
30+
"explicit-function-return-type"
2231
]
2332
}
2433
},
2534
"fmt": {
2635
"include": [
2736
"mod.ts",
2837
"deps.ts",
29-
"example/"
38+
"example/",
39+
"src/"
3040
],
3141
"indentWidth": 2,
3242
"lineWidth": 80,
@@ -36,12 +46,7 @@
3646
},
3747
"tasks": {
3848
"build": "bash ./example/cache.sh && deno run -A ./example/build.ts",
39-
"test": "bash ./test/build/cache.sh && deno test -A",
40-
"test:unit": "deno test -A test/unit",
41-
"test:build": "bash ./test/build/cache.sh && deno test -A test/build",
42-
"debug:build": "bash ./example/cache.sh && deno run -A --inspect-brk ./example/build.ts",
43-
"debug:test": "bash ./test/cache.sh && deno test -A --inspect-brk",
44-
"debug:test:unit": "deno test -A --inspect-brk test/unit",
45-
"debug:test:build": "bash ./test/build/cache.sh && deno test -A --inspect-brk test/build"
49+
"test": "deno test -A",
50+
"test:unit": "deno test -A test/unit"
4651
}
4752
}

deno.lock

Lines changed: 143 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * as esbuild from 'https://deno.land/x/esbuild@v0.19.4/mod.js';
2-
export { posix } from 'https://deno.land/std@0.203.0/path/mod.ts';
3-
export * as fs from 'https://deno.land/std@0.203.0/fs/mod.ts';
4-
export { crypto } from 'https://deno.land/std@0.203.0/crypto/mod.ts';
5-
export * as asserts from 'https://deno.land/std@0.203.0/testing/asserts.ts';
2+
export * as path from 'https://deno.land/std@0.214.0/path/mod.ts';
3+
export * as fs from 'https://deno.land/std@0.214.0/fs/mod.ts';
4+
export { crypto } from 'https://deno.land/std@0.214.0/crypto/mod.ts';

example/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

example/build.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

example/cache.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

example/ignore-modules/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bundle.js

example/ignore-modules/build.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { esbuild } from '../../deps.ts';
2+
import esbuildCachePlugin from '../../mod.ts';
3+
4+
const lockMap = JSON.parse(Deno.readTextFileSync('./deno.lock'));
5+
6+
const denoPath = await esbuildCachePlugin.util.getDenoDir();
7+
await esbuild.build({
8+
entryPoints: ['./index.ts'],
9+
bundle: true,
10+
outfile: './bundle.js',
11+
plugins: [
12+
esbuildCachePlugin({
13+
denoCacheDirectory: denoPath,
14+
lockMap,
15+
loaderRules: [
16+
{ test: /^node:/, loader: 'empty' },
17+
],
18+
}),
19+
],
20+
});
21+
22+
await esbuild.stop();

example/ignore-modules/deno.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"tasks": {
3+
"build": "deno run -A build.ts",
4+
"cache": "rm deno.lock && deno cache **/*.ts",
5+
"clean": "rm -f bundle.js",
6+
"run:bundle": "deno run bundle.js",
7+
"run:raw": "deno run index.ts"
8+
}
9+
}

0 commit comments

Comments
 (0)