@pikokr/command.ts 4.0.2-dev.6d75eff → 4.0.2-dev.c1a6596

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ name: Documentation
2
+ on:
3
+ push:
4
+ branches:
5
+ - 'dev'
6
+ - 'master'
7
+ - '!docs'
8
+ tags:
9
+ - '*'
10
+ jobs:
11
+ build:
12
+ name: Build documentation
13
+ runs-on: ubuntu-latest
14
+ outputs:
15
+ BRANCH_NAME: ${{ steps.env.outputs.BRANCH_NAME }}
16
+ BRANCH_OR_TAG: ${{ steps.env.outputs.BRANCH_OR_TAG }}
17
+ SHA: ${{ steps.env.outputs.SHA }}
18
+ if: github.repository_owner == 'pikokr'
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v2
22
+
23
+ - name: Install node.js v16
24
+ uses: actions/setup-node@v2
25
+ with:
26
+ node-version: 16
27
+ cache: 'yarn'
28
+ cache-dependency-path: yarn.lock
29
+ - name: Install dependencies
30
+ run: yarn --immutable
31
+
32
+ - name: Build docs
33
+ run: yarn docs
34
+
35
+ - name: Upload artifacts
36
+ uses: actions/upload-artifact@v2
37
+ with:
38
+ name: docs
39
+ path: docs/docs.json
40
+ - name: Set outputs for upload job
41
+ id: env
42
+ run: |
43
+ echo "::set-output name=BRANCH_NAME::${GITHUB_REF_NAME}"
44
+ echo "::set-output name=BRANCH_OR_TAG::${GITHUB_REF_TYPE}"
45
+ echo "::set-output name=SHA::${GITHUB_SHA}"
46
+ upload:
47
+ name: Upload Documentation
48
+ needs: build
49
+ runs-on: ubuntu-latest
50
+ env:
51
+ BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
52
+ BRANCH_OR_TAG: ${{ needs.build.outputs.BRANCH_OR_TAG }}
53
+ SHA: ${{ needs.build.outputs.SHA }}
54
+ steps:
55
+ - name: Download artifacts
56
+ uses: actions/download-artifact@v2
57
+ with:
58
+ name: docs
59
+ path: docs
60
+
61
+ - name: Checkout docs repository
62
+ uses: actions/checkout@v2
63
+ with:
64
+ repository: 'pikokr/docs'
65
+ token: ${{ secrets.PIKOKR_DOCS }}
66
+ path: 'out'
67
+
68
+ - name: Move docs to correct directory
69
+ run: |
70
+ mkdir -p out/command.ts
71
+ mv docs/docs.json out/command.ts/${BRANCH_NAME}.json
72
+ - name: Commit and push
73
+ run: |
74
+ cd out
75
+ git config user.name github-actions[bot]
76
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
77
+ git add .
78
+ git commit -m "Docs build for ${BRANCH_OR_TAG} ${BRANCH_NAME}: ${SHA}" || true
79
+ git push
package/docs/index.yml ADDED
@@ -0,0 +1,5 @@
1
+ - name: General
2
+ files:
3
+ - name: Welcome
4
+ id: welcome
5
+ path: ../../README.md
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@pikokr/command.ts",
3
3
  "description": "Discord.js command framework for typescript.",
4
- "version": "4.0.2-dev.6d75eff",
4
+ "version": "4.0.2-dev.c1a6596",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "MIT",
8
8
  "devDependencies": {
9
+ "@discordjs/ts-docgen": "^0.3.4",
9
10
  "@swc/core": "^1.2.135",
10
11
  "@types/lodash": "^4.14.172",
11
12
  "all-contributors-cli": "^6.20.0",
@@ -13,7 +14,7 @@
13
14
  "prettier": "^2.2.1",
14
15
  "ts-node": "^10.1.0",
15
16
  "tsup": "^5.11.12",
16
- "typedoc": "^0.20.35"
17
+ "typedoc": "^0.22.11"
17
18
  },
18
19
  "dependencies": {
19
20
  "@types/node": "^14.14.37",
@@ -32,6 +33,7 @@
32
33
  "prepack": "yarn build",
33
34
  "build": "tsup-node",
34
35
  "docs:dev": "typedoc",
35
- "docs:build": "typedoc"
36
+ "docs:build": "typedoc",
37
+ "docs": "typedoc --json docs/typedoc-out.json src/index.ts && ts-node scripts/docs"
36
38
  }
37
39
  }
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Copyright (c) 2022 pikokr. Licensed under the MIT license
3
+ */
4
+
5
+ import { runGenerator } from '@discordjs/ts-docgen'
6
+
7
+ runGenerator({
8
+ existingOutput: 'docs/typedoc-out.json',
9
+ custom: 'docs/index.yml',
10
+ output: 'docs/docs.json',
11
+ })
package/tsconfig.json CHANGED
@@ -79,5 +79,5 @@
79
79
  "forceConsistentCasingInFileNames": true
80
80
  /* Disallow inconsistently-cased references to the same file. */
81
81
  },
82
- "exclude": ["test", "node_modules", "dist", "tsup.config.ts"]
82
+ "exclude": ["test", "node_modules", "dist", "tsup.config.ts", "scripts"]
83
83
  }