Setup lerna and yarn workspaces

This commit is contained in:
tgreyuk
2020-08-17 23:38:12 +01:00
parent 23309f6761
commit 7e406e6268
98 changed files with 7699 additions and 6611 deletions

12
.gitignore vendored
View File

@@ -1,15 +1,17 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
dist
tmp
/out
/test/fixtures
.nyc_output/
html
# dependencies
/node_modules
node_modules
# IDEs and editors
/.idea
@@ -22,7 +24,7 @@
# misc
/.sass-cache
/connect.lock
/coverage/*
coverage/*
/libpeerconnection.log
npm-debug.log
testem.log

View File

@@ -1,4 +1,3 @@
disableLanguages": ['hbs', 'handlebars']
printWidth: 120
singleQuote: true
trailingComma: all

10
jest.config.base.js Normal file
View File

@@ -0,0 +1,10 @@
module.exports = {
modulePaths: ['<rootDir>/dist'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
verbose: true,
collectCoverage: false,
coverageReporters: ['lcov', 'text', 'text-summary'],
collectCoverageFrom: ['<rootDir>/dist/**/*js'],
};

View File

@@ -1,10 +1,7 @@
const base = require('./jest.config.base.js');
module.exports = {
modulePaths: ['<rootDir>/dist'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
verbose: true,
collectCoverage: true,
coverageReporters: ['text-summary'],
collectCoverageFrom: ['<rootDir>/dist/**/*js'],
...base,
projects: ['<rootDir>/packages/*/jest.config.js'],
coverageDirectory: '<rootDir>/coverage/',
};

6
lerna.json Normal file
View File

@@ -0,0 +1,6 @@
{
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent"
}

BIN
logos.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

6550
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +1,11 @@
{
"name": "typedoc-plugin-markdown",
"version": "2.4.1",
"description": "A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.",
"main": "dist/index.js",
"files": [
"dist/"
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"lint": "eslint ./src --ext .ts",
"build": "rm -rf dist && tsc && copyfiles --up 1 ./src/**/*.hbs ./dist/",
"prepublishOnly": "npm run test",
"pretest": "npm run lint && npm run build",
"test": "jest",
"test:updateSnapshot": "jest --updateSnapshot",
"fixtures": "rm -rf ./test/fixtures && node ./tasks/fixtures.js",
"examples": "npm run build && rm -rf out && node ./tasks/link-plugin.js && npm run examples:html && npm run examples:md",
"examples:html": "typedoc --tsconfig ./test/stubs/tsconfig.json --options ./test/options.json --plugin none --out ./out/html",
"examples:md": "typedoc --tsconfig ./test/stubs/tsconfig.json --options ./test/options.json --out ./out/md"
},
"author": "Thomas Grey",
"license": "MIT",
"engines": {
"node": ">= 8.0.0"
},
"bugs": {
"url": "https://github.com/tgreyuk/typedoc-plugin-markdown/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tgreyuk/typedoc-plugin-markdown.git"
},
"keywords": [
"markdown",
"typescript",
"documentation",
"api",
"typedocplugin",
"typedoc"
],
"peerDependencies": {
"typedoc": ">=0.17.0"
"build": "lerna run build",
"test": "lerna run test --stream"
},
"devDependencies": {
"@types/fs-extra": "^9.0.1",
@@ -48,14 +14,9 @@
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"copyfiles": "^2.3.0",
"eslint": "^7.6.0",
"jest": "^26.2.2",
"ts-jest": "^26.1.4",
"typedoc": "0.17.8",
"typescript": "3.9.x"
},
"dependencies": {
"fs-extra": "^9.0.1",
"handlebars": "^4.7.6"
"lerna": "^3.5.1",
"prettier": "^2.0.5",
"ts-jest": "^26.1.4"
}
}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Thomas Grey
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,52 @@
# typedoc-plugin-markdown
A plugin for [TypeDoc](https://github.com/TypeStrong/typedoc) that enables TypeScript API documentation to be generated in Markdown.
[![npm](https://img.shields.io/npm/v/typedoc-plugin-markdown.svg)](https://www.npmjs.com/package/typedoc-plugin-markdown)
[![Build Status](https://travis-ci.org/tgreyuk/typedoc-plugin-markdown.svg?branch=master)](https://travis-ci.org/tgreyuk/typedoc-plugin-markdown)
## What it does?
The plugin will replace the default HTML theme with a built-in Markdown theme, and expose some additional arguments.
By default, the Markdown theme will attempt to render standard CommonMark, suitable for the majority of Markdown engines.
It follows the same structure and file patterns as the default HTML theme.
## Installation
```bash
npm install --save-dev typedoc typedoc-plugin-markdown
```
## Usage
```bash
$ npx typedoc --plugin typedoc-plugin-markdown [args]
```
### Note:
- The `--plugin` arg is optional - if omitted all installed plugins will run.
- If using with the default HTML theme or other themes, use `--plugin none` to switch the plugin off.
- The plugin needs to be executed from the same location as `typedoc`. Either run as an npm script or make sure to run `npx typedoc`.
## Arguments
The following arguments can be used in addition to the default [TypeDoc arguments](https://github.com/TypeStrong/typedoc#arguments).
- `--theme <markdown|docusaurus|docusaurus2|vuepress|bitbucket|path/to/theme>`<br>
Specify the theme that should be used. Defaults to `markdown`. Please read [Markdown Themes](https://github.com/tgreyuk/typedoc-plugin-markdown/blob/master/THEMES.md) for further details.
- `--namedAnchors`<br>
Use HTML named anchors as fragment identifiers for engines that do not automatically assign header ids.
- `--hideSources`<br>
Do not print source file link rendering.
- `--hideBreadcrumbs`<br>
Do not print breadcrumbs.
- `--publicPath`<br>
- Specifies the base path for all urls. If omitted urls will be relative.
- `--skipSidebar`<br>
Do not update the `sidebar.json` file when used with `docusaurus` or `docusaurus2` theme.
## License
[MIT](https://github.com/tgreyuk/typedoc-plugin-markdown/blob/master/LICENSE)

View File

@@ -0,0 +1,7 @@
const base = require('../../jest.config.base.js');
module.exports = {
...base,
name: 'typedoc-plugin-markdown',
displayName: 'typedoc-plugin-markdown',
};

View File

@@ -0,0 +1,50 @@
{
"name": "typedoc-plugin-markdown",
"version": "2.4.1",
"description": "A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.",
"main": "dist/index.js",
"files": [
"dist/"
],
"scripts": {
"prepublishOnly": "npm run lint && npm run build && npm run test",
"build": "rm -rf dist && tsc && copyfiles --up 1 ./src/**/*.hbs ./dist/",
"test": "jest --colors",
"test:update": "jest --updateSnapshot",
"build-and-test": "npm run build && npm run test",
"samples": "rm -rf ./samples && npm run sample:md & npm run sample:html",
"sample:md": "typedoc --name typedoc-sample --out ./samples/md ../../ts-samples/src",
"sample:html": "typedoc --name typedoc-sample --mode file --plugin none --out ./samples/html ../../ts-samples/src"
},
"author": "Thomas Grey",
"license": "MIT",
"engines": {
"node": ">= 8.0.0"
},
"bugs": {
"url": "https://github.com/tgreyuk/typedoc-plugin-markdown/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tgreyuk/typedoc-plugin-markdown.git"
},
"keywords": [
"markdown",
"typescript",
"documentation",
"api",
"typedocplugin",
"typedoc"
],
"peerDependencies": {
"typedoc": ">=0.17.0"
},
"dependencies": {
"fs-extra": "^9.0.1",
"handlebars": "^4.7.6"
},
"devDependencies": {
"typedoc": "^0.18.0",
"typescript": "^3.9.7"
}
}

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"declaration": true,
"experimentalDecorators": true,
"lib": ["es2016", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": false,
"noUnusedLocals": true,
"outDir": "./dist",
"removeComments": true,
"sourceMap": false,
"strictNullChecks": false,
"target": "es2015"
},
"exclude": ["./dist", "./test", "**/*.spec.ts"]
}

7516
yarn.lock Normal file

File diff suppressed because it is too large Load Diff