Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Latest commit

 

History

History
221 lines (149 loc) · 4.41 KB

commands.md

File metadata and controls

221 lines (149 loc) · 4.41 KB

Commands

This file describes the commands that can be run for this application.

/!\ The commands are run from the project's root directory.

  • Go here to know more about the library.
  • Go here to see more project commands.

Table of contents

Running commands

The running commands run an instance of the application or another processus.

Start

There is a command to run the office application in dev mode:

npm run office:start

The server will be listening on the port 5200.
Unless another port is set:

npm run office:start -- --port 5202

https://angular.io/cli/serve

Lint

As in the lint section, the application code can be linted with the following command:

npm run office:lint

And its corrector:

npm run office:lint:fix

Check also the styleguide.

Run linters separately

As for the global linting, it is possible to run each linter separately

  • ESLint:
npm run office:lint:code

And its corrector:

npm run office:lint:code:fix
  • Stylelint:
npm run office:lint:style

And its corrector:

npm run office:lint:style:fix

Test

As in the test section, the library code can be tested with the following command:

npm run office:test

If developing at the same time, enable the watch mode:

npm run office:test:watch

E2E tests

See these commands to run the E2E tests.

Compodoc

Compodoc is a tool that generates documentation from the comments of an Angular application.

The documentation can be served with the following command:

npm run office:compodoc

The server will be listening on the port 5080.

The documentation can also be generated to be served as static content:

npm run office:compodoc:build

The comment coverage can also be tested. In fact, it is one of the tests of the CI:

npm run office:compodoc:coverage

Storybook

Storybook generates pages for the components of the application in which it is possible to modifie their parameters and see them changing.

It can be run, in watch mode, with the following command:

npm run office:storybook

The server will be listening on the port 5040.

The content can also be compiled to be served statically:

npm run office:storybook:build

Code generation

Generate Angular files

The Angular CLI is a useful tool that can be used via Nx. The latest proposes a lot of commands, especially the generators.

Also see the structure of the code.

Generate views

Views can be generated with the following command:

nx g @nna/plugin:view --project=office <view>

To generate a dev view:

nx g @nna/plugin:view --project=office --dev <view>

It uses the plugin of the project.

Generate components

Components can be generated with the following command:

nx g @nx/angular:component --project=office components/<component>

To generate a dev component:

nx g @nx/angular:component --project=office ../dev/components/<component>

Create stories (Storybook)

To generate stories from the existing components:

npm run office:storybook:generate

I18n

The following sections describe the commands related to I18n.

Extract I18n

The I18n keys can be extracted with the following command:

npm run office:i18n:extract