Skip to content

Commit f49ea0a

Browse files
committed
feat: initial commit
0 parents  commit f49ea0a

File tree

18 files changed

+538
-0
lines changed

18 files changed

+538
-0
lines changed

.eslintrc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-env node */
2+
// This file is managed by code-skeleton. Do not make changes.
3+
module.exports = {
4+
extends: [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
8+
"plugin:@typescript-eslint/strict",
9+
],
10+
rules: {
11+
semi: "off", // have to disable eslint's core semicolon rules before enabling typescript-eslint's
12+
"@typescript-eslint/semi": "error",
13+
"@typescript-eslint/member-delimiter-style": "error",
14+
quotes: ["error", "double", { "avoidEscape": true }],
15+
},
16+
ignorePatterns: ["coverage", "prisma/client/**/*"],
17+
overrides: [{
18+
files: ["test/**/*"],
19+
rules: {
20+
"@typescript-eslint/no-non-null-assertion": "off",
21+
},
22+
}],
23+
parser: "@typescript-eslint/parser",
24+
parserOptions: {
25+
project: ["tsconfig.json"],
26+
},
27+
plugins: [
28+
"@typescript-eslint",
29+
],
30+
root: true,
31+
};

.github/matchers/tap.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"//": "This file is managed by code-skeleton. Do not make changes",
3+
"problemMatcher": [
4+
{
5+
"owner": "tap",
6+
"pattern": [
7+
{
8+
"regexp": "^\\s*not ok \\d+ - (.*)",
9+
"message": 1
10+
},
11+
{
12+
"regexp": "^\\s*---"
13+
},
14+
{
15+
"regexp": "^\\s*at:"
16+
},
17+
{
18+
"regexp": "^\\s*line:\\s*(\\d+)",
19+
"line": 1
20+
},
21+
{
22+
"regexp": "^\\s*column:\\s*(\\d+)",
23+
"column": 1
24+
},
25+
{
26+
"regexp": "^\\s*file:\\s*(.*)",
27+
"file": 1
28+
}
29+
]
30+
}
31+
]
32+
}

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This file is managed by code-skeleton. Do not make changes.
2+
name: CI
3+
4+
on:
5+
workflow_dispatch:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
schedule:
11+
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
12+
- cron: "0 9 * * 1"
13+
14+
jobs:
15+
lint:
16+
name: Lint
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
shell: bash
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Setup node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 18.x
28+
- name: Update npm
29+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
30+
- name: Install dependencies
31+
run: npm i --no-audit --no-fund
32+
- name: Lint
33+
run: npm run lint
34+
35+
test:
36+
name: Test
37+
runs-on: ubuntu-latest
38+
defaults:
39+
run:
40+
shell: bash
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v3
44+
- name: Setup node
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: 18.x
48+
- name: Update npm
49+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
50+
- name: Install dependencies
51+
run: npm i --no-audit --no-fund
52+
- name: Add tap problem matcher
53+
run: echo "::add-matcher::.github/matchers/tap.json"
54+
- name: Test
55+
run: npm test --ignore-scripts

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This file is managed by code-skeleton. Do not make changes.
2+
# ignore everything in the root
3+
/*
4+
5+
# keep these
6+
!**/.gitignore
7+
!/.eslintrc.js
8+
!/.github/
9+
!/.gitignore
10+
!/.npmrc
11+
!/bin/
12+
!/CHANGELOG*
13+
!/docs/
14+
!/lib/
15+
!/LICENSE*
16+
!/package.json
17+
!/README*
18+
!/scripts/
19+
!/tap-snapshots/
20+
!/test/
21+
!/tsconfig*.json
22+
23+
# re-ignore typescript output artifacts
24+
/bin/**/*.js
25+
/bin/**/*.d.ts
26+
/lib/**/*.js
27+
/lib/**/*.d.ts
28+
/scripts/**/*.js
29+
/scripts/**/*.d.ts
30+
/test/**/*.js
31+
/test/**/*.d.ts
32+
33+
# make sure we keep type defs for external libs
34+
!/lib/types/*/*.d.ts

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
; This file is managed by code-skeleton. Do not make changes.
2+
package-lock=false

lib/content/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# we want to keep everything in this directory
2+
3+
!**/*

lib/content/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This file is managed by code-skeleton. Do not make changes.
2+
name: CI
3+
4+
on:
5+
workflow_dispatch:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
schedule:
11+
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
12+
- cron: "0 9 * * 1"
13+
14+
jobs:
15+
lint:
16+
name: Lint
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
shell: bash
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Setup node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 18.x
28+
- name: Update npm
29+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
30+
- name: Install dependencies
31+
run: npm i --no-audit --no-fund
32+
- name: Lint
33+
run: npm run lint
34+
35+
test:
36+
name: Test
37+
runs-on: ubuntu-latest
38+
defaults:
39+
run:
40+
shell: bash
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v3
44+
- name: Setup node
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: 18.x
48+
- name: Update npm
49+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
50+
- name: Install dependencies
51+
run: npm i --no-audit --no-fund
52+
- name: Add tap problem matcher
53+
run: echo "::add-matcher::.github/matchers/tap.json"
54+
- name: Test
55+
run: npm test --ignore-scripts

lib/content/clean.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env ts-node
2+
"use strict";
3+
// This file is managed by code-skeleton. Do not make changes.
4+
Object.defineProperty(exports, "__esModule", { value: true });
5+
const node_fs_1 = require("node:fs");
6+
const node_path_1 = require("node:path");
7+
const child_process_1 = require("child_process");
8+
const ROOT = (0, node_path_1.dirname)(__dirname);
9+
const lsFilesResult = (0, child_process_1.spawnSync)("git", ["ls-files", "--other", "--ignored", "--exclude-standard", "--directory"], {
10+
cwd: ROOT,
11+
shell: true,
12+
encoding: "utf8",
13+
});
14+
const toRemove = lsFilesResult.stdout.split("\n")
15+
.filter(Boolean)
16+
.filter((file) => file !== "node_modules/");
17+
for (const file of toRemove) {
18+
(0, node_fs_1.rmSync)((0, node_path_1.join)(ROOT, file), { recursive: true });
19+
}

lib/content/clean.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env ts-node
2+
// This file is managed by code-skeleton. Do not make changes.
3+
4+
import { rmSync } from "node:fs";
5+
import { dirname, join } from "node:path";
6+
import { spawnSync } from "child_process";
7+
8+
const ROOT = dirname(__dirname);
9+
const lsFilesResult = spawnSync("git", ["ls-files", "--other", "--ignored", "--exclude-standard", "--directory"], {
10+
cwd: ROOT,
11+
shell: true,
12+
encoding: "utf8",
13+
});
14+
15+
const toRemove = lsFilesResult.stdout.split("\n")
16+
.filter(Boolean)
17+
.filter((file) => file !== "node_modules/");
18+
19+
for (const file of toRemove) {
20+
rmSync(join(ROOT, file), { recursive: true });
21+
}

lib/content/eslintrc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-env node */
2+
// This file is managed by code-skeleton. Do not make changes.
3+
module.exports = {
4+
extends: [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
8+
"plugin:@typescript-eslint/strict",
9+
],
10+
rules: {
11+
semi: "off", // have to disable eslint's core semicolon rules before enabling typescript-eslint's
12+
"@typescript-eslint/semi": "error",
13+
"@typescript-eslint/member-delimiter-style": "error",
14+
quotes: ["error", "double", { "avoidEscape": true }],
15+
},
16+
ignorePatterns: ["coverage", "prisma/client/**/*"],
17+
overrides: [{
18+
files: ["test/**/*"],
19+
rules: {
20+
"@typescript-eslint/no-non-null-assertion": "off",
21+
},
22+
}],
23+
parser: "@typescript-eslint/parser",
24+
parserOptions: {
25+
project: ["tsconfig.json"],
26+
},
27+
plugins: [
28+
"@typescript-eslint",
29+
],
30+
root: true,
31+
};

0 commit comments

Comments
 (0)