0.0.0 • Published 8 years ago

generator-expensy v0.0.0

Weekly downloads
3
License
-
Repository
-
Last release
8 years ago

generator-expensy

This is the generator to create new modules into the Expensy application.

Usage

The first time you call a subgenerator, it will ask for a configuration. This configuration is then stored in the .yo-rc.json file in the root of the project. Please, remember to untrack this file as it is specific to your environment.

Create a new route component

yo expensy:route <name>

with as the name of the component. If you don't provide an entry point, the route is considered as the main entry point.

yo expensy:route foo      --entry=parent   # create a new route component at xxx/routes/parents/routes/foo/foo.ts
yo expensy:route foo/bar  --entry=parent   # create a new sub route component at xxx/routes/parent/routes/foo/bar/bar.ts

Create a new component

yo expensy:component <name>

with as the name of the component. If you don't provide an entry point, the directive is considered as shared.

yo expensy:component foo                       # create a new component at xxx/shared/components/foo/foo.ts
yo expensy:component foo/bar                   # create a new sub component at xxx/shared/components/foo/bar/bar.ts
yo expensy:component foo     --entry=parent    # create a new component at xxx/routes/parent/components/foo/foo.ts
yo expensy:component foo/bar --entry=parent    # create a new sub component at xxx/routes/parent/components/foo/bar/bar.ts

Create a new filter

yo expensy:filter <name>

with as the name of the filter. If you don't provide an entry point, the directive is considered as shared.

yo expensy:filter foo                   # create a new filter at xxx/shared/filters/foo/foo.ts
yo expensy:filter bar --entry=parent    # create a new filter at xxx/routes/parent/filters/bar/bar.ts

Create a new service

yo expensy:service <name>

with as the name of the service. If you don't provide an entry point, the directive is considered as shared.

yo expensy:service foo                   # create a new service at xxx/shared/services/foo/foo.ts
yo expensy:service bar --entry=parent    # create a new service at xxx/routes/parent/services/bar/bar.ts

Create a new directive

yo expensy:directive <name>

with as the name of the directive. If you don't provide an entry point, the directive is considered as shared.

yo expensy:directive foo                   # create a new directive at xxx/shared/directive/foo/foo.ts
yo expensy:directive bar --entry=parent    # create a new directive at xxx/routes/parent/directive/bar/bar.ts

Create a new model

yo expensy:model <name>

with as the name of the model. Models are always created in the shared directory. Models cannot be nested.

Develop

Run the tests

gulp test

Release a new version

Please use the following command

npm version x.y.z

This is necessary so that our update notifier will be able to compare the version in the package.json with the tags in the git repository.

Add a new subcommand

To create a new subcommand, you have to follow a few rules.

  1. Create a folder inside generators. The name of the folder will determine the name of the subcommand.
  2. Create a templates folder.
  3. Create all the files to copy. If you write <name> in the file name, it will be replaced by the name when calling the generator.
  4. Add an index.js file. You will put the logic in here.
  5. Add the tests