0.3.5 • Published 6 years ago

nativescript-starter-kits v0.3.5

Weekly downloads
36
License
Apache-2.0
Repository
github
Last release
6 years ago

nativescript-starter-kits

A NativeScript CLI extension for managing templates

Automatic Installation

You can install this extension using the Nativescript CLI

$ tns extension install nativescript-starter-kits

Manual Installation and Development

Download the GIT repository in you favorite projects directory

$ git clone git@github.com:NativeScript/nativescript-starter-kits.git

Run the following commands to install all dependencies, transpile all Ts files and to pack the extension.

$ npm i --ignore-scripts
$ npm i -g grunt-cli (only in case you do not have it installed globally)

$ grunt
$ grunt pack

These commands will create a .tgz file in the extension folder

Install the npm package

$ tns extension install <path to nativescript-starter-kits>.tgz

Public API

Get proper nativescript reference

const pathToPackage = require("global-modules-path").getPath("nativescript", "tns");
const tns = require(pathToPackage);

Load all available extensions

/**
     * @name loadExtensions
     * @description Loads all currently installed extensions
     * @return {Promise<any>[]} - On Success: Array of Promises, one for each installed extension
*/
Promise.all(tns.extensibilityService.loadExtensions()).then((loadedExtensions) => {
    console.log("All extensions loaded successfully!");
}).catch((error) => {
    console.error(error);
});
Get details for all installed templates
/**
     * @name getTemplates
     * @description List all available templates
     * @return {Promise<Array<any>>} - On Success: Array of Objects with Details about each template
*/
tns.templateService.getTemplates().then((templates) => {
    console.log(templates);
}).catch((error) => {
    console.error(error);
});
Get details for a single App template
/**
     * @name getAppTemplateDetails
     * @description The method returns details about a single app template.
     * @param {string} templateName - The name of the template
     * @returns {Promise<any>} - Object with details about the app template
     */
    getAppTemplateDetails(templateName: string): any;
    
tns.templateService.getAppTemplateDetails("templateName").then((details) => {
    console.log(details);
}).catch((error) => {
    console.error(error);
});

Run tests

Before running the test you need to transpile all files and dependencies.

$ grunt pack
$ npm run test

Issues

If you have found an issue with this extension, please report the problem in the Issues section.

0.3.5

6 years ago

0.3.4-2018-3-1-1

6 years ago

0.3.4-2018-1-9-1

6 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago