Commands
NPM Scripts
npm install: Install the dependencies (do this before starting the project)npm start: Run the project in development modenpm build: Create a compiled build of the projects assetsnpm generate: Used in combination with certain parameters to generate components within the brandplatformprepare: NPM command, should not be executed manually. This command is executed after anpm installnpm production: Start the servernpm release: Create a package.zip file from the compiled assets of the brandplatform and place its version and the current one in the correct folders
npm generate
The brandplatform has a certain structure when defining components. This is done to create consistency. Now it gets really annoying when you have to create a component because a certain amount of files and configuration is needed. So in order to make this dreadsome process more enjoyable and automagical, we have provided a command to generate a component with its correct configuration.
There are two type of parameters you can pass to the command:
- category: The category of the component library to place the component in. This is optional. If not passed the default general will be used. So to clearify this means that you have to write --cateogry=general.
- folder-name: The folder-name can be anything you want but it has to represent one of the folders you used to differentiate the components from each other. So this means if you have a folder called components and you want a
- button* to be generated into it. You will have to write
- components=button*.
Examples:
Generate the building-block button. This will result in a building-block being placed within the building-blocks folder of the general category.
npm run generate -- --building-blocks=buttonGenerate the component collapse. This will result in a component being placed within the components folder of the general category.
npm run generate -- --components=collapseGenerate the layout section. This will result in a layout being placed within the layouts folder of the general category.
npm run generate -- --layouts=sectionGenerate the component button. This will result in a component being placed within the components folder of the general category.
npm run generate -- --category=general --components=buttonGenerate the component button. This will result in a component being placed within the components folder of the marketing category.
npm run generate -- --category=marketing --components=buttonGenerate the component button. This will result in a component being placed within the components folder of the portal category.
npm run generate -- --category=portal --components=button