Skip to content

Commit

Permalink
feat: add cli command (#51)
Browse files Browse the repository at this point in the history
* feat: add cli command

* add cli test

* fix

* put back plugin

* prettier

* update workflow

* update docs
  • Loading branch information
danadajian authored Aug 11, 2022
1 parent bcf8e82 commit 54c45d3
Show file tree
Hide file tree
Showing 7 changed files with 369 additions and 35 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ jobs:

- name: Unit Tests
run: npm run test
cli:
name: CLI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install
run: npm ci

- name: Run cypress-codegen
run: npm run cli

- name: Check generated types match git
run: |
if [[ $(git status --porcelain) ]]; then
echo "Detected changes in generated types"
git status
exit 1
fi
component:
name: ${{ matrix.name }}
strategy:
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![npm version](https://badge.fury.io/js/cypress-codegen.svg)](https://www.npmjs.com/package/cypress-codegen)
[![Downloads](https://img.shields.io/npm/dm/cypress-codegen.svg)](https://www.npmjs.com/package/cypress-codegen)

A [Cypress](https://www.cypress.io/) plugin which automatically adds and enables IntelliSense for your [custom commands](https://docs.cypress.io/api/cypress-api/custom-commands)!
A [Cypress](https://www.cypress.io/) plugin and CLI tool which automatically adds and enables IntelliSense for your [custom commands](https://docs.cypress.io/api/cypress-api/custom-commands)!

## Table of Contents

Expand All @@ -26,7 +26,7 @@ The `cypress-codegen` plugin will dynamically import all of your project's custo
npm i --save-dev cypress-codegen
```

## Usage
## Plugin Usage

Model your Cypress project exactly like [the one in this repository](https://github.com/ExpediaGroup/cypress-codegen/blob/main/cypress.config.ts)!

Expand Down Expand Up @@ -92,6 +92,12 @@ setupNodeEvents(on, config) {
}
```

## Command Line Usage

You can also run `cypress-codegen` in your terminal to generate types for your Cypress project!

Optionally pass the `--prettier-config` flag to pass in a stringified prettier config object.

## Configuration

### Project Flag
Expand Down
Loading

0 comments on commit 54c45d3

Please sign in to comment.