Skip to content

Commit

Permalink
feat(nx): storybook schematics
Browse files Browse the repository at this point in the history
    chore(nx): move some schematics into @nrwl/angular

    chore(nx): add e2e test

    feat(nx): add storybook schematics and builder

    test: Add tests

    test: remove test

    chore: Move some schematics into @nrwl/angular

    test: fix tests

    chore: Add e2e test

    chore: Bump storybook versions

    chore: createTestUiLib takes a libName argument

    chore: configs extend root config

    fix: Remove custom scss loader

    feat: add storybook builder

    fix: generate documentation and fix linting

    chore: Builder tests passing

    fix(nx): configuration schematic can run multiple times

    feat(nx): component story format

    docs(nx): update storybook docs

    fix(nx): pin core-js dev dependency to ^2.6.9

    chore(nx): fix formatting

    chore(nx): match core-js version for web/storybook

    chore(nx): remove storybook's angular dependencies

    chore(nx): modifyObstructiveCode to false in cypress.json

    See: cypress-io/cypress#4042 (comment)

    chore(nx): storybook tests --no-interactive

    chore(nx): add storybook to e2e tests

    chore(nx): reorder e2e tests
  • Loading branch information
Isaac Mann authored and vsavkin committed Oct 23, 2019
1 parent 148a8c8 commit c60857a
Show file tree
Hide file tree
Showing 78 changed files with 5,206 additions and 204 deletions.
37 changes: 37 additions & 0 deletions docs/angular/api-angular/schematics/stories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# stories

Create stories/specs for all components declared in a library

## Usage

```bash
ng generate stories ...
```

By default, Nx will search for `stories` in the default collection provisioned in `angular.json`.

You can specify the collection explicitly as follows:

```bash
ng g @nrwl/angular:stories ...
```

Show what will be generated without writing to disk:

```bash
ng g stories ... --dry-run
```

## Options

### generateCypressSpecs

Type: `boolean`

Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure schematic

### name

Type: `string`

Library name
73 changes: 73 additions & 0 deletions docs/angular/api-storybook/builders/storybook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# storybook

Serve Storybook

Builder properties can be configured in angular.json when defining the builder, or when invoking it.

## Properties

### host

Default: `localhost`

Type: `string`

Host to listen on.

### port

Default: `9009`

Type: `number`

Port to listen on.

### quiet

Default: `true`

Type: `boolean`

Suppress verbose build output.

### ssl

Default: `false`

Type: `boolean`

Serve using HTTPS.

### sslCert

Type: `string`

SSL certificate to use for serving HTTPS.

### sslKey

Type: `string`

SSL key to use for serving HTTPS.

### staticDir

Type: `array`

Directory where to load static files from, array of strings

### uiFramework (**hidden**)

Default: `@storybook/angular`

Type: `string`

Storybook framework npm package

### watch

Default: `true`

Type: `boolean`

Watches for changes and rebuilds application
49 changes: 49 additions & 0 deletions docs/angular/api-storybook/schematics/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# configuration

Add storybook configuration to a ui library

## Usage

```bash
ng generate configuration ...
```

By default, Nx will search for `configuration` in the default collection provisioned in `angular.json`.

You can specify the collection explicitly as follows:

```bash
ng g @nrwl/storybook:configuration ...
```

Show what will be generated without writing to disk:

```bash
ng g configuration ... --dry-run
```

## Options

### configureCypress

Type: `boolean`

Run the cypress-configure schematic

### generateCypressSpecs

Type: `boolean`

Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure schematic

### generateStories

Type: `boolean`

Automatically generate \*.stories.ts files for components declared in this library

### name

Type: `string`

Library name
31 changes: 31 additions & 0 deletions docs/angular/api-storybook/schematics/cypress-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# cypress-project

Add cypress e2e app to test a ui library that is set up for storybook

## Usage

```bash
ng generate cypress-project ...
```

By default, Nx will search for `cypress-project` in the default collection provisioned in `angular.json`.

You can specify the collection explicitly as follows:

```bash
ng g @nrwl/storybook:cypress-project ...
```

Show what will be generated without writing to disk:

```bash
ng g cypress-project ... --dry-run
```

## Options

### name

Type: `string`

Library name
1 change: 1 addition & 0 deletions docs/angular/builders.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"nest",
"next",
"node",
"storybook",
"web",
"workspace"
]
1 change: 1 addition & 0 deletions docs/angular/schematics.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"next",
"node",
"react",
"storybook",
"web",
"workspace"
]
42 changes: 42 additions & 0 deletions docs/api-angular/schematics/component-cypress-spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# component-cypress-spec [hidden]

Create a cypress spec for a ui component that has a story

## Usage

```bash
ng generate component-cypress-spec ...

```

## Options

### componentFileName

Type: `string`

Component file name without the .ts extension

### componentName

Type: `string`

Class name of the component

### componentPath

Type: `string`

Relative path to the component file from the library root

### libPath

Type: `string`

Path to the library

### projectName

Type: `string`

Name of the library from angular.json
48 changes: 48 additions & 0 deletions docs/api-angular/schematics/component-story.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# component-story [hidden]

Create a stories.ts file for a component

## Usage

```bash
ng generate component-story ...

```

## Options

### componentFileName

Type: `string`

Component file name without the .ts extension

### componentName

Type: `string`

Class name of the component

### componentPath

Type: `string`

Relative path to the component file from the library root

### libPath

Type: `string`

Path to the library

### moduleFileName

Type: `string`

File name of the module that declares this component

### ngModuleClassName

Type: `string`

Class name of the module that declares this component
24 changes: 24 additions & 0 deletions docs/api-angular/schematics/stories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# stories

Create stories/specs for all components declared in a library

## Usage

```bash
ng generate stories ...

```

## Options

### generateCypressSpecs

Type: `boolean`

Automatically generate \*.spec.ts files in the cypress e2e app generated by the cypress-configure schematic

### name

Type: `string`

Library name
69 changes: 69 additions & 0 deletions docs/api-storybook/builders/storybook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# storybook

Serve Storybook

## Properties

### host

Default: `localhost`

Type: `string`

Host to listen on.

### port

Default: `9009`

Type: `number`

Port to listen on.

### quiet

Default: `true`

Type: `boolean`

Suppress verbose build output.

### ssl

Default: `false`

Type: `boolean`

Serve using HTTPS.

### sslCert

Type: `string`

SSL certificate to use for serving HTTPS.

### sslKey

Type: `string`

SSL key to use for serving HTTPS.

### staticDir

Type: `array`

Directory where to load static files from, array of strings

### uiFramework

Type: `string`

Storybook framework npm package

### watch

Default: `true`

Type: `boolean`

Watches for changes and rebuilds application

0 comments on commit c60857a

Please sign in to comment.