From 18f883748f5d1fed5a943a57893b7fccd983b1d5 Mon Sep 17 00:00:00 2001 From: Nicholas Valbusa Date: Fri, 17 Feb 2017 16:57:07 +0100 Subject: [PATCH] more and more --- docs/Building-components.md | 23 +++++++++++++++++++++++ docs/JS-APIs.md | 8 +++++++- docs/Quickstart.md | 2 +- docs/README.md | 2 +- fliplet-create-widget.js | 2 +- package.json | 2 +- 6 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 docs/Building-components.md diff --git a/docs/Building-components.md b/docs/Building-components.md new file mode 100644 index 00000000..93502abc --- /dev/null +++ b/docs/Building-components.md @@ -0,0 +1,23 @@ +# Building components + +To start creating a component, use the CLI to generate a boilerplate including the basic things you'll need: + +``` +$ fliplet create-widget "my-awesome-component" +``` + +The above code will create a new folder named "my-awesome-component" including the skeleton of your component, including these files: + +``` +css/ +img/ +js/interface.js +widget.json +interface.html +build.html +``` + +We'll first focus on the `widget.json`, which is the definition of your component. If you're used to npm, it's similar to the `package.json` file for npm modules. + +## The component definition file (`widget.json`) + diff --git a/docs/JS-APIs.md b/docs/JS-APIs.md index 820c2273..94968956 100644 --- a/docs/JS-APIs.md +++ b/docs/JS-APIs.md @@ -50,4 +50,10 @@ Our SDK uses [Javascript promises](https://developer.mozilla.org/en-US/docs/Web/ Fliplet.Pages.get().then(function (pages) { }); -``` \ No newline at end of file +``` + +Make sure you're familiar with promises before diving into building components. + +When you're ready, move to the next section of the documentation to start building your first component. + +Build a component → \ No newline at end of file diff --git a/docs/Quickstart.md b/docs/Quickstart.md index ec2da1ee..3f54515c 100644 --- a/docs/Quickstart.md +++ b/docs/Quickstart.md @@ -47,7 +47,7 @@ You can see the version you have installed by running the command below: ```shell $ fliplet --version -3.0.0 +3.0.1 ``` You can check the latest available version of the Fliplet CLI on the [Npm](https://www.npmjs.com/package/fliplet-cli) website. diff --git a/docs/README.md b/docs/README.md index 97c15b17..bf5ab9d2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,7 +7,7 @@ To get a brief introduction to the technologies we use and the stack of the plat - [Introduction to the platform](Introduction.md) - [Quickstart](Quickstart.md) - [The JS APIs](JS-APIs.md) -- Building components +- [Building components](Building-components.md) - Building themes - [API Documentation](API-Documentation.md) - Publishing diff --git a/fliplet-create-widget.js b/fliplet-create-widget.js index 185a6cb8..55d9bead 100755 --- a/fliplet-create-widget.js +++ b/fliplet-create-widget.js @@ -39,7 +39,7 @@ ncp(path.join(__dirname, 'widget-template'), folderPath, function (err) { log('Widget has been successfully created. To run it for development:'); log(''); log(' $ cd ' + packageName); - log(' $ fliplet run-widget'); + log(' $ fliplet run'); log(''); }); diff --git a/package.json b/package.json index 685ba2b4..58f9c9de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fliplet-cli", - "version": "3.0.0", + "version": "3.0.1", "description": "", "main": "fliplet.js", "scripts": {