Skip to content

Commit e43bd1a

Browse files
dnischetaDmitry Nishcheta
andauthored
Generate docs with @2gis/ts-docs-generator (#41)
* Generate docs with @2gis/ts-docs-generator * Try to fix test job * Migrate to @2gis/ts-docs-generator * Update workflow * Bump @2gis/ts-docs-generator * Remove redundant env * Allow openssl legacy * Bump jest-dev-server, fix test on updated node --------- Co-authored-by: Dmitry Nishcheta <nish.dima@gmail.com>
1 parent 36e5142 commit e43bd1a

File tree

9 files changed

+422
-245
lines changed

9 files changed

+422
-245
lines changed

.github/workflows/prettier-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
- uses: actions/checkout@v3
1010
- uses: actions/setup-node@v3
1111
with:
12-
node-version: 16
12+
node-version: 18
1313
- run: npm ci
1414
- run: npm run prettier

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-node@v2
1515
with:
16-
node-version: 16
16+
node-version: 18
1717
registry-url: https://registry.npmjs.org/
1818
- run: npm ci
1919
- run: npm run build
2020
- run: npm publish --access public
2121
env:
22+
VERSION: $GITHUB_REF_NAME
2223
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-node@v3
1616
with:
17-
node-version: 16
17+
node-version: 18
1818
- run: npm ci
1919
- run: npm run test:screenshots
20-
- uses: actions/upload-artifact@v3
20+
- uses: actions/upload-artifact@v4
2121
if: ${{ failure() }}
2222
with:
2323
path: test/screenshots/__screenshots__/**/__diff_output__/*.png

build/docs.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const { generateDocs } = require('@2gis/ts-docs-generator');
2+
const fs = require('fs');
3+
const path = require('path');
4+
5+
const version = process.env.VERSION || 'branch';
6+
fs.mkdirSync(path.join('dist', 'docs', version), { recursive: true });
7+
8+
generateDocs({
9+
version,
10+
project: 'deck2gisLayer',
11+
defaultReference: 'Deck2gisLayer',
12+
docsHost: 'https://unpkg.com/@2gis/deck2gis-layer@^2/dist/docs',
13+
excludePaths: [],
14+
globs: ['src/**/*'],
15+
ignoreMarkdown: true,
16+
legacyOutPath: 'dist/docs.json',
17+
})
18+
.then((result) => {
19+
fs.writeFileSync(path.join('dist', 'docs', 'manifest.json'), result.manifest);
20+
fs.writeFileSync(path.join('dist', 'docs', version, 'en.json'), result.reference.en);
21+
fs.writeFileSync(path.join('dist', 'docs', version, 'ru.json'), result.reference.ru);
22+
})
23+
.catch((e) => {
24+
console.log(e);
25+
process.exit(1);
26+
});

build/documentalist.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)