create-project

Creates a project scaffold with basic plugins examples on a default destination directory from a selected template.

Copy
devkit-scripts create-project <my-project-name>

It is mandatory to specify my-project-name when you run the command in order to create the scaffold.

Options

Copy
--internal-developer   specifies the type of developer who wants to generate a project (default: false)
--no-install           allows you to install the dependencies on the generated project (default: true)
--no-git-init          avoids to run git init on the generated template folder (default: false)
--template <template>  the NPM package of the template which your project will be generated from (default: "@pos-web/devkit-template-default")
--transpile-to-js      use Typescript compiler to transform Typescript files to Javascript  (default: false)

API Usage

Copy
const { createProject } = require('@pos-web/devkit-scripts');

createProject({
  install: Boolean?,
  internalDeveloper: Boolean?,
  template: String?,
})

Important:

  1. If you want to specify a different template, you will have to run the command with --template option followed by its name. Remember that this template must exist on the templates folder of the devkit-scripts in order to generate the project correctly.

  2. The command will install the node_modules by default. If you do not want them, you have to run the command with --no-install option. The project will be created without the dependencies installed, so you will probably will need to launch yarn manually on the terminal.

  3. It also uses the external registry by default to get the dependencies when yarn command is running. To change this behaviour use --internal-developer option.

  4. To be able to consume the packages from the internal repository you have to generate the new AZURE_YARN_AUTH_TOKEN based on the VSTS_NPM_AUTH_TOKEN to work with yarn v2. To know how to obtain it, please check this out.

Available templates

Default template

This template initializes a javascript project with a plugin example about:

  • template-plugin-hello-world: A basic plugin which prints a 'Hello World!' text on screen and supports translations.

You can check the whole default template structure using this link.