Skip to content

Commit 696b158

Browse files
committed
Run typecheck on CI
1 parent 9d933dc commit 696b158

File tree

7 files changed

+51
-85
lines changed

7 files changed

+51
-85
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ jobs:
2020
- name: Install Dependencies
2121
run: yarn --frozen-lockfile
2222

23+
- name: Typecheck
24+
run: yarn typecheck
25+
2326
- name: Test
2427
run: yarn test

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@
1212
"@changesets/write": "^0.1.6",
1313
"@types/fs-extra": "^8.0.0",
1414
"@types/jest": "^29.5.1",
15-
"@types/node": "^20.11.17",
15+
"@types/node": "^22.15.17",
1616
"@types/semver": "^7.5.0",
1717
"@vercel/ncc": "^0.36.1",
1818
"babel-jest": "^29.5.0",
1919
"fixturez": "^1.1.0",
2020
"husky": "^3.0.3",
2121
"jest": "^29.5.0",
2222
"prettier": "^2.0.5",
23-
"typescript": "^5.0.4"
23+
"typescript": "^5.8.3"
2424
},
2525
"scripts": {
2626
"build": "ncc build src/index.ts -o dist --transpile-only --minify",
2727
"test": "jest",
2828
"test:watch": "yarn test --watch",
29+
"typecheck": "tsc",
2930
"changeset": "changeset",
3031
"bump": "node ./scripts/bump.js",
3132
"release": "node ./scripts/release.js"
@@ -43,6 +44,7 @@
4344
"@manypkg/get-packages": "^1.1.3",
4445
"@octokit/core": "^5.2.1",
4546
"@octokit/plugin-throttling": "^8.0.0",
47+
"@types/mdast": "^3.0.0",
4648
"fs-extra": "^8.1.0",
4749
"mdast-util-to-string": "^1.0.6",
4850
"remark-parse": "^7.0.1",

src/run.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe("version", () => {
8181

8282
await runVersion({
8383
octokit: setupOctokit("@@GITHUB_TOKEN"),
84-
git: new Git(),
84+
git: new Git({ cwd }),
8585
cwd,
8686
});
8787

@@ -115,7 +115,7 @@ describe("version", () => {
115115

116116
await runVersion({
117117
octokit: setupOctokit("@@GITHUB_TOKEN"),
118-
git: new Git(),
118+
git: new Git({ cwd }),
119119
cwd,
120120
});
121121

@@ -149,7 +149,7 @@ describe("version", () => {
149149

150150
await runVersion({
151151
octokit: setupOctokit("@@GITHUB_TOKEN"),
152-
git: new Git(),
152+
git: new Git({ cwd }),
153153
cwd,
154154
});
155155

@@ -203,7 +203,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
203203

204204
await runVersion({
205205
octokit: setupOctokit("@@GITHUB_TOKEN"),
206-
git: new Git(),
206+
git: new Git({ cwd }),
207207
cwd,
208208
prBodyMaxCharacters: 1000,
209209
});
@@ -261,7 +261,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
261261

262262
await runVersion({
263263
octokit: setupOctokit("@@GITHUB_TOKEN"),
264-
git: new Git(),
264+
git: new Git({ cwd }),
265265
cwd,
266266
prBodyMaxCharacters: 500,
267267
});

src/utils.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unified from "unified";
22
import remarkParse from "remark-parse";
33
import remarkStringify from "remark-stringify";
4+
import type { Root } from "mdast";
45
// @ts-ignore
56
import mdastToString from "mdast-util-to-string";
67
import { getPackages, Package } from "@manypkg/get-packages";
@@ -35,11 +36,11 @@ export async function getChangedPackages(
3536
}
3637

3738
export function getChangelogEntry(changelog: string, version: string) {
38-
let ast = unified().use(remarkParse).parse(changelog);
39+
let ast = unified().use(remarkParse).parse(changelog) as Root;
3940

4041
let highestLevel: number = BumpLevels.dep;
4142

42-
let nodes = ast.children as Array<any>;
43+
let nodes = ast.children;
4344
let headingStartInfo:
4445
| {
4546
index: number;
@@ -75,10 +76,7 @@ export function getChangelogEntry(changelog: string, version: string) {
7576
}
7677
}
7778
if (headingStartInfo) {
78-
ast.children = (ast.children as any).slice(
79-
headingStartInfo.index + 1,
80-
endIndex
81-
);
79+
ast.children = ast.children.slice(headingStartInfo.index + 1, endIndex);
8280
}
8381
return {
8482
content: unified().use(remarkStringify).stringify(ast),

tsconfig.json

Lines changed: 7 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,11 @@
11
{
22
"compilerOptions": {
3-
/* Basic Options */
4-
// "incremental": true, /* Enable incremental compilation */
5-
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
6-
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
7-
// "lib": [], /* Specify library files to be included in the compilation. */
8-
// "allowJs": true, /* Allow javascript files to be compiled. */
9-
// "checkJs": true, /* Report errors in .js files. */
10-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
11-
// "declaration": true, /* Generates corresponding '.d.ts' file. */
12-
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
13-
// "sourceMap": true, /* Generates corresponding '.map' file. */
14-
// "outFile": "./", /* Concatenate and emit output to single file. */
15-
// "outDir": "./", /* Redirect output structure to the directory. */
16-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
17-
// "composite": true, /* Enable project compilation */
18-
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
19-
// "removeComments": true, /* Do not emit comments to output. */
20-
"noEmit": true /* Do not emit outputs. */,
21-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
22-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
23-
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
24-
25-
/* Strict Type-Checking Options */
26-
"strict": true /* Enable all strict type-checking options. */,
27-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
28-
// "strictNullChecks": true, /* Enable strict null checks. */
29-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
30-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
31-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
32-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
33-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
34-
35-
/* Additional Checks */
36-
// "noUnusedLocals": true, /* Report errors on unused locals. */
37-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
38-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
39-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
40-
41-
/* Module Resolution Options */
42-
"moduleResolution": "nodenext", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
43-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
44-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
45-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
46-
// "typeRoots": [], /* List of folders to include type definitions from. */
47-
// "types": [], /* Type declaration files to be included in compilation. */
48-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
49-
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
50-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
51-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
52-
53-
/* Source Map Options */
54-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
55-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
56-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
57-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
58-
59-
/* Experimental Options */
60-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
61-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
3+
"target": "esnext",
4+
"module": "node18",
5+
"noEmit": true,
6+
"isolatedModules": true,
7+
"strict": true,
8+
"moduleResolution": "node16",
9+
"erasableSyntaxOnly": true
6210
}
6311
}

yarn.lock

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,13 @@
17331733
expect "^29.0.0"
17341734
pretty-format "^29.0.0"
17351735

1736+
"@types/mdast@^3.0.0":
1737+
version "3.0.15"
1738+
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.15.tgz#49c524a263f30ffa28b71ae282f813ed000ab9f5"
1739+
integrity sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==
1740+
dependencies:
1741+
"@types/unist" "^2"
1742+
17361743
"@types/minimist@^1.2.0":
17371744
version "1.2.2"
17381745
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
@@ -1748,12 +1755,12 @@
17481755
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240"
17491756
integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==
17501757

1751-
"@types/node@^20.11.17":
1752-
version "20.11.17"
1753-
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.17.tgz#cdd642d0e62ef3a861f88ddbc2b61e32578a9292"
1754-
integrity sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==
1758+
"@types/node@^22.15.17":
1759+
version "22.15.17"
1760+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.17.tgz#355ccec95f705b664e4332bb64a7f07db30b7055"
1761+
integrity sha512-wIX2aSZL5FE+MR0JlvF87BNVrtFWf6AE6rxSE9X7OwnVvoyCQjpzSRJ+M87se/4QCkCiebQAqrJ0y6fwIyi7nw==
17551762
dependencies:
1756-
undici-types "~5.26.4"
1763+
undici-types "~6.21.0"
17571764

17581765
"@types/normalize-package-data@^2.4.0":
17591766
version "2.4.1"
@@ -1780,6 +1787,11 @@
17801787
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"
17811788
integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==
17821789

1790+
"@types/unist@^2":
1791+
version "2.0.11"
1792+
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.11.tgz#11af57b127e32487774841f7a4e54eab166d03c4"
1793+
integrity sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==
1794+
17831795
"@types/unist@^2.0.0", "@types/unist@^2.0.2":
17841796
version "2.0.6"
17851797
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
@@ -4959,10 +4971,10 @@ typed-array-length@^1.0.4:
49594971
for-each "^0.3.3"
49604972
is-typed-array "^1.1.9"
49614973

4962-
typescript@^5.0.4:
4963-
version "5.0.4"
4964-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
4965-
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
4974+
typescript@^5.8.3:
4975+
version "5.8.3"
4976+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e"
4977+
integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==
49664978

49674979
unbox-primitive@^1.0.2:
49684980
version "1.0.2"
@@ -4974,10 +4986,10 @@ unbox-primitive@^1.0.2:
49744986
has-symbols "^1.0.3"
49754987
which-boxed-primitive "^1.0.2"
49764988

4977-
undici-types@~5.26.4:
4978-
version "5.26.5"
4979-
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
4980-
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
4989+
undici-types@~6.21.0:
4990+
version "6.21.0"
4991+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
4992+
integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
49814993

49824994
undici@^5.25.4, undici@^5.28.5:
49834995
version "5.29.0"

0 commit comments

Comments
 (0)