noct
v1.0.55
Published
cli for nocturn, https://nocturn.io
Downloads
15
Maintainers
Readme
Nocturn CLI
noct is a tool to build Nocturn projects from the command line.
Getting Started
npm install -g noct
Dependencies
Creating a Nocturn project
Create a Nocturn project in the current directory
noct init
Project files and directories
app.json
The app.json file contains configuration data for the project. A basic app.json file will be generated after "noct init" and can be modified directly after.
{
"name": <project name>,
"displayName": <display name, shows up in title tag>,
"start": <main module (first module loaded)>,
"uiVersion": <version of nocturn-ui.js to use>,
"cmlVersion": <version of cml-runtime.js to use>,
"plugins": [{
"name": <plugin name>,
"type": <file type, ie javascript, css>,
"url": <path to plugin, can be a local path or an url>
},
...
],
"modules": [
<module name>,
...
]
// PWA Properties
"includeRuntime": <true (include runtime files locally), false (use cdn url)>,
"includeManifest": <true (include manifest.json file), false (default, don't include)>,
"includeServiceWorker": <true (include serviceworker.js file), false (default, don't include)>,
"themeColor": <color theme for app>,
"icons": [
{
"src": <icon image>,
"type": "image/png",
"sizes": "192x192"
},
{
"src": <icon image>,
"type": "image/png",
"sizes": "512x512"
}
],
"background_color": <loading screen color>,
"display": "standalone",
"cacheList": [
<url to cache in serviceworker.js>
...
]
}
Some properties in the app.json file are used to generate manifest and serviceworker files. These files are necessary to make your app a Progressive Web App (PWA).
index.html
Nocturn projects compiles into a single html file. Code in index.html is generated from modules and information from the app.json. The file index.html will include all other resource used by the single page app.
cml directory
This directory is where the projects cml files are stored. In the project.json file a referenced module name should match a file name in the cml directory.
js directory
This directory is where the compiled js files for the project will be placed.
Building a Nocturn project
Build the Nocturn project in the current directory.
noct build
Check version of cml noct is building using.
noct build -v
or
noct build --version
Editing Modules
Nocturn projects are composed of Modules. You can add or remove modules from the project by editing app.json or by using cli commands.
Creating Modules
create a new module with a template
noct create -t Card.cml exampleCard.cml
Templates
- Module.cml
- Card.cml
- NavBar.cml
- SideNav.cml
- Banner.cml
- Modal.cml
- Footer.cml
- FAB.cml
Adding Modules
add all modules in the cml directory
noct add -all
or
noct add -a
add a specific module from the cml directory, in this case "exampleModule"
noct add exampleModule
Removing Modules
remove a specific module from the project, in this case "exampleModule". The module will still be available in the directory, the file will not be deleted.
noct remove exampleModule
remove all modules from the project. All modules in the cml directory will stay available; they will not be deleted.
noct remove -a