Skip to content

Commit 140a67d

Browse files
committed
Add new project tsdoc-config
1 parent c1726fa commit 140a67d

File tree

11 files changed

+199
-2
lines changed

11 files changed

+199
-2
lines changed

api-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"dependencies": {
88
"@microsoft/tsdoc": "0.12.15",
9-
"@types/node": "10.7.1",
9+
"@types/node": "10.17.5",
1010
"colors": "~1.3.3"
1111
},
1212
"devDependencies": {

eslint-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@rushstack/eslint-config": "0.4.0",
3333
"@types/eslint": "6.1.3",
3434
"@types/estree": "0.0.39",
35-
"@types/node": "10.7.1",
35+
"@types/node": "10.17.5",
3636
"eslint": "^6.0.0",
3737
"rimraf": "~2.6.3",
3838
"typescript": "~3.5.3"

rush.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@
376376
"projectFolder": "tsdoc",
377377
"shouldPublish": true
378378
},
379+
{
380+
"packageName": "@microsoft/tsdoc-config",
381+
"projectFolder": "tsdoc-config",
382+
"shouldPublish": false
383+
},
379384
{
380385
"packageName": "eslint-plugin-tsdoc",
381386
"projectFolder": "eslint-plugin",

tsdoc-config/.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require("@rushstack/eslint-config/patch-eslint6");
3+
4+
module.exports = {
5+
extends: [ "@rushstack/eslint-config" ],
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
};

tsdoc-config/.npmignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Ignore everything by default
2+
**
3+
4+
# Use negative patterns to bring back the specific things we want to publish
5+
!/bin/**
6+
!/lib/**
7+
!/dist/**
8+
!ThirdPartyNotice.txt
9+
10+
# Ignore certain files in the above folder
11+
/dist/*.stats.*
12+
/lib/**/test/*
13+
/lib/**/__tests__/*
14+
15+
# NOTE: These don't need to be specified, because NPM includes them automatically.
16+
#
17+
# package.json
18+
# README (and its variants)
19+
# CHANGELOG (and its variants)
20+
# LICENSE / LICENCE
21+
22+
## Project specific definitions
23+
# -----------------------------
24+
25+
# (Add your exceptions here)

tsdoc-config/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.org/
2+
always-auth=false

tsdoc-config/.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"printWidth": 120,
4+
"tabWidth": 2,
5+
"singleQuote": true
6+
}

tsdoc-config/LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) Microsoft Corporation. All rights reserved.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tsdoc-config/build.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
'use strict';
2+
3+
const child_process = require('child_process');
4+
const path = require('path');
5+
6+
const production = process.argv.indexOf('--production') >= 0;
7+
const baseDir = __dirname;
8+
9+
process.chdir(baseDir);
10+
11+
process.exitCode = 1;
12+
try {
13+
child_process.execSync(path.join(baseDir, 'node_modules/.bin/rimraf')
14+
+ ' ./lib/', { stdio: 'inherit' });
15+
16+
console.log('-- TYPESCRIPT --\n');
17+
child_process.execSync(path.join(baseDir, 'node_modules/.bin/tsc'), { stdio: 'inherit' });
18+
19+
console.log('-- ESLINT --\n');
20+
child_process.execSync(path.join(baseDir, 'node_modules/.bin/eslint')
21+
+ ' -f unix \"src/**/*.{ts,tsx}\"',
22+
{ stdio: 'inherit' });
23+
24+
if (production) {
25+
console.log('-- JEST --\n');
26+
27+
// Map stderr-->stdout because Jest weirdly writes to stderr during a successful run,
28+
// which the build tools (rightly so) interpret as an issue that should fail the build
29+
child_process.execSync(path.join(baseDir, 'node_modules/.bin/jest'), {
30+
stdio: [ 0, 1, 1 ]
31+
});
32+
}
33+
34+
process.exitCode = 0;
35+
} catch (e) {
36+
console.log('ERROR: ' + e.message);
37+
}

tsdoc-config/package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "@microsoft/tsdoc-config",
3+
"version": "0.12.15",
4+
"description": "A loader for the tsdoc-config.json file",
5+
"keywords": [
6+
"TypeScript",
7+
"documentation",
8+
"doc",
9+
"comments",
10+
"JSDoc",
11+
"parser",
12+
"standard"
13+
],
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/Microsoft/tsdoc"
17+
},
18+
"homepage": "https://github.com/Microsoft/tsdoc",
19+
"main": "lib/index.js",
20+
"typings": "lib/index.d.ts",
21+
"license": "MIT",
22+
"dependencies": {
23+
"ajv": "~6.10.2",
24+
"resolve": "~1.12.0"
25+
},
26+
"devDependencies": {
27+
"@rushstack/eslint-config": "0.4.0",
28+
"@types/jest": "24.0.16",
29+
"@types/resolve": "0.0.8",
30+
"@types/node": "10.17.5",
31+
"eslint": "^6.0.0",
32+
"jest": "~24.8.0",
33+
"prettier": "~1.18.2",
34+
"rimraf": "~2.6.3",
35+
"ts-jest": "~24.0.2",
36+
"typescript": "~3.5.3"
37+
},
38+
"scripts": {
39+
"build": "node ./build.js",
40+
"test": "jest",
41+
"watch": "jest --watch",
42+
"lint": "eslint -f unix \"src/**/*.{ts,tsx}\""
43+
},
44+
"jest": {
45+
"moduleFileExtensions": [
46+
"ts",
47+
"tsx",
48+
"js",
49+
"jsx"
50+
],
51+
"transform": {
52+
"^.+\\.tsx?$": "ts-jest"
53+
},
54+
"testMatch": [
55+
"<rootDir>/src/**/*.test.ts"
56+
]
57+
}
58+
}

0 commit comments

Comments
 (0)