# phoenix-unav

> Phoenix UNav

Latest version **1.0.0** (published 2022-02-17) · SEE LICENSE IN LICENSE.txt license · 0 weekly downloads

## Install

```sh
npm install phoenix-unav
pnpm add phoenix-unav
yarn add phoenix-unav
bun add phoenix-unav
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-02-17 |
| First published | 2022-02-17 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.txt |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 85 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | saikrishna235 |

## Links

- npm: https://www.npmjs.com/package/phoenix-unav
- npm.io page: https://npm.io/package/phoenix-unav

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [@shopify/jest-dom-mocks](https://npm.io/package/@shopify/jest-dom-mocks.md) ^3.0.11
- [@tmobile/phoenix-design-system](https://npm.io/package/@tmobile/phoenix-design-system.md) 1.0.454185496-362b7a76

## Recent versions

- 1.0.0 (latest) — 2022-02-17

## README

# Frontend Build

## Features

- Typescript support with Webpack and ESLint
- SCSS support with Webpack

## Installation

1. Install the latest LTS version of [NodeJS](https://nodejs.org/en/download/), globally. This will also install `npm`.
2. Navigate to `ui.frontend` in your project and run `npm install`.

## Usage

The following npm scripts drive the frontend workflow:

- `npm run build` - Full build of client libraries with optimizations disabled (tree shaking, etc) and source maps enabled.
- `npm run build:prod` - Full build of client libraries with optimizations enabled (tree shaking, etc) and source maps disabled.
- `npm run start` - Starts the development build `npm run build` in watch mode and syncs changes to your local AEM instance.

### General

The ui.frontend module compiles the code under the `ui.frontend/src` folder and outputs the compiled CSS and JS, and any resources beneath a folder named `ui.frontend/dist`. Each folder under the `src` directory should constitute a complete and indipendent clientlib. For example, `src/sales` and `src/care` would contain the code (TS and SCSS) required to build each of those areas of the site and may shared code through a third `src/shared` but always build complete packages with no dependency on one another.

### Typescript

JavaScript support has been removed. Only Typescript code should be created under the `src` directory. This does not mean you cannot use JavaScript libraries and third-party dependencies. You simply must write all of your own scripts in Typescript. This was done to enforce compile-time checks that help eliminate hard to catch bugs in large enterprise applications, such as the T-Mobile site.

- **Optimization** - for production builds, all scripts and dependencies are tree-shaken meaning unused code is removed.
  - **globbing** - Globbing, a feature that is normally included with the AEM Maven Archetype has been purposfuly removed because it negatively impacts tree-shaking of code. This means you must import all scripts and styles into a root or main TS file for them to be included in their respective clientlib bundle.

### SCSS

- **Autoprefixing** - all SCSS is run through a prefixer and any properties that require prefixing will automatically have those added in the CSS.
- **Optimization** - for production builds, all CSS is run through an optimizer.

### Client Library Generation

The second part of the ui.frontend module build process leverages the [aem-clientlib-generator](https://www.npmjs.com/package/aem-clientlib-generator) plugin to move the compiled CSS, JS and any resources into the `ui.apps` module. The aem-clientlib-generator configuration is defined in `clientlib.config.js`. When running `npm run build`, `npm run build:prod`, or `npm run start`, the compiles JS, CSS, and any resources will automatically be synced to the `ui.apps` directory and, if it is running, the local AEM instance.

---
_Source: https://npm.io/package/phoenix-unav · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
