open-index/open-npm huggingface dataset:
npm package: @nativescript-community/xml-ui-compiler
Description: A compiler that turns NativeScript XML UI content into JavaScript.
Author: CatchABus
Latest version: 1.0.0-alpha.3

# @nativescript-community/xml-ui-compiler

[![npm](https://img.shields.io/npm/v/@nativescript-community/xml-ui-compiler.svg)](https://www.npmjs.com/package/@nativescript-community/xml-ui-compiler)
[![npm](https://img.shields.io/npm/dt/@nativescript-community/xml-ui-compiler.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/xml-ui-compiler)

A Node compiler that converts NativeScript XML view content to AST.  

## Installation

```
npm install @nativescript-community/xml-ui-compiler --save-dev
```

## Usage
```js
import fs from 'fs';
import generate from '@babel/generator';
import { compile } from '@nativescript-community/xml-ui-compiler';

const filePath = 'views/home/home.xml';
const content = fs.readFileSync(filePath, 'utf8');

const { output } = compile(content, filePath, 'android');

// Convert AST to JS and print
console.log(generate(output).code);
```
npm package: @nativescript-community/xml-ui-core
Description: A set of utilities for NativeScript XML UI (JS/TS).
Author: CatchABus
Latest version: 1.0.0-alpha.3

# @nativescript-community/xml-ui-core

[![npm](https://img.shields.io/npm/v/@nativescript-community/xml-ui-core.svg)](https://www.npmjs.com/package/@nativescript-community/xml-ui-core)
[![npm](https://img.shields.io/npm/dt/@nativescript-community/xml-ui-core.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/xml-ui-core)

This package contains utilities used by [@nativescript-community/xml-ui-compiler](../compiler).  

## Installation

```
npm install @nativescript-community/xml-ui-core
```

## Usage
In your app/main.ts, append the following import:
```js
import '@nativescript-community/xml-ui-core';
```
npm package: @nativescript-community/xml-ui-loader
Description: A webpack loader that works as an ahead-of-time (AOT) compiler which turns XML content into JavaScript during the build phase.
Author: CatchABus
Latest version: 3.3.1-alpha.3

# @nativescript-community/xml-ui-loader

[![npm](https://img.shields.io/npm/v/@nativescript-community/xml-ui-loader.svg)](https://www.npmjs.com/package/@nativescript-community/xml-ui-loader)
[![npm](https://img.shields.io/npm/dt/@nativescript-community/xml-ui-loader.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/xml-ui-loader)

This loader provides support for using [@nativescript-community/xml-ui-compiler](../compiler) in Webpack.  

## Installation

```
npm install @nativescript-community/xml-ui-loader --save-dev
```

## Usage
`webpack.config.js`
```javascript
const webpack = require('@nativescript/webpack');
const { getEntryDirPath, getPlatformName } = require('@nativescript/webpack/dist/helpers/platform');
const { chainLoaderConfiguration } = require("@nativescript-community/xml-ui-loader/helpers");

module.exports = (env) => {
  webpack.init(env);

  // Learn how to customize:
  // https://docs.nativescript.org/webpack

  webpack.chainWebpack((config) => {
    chainLoaderConfiguration(config, {
      appPath: getEntryDirPath(),
      platform: getPlatformName()
    });
  });

  return webpack.resolveConfig();
};
```

There are also few preprocessing options that are useful for applying output customizations.
```javascript
chainLoaderConfiguration(config, {
  appPath: getEntryDirPath(),
  platform: getPlatformName(),
  useDataBinding: false, // Set this to false if you don't want to use data binding system
  preprocess: {
    // Format attribute value
    attributeValueFormatter: (value, attributeName, tagName, attributes) => value.toUpperCase(),
    // Manage AST result
    transformAst: (ast, generateFunc) => generateFunc(ast).code,
  }
});

```
npm package: @nativescript-dev/multiple-environments
Description: A Hook For Nativescript to allow multiple Environments
Author: Federicorp
Latest version: 1.0.0

All credits to Brendan Ingham, original creator of this amazing hook.

# @nativescript-dev/multiple-environments

This Hook is made for using multiple environments within a nativescript application.

Actually this is a copy of nativescript-dev-multiple-environments adapted to work on NS 7 CLI.

## What it does

First it changes your packageId to whatever you have stated in your `environment-rules.json`

it also copies any files you have suffixed with the name of the environemnt for example : `App_Resources/Android/google-services.staging.json` will get copied to `App_Resources/Android/google-services.json` before building. 

## Selecting Environment

Once you have a initial `environment-rules.json` file you can change between the environments using `--env.use.ENV_NAME`

for example for ios:
`tns run ios --env.use.staging`

this can also be used with other --env args like:

`tns run ios --bundle --env.aot --env.uglify --env.use.release`

## Environments

a basic environment-rules.json file is generated for you it looks like this: 

```(javascript)

{
    "version": "1.0.0",
    "default": "staging",
    "extraPaths": [
        'app/environments'
    ],
    "environments": [
        {
            name: "staging",
            packageId: "org.nativescript.appName.staging",
            copyRule: "(.*\\.staging\\..*)"
        },
        {
            name: "release",
            packageId: "org.nativescript.appName.release",
            copyRule: "(.*\\.release\\..*)"
        }
    ]
}

```

You can tweak this however you want, and add as many environments as you like.

ExtraPaths is Optional, but can add multiple paths within the app. these will follow the same rules for the rules.