Skip to content

Commit f8dd341

Browse files
committed
ci: auto publish;
chore: update dependencies
1 parent 088a7de commit f8dd341

File tree

6 files changed

+138
-134
lines changed

6 files changed

+138
-134
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1-
name: Publish
1+
name: Release & Publish
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
tags:
6+
- 'v*'
67

78
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Create Release
16+
id: create_release
17+
uses: actions/create-release@v1
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
tag_name: ${{ github.ref }}
22+
release_name: ${{ github.ref }}
23+
draft: false
24+
prerelease: false
25+
826
publish:
927
runs-on: ubuntu-latest
1028
steps:

.github/workflows/test.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@ name: Test
22

33
on:
44
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- 'README.md'
8+
- 'LICENSE'
9+
- '.editorconfig'
510
branches:
611
- main
712
- master
813
pull_request:
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'LICENSE'
18+
- '.editorconfig'
919
branches:
1020
- main
1121
- master
@@ -17,9 +27,8 @@ jobs:
1727
matrix:
1828
os:
1929
- ubuntu-latest
20-
- macos-latest
2130
- windows-latest
22-
node: [10.x, 12.x, 14.x]
31+
node: [10.x, 12.x, 14.x, 15.x]
2332

2433
steps:
2534
- uses: actions/checkout@v2
@@ -29,7 +38,5 @@ jobs:
2938
node-version: ${{ matrix.node }}
3039
- name: Install modules
3140
run: yarn
32-
- name: Build
33-
run: yarn build
34-
- name: Run tests
41+
- name: Build and Test
3542
run: yarn test

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ Example 1:
3131
* My class
3232
* @notExported
3333
*/
34-
class Cls {
34+
class MyClass {
3535
convert(str: string): string {
3636
return str
3737
}
3838
}
39-
export const me = new Cls()
39+
export const me = new MyClass()
4040
```
4141

4242
Example 2:
@@ -52,7 +52,7 @@ type twoNumbers = [number, number]
5252
type threeNumbers = [number, number, number]
5353

5454
export type twoOrThreeNumbers = twoNumbers | threeNumbers
55-
export function sum2(ns: twoOrThreeNumbers): number {
55+
export function sum(ns: twoOrThreeNumbers): number {
5656
return ns.reduce((a, b) => a + b)
5757
}
5858
```

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"main": "dist/main.js",
66
"scripts": {
77
"build": "rimraf dist && tsc",
8-
"test": "npm run test:gen && npm run test:jest && npm run test:cleanup",
8+
"test": "npm run build && npm run test:gen && npm run test:jest && npm run test:cleanup",
99
"test:cleanup": "rimraf test/docs test/docs2",
1010
"test:gen": "npm run test:cleanup && typedoc --options test/typedoc.json && typedoc --options test/typedoc2.json",
11-
"test:jest": "jest",
11+
"test:jest": "jest --no-cache --runInBand",
1212
"addscope": "node tools/packagejson name @tomchen/typedoc-plugin-not-exported"
1313
},
1414
"publishConfig": {
@@ -42,18 +42,18 @@
4242
},
4343
"devDependencies": {
4444
"@types/jest": "^26.0.20",
45-
"@typescript-eslint/eslint-plugin": "^4.14.1",
46-
"@typescript-eslint/parser": "^4.14.1",
45+
"@typescript-eslint/eslint-plugin": "^4.15.0",
46+
"@typescript-eslint/parser": "^4.15.0",
4747
"cheerio": "^1.0.0-rc.5",
48-
"eslint": "^7.18.0",
48+
"eslint": "^7.20.0",
4949
"eslint-config-prettier": "^7.2.0",
5050
"eslint-plugin-prettier": "^3.3.1",
5151
"jest": "^26.6.3",
5252
"prettier": "^2.2.1",
5353
"rimraf": "^3.0.2",
54-
"ts-jest": "^26.4.4",
55-
"ts-loader": "^8.0.14",
56-
"typedoc": "0.20.16",
57-
"typescript": "^4.1.3"
54+
"ts-jest": "^26.5.1",
55+
"ts-loader": "^8.0.17",
56+
"typedoc": "0.20.24",
57+
"typescript": "^4.1.5"
5858
}
5959
}

src/main.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ exports.load = function ({ application }: { application: Application }) {
8484
}
8585
}
8686

87-
function isInDocumentableScope(symbol: TypeScript.Symbol, node: TypeScript.Node) {
87+
function isInDocumentableScope(
88+
symbol: TypeScript.Symbol,
89+
node: TypeScript.Node
90+
) {
8891
for (const decl of symbol.getDeclarations() || []) {
8992
// Case 1: Included in this namespace/source file
9093
if (decl.parent === node) return true
@@ -95,12 +98,11 @@ function isInDocumentableScope(symbol: TypeScript.Symbol, node: TypeScript.Node)
9598
if (
9699
TypeScript.isSourceFile(node) &&
97100
TypeScript.isModuleBlock(decl.parent) &&
98-
decl.parent.parent.name.getText() === "global"
101+
decl.parent.parent.name.getText() === 'global'
99102
) {
100103
return true
101104
}
102105
}
103106

104107
return false
105108
}
106-

0 commit comments

Comments
 (0)