Skip to content

Commit 418fdf7

Browse files
Wojciech KrysiakWojciech Krysiak
authored andcommitted
ci: install typescript
1 parent fa82beb commit 418fdf7

File tree

8 files changed

+482
-230
lines changed

8 files changed

+482
-230
lines changed

lib/better-docs.type.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });

lib/helpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6+
exports.needsSignature = exports.hashToLink = exports.resolveAuthorLinks = exports.linkto = exports.htmlsafe = exports.tutoriallink = void 0;
67
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
78
// @ts-ignore
89
const templateHelper_1 = __importDefault(require("jsdoc/util/templateHelper"));

lib/navigation/build-nav.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.buildNav = void 0;
34
const helpers_1 = require("../helpers");
45
const decorate_1 = require("../sections/decorate");
56
const { hasOwnProperty } = Object.prototype;

lib/rendered/template.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6+
exports.Template = void 0;
67
/**
78
* Wrapper for underscore's template utility to allow loading templates from files.
89
* @module jsdoc/template

lib/sections/decorate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6+
exports.decorateSections = exports.buildKey = exports.buildFileName = exports.SECTIONS_CONFIG_FILE_NAME = void 0;
67
const fs_1 = __importDefault(require("fs"));
78
const path_1 = __importDefault(require("path"));
89
exports.SECTIONS_CONFIG_FILE_NAME = 'sections.json';
@@ -53,7 +54,6 @@ const loadConfig = (sectionConfigPath) => {
5354
function decorateSections(sections = {}, sectionConfigPath) {
5455
const config = loadConfig(sectionConfigPath) || {};
5556
return Object.keys(sections).reduce((memo, sectionName, index) => {
56-
var _a, _b;
5757
const name = buildKey(sectionName);
5858
const originalSection = sections[sectionName];
5959
const configSection = config[name] || null;
@@ -79,8 +79,8 @@ function decorateSections(sections = {}, sectionConfigPath) {
7979
title,
8080
href,
8181
order,
82-
homeBody: (_a = configSection) === null || _a === void 0 ? void 0 : _a.homeBody,
83-
homePath: (_b = configSection) === null || _b === void 0 ? void 0 : _b.homePath,
82+
homeBody: configSection === null || configSection === void 0 ? void 0 : configSection.homeBody,
83+
homePath: configSection === null || configSection === void 0 ? void 0 : configSection.homePath,
8484
} });
8585
}, {});
8686
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"gulp": "./node_modules/.bin/gulp",
99
"test": "mocha --recursive './*spec.js' './typescript/*spec.js'",
10-
"test:ts": "mocha -r ts-node/register --recursive '**/*/*.spec.ts'",
10+
"test:ts": "mocha -r ts-node/register -r tsconfig-paths/register src/**/*.spec.ts",
1111
"build": "babel src/components --out-dir lib/components",
1212
"build:ts": "tsc",
1313
"build:css": "yarn run gulp build",
@@ -26,7 +26,6 @@
2626
"@commitlint/cli": "^8.3.5",
2727
"@commitlint/config-conventional": "^8.3.4",
2828
"@semantic-release/git": "^9.0.0",
29-
"semantic-release-slack-bot": "^1.6.2",
3029
"@types/mocha": "^8.0.3",
3130
"@typescript-eslint/eslint-plugin": "^2.3.1",
3231
"@typescript-eslint/parser": "^2.3.1",
@@ -50,10 +49,12 @@
5049
"gulp-sass": "^4.0.2",
5150
"gulp-uglify": "^3.0.2",
5251
"husky": "^4.2.5",
53-
"jsdoc": "^3.6.3",
54-
"mocha": "^6.2.0",
52+
"jsdoc": "^3.6.5",
53+
"mocha": "^8.1.3",
5554
"semantic-release": "^17.0.7",
56-
"ts-node": "^9.0.0"
55+
"semantic-release-slack-bot": "^1.6.2",
56+
"ts-node": "6.2.0",
57+
"typescript": "^3.6.4"
5758
},
5859
"peerDependencies": {
5960
"react": "^16.0.0",
@@ -65,7 +66,6 @@
6566
"react-ace": "^6.5.0",
6667
"react-docgen": "^5.3.0",
6768
"react-frame-component": "^4.1.1",
68-
"typescript": "^3.7.5",
6969
"underscore": "^1.9.1",
7070
"vue-docgen-api": "^3.22.0",
7171
"vue2-ace-editor": "^0.0.13"

src/better-docs.type.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
export type NavButton = {
2+
label: string;
3+
href: string;
4+
target: string;
5+
className?: string;
6+
}
7+
8+
export type NavLink = {
9+
label: string;
10+
href: string;
11+
className?: string;
12+
}
13+
14+
export type OgTags = {
15+
/**
16+
* @ogTitle
17+
* @ogDescription
18+
* @ogImage
19+
*/
20+
title: string;
21+
description: string;
22+
image: string;
23+
}
24+
25+
export type BetterDocsConfig = {
26+
/**
27+
* Path to the landing page
28+
*/
29+
landing?: string;
30+
/**
31+
* Logo
32+
*/
33+
logo?: string;
34+
/**
35+
* Page Title
36+
*/
37+
title?: string;
38+
ogTags: OgTags;
39+
/**
40+
* Component config
41+
*/
42+
component?: {
43+
/**
44+
* Wrapping Component
45+
*/
46+
wrapper: string;
47+
};
48+
/**
49+
* Tracking code
50+
*/
51+
trackingCode?: string;
52+
/**
53+
* Custom text injected to the HEAD
54+
*/
55+
head?: string;
56+
57+
/**
58+
* NavButtons showed in the TOP section
59+
*/
60+
navButtons: Array<NavButton>;
61+
/**
62+
* Navigation links
63+
*/
64+
navLinks: Array<NavLink>;
65+
}

0 commit comments

Comments
 (0)