Skip to content

Commit 3f29282

Browse files
committed
Reduce "api-extractor-test-05" to another scenario in "api-extractors-scenarios"
1 parent 8060ecc commit 3f29282

File tree

16 files changed

+44
-135
lines changed

16 files changed

+44
-135
lines changed

apps/api-extractor/build-tests.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@ECHO OFF
22
@SETLOCAL
3-
rush build -t api-extractor-lib1-test -t api-extractor-lib2-test -t api-extractor-lib3-test -t api-extractor-scenarios -t api-extractor-test-01 -t api-extractor-test-02 -t api-extractor-test-03 -t api-extractor-test-04 -t api-extractor-test-05 -t api-documenter-test
3+
rush build -t api-extractor-lib1-test -t api-extractor-lib2-test -t api-extractor-lib3-test -t api-extractor-scenarios -t api-extractor-test-01 -t api-extractor-test-02 -t api-extractor-test-03 -t api-extractor-test-04 -t api-documenter-test

build-tests/api-extractor-scenarios/config/build-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"dynamicImportType2",
1919
"dynamicImportType3",
2020
"ecmaScriptPrivateFields",
21+
"excerptTokens",
2122
"exportDuplicate",
2223
"exportEquals",
2324
"exportImportedExternal",

build-tests/api-extractor-test-05/etc/api-extractor-test-05.api.json renamed to build-tests/api-extractor-scenarios/etc/test-outputs/excerptTokens/api-extractor-scenarios.api.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,18 @@
161161
}
162162
},
163163
"kind": "Package",
164-
"canonicalReference": "api-extractor-test-05!",
164+
"canonicalReference": "api-extractor-scenarios!",
165165
"docComment": "",
166-
"name": "api-extractor-test-05",
166+
"name": "api-extractor-scenarios",
167167
"members": [
168168
{
169169
"kind": "EntryPoint",
170-
"canonicalReference": "api-extractor-test-05!",
170+
"canonicalReference": "api-extractor-scenarios!",
171171
"name": "",
172172
"members": [
173173
{
174174
"kind": "Variable",
175-
"canonicalReference": "api-extractor-test-05!MY_CONSTANT:var",
175+
"canonicalReference": "api-extractor-scenarios!MY_CONSTANT:var",
176176
"docComment": "/**\n * @public\n */\n",
177177
"excerptTokens": [
178178
{
@@ -193,7 +193,7 @@
193193
},
194194
{
195195
"kind": "Class",
196-
"canonicalReference": "api-extractor-test-05!MyClass:class",
196+
"canonicalReference": "api-extractor-scenarios!MyClass:class",
197197
"docComment": "/**\n * This is my class.\n *\n * @public\n */\n",
198198
"excerptTokens": [
199199
{
@@ -206,7 +206,7 @@
206206
"members": [
207207
{
208208
"kind": "Method",
209-
"canonicalReference": "api-extractor-test-05!MyClass#someMethod:member(1)",
209+
"canonicalReference": "api-extractor-scenarios!MyClass#someMethod:member(1)",
210210
"docComment": "/**\n * This method does something.\n *\n * @param x - This is x.\n *\n * @param y - This is y.\n */\n",
211211
"excerptTokens": [
212212
{

build-tests/api-extractor-test-05/etc/api-extractor-test-05.api.md renamed to build-tests/api-extractor-scenarios/etc/test-outputs/excerptTokens/api-extractor-scenarios.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "api-extractor-test-05"
1+
## API Report File for "api-extractor-scenarios"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** @public */
2+
export declare let MY_CONSTANT : number;
3+
4+
/**
5+
* @public This is my class.
6+
*/
7+
export declare class MyClass {
8+
/**
9+
* This method does something.
10+
* @param x - This is x.
11+
* @param y - This is y.
12+
*/
13+
someMethod(x : number , y : string ) : boolean ;
14+
}
15+
16+
export { }

build-tests/api-extractor-test-05/lib/index.d.ts renamed to build-tests/api-extractor-scenarios/src/excerptTokens/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
// prettier-ignore
12
/** @public */
23
export let MY_CONSTANT : number ;
4+
5+
// prettier-ignore
36
/**
47
* @public This is my class.
58
*/
@@ -10,4 +13,4 @@ export class MyClass {
1013
* @param y - This is y.
1114
*/
1215
someMethod(x : number , y : string ) : boolean ;
13-
}
16+
}

build-tests/api-extractor-scenarios/src/runScenarios.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See LICENSE in the project root for license information.
33

44
import * as path from 'path';
5-
import { FileSystem, JsonFile } from '@rushstack/node-core-library';
5+
import { AlreadyExistsBehavior, FileSystem, JsonFile } from '@rushstack/node-core-library';
66
import {
77
Extractor,
88
ExtractorConfig,
@@ -16,6 +16,20 @@ import {
1616
export function runScenarios(buildConfigPath: string): void {
1717
const buildConfig = JsonFile.load(buildConfigPath);
1818

19+
// Copy any .d.ts files into the "lib/" folder
20+
FileSystem.copyFiles({
21+
sourcePath: './src/',
22+
destinationPath: './lib/',
23+
alreadyExistsBehavior: AlreadyExistsBehavior.Overwrite,
24+
filter: (sourcePath: string, destinationPath: string): boolean => {
25+
if (sourcePath.endsWith('.d.ts') || !sourcePath.endsWith('.ts')) {
26+
// console.log('COPY ' + sourcePath);
27+
return true;
28+
}
29+
return false;
30+
}
31+
});
32+
1933
const entryPoints: string[] = [];
2034

2135
// TODO: Eliminate this workaround

build-tests/api-extractor-test-05/build.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

build-tests/api-extractor-test-05/config/api-extractor.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

build-tests/api-extractor-test-05/config/rush-project.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

build-tests/api-extractor-test-05/package.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

build-tests/api-extractor-test-05/tsconfig.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

build-tests/api-extractor-test-05/tsdoc-metadata.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

build-tests/api-extractor-test-05/typings/tsd.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

common/config/rush/pnpm-lock.yaml

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rush.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,6 @@
536536
"reviewCategory": "tests",
537537
"shouldPublish": false
538538
},
539-
{
540-
"packageName": "api-extractor-test-05",
541-
"projectFolder": "build-tests/api-extractor-test-05",
542-
"reviewCategory": "tests",
543-
"shouldPublish": false
544-
},
545539
{
546540
"packageName": "eslint-7-test",
547541
"projectFolder": "build-tests/eslint-7-test",

0 commit comments

Comments
 (0)