@composi/create-composi-app:

Install

To install Composi, you'll need to have Node installed first. If you do have Node, then open your terminal and run:

npm install -g @composi/create-composi-app

If you are on a Mac or Linux, you may need to run the above command with sudo.

After installing you can check that everything is right by running:

create-composi-app -h

This will output help in the terminal. You can also get the current version of create-composi-app:

create-composi-app -v

Create a Project

Now that you have @composi/create-composi-app installed, you can use it to create a new project setup to use @composi/core. To do this you open your terminal and type in create-composi-app -n followed by the name for the project. The -n flag indicates that what follows is the name for the project. This will create a project with that name on your desktop:

create-composi-app -n MyProj

If you want a multi-word project name with spaces, you'll need to enclose the name in quotes:

create-composi-app -n "My Project"

When you create a project with a multi-word name with spaces, Composi creates a folder with that name. However, because of NPM requirements, the package.json name is converted to lowercase and the spaces to hyphens. So the name "My Project" would appear in the package.json file as "my-project". But the project folder would remain "My Project".

Provide a Path

By default create-composi-app puts the new project on the desktop. However, you can tell it where you want the project to be placed by providing a second argument. This needs to be a valid path for your operating system. It also needs to be quoted. To designate a path for a new project you use the -p flag followed by the path. We'll create our project in a special folder in our home directory:

create-composi-app -n "Panda Puff" -p "~/dev"

The above will create the project "Panda Puff" in the folder dev. If dev does not exist, it will be created. Otherwise it will be create inside of it with whatever else the folder contains.

Install Dependencies

After creating a new project you need to install its Dependencies. To do so, cd to the project folder and run the following in your terminal:

npm i

This might take a while. Once the installation is finished you're ready to launch your project.

Launch the Project

You launch your project by running the following command in the terminal while in the project folder:

npm start

This will build the project, set up watchers and launch the build in your default browser.

Any changes you make to the index.html file, or any files inside the project's src folder, will trigger and appropriate build process and browser refresh.