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

Commit 3447b35

Browse files
committed
first commit
0 parents  commit 3447b35

File tree

10 files changed

+166
-0
lines changed

10 files changed

+166
-0
lines changed

.editorconfig

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

.gitignore

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

.vscode/settings.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"[jsonc]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
},
5+
"[yaml]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[typescript]": {
9+
"editor.defaultFormatter": "dprint.dprint"
10+
},
11+
"[markdown]": {
12+
"editor.defaultFormatter": "dprint.dprint"
13+
},
14+
"deno.codeLens.testArgs": ["-A", "-L=info"],
15+
"deno.config": "./deno.jsonc",
16+
"deno.suggest.imports.hosts": {
17+
"https://deno.land": true
18+
},
19+
"deno.enable": true,
20+
"deno.lint": true,
21+
"editor.defaultFormatter": "dprint.dprint",
22+
"editor.formatOnSave": true,
23+
"editor.tabSize": 2,
24+
"files.watcherExclude": {
25+
"**/.git/objects/**": true,
26+
"**/.git/subtree-cache/**": true
27+
},
28+
"prettier.printWidth": 100,
29+
"ltex.disabledRules": {
30+
"en-US": ["MORFOLOGIK_RULE_EN_US"]
31+
},
32+
"markdownlint.config": {
33+
"MD013": false,
34+
"MD024": false,
35+
"MD033": false
36+
}
37+
}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Star
2+
3+
A tiny utility for type-checking all TypeScript files within a directory
4+
5+
```sh
6+
deno run -A https://deno.land/x/star/main.ts -c
7+
```

cspell.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3+
"version": "0.2",
4+
"dictionaryDefinitions": [
5+
{
6+
"name": "project-words",
7+
"path": "words.txt",
8+
"addWords": true
9+
}
10+
],
11+
"enableGlobDot": true,
12+
"dictionaries": ["project-words"],
13+
"ignorePaths": [
14+
"**/__snapshots__/*.snap",
15+
".git",
16+
"target"
17+
]
18+
}
19+

deno.jsonc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"compilerOptions": {
3+
"checkJs": false,
4+
"noFallthroughCasesInSwitch": true,
5+
"noImplicitOverride": true,
6+
"noImplicitReturns": true,
7+
"noUncheckedIndexedAccess": true,
8+
"useUnknownInCatchVariables": true
9+
},
10+
"include": ["."],
11+
"lock": false,
12+
"lint": {
13+
"files": {
14+
"include": ["."]
15+
},
16+
"rules": {
17+
"exclude": [
18+
"no-empty-interface",
19+
"no-explicit-any",
20+
"no-namespace",
21+
"no-empty",
22+
"no-extra-semi",
23+
"ban-types",
24+
"require-await"
25+
],
26+
"tags": ["recommended"]
27+
}
28+
}
29+
}

dprint.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"incremental": true,
3+
"indentWidth": 2,
4+
"lineWidth": 100,
5+
"typescript": {
6+
"quoteProps": "asNeeded",
7+
"arrowFunction.useParentheses": "force",
8+
"semiColons": "asi"
9+
},
10+
"markdown": {
11+
"lineWidth": 80,
12+
"textWrap": "always"
13+
},
14+
"includes": ["**.{json,md,ts}"],
15+
"plugins": [
16+
"https://plugins.dprint.dev/json-0.17.2.wasm",
17+
"https://plugins.dprint.dev/markdown-0.15.2.wasm",
18+
"https://plugins.dprint.dev/typescript-0.84.4.wasm"
19+
]
20+
}

main.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { parse } from "https://deno.land/[email protected]/flags/mod.ts"
2+
import * as fs from "https://deno.land/[email protected]/fs/mod.ts"
3+
import * as path from "https://deno.land/[email protected]/path/mod.ts"
4+
5+
const { dest: destRaw, exclude: excludeRaw, check } = parse(Deno.args, {
6+
string: ["dest"],
7+
boolean: ["check"],
8+
default: { dest: "target/star.ts" },
9+
collect: ["exclude"],
10+
alias: {
11+
d: "dest",
12+
e: "exclude",
13+
c: "check",
14+
},
15+
})
16+
17+
const dest = path.join(Deno.cwd(), destRaw)
18+
const destDir = path.dirname(dest)
19+
20+
let generated = ""
21+
for await (
22+
const entry of fs.walk(".", {
23+
match: [/\.ts$/],
24+
skip: [destRaw, ...((excludeRaw ?? []) as string[])].map((g) => path.globToRegExp(g)),
25+
})
26+
) {
27+
generated += `import ${JSON.stringify(path.relative(destDir, entry.path))}\n`
28+
}
29+
30+
await fs.ensureDir(destDir)
31+
await Deno.writeTextFile(dest, generated)
32+
33+
if (check) {
34+
new Deno.Command("deno", {
35+
args: ["cache", dest, "--check"],
36+
stderr: "inherit",
37+
stdout: "inherit",
38+
}).spawn()
39+
}

target/star.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "../main.ts"

words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deno

0 commit comments

Comments
 (0)