Skip to content

Commit 4f46de1

Browse files
committed
Rename tsdocconfig.json --> tsdoc.json based on community vote: https://twitter.com/octogonz_/status/1195793782534393856
1 parent 0fd677c commit 4f46de1

File tree

12 files changed

+49
-49
lines changed

12 files changed

+49
-49
lines changed

common/changes/eslint-plugin-tsdoc/octogonz-tsdoc-config_2019-11-17-07-26.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"changes": [
33
{
44
"packageName": "eslint-plugin-tsdoc",
5-
"comment": "Add support for defining your own custom tags using tsdocconfig.json",
5+
"comment": "Add support for defining your own custom tags using tsdoc.json",
66
"type": "minor"
77
}
88
],

tsdoc-config/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**TSDoc** is a proposal to standardize the doc comments used in [TypeScript](http://www.typescriptlang.org/)
44
source files. The main package [`@microsoft/tsdoc`](https://www.npmjs.com/package/@microsoft/tsdoc) implements
5-
the TSDoc parser. The `@microsoft/tsdoc-config` package is an optional add-on for loading the **tsdocconfig.json**
5+
the TSDoc parser. The `@microsoft/tsdoc-config` package is an optional add-on for loading the **tsdoc.json**
66
file format that enables users to define custom TSDoc tags. (This functionality was moved to its own package
77
because it requires external dependencies such as NodeJS and `ajv`, whereas the main package is fully self-contained.)
88

@@ -13,23 +13,23 @@ https://github.com/microsoft/tsdoc
1313

1414
## Creating config files
1515

16-
The **tsdocconfig.json** file is optional. When used, it is expected to be found in the same folder as
16+
The **tsdoc.json** file is optional. When used, it is expected to be found in the same folder as
1717
the **tsconfig.json** file for a project. The loader looks for it by walking upwards in the directory tree
1818
until it finds a folder containing **tsconfig.json** or **package.json**, and then it attempts to load
19-
**tsdocconfig.json** from that location.
19+
**tsdoc.json** from that location.
2020

21-
The **tsdocconfig.json** file conforms to the [tsdocconfig.schema.json](
22-
https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json) JSON schema. It defines tags using
21+
The **tsdoc.json** file conforms to the [tsdoc.schema.json](
22+
https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json) JSON schema. It defines tags using
2323
similar fields as the
2424
[TSDocTagDefinition](https://github.com/microsoft/tsdoc/blob/master/tsdoc/src/configuration/TSDocTagDefinition.ts)
2525
API used by `TSDocParser` from `@microsoft/tsdoc`.
2626

2727
Here's a simple example:
2828

29-
**tsdocconfig.json**
29+
**tsdoc.json**
3030
```js
3131
{
32-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
32+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
3333
"tagDefinitions": [
3434
{
3535
"tagName": "@myTag",
@@ -42,13 +42,13 @@ Here's a simple example:
4242
If you want to define custom tags in one place and share them across multiple projects, the `extends` field specifies
4343
a list of paths that will be mixed in with the current file:
4444

45-
**tsdocconfig.json**
45+
**tsdoc.json**
4646
```js
4747
{
48-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
48+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
4949
"extends": [
50-
"my-package/dist/tsdocconfig-base.json",
51-
"./path/to/local/file/tsdocconfig-local.json"
50+
"my-package/dist/tsdoc-base.json",
51+
"./path/to/local/file/tsdoc-local.json"
5252
]
5353
}
5454
```
@@ -60,7 +60,7 @@ a list of paths that will be mixed in with the current file:
6060
## API Usage
6161

6262
The code sample below illustrates how to invoke the `@microsoft/tsdoc-config` API to load a
63-
**tsdocconfig.json** file:
63+
**tsdoc.json** file:
6464

6565
```ts
6666
import * as path from 'path';
@@ -70,7 +70,7 @@ import { TSDocConfigFile } from '@microsoft/tsdoc-config';
7070
// Sample source file to be parsed
7171
const mySourceFile: string = 'my-project/src/example.ts';
7272

73-
// Load the nearest config file, for example `my-project/tsdocconfig.json`
73+
// Load the nearest config file, for example `my-project/tsdoc.json`
7474
const tsdocConfigFile: TSDocConfigFile = TSDocConfigFile.loadForFolder(path.dirname(mySourceFile));
7575
if (tsdocConfigFile.hasErrors) {
7676
// Report any errors

tsdoc-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@microsoft/tsdoc-config",
33
"version": "0.12.15",
4-
"description": "A loader for the tsdocconfig.json file",
4+
"description": "A loader for the tsdoc.json file",
55
"keywords": [
66
"TypeScript",
77
"documentation",

tsdoc-config/src/TSDocConfigFile.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import * as Ajv from 'ajv';
1616
const ajv: Ajv.Ajv = new Ajv({ verbose: true });
1717

1818
function initializeSchemaValidator(): Ajv.ValidateFunction {
19-
const jsonSchemaPath: string = resolve.sync('@microsoft/tsdoc/schemas/tsdocconfig.schema.json', { basedir: __dirname });
19+
const jsonSchemaPath: string = resolve.sync('@microsoft/tsdoc/schemas/tsdoc.schema.json', { basedir: __dirname });
2020
const jsonSchemaContent: string = fs.readFileSync(jsonSchemaPath).toString();
2121
const jsonSchema: object = JSON.parse(jsonSchemaContent);
2222
return ajv.compile(jsonSchema);
@@ -41,14 +41,14 @@ interface IConfigJson {
4141
}
4242

4343
/**
44-
* Represents an individual `tsdocconfig.json` file.
44+
* Represents an individual `tsdoc.json` file.
4545
*
4646
* @public
4747
*/
4848
export class TSDocConfigFile {
49-
public static readonly FILENAME: string = 'tsdocconfig.json';
49+
public static readonly FILENAME: string = 'tsdoc.json';
5050
public static readonly CURRENT_SCHEMA_URL: string
51-
= 'https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json';
51+
= 'https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json';
5252

5353
/**
5454
* A queryable log that reports warnings and error messages that occurred during parsing.
@@ -90,7 +90,7 @@ export class TSDocConfigFile {
9090
}
9191

9292
/**
93-
* If true, then the TSDocConfigFile object contains an empty state, because the `tsdocconfig.json` file could
93+
* If true, then the TSDocConfigFile object contains an empty state, because the `tsdoc.json` file could
9494
* not be found by the loader.
9595
*/
9696
public get fileNotFound(): boolean {
@@ -111,14 +111,14 @@ export class TSDocConfigFile {
111111
}
112112

113113
/**
114-
* The `$schema` field from the `tsdocconfig.json` file.
114+
* The `$schema` field from the `tsdoc.json` file.
115115
*/
116116
public get tsdocSchema(): string {
117117
return this._tsdocSchema;
118118
}
119119

120120
/**
121-
* The `extends` field from the `tsdocconfig.json` file. For the parsed file contents,
121+
* The `extends` field from the `tsdoc.json` file. For the parsed file contents,
122122
* use the `extendsFiles` property instead.
123123
*/
124124
public get extendsPaths(): ReadonlyArray<string> {
@@ -275,7 +275,7 @@ export class TSDocConfigFile {
275275
}
276276

277277
/**
278-
* For the given folder, discover the relevant tsdocconfig.json files (if any), and load them.
278+
* For the given folder, discover the relevant tsdoc.json files (if any), and load them.
279279
* @param folderPath - the path to a folder where the search should start
280280
*/
281281
public static loadForFolder(folderPath: string): TSDocConfigFile {

tsdoc-config/src/__tests__/TSDocConfigFile.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ test('Load p1', () => {
3838
"extendsFiles": Array [],
3939
"extendsPaths": Array [],
4040
"fileNotFound": false,
41-
"filePath": "assets/p1/tsdocconfig.json",
41+
"filePath": "assets/p1/tsdoc.json",
4242
"messages": Array [],
4343
"tagDefinitions": Array [],
44-
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
44+
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
4545
}
4646
`);
4747
});
@@ -51,7 +51,7 @@ test('Load p2', () => {
5151
"extendsFiles": Array [],
5252
"extendsPaths": Array [],
5353
"fileNotFound": true,
54-
"filePath": "assets/p2/tsdocconfig.json",
54+
"filePath": "assets/p2/tsdoc.json",
5555
"messages": Array [
5656
ParserMessage {
5757
"_text": undefined,
@@ -79,7 +79,7 @@ test('Load p3', () => {
7979
"extendsFiles": Array [],
8080
"extendsPaths": Array [],
8181
"fileNotFound": false,
82-
"filePath": "assets/p3/base1/tsdocconfig-base1.json",
82+
"filePath": "assets/p3/base1/tsdoc-base1.json",
8383
"messages": Array [],
8484
"tagDefinitions": Array [
8585
TSDocTagDefinition {
@@ -90,13 +90,13 @@ test('Load p3', () => {
9090
"tagNameWithUpperCase": "@BASE1",
9191
},
9292
],
93-
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
93+
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
9494
},
9595
Object {
9696
"extendsFiles": Array [],
9797
"extendsPaths": Array [],
9898
"fileNotFound": false,
99-
"filePath": "assets/p3/base2/tsdocconfig-base2.json",
99+
"filePath": "assets/p3/base2/tsdoc-base2.json",
100100
"messages": Array [],
101101
"tagDefinitions": Array [
102102
TSDocTagDefinition {
@@ -107,15 +107,15 @@ test('Load p3', () => {
107107
"tagNameWithUpperCase": "@BASE2",
108108
},
109109
],
110-
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
110+
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
111111
},
112112
],
113113
"extendsPaths": Array [
114-
"./base1/tsdocconfig-base1.json",
115-
"./base2/tsdocconfig-base2.json",
114+
"./base1/tsdoc-base1.json",
115+
"./base2/tsdoc-base2.json",
116116
],
117117
"fileNotFound": false,
118-
"filePath": "assets/p3/tsdocconfig.json",
118+
"filePath": "assets/p3/tsdoc.json",
119119
"messages": Array [],
120120
"tagDefinitions": Array [
121121
TSDocTagDefinition {
@@ -126,7 +126,7 @@ test('Load p3', () => {
126126
"tagNameWithUpperCase": "@ROOT",
127127
},
128128
],
129-
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
129+
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
130130
}
131131
`);
132132
});
@@ -138,7 +138,7 @@ test('Load p4', () => {
138138
"extendsFiles": Array [],
139139
"extendsPaths": Array [],
140140
"fileNotFound": false,
141-
"filePath": "assets/p4/node_modules/example-lib/dist/tsdocconfig-example.json",
141+
"filePath": "assets/p4/node_modules/example-lib/dist/tsdoc-example.json",
142142
"messages": Array [],
143143
"tagDefinitions": Array [
144144
TSDocTagDefinition {
@@ -149,14 +149,14 @@ test('Load p4', () => {
149149
"tagNameWithUpperCase": "@EXAMPLE",
150150
},
151151
],
152-
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
152+
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
153153
},
154154
],
155155
"extendsPaths": Array [
156-
"example-lib/dist/tsdocconfig-example.json",
156+
"example-lib/dist/tsdoc-example.json",
157157
],
158158
"fileNotFound": false,
159-
"filePath": "assets/p4/tsdocconfig.json",
159+
"filePath": "assets/p4/tsdoc.json",
160160
"messages": Array [],
161161
"tagDefinitions": Array [
162162
TSDocTagDefinition {
@@ -167,7 +167,7 @@ test('Load p4', () => {
167167
"tagNameWithUpperCase": "@ROOT",
168168
},
169169
],
170-
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
170+
"tsdocSchema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
171171
}
172172
`);
173173
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json"
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json"
33
}

tsdoc-config/src/__tests__/assets/p3/base1/tsdoc-base1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
33
"tagDefinitions": [
44
{
55
"tagName": "@base1",

tsdoc-config/src/__tests__/assets/p3/base2/tsdoc-base2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
33
"tagDefinitions": [
44
{
55
"tagName": "@base2",

tsdoc-config/src/__tests__/assets/p3/tsdoc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
33
"extends": [
4-
"./base1/tsdocconfig-base1.json",
5-
"./base2/tsdocconfig-base2.json"
4+
"./base1/tsdoc-base1.json",
5+
"./base2/tsdoc-base2.json"
66
],
77
"tagDefinitions": [
88
{

tsdoc-config/src/__tests__/assets/p4/tsdoc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdocconfig.schema.json",
2+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v1/tsdoc.schema.json",
33
"extends": [
4-
"example-lib/dist/tsdocconfig-example.json"
4+
"example-lib/dist/tsdoc-example.json"
55
],
66
"tagDefinitions": [
77
{

0 commit comments

Comments
 (0)