@composi/create-composi-appPackage to create projects ready to use @composi/core to create desktop and mobile websites, PWAs and hybrid apps.
If you're on Mac or Linux you may need to run the above command with
npm install --save-dev @composi/create-composi-app
sudo, depending on how you have NPM set up. Check the NPM docs for information about how to handle permissions to avoid having to use
HelpAfter installing create-composi-app, you can get help at any time:
create-composi-app -h // or: create-composi-app --help
VersionYou can find out what version of create-composi-app you are using as follows:
create-composi-app -v // or: create-composi-app --version
Create New ProjectTo create a new project, you open your terminal and type in create-composi-app followed by the
-nflag and the name for the project. This will create a project with that name on your desktop:
create-composi-app -n MyProj
When providing a name, create-composi-app will always use the name as provided. However, for the package.json file it has to use a valid name. This means it makes the name lowercase. It also converts spaces to hyphens.
If you want to use a multi-word name with spaces, you need to enclose it in quotes:
Although the project folder will be "My Project", the package name will be "my-project".
create-composi-app -n "My Project"
Provide Path for New ProjectWhen you only provide a name for a project, create-composi-app creates it on the Desktop. However, you can provide an argument with the flag
-pas the path for where you want the new project created. Of course this path needs to follow the naming conventions of your operating system:
# For Mac and Linux: create-composi-app -n "My App" -p "~/Desktop/dev/personal" # For Windows: create-composi-app -n "My App" -p "~\Desktop\dev\personal"
Install Dependencies and launch project.After creating a project,
cdto it and run:
When the install finishes, you can build and launch the new project with:
Create Deployment VersionWhen you are done developing your app, you can get a development version. To do so, from within the project, run:
npm run build:production
This will create a new copy of your project using the same name with "-production' appended. For example, if the project's name was "My App", the production version would be "My App-production".
The production version leaves behind everything that was needed for development. In the folder you will find the index.html file and the dist folder. The paths in the index.html are aboslute, so the dist folder can be placed wherever the production server needs it to be.
Other Tasks to RunThe new project comes configured to build and launch the project with
npm run lint
And, in the case your project's dist folder has gotten messy and your not sure what you need in there, you can clean it out with:
npm run format
After cleaning out the dist folder, you can run
npm run clean
npm run build:freshto get just the files you need in the dist folder.
Less TypingYou can use an alias to create a shortcut so you don't have to type out
create-composi-app. For macOS and Linux, open your .bashprofile and add the following line:
Restart the terminal. Now you should be able to use
For Windows, in the command prompt enter: