Skip to content

Commit

Permalink
ci: install typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech Krysiak authored and Wojciech Krysiak committed Sep 7, 2020
1 parent fa82beb commit 418fdf7
Show file tree
Hide file tree
Showing 8 changed files with 482 additions and 230 deletions.
2 changes: 2 additions & 0 deletions lib/better-docs.type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
1 change: 1 addition & 0 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.needsSignature = exports.hashToLink = exports.resolveAuthorLinks = exports.linkto = exports.htmlsafe = exports.tutoriallink = void 0;
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
const templateHelper_1 = __importDefault(require("jsdoc/util/templateHelper"));
Expand Down
1 change: 1 addition & 0 deletions lib/navigation/build-nav.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildNav = void 0;
const helpers_1 = require("../helpers");
const decorate_1 = require("../sections/decorate");
const { hasOwnProperty } = Object.prototype;
Expand Down
1 change: 1 addition & 0 deletions lib/rendered/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Template = void 0;
/**
* Wrapper for underscore's template utility to allow loading templates from files.
* @module jsdoc/template
Expand Down
6 changes: 3 additions & 3 deletions lib/sections/decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.decorateSections = exports.buildKey = exports.buildFileName = exports.SECTIONS_CONFIG_FILE_NAME = void 0;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
exports.SECTIONS_CONFIG_FILE_NAME = 'sections.json';
Expand Down Expand Up @@ -53,7 +54,6 @@ const loadConfig = (sectionConfigPath) => {
function decorateSections(sections = {}, sectionConfigPath) {
const config = loadConfig(sectionConfigPath) || {};
return Object.keys(sections).reduce((memo, sectionName, index) => {
var _a, _b;
const name = buildKey(sectionName);
const originalSection = sections[sectionName];
const configSection = config[name] || null;
Expand All @@ -79,8 +79,8 @@ function decorateSections(sections = {}, sectionConfigPath) {
title,
href,
order,
homeBody: (_a = configSection) === null || _a === void 0 ? void 0 : _a.homeBody,
homePath: (_b = configSection) === null || _b === void 0 ? void 0 : _b.homePath,
homeBody: configSection === null || configSection === void 0 ? void 0 : configSection.homeBody,
homePath: configSection === null || configSection === void 0 ? void 0 : configSection.homePath,
} });
}, {});
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"gulp": "./node_modules/.bin/gulp",
"test": "mocha --recursive './*spec.js' './typescript/*spec.js'",
"test:ts": "mocha -r ts-node/register --recursive '**/*/*.spec.ts'",
"test:ts": "mocha -r ts-node/register -r tsconfig-paths/register src/**/*.spec.ts",
"build": "babel src/components --out-dir lib/components",
"build:ts": "tsc",
"build:css": "yarn run gulp build",
Expand All @@ -26,7 +26,6 @@
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/git": "^9.0.0",
"semantic-release-slack-bot": "^1.6.2",
"@types/mocha": "^8.0.3",
"@typescript-eslint/eslint-plugin": "^2.3.1",
"@typescript-eslint/parser": "^2.3.1",
Expand All @@ -50,10 +49,12 @@
"gulp-sass": "^4.0.2",
"gulp-uglify": "^3.0.2",
"husky": "^4.2.5",
"jsdoc": "^3.6.3",
"mocha": "^6.2.0",
"jsdoc": "^3.6.5",
"mocha": "^8.1.3",
"semantic-release": "^17.0.7",
"ts-node": "^9.0.0"
"semantic-release-slack-bot": "^1.6.2",
"ts-node": "6.2.0",
"typescript": "^3.6.4"
},
"peerDependencies": {
"react": "^16.0.0",
Expand All @@ -65,7 +66,6 @@
"react-ace": "^6.5.0",
"react-docgen": "^5.3.0",
"react-frame-component": "^4.1.1",
"typescript": "^3.7.5",
"underscore": "^1.9.1",
"vue-docgen-api": "^3.22.0",
"vue2-ace-editor": "^0.0.13"
Expand Down
65 changes: 65 additions & 0 deletions src/better-docs.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
export type NavButton = {
label: string;
href: string;
target: string;
className?: string;
}

export type NavLink = {
label: string;
href: string;
className?: string;
}

export type OgTags = {
/**
* @ogTitle
* @ogDescription
* @ogImage
*/
title: string;
description: string;
image: string;
}

export type BetterDocsConfig = {
/**
* Path to the landing page
*/
landing?: string;
/**
* Logo
*/
logo?: string;
/**
* Page Title
*/
title?: string;
ogTags: OgTags;
/**
* Component config
*/
component?: {
/**
* Wrapping Component
*/
wrapper: string;
};
/**
* Tracking code
*/
trackingCode?: string;
/**
* Custom text injected to the HEAD
*/
head?: string;

/**
* NavButtons showed in the TOP section
*/
navButtons: Array<NavButton>;
/**
* Navigation links
*/
navLinks: Array<NavLink>;
}
Loading

0 comments on commit 418fdf7

Please sign in to comment.