GithubHelp home page GithubHelp logo

elasticstatic / nativescript-starter-kits Goto Github PK

View Code? Open in Web Editor NEW

This project forked from telerik/nativescript-starter-kits

0.0 1.0 0.0 2.62 MB

NativeScript Cli Extension

License: Apache License 2.0

JavaScript 23.59% TypeScript 76.41%

nativescript-starter-kits's Introduction

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 [email protected]: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.

nativescript-starter-kits's People

Contributors

lini avatar adjenkov avatar manoldonev avatar dimitartodorov avatar martoyankov avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.