Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: clean up, add docs, add entry point #1955

Merged
merged 26 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d64c4be
test generated docs
davidjgoss Mar 14, 2022
58f14a8
add metadata to entry point, regenerate
davidjgoss Mar 15, 2022
f76777c
add tooling
davidjgoss Mar 15, 2022
1bb5413
merge main
davidjgoss Mar 15, 2022
3e3423f
bump cucumber-expressions to fix issue
davidjgoss Mar 15, 2022
ea357c6
combine in a single `docs` script and tell dependency-lint.yml
davidjgoss Mar 15, 2022
19d060b
regenerate docs
davidjgoss Mar 15, 2022
8ba535a
rework directories
davidjgoss Mar 15, 2022
0edd467
improve docs
davidjgoss Mar 15, 2022
d4af1b0
Merge branch 'main' into feat/api-entry-point-and-docs
davidjgoss Mar 16, 2022
d3fc0bc
add entry point at /api
davidjgoss Mar 16, 2022
921cc4d
runtime options to extend
davidjgoss Mar 16, 2022
3bc5df7
get the docs in reasonable shape; make naming consistent, split out s…
davidjgoss Mar 16, 2022
c90de5d
get the docs in reasonable shape; make naming consistent, split out s…
davidjgoss Mar 16, 2022
37ab35a
refactor scripts, add a ci one
davidjgoss Mar 16, 2022
2363250
fix api-extractor warning for now
davidjgoss Mar 16, 2022
35fbd28
use @public
davidjgoss Mar 16, 2022
1b4e26f
rework tooling, add guidance to CONTRIBUTING.md
davidjgoss Mar 16, 2022
316ea0e
write some docs, make some stuff optional where possible
davidjgoss Mar 16, 2022
7102237
simplify dir structure
davidjgoss Mar 16, 2022
5ca8c5e
add changelog entry
davidjgoss Mar 16, 2022
265f2ec
link to new doc in changelog entry
davidjgoss Mar 17, 2022
f0dbb5f
rename interfaces and properties per review feedback
davidjgoss Mar 17, 2022
42598e2
fix hand-written doc
davidjgoss Mar 17, 2022
052f5e8
Update docs/javascript_api.md
davidjgoss Mar 17, 2022
24b420d
Update javascript_api.md
davidjgoss Mar 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
([#1136](https://github.com/cucumber/cucumber-js/issues/1136)
[#1721](https://github.com/cucumber/cucumber-js/pull/1721))
- Support for configuration to be objects instead of argv strings, and for configuration files in ESM and JSON formats ([#1952](https://github.com/cucumber/cucumber-js/pull/1952))
- New API for running Cucumber programmatically ([#1955](https://github.com/cucumber/cucumber-js/pull/1955))
davidjgoss marked this conversation as resolved.
Show resolved Hide resolved

### Fixed
- Warn users who are on an unsupported node version ([#1922](https://github.com/cucumber/cucumber-js/pull/1922))
Expand Down
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ Type `npm run` or see the `package.json` scripts section for how to run each cat
* feature tests - `npm run feature-test`
* cucumber-js tests itself

## API Documentation

The functionality exposed under the `@cucumber/cucumber/api` entry point is analysed and has documentation generated by [API Extractor](https://api-extractor.com/). If you make a change that affects the public API surface, you'll need to run `npm run docs:local` to run the analysis and regenerate the docs, and commit the changes. If you forget to do this locally, the CI build will fail and remind you.

## Internals

### Project Structure

```
└── src
├── cli # argv parsing, reading files
├── api # main runCucumber function etc
├── cli # executing from argv
├── configuration # loading, merging, validating configuration
├── formatter # displaying the results
Expand Down
25 changes: 25 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/lib/api/index.d.ts",
"compiler": {
},
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/reports/",
"reportTempFolder": "<projectFolder>/tmp/api-extractor/"
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/tmp/api-extractor/<unscopedPackageName>.api.json"
},
"dtsRollup": {
"enabled": false
},
"messages": {
"extractorMessageReporting": {
"ae-forgotten-export": {
"logLevel": "none"
}
}
}
}
2 changes: 2 additions & 0 deletions dependency-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ executedModules:
npmScripts:
dev:
- build
- docs:ci
- docs:local
- lint
- publish
- test
Expand Down
13 changes: 13 additions & 0 deletions docs/api/cucumber.iloadconfigurationoptions.file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) &gt; [file](./cucumber.iloadconfigurationoptions.file.md)

## ILoadConfigurationOptions.file property

Path to load configuration file from (defaults to `cucumber.(js|cjs|mjs|json)` if omitted).

<b>Signature:</b>

```typescript
file?: string;
```
21 changes: 21 additions & 0 deletions docs/api/cucumber.iloadconfigurationoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md)

## ILoadConfigurationOptions interface


<b>Signature:</b>

```typescript
export interface ILoadConfigurationOptions
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [file?](./cucumber.iloadconfigurationoptions.file.md) | string | <i>(Optional)</i> Path to load configuration file from (defaults to <code>cucumber.(js&#124;cjs&#124;mjs&#124;json)</code> if omitted). |
| [profiles?](./cucumber.iloadconfigurationoptions.profiles.md) | string\[\] | <i>(Optional)</i> Zero or more profile names from which to source configuration (if omitted or empty, the <code>default</code> profile will be used). |
| [provided?](./cucumber.iloadconfigurationoptions.provided.md) | Partial&lt;IConfiguration&gt; | <i>(Optional)</i> Ad-hoc configuration options to be applied over the top of whatever is loaded from the configuration file/profiles. |

13 changes: 13 additions & 0 deletions docs/api/cucumber.iloadconfigurationoptions.profiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) &gt; [profiles](./cucumber.iloadconfigurationoptions.profiles.md)

## ILoadConfigurationOptions.profiles property

Zero or more profile names from which to source configuration (if omitted or empty, the `default` profile will be used).

<b>Signature:</b>

```typescript
profiles?: string[];
```
13 changes: 13 additions & 0 deletions docs/api/cucumber.iloadconfigurationoptions.provided.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [ILoadConfigurationOptions](./cucumber.iloadconfigurationoptions.md) &gt; [provided](./cucumber.iloadconfigurationoptions.provided.md)

## ILoadConfigurationOptions.provided property

Ad-hoc configuration options to be applied over the top of whatever is loaded from the configuration file/profiles.

<b>Signature:</b>

```typescript
provided?: Partial<IConfiguration>;
```
20 changes: 20 additions & 0 deletions docs/api/cucumber.iloadsupportoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [ILoadSupportOptions](./cucumber.iloadsupportoptions.md)

## ILoadSupportOptions interface


<b>Signature:</b>

```typescript
export interface ILoadSupportOptions
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [sources](./cucumber.iloadsupportoptions.sources.md) | [ISourcesCoordinates](./cucumber.isourcescoordinates.md) | |
| [support](./cucumber.iloadsupportoptions.support.md) | [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) | |

11 changes: 11 additions & 0 deletions docs/api/cucumber.iloadsupportoptions.sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [ILoadSupportOptions](./cucumber.iloadsupportoptions.md) &gt; [sources](./cucumber.iloadsupportoptions.sources.md)

## ILoadSupportOptions.sources property

<b>Signature:</b>

```typescript
sources: ISourcesCoordinates;
```
11 changes: 11 additions & 0 deletions docs/api/cucumber.iloadsupportoptions.support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [ILoadSupportOptions](./cucumber.iloadsupportoptions.md) &gt; [support](./cucumber.iloadsupportoptions.support.md)

## ILoadSupportOptions.support property

<b>Signature:</b>

```typescript
support: ISupportCodeCoordinates;
```
20 changes: 20 additions & 0 deletions docs/api/cucumber.iresolvedconfiguration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IResolvedConfiguration](./cucumber.iresolvedconfiguration.md)

## IResolvedConfiguration interface


<b>Signature:</b>

```typescript
export interface IResolvedConfiguration
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [original](./cucumber.iresolvedconfiguration.original.md) | IConfiguration | The final flat configuration object resolved from the configuration file/profiles plus any extra provided. |
| [runnable](./cucumber.iresolvedconfiguration.runnable.md) | [IRunnableConfiguration](./cucumber.irunnableconfiguration.md) | The format that can be passed into <code>runCucumber</code>. |

13 changes: 13 additions & 0 deletions docs/api/cucumber.iresolvedconfiguration.original.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IResolvedConfiguration](./cucumber.iresolvedconfiguration.md) &gt; [original](./cucumber.iresolvedconfiguration.original.md)

## IResolvedConfiguration.original property

The final flat configuration object resolved from the configuration file/profiles plus any extra provided.

<b>Signature:</b>

```typescript
original: IConfiguration;
```
13 changes: 13 additions & 0 deletions docs/api/cucumber.iresolvedconfiguration.runnable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IResolvedConfiguration](./cucumber.iresolvedconfiguration.md) &gt; [runnable](./cucumber.iresolvedconfiguration.runnable.md)

## IResolvedConfiguration.runnable property

The format that can be passed into `runCucumber`<!-- -->.

<b>Signature:</b>

```typescript
runnable: IRunnableConfiguration;
```
13 changes: 13 additions & 0 deletions docs/api/cucumber.irunenvironment.cwd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunEnvironment](./cucumber.irunenvironment.md) &gt; [cwd](./cucumber.irunenvironment.cwd.md)

## IRunEnvironment.cwd property

Working directory for the project (defaults to `process.cwd()` if omitted).

<b>Signature:</b>

```typescript
cwd?: string;
```
13 changes: 13 additions & 0 deletions docs/api/cucumber.irunenvironment.env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunEnvironment](./cucumber.irunenvironment.md) &gt; [env](./cucumber.irunenvironment.env.md)

## IRunEnvironment.env property

Environment variables (defaults to `process.env` if omitted).

<b>Signature:</b>

```typescript
env?: NodeJS.ProcessEnv;
```
23 changes: 23 additions & 0 deletions docs/api/cucumber.irunenvironment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunEnvironment](./cucumber.irunenvironment.md)

## IRunEnvironment interface

Contextual data about the project environment.

<b>Signature:</b>

```typescript
export interface IRunEnvironment
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [cwd?](./cucumber.irunenvironment.cwd.md) | string | <i>(Optional)</i> Working directory for the project (defaults to <code>process.cwd()</code> if omitted). |
| [env?](./cucumber.irunenvironment.env.md) | NodeJS.ProcessEnv | <i>(Optional)</i> Environment variables (defaults to <code>process.env</code> if omitted). |
| [stderr?](./cucumber.irunenvironment.stderr.md) | IFormatterStream | <i>(Optional)</i> Writable stream where the test run's warning/error output is written (defaults to <code>process.stderr</code> if omitted). |
| [stdout?](./cucumber.irunenvironment.stdout.md) | IFormatterStream | <i>(Optional)</i> Writable stream where the test run's main output is written (defaults to <code>process.stdout</code> if omitted). |

13 changes: 13 additions & 0 deletions docs/api/cucumber.irunenvironment.stderr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunEnvironment](./cucumber.irunenvironment.md) &gt; [stderr](./cucumber.irunenvironment.stderr.md)

## IRunEnvironment.stderr property

Writable stream where the test run's warning/error output is written (defaults to `process.stderr` if omitted).

<b>Signature:</b>

```typescript
stderr?: IFormatterStream;
```
13 changes: 13 additions & 0 deletions docs/api/cucumber.irunenvironment.stdout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunEnvironment](./cucumber.irunenvironment.md) &gt; [stdout](./cucumber.irunenvironment.stdout.md)

## IRunEnvironment.stdout property

Writable stream where the test run's main output is written (defaults to `process.stdout` if omitted).

<b>Signature:</b>

```typescript
stdout?: IFormatterStream;
```
11 changes: 11 additions & 0 deletions docs/api/cucumber.irunnableconfiguration.formats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunnableConfiguration](./cucumber.irunnableconfiguration.md) &gt; [formats](./cucumber.irunnableconfiguration.formats.md)

## IRunnableConfiguration.formats property

<b>Signature:</b>

```typescript
formats: IRunOptionsFormats;
```
22 changes: 22 additions & 0 deletions docs/api/cucumber.irunnableconfiguration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunnableConfiguration](./cucumber.irunnableconfiguration.md)

## IRunnableConfiguration interface


<b>Signature:</b>

```typescript
export interface IRunnableConfiguration
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [formats](./cucumber.irunnableconfiguration.formats.md) | [IRunOptionsFormats](./cucumber.irunoptionsformats.md) | |
| [runtime](./cucumber.irunnableconfiguration.runtime.md) | [IRunOptionsRuntime](./cucumber.irunoptionsruntime.md) | |
| [sources](./cucumber.irunnableconfiguration.sources.md) | [ISourcesCoordinates](./cucumber.isourcescoordinates.md) | |
| [support](./cucumber.irunnableconfiguration.support.md) | [ISupportCodeCoordinates](./cucumber.isupportcodecoordinates.md) | |

11 changes: 11 additions & 0 deletions docs/api/cucumber.irunnableconfiguration.runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunnableConfiguration](./cucumber.irunnableconfiguration.md) &gt; [runtime](./cucumber.irunnableconfiguration.runtime.md)

## IRunnableConfiguration.runtime property

<b>Signature:</b>

```typescript
runtime: IRunOptionsRuntime;
```
11 changes: 11 additions & 0 deletions docs/api/cucumber.irunnableconfiguration.sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunnableConfiguration](./cucumber.irunnableconfiguration.md) &gt; [sources](./cucumber.irunnableconfiguration.sources.md)

## IRunnableConfiguration.sources property

<b>Signature:</b>

```typescript
sources: ISourcesCoordinates;
```
11 changes: 11 additions & 0 deletions docs/api/cucumber.irunnableconfiguration.support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunnableConfiguration](./cucumber.irunnableconfiguration.md) &gt; [support](./cucumber.irunnableconfiguration.support.md)

## IRunnableConfiguration.support property

<b>Signature:</b>

```typescript
support: ISupportCodeCoordinates;
```
11 changes: 11 additions & 0 deletions docs/api/cucumber.irunoptions.formats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@cucumber/cucumber](./cucumber.md) &gt; [IRunOptions](./cucumber.irunoptions.md) &gt; [formats](./cucumber.irunoptions.formats.md)

## IRunOptions.formats property

<b>Signature:</b>

```typescript
formats: IRunOptionsFormats;
```
Loading