All Projects → NativeScript → Nativescript Schematics

NativeScript / Nativescript Schematics

Licence: apache-2.0
nativescript, mobile, schematics, angular

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Nativescript Schematics

Nx Electron
Electron schematics for nrwl nx platform
Stars: ✭ 105 (-40.34%)
Mutual labels:  schematics, cross-platform, monorepo
Luaviewsdk
A cross-platform framework to build native, dynamic and swift user interface - 强大轻巧灵活的客户端动态化解决方案
Stars: ✭ 3,586 (+1937.5%)
Mutual labels:  cross-platform, nativescript
Xplat
Cross-platform (xplat) tools for Nx workspaces https://nstudio.io/xplat
Stars: ✭ 300 (+70.45%)
Mutual labels:  cross-platform, nativescript
Angular6 Monorepo Experiment
A monorepo experiment using Angular-CLI and Lerna
Stars: ✭ 15 (-91.48%)
Mutual labels:  monorepo, angular-cli
Model
Angular Model - Simple state management with minimalist API, one way data flow, multiple model support and immutable data exposed as RxJS Observable.
Stars: ✭ 242 (+37.5%)
Mutual labels:  schematics, angular-cli
yang-schematics
Yet Another Angular Generator - based on @schematics/angular
Stars: ✭ 16 (-90.91%)
Mutual labels:  angular-cli, schematics
Nativescript
NativeScript empowers you to access native platform APIs from JavaScript directly. Angular, Capacitor, Ionic, React, Svelte, Vue and you name it compatible.
Stars: ✭ 20,730 (+11678.41%)
Mutual labels:  cross-platform, nativescript
Android Runtime
Android runtime for NativeScript (based on V8)
Stars: ✭ 399 (+126.7%)
Mutual labels:  cross-platform, nativescript
Nativescript Angular
Integrating NativeScript with Angular
Stars: ✭ 1,203 (+583.52%)
Mutual labels:  nativescript, angular-cli
Nx Packaged
Angular libraries with ng-packagr embedded in Nx Workspace.
Stars: ✭ 82 (-53.41%)
Mutual labels:  monorepo, angular-cli
Mln
高性能、小巧、易上手的移动跨平台开发框架. A framework for building Mobile cross-platform apps with Lua
Stars: ✭ 1,343 (+663.07%)
Mutual labels:  cross-platform, nativescript
Ngtron
Easily serve and build angular based electron applications
Stars: ✭ 178 (+1.14%)
Mutual labels:  schematics, angular-cli
Rwa Trivia
Trivia App - Real World Angular series
Stars: ✭ 251 (+42.61%)
Mutual labels:  nativescript, angular-cli
Angular Native Seed
Build web apps and NativeScript applications from one codebase using the AngularCLI.
Stars: ✭ 271 (+53.98%)
Mutual labels:  nativescript, angular-cli
Nativescript Cli
Command-line interface for building NativeScript apps
Stars: ✭ 977 (+455.11%)
Mutual labels:  cross-platform, nativescript
Lib
🤖 Lets you focus on the stuff that matters
Stars: ✭ 142 (-19.32%)
Mutual labels:  schematics, angular-cli
Ngx Formly
JSON powered / Dynamic forms for Angular
Stars: ✭ 2,109 (+1098.3%)
Mutual labels:  schematics, nativescript
Gsy github app flutter
Flutter 超完整的开源项目,功能丰富,适合学习和日常使用。GSYGithubApp系列的优势:我们目前已经拥有Flutter、Weex、ReactNative、kotlin 四个版本。 功能齐全,项目框架内技术涉及面广,完成度高,持续维护,配套文章,适合全面学习,对比参考。跨平台的开源Github客户端App,更好的体验,更丰富的功能,旨在更好的日常管理和维护个人Github,提供更好更方便的驾车体验Σ( ̄。 ̄ノ)ノ。同款Weex版本 : https://github.com/CarGuo/GSYGithubAppWeex 、同款React Native版本 : https://github.com/CarGuo/GSYGithubApp 、原生 kotlin 版本 https:…
Stars: ✭ 12,920 (+7240.91%)
Mutual labels:  cross-platform
Scapix
Scapix Language Bridge
Stars: ✭ 171 (-2.84%)
Mutual labels:  cross-platform
Battery
cross-platform, normalized battery information library
Stars: ✭ 170 (-3.41%)
Mutual labels:  cross-platform

NativeScript Schematics Build Status

This repository contains schematics for generating components in NativeScript Angular apps using the Angular CLI.

Installation

Install Angular CLI

You should be using @angular/[email protected] or newer.

npm i -g @angular/cli

Install NativeScript Schematics

npm i -g @nativescript/schematics

Usage

Creating a new project

To generate new NativeScript Angular project, you can use ng new with @nativescript/schematics specified as the schematics collection.

NativeScript Only

ng new --collection=@nativescript/schematics my-mobile-app

You can specify the following options when generating new applications:

Option Description Default
prefix The prefix to apply to generated selectors. app
theme Specifies whether the {N} css theme should be included. true
style Specifies whether the app should use 'css' or 'scss' files for styling. css
webpack Specifies whether the app will be ready for building with webpack. true

Web + Mobile Code Sharing project

ng new --collection=@nativescript/schematics my-shared-app --shared

You can specify the following options when generating new applications:

Option Description Default
sourceDir The name of the source directory. src
prefix The prefix to apply to generated selectors. app
theme Specifies whether the {N} css theme should be included. true
style Specifies whether the app should use 'css' or 'scss' files for styling. css
sample Generates an eagerly loaded module and master-detail navigation. false

Prerequisites for using @nativescript/schematics in an existing project

You need to add an angular.json configuration file to your NativeScript project root directory. That will allow you to use Angular CLI for generating components.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "cli": {
    "defaultCollection": "@nativescript/schematics"
  },
  "projects": {
    "project-name": {
      "root": "",
      "sourceRoot": ".",
      "projectType": "application",
      "prefix": "app"
    }
  },
  "defaultProject": "project-name"
}

Note: If you created your project with ng new, your project already has angular.json.

Generate angular.json

You can generate it the configuration using Schematics. Install Schematics globally

npm install -g @angular-devkit/schematics-cli

From inside your project call:

schematics @nativescript/schematics:angular-json --name=project-name

Generating Components, Modules, Directives, etc.

You can use the ng generate (or just ng g) command to generate pretty much any Angular building unit - components, modules, directives, classes and so on. For the full list, check out the Angular CLI repo. Some of these generators are overwritten in NativeScript Schematics to suite the needs of a NativeScript Angular application.

To generate a component, call:

ng g c component-name

To generate a module, call:

ng g m module-name

To generate a component in an existing module folder, call:

ng g c module-name/component-name

Migrating ng Project to a shared project

Migrating Web Components to a Shared Components

You can use ng generate migrate-component to convert a web Component to a shared component. This includes the following steps:

  • add component-name.component.tns.html
  • add the component to its .tns parent module - note that the module-name.module.tns.ts need to exist before you execute the command, or just use the --skipModule flag

Params:

  • name - required - name of the component to be migrated - do not include the word Component
  • componentPath - optional - the location of the component file, do not include src/app, i.e. home/home.component.ts - use if the componentPath cannot be derived from the parent module
  • module - optional - the name of the parent module - do not include the word Module, leave empty if using the default EntryModule (AppModule)
  • modulePath - optional - the location of the parent module file, do not include src/app, i.e. home/home.module.ts - use if the module is not located at the root/app (by default: src/app)
  • skipModule - optional - use if you don't want the module to be used for finding the component, and if you don't want to add the Component to Modules providers

Migrating Web Modules to Shared Modules

You can use ng generate migrate-module to convert a Web Module to a Shared Module and also convert all of its Components. This includes the following steps:

  • add module-name.component.tns.ts
  • convert all of modules' components, by using migrate-component schematic
  • copy over all providers from the web module

Code sharing: Build

In a code sharing project to build:

  • a web app call: ng serve,
  • an iOS app call: tns run ios,
  • an Android app call: tns run android

Templates

Master Detail template

To generate a Master Detail module, you can use the following command ng g master-detail --master=dogs --detail=dog

The above command will generate the following file structure

  • dogs
  • dog-detail
    • dog-detail component files
  • dogs
    • dogs component files
  • data.service.ts
  • dogs.module.ts

Options

Option Description
master The name of the master component and the name of the module.
detail The name of the detail component
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].