@ibyar/cli
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

Ibyar CLI

NPM Version NPM Downloads LICENSE lerna GitHub contributors

The Ibyar/Aurora CLI tool. ( dev - prerelease)

Install

npm i --save @ibyar/cli
yarn add @ibyar/cli

How to use

npx ibyar --build --watch --verbose

it load the configuration from a tsconfig.json file

Usage: ibyar [options]

Examples:
    ibyar
    ibyar -b
    ibyar -gt
    ibyar -v
    ibyar --help

Options:
    -b      --build             compile the project source code with ibyar transformers
    -gt     --generate-types    generate "web-types.json" files, and typescript
	                            definitions '.d.ts' files. 
	                            you can import this file later in your "index.ts" 
								or "polyfills.ts" file, so any editor "VS Code" can
								support autocomplete easily,
    -h      --help              print help message
    -v      --version           output the version number

The Ibyar CLI has a typescript transformer to generate a definitions for you component

import { Component, EventEmitter, Input, Output } from '@ibyar/aurora';


@Component({
	selector: 'person-edit',
	template: `<form #form>
					<input if="show" type="text" [(value)]="person.name" />
					<input type="number" [(value)]="person.age" />
					<input type="button" (click)="printPerson()" value="Save" />
				</form>`
})
export class PersonEdit {

	@Input()
	person: Person;

	@Input()
	show = true;

	@Output()
	save = new EventEmitter<Person>();

	printPerson() {
		console.log(this.person);
		this.save.emit(this.person);
	}
}

will generate the view class and add it to the definition files

import { EventEmitter } from '@ibyar/aurora';

export declare class PersonEdit {
    static readonly HTMLPersonEditElement: ConstructorOfView<HTMLPersonEditElement>;
    person: Person;
    show: boolean;
    save: EventEmitter<Person>;
    printPerson(): void;
}

import { BaseComponent, ConstructorOfView } from "@ibyar/core";

declare class HTMLPersonEditElement extends HTMLElement {
    public static observedAttributes: "person" | "show" | "onSave"[];
    public person: Person;
    public show: true;
    public onSave: EventEmitter<Person>;
}

declare interface HTMLPersonEditElement extends BaseComponent<PersonEdit> {}

declare global {
    interface HTMLElementTagNameMap {
        ["person-edit"]: HTMLPersonEditElement;
    }
}

Package Sidebar

Install

npm i @ibyar/cli

Weekly Downloads

8

Version

1.2.2

License

MIT

Unpacked Size

112 kB

Total Files

36

Last publish

Collaborators

  • salem.ebo