Skip to content

Latest commit

 

History

History
114 lines (76 loc) · 1.81 KB

development.md

File metadata and controls

114 lines (76 loc) · 1.81 KB

Autorest Development

Requirements

  • node (LTS recommended)

Optional recommendation:

  • VSCode with the following extensions:

    • Prettier
    • ESLint
    • EditorConfig

First build

  1. Install rush.js using
npm install -g @microsoft/rush
  1. Install dependencies
rush update
  1. Build
rush build

# or to do a force rebuild.
rush rebuild

Run in watch mode

When working on autorest it is recommended to have the compiler run in watch mode. This means that on file changes typescript will automatically recompile and produce the output.

# Run for all packages.
rush watch
# Run for a specific package.
npm run watch

Test

Test framework we used is jest

To run the test on the built product you have 2 options:

  1. Run all the tests using
rush test:ci
  1. Run individual project tests(Recommended when working on test)
# Go to the package directory
cd packages/<type>/<package>/

# Run test in interactive mode
npm test

# Alternatively you can run them once with coverage(Same as rush test:ci)
npm run test:ci

Other commands

  • Linting
# Run for all packages.
rush lint
# Run for a specific package.
npm run lint
  • Cleaning
# Run for all packages.
rush clean
# Run for a specific package.
npm run clean

Use your local changes

You can tell autorest to use your local changes.

  • For @autorest/core, use the --version option
autorest --version:<path-to-repo>/packages/extensions/core
  • For @autorest/modelerfour, use the --use option
autorest --use:<path-to-repo>/packages/extensions/modelerfour
  • For autorest itself, change the command
node <path-to-repo>/packages/apps/autorest/entrypoints/app.js