Skip to content

Commit 0002b1c

Browse files
committed
Introduce test projects for TSv2, TSv3, and TSv4.
1 parent 81ef205 commit 0002b1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1314
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib-*
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
4+
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
5+
"apiReport": {
6+
"enabled": true,
7+
"reportFolder": "<projectFolder>/etc"
8+
},
9+
"docModel": {
10+
"enabled": true
11+
},
12+
"dtsRollup": {
13+
"enabled": true,
14+
"alphaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-alpha.d.ts",
15+
"betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts"
16+
}
17+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* Defines configuration used by core Heft.
3+
*/
4+
{
5+
"$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json",
6+
7+
"eventActions": [
8+
{
9+
/**
10+
* The kind of built-in operation that should be performed.
11+
* The "deleteGlobs" action deletes files or folders that match the
12+
* specified glob patterns.
13+
*/
14+
"actionKind": "deleteGlobs",
15+
16+
/**
17+
* The stage of the Heft run during which this action should occur. Note that actions specified in heft.json
18+
* occur at the end of the stage of the Heft run.
19+
*/
20+
"heftEvent": "clean",
21+
22+
/**
23+
* A user-defined tag whose purpose is to allow configs to replace/delete handlers that were added by other
24+
* configs.
25+
*/
26+
"actionId": "defaultClean",
27+
28+
/**
29+
* Glob patterns to be deleted. The paths are resolved relative to the project folder.
30+
*/
31+
"globsToDelete": ["dist", "lib", "lib-esnext", "lib-umd", "temp"]
32+
}
33+
],
34+
35+
/**
36+
* The list of Heft plugins to be loaded.
37+
*/
38+
"heftPlugins": [
39+
// {
40+
// /**
41+
// * The path to the plugin package.
42+
// */
43+
// "plugin": "path/to/my-plugin",
44+
//
45+
// /**
46+
// * An optional object that provides additional settings that may be defined by the plugin.
47+
// */
48+
// // "options": { }
49+
// }
50+
51+
{
52+
/**
53+
* The path to the plugin package.
54+
*/
55+
"plugin": "@rushstack/heft-jest-plugin"
56+
}
57+
]
58+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json"
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"operationSettings": [
3+
{
4+
"operationName": "build",
5+
"outputFolderNames": ["dist", "lib", "lib-esnext", "lib-umd"]
6+
}
7+
]
8+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Configures the TypeScript plugin for Heft. This plugin also manages linting.
3+
*/
4+
{
5+
"$schema": "https://developer.microsoft.com/json-schemas/heft/typescript.schema.json",
6+
7+
/**
8+
* If provided, emit these module kinds in addition to the modules specified in the tsconfig.
9+
* Note that this option only applies to the main tsconfig.json configuration.
10+
*/
11+
"additionalModuleKindsToEmit": [
12+
{
13+
"moduleKind": "esnext",
14+
"outFolderName": "lib-esnext"
15+
},
16+
{
17+
"moduleKind": "umd",
18+
"outFolderName": "lib-umd"
19+
}
20+
]
21+
22+
/**
23+
* If set to "true", the TSlint task will not be invoked.
24+
*/
25+
// "disableTslint": true,
26+
27+
/**
28+
* Set this to change the maximum number of file handles that will be opened concurrently for writing.
29+
* The default is 50.
30+
*/
31+
// "maxWriteParallelism": 50
32+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## API Report File for "heft-typescript-v2-test"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
// @public (undocumented)
8+
export class TestClass {
9+
}
10+
11+
// (No @packageDocumentation comment for this package)
12+
13+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "heft-typescript-v2-test",
3+
"description": "Building this project tests building with TypeScript v2",
4+
"version": "1.0.0",
5+
"private": true,
6+
"main": "lib/index.js",
7+
"license": "MIT",
8+
"scripts": {
9+
"build": "heft build --clean",
10+
"_phase:build": "heft build --clean",
11+
"_phase:test": "heft test --no-build"
12+
},
13+
"devDependencies": {
14+
"@microsoft/api-extractor": "workspace:*",
15+
"@rushstack/heft": "workspace:*",
16+
"@rushstack/heft-jest-plugin": "workspace:*",
17+
"@types/jest": "ts2.9",
18+
"@types/node": "ts2.9",
19+
"tslint": "~5.20.1",
20+
"tslint-microsoft-contrib": "~6.2.0",
21+
"typescript": "~2.9.2"
22+
}
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
/**
5+
* @public
6+
*/
7+
export class TestClass {} // tslint:disable-line:export-name
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
interface IInterface {
5+
element: string;
6+
}
7+
8+
describe('Example Test', () => {
9+
it('Correctly tests stuff', () => {
10+
expect(true).toBeTruthy();
11+
});
12+
13+
it('Correctly handles snapshots', () => {
14+
expect({ a: 1, b: 2, c: 3 }).toMatchSnapshot();
15+
});
16+
17+
it('Correctly handles TypeScript constructs', () => {
18+
const interfaceInstance: IInterface = {
19+
element: 'a'
20+
};
21+
expect(interfaceInstance).toBeTruthy();
22+
});
23+
});

0 commit comments

Comments
 (0)