-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a8d884c
Showing
12 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/ | ||
typings/ | ||
*.js | ||
*.d.ts | ||
*.log.* | ||
*.log | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules/ | ||
typings/ | ||
test/ | ||
src/ | ||
.travis.yml | ||
*.log.* | ||
*.log | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- "5.6" | ||
- "4.3" | ||
- "0.12" | ||
- "0.10" | ||
|
||
install: npm link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 BusFaster Ltd | ||
|
||
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
docts | ||
===== | ||
|
||
[![build status](https://travis-ci.org/charto/docts.svg?branch=master)](http://travis-ci.org/charto/docts) | ||
[![npm version](https://img.shields.io/npm/v/docts.svg)](https://www.npmjs.com/package/docts) | ||
|
||
License | ||
======= | ||
|
||
[The MIT License](https://raw.githubusercontent.com/charto/docts/master/LICENSE) | ||
|
||
Copyright (c) 2016 BusFaster Ltd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require('./dist/cli.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "docts", | ||
"version": "0.0.1", | ||
"description": "README.md API section autogenerator for TypeScript projects", | ||
"main": "dist/docts.js", | ||
"typings": "dist/docts.d.ts", | ||
"bin": { | ||
"docts": "docts-cli.js" | ||
}, | ||
"scripts": { | ||
"tsc": "tsc", | ||
"typings": "typings", | ||
"prepublish": "typings install && tsc", | ||
"test": "npm link docts && docts --help" | ||
}, | ||
"author": "Juha Järvi", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/charto/docts.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/charto/docts/issues" | ||
}, | ||
"homepage": "https://github.com/charto/docts#readme", | ||
"devDependencies": { | ||
"typescript": "^1.8.7", | ||
"typings": "~0.7.9" | ||
}, | ||
"dependencies": { | ||
"readts": "0.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// This file is part of docts, copyright (c) 2016 BusFaster Ltd. | ||
// Released under the MIT license, see LICENSE. | ||
|
||
import * as path from 'path'; | ||
import {Parser} from 'readts'; | ||
|
||
export function patchReadme(basePath: string) { | ||
var parser = new Parser(); | ||
|
||
var packagePath = path.resolve(basePath, 'package.json'); | ||
var tsconfigPath = path.resolve(basePath, 'tsconfig.json'); | ||
|
||
var config = parser.parseConfig(tsconfigPath); | ||
|
||
var pkgJson = require(packagePath); | ||
var dtsPath = path.resolve(basePath, pkgJson.typings); | ||
|
||
config.options.noEmit = true; | ||
config.fileNames = [ dtsPath ]; | ||
|
||
console.log(JSON.stringify(parser.parse(config), null, 4)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This file is part of docts, copyright (c) 2016 BusFaster Ltd. | ||
// Released under the MIT license, see LICENSE. | ||
|
||
import {patchReadme} from './Patcher'; | ||
|
||
patchReadme(process.cwd()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This file is part of docts, copyright (c) 2016 BusFaster Ltd. | ||
// Released under the MIT license, see LICENSE. | ||
|
||
export {patchReadme} from './Patcher'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"experimentalDecorators": true, | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"outDir": "dist", | ||
"removeComments": false, | ||
"target": "es5" | ||
}, | ||
"files": [ | ||
"typings/main.d.ts", | ||
|
||
"src/cli.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "docts", | ||
"version": false, | ||
"dependencies": {}, | ||
"ambientDependencies": { | ||
"node": "registry:dt/node#4.0.0+20160317120654" | ||
} | ||
} |