# babel-plugin-ng-component-module

> Transforms the directive 'ngComponentModule' into a series of import/angular statements to lessen the amount of boilerplate.

Latest version **1.0.4** (published 2017-07-28) · 0 weekly downloads

## Install

```sh
npm install babel-plugin-ng-component-module
pnpm add babel-plugin-ng-component-module
yarn add babel-plugin-ng-component-module
bun add babel-plugin-ng-component-module
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-07-28 |
| First published | 2017-02-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Langdon Oliver |
| Maintainers | langdonx |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-ng-component-module
- Repository: https://github.com/langdonx/babel-plugin-ng-component-module
- Homepage: https://github.com/langdonx/babel-plugin-ng-component-module#readme
- Issues: https://github.com/langdonx/babel-plugin-ng-component-module/issues
- npm.io page: https://npm.io/package/babel-plugin-ng-component-module

## Recent versions

- 1.0.4 (latest) — 2017-07-28
- 1.0.3 — 2017-06-05
- 1.0.2 — 2017-03-24
- 1.0.1 — 2017-03-24
- 1.0.0 — 2017-02-14

## README

# About

Writing `import`, `export`, `angular.module`, and `angular.component` statements all day long is no fun. This plugin automatically generates those statements after inspecting the filesystem at compile time.

It's being used in [angular-2017-starter repo](https://github.com/langdonx/angularjs-2017-starter), where the components directory contains logically grouped components together that are lazy loaded on demand at runtime.

Given the following directory structure:

    src/components/todo/
    -------------------/index.js
    -------------------/todo/
    ------------------------/todo.html
    ------------------------/todo.js
    ------------------------/todo.scss
    src/components/todo/todo-list/
    -----------------------------/todo-list.html
    -----------------------------/todo-list.js
    -----------------------------/todo-list.scss

Using `'ngComponentModule'` inside `todo/index.js` will generate the following code prior to compilation:

    import todo from './todo/todo'
    import todoList from './todo-list/todo-list'
    var todoModule = angular.module('app.todo', [])
	todoModule.component(todo.name, todo)
	todoModule.component(todoList.name, todoList)

# To Do
- Add some elaborate integration test
- Allow for root namespace to be configured (perhaps `'ngModelComponent:app'`)
- Maybe allow a comment (`/* ngComponentModule */`) in lieu of a directive
- Maybe figure out how to add semicolons even though they're not necessary
- Maybe figure out how to chain `.component()` calls off of `.module()` (hint: loop)

# Note
 - https://docs.npmjs.com/getting-started/publishing-npm-packages

---
_Source: https://npm.io/package/babel-plugin-ng-component-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
