Skip to content

Commit

Permalink
Merge pull request #52 from explooosion/dev
Browse files Browse the repository at this point in the history
Dev - 0.7.4
  • Loading branch information
explooosion authored Oct 23, 2018
2 parents 990e1d0 + abd9cfa commit bcd150d
Show file tree
Hide file tree
Showing 64 changed files with 6,282 additions and 9,709 deletions.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[Agm-Direction](https://github.com/explooosion/Agm-Direction) is the directive for [@agm/core](https://github.com/SebastianM/angular-google-maps) (not official)

- Angular 2+
- Angular 2~7
- Google Map API
- [Playground](https://stackblitz.com/edit/agm-direction-demo)

Expand All @@ -24,21 +24,20 @@ How to use?
Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

+ Install @agm/core
- Use npm
```bash
npm install --save @agm/core
npm install --save agm-direction
```

+ Install agm-direction
- Use yarn
```bash
npm install --save agm-direction
yarn add @agm/core
yarn add agm-direction
```

## Importing Modules

📦 [@agm/core](https://www.npmjs.com/package/@agm/core)
📦 [agm-direction](https://www.npmjs.com/package/agm-direction)

```typescript
import { BrowserModule } from '@angular/platform-browser'
import { NgModule } from '@angular/core'
Expand Down Expand Up @@ -113,6 +112,18 @@ getDirection() {

👉 [Playground](https://github.com/explooosion/Agm-Direction/tree/master/playground)

```bash
git clone https://github.com/explooosion/Agm-Direction.git
```

```bash
cd playground
```

```bash
yarn start
```

## Generator
This library generated by [angular-library-starter](https://github.com/robisim74/angular-library-starter).

Expand Down
30 changes: 15 additions & 15 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ shell.cp(`-Rf`, [`src`, `*.ts`, `*.json`], `${OUT_DIR}`);
/* Try to process scss files */
shell.echo(`Try to process scss files`);
if (shell.exec(`node-sass -r ${OUT_DIR} -o ${OUT_DIR}`).code === 0) {
shell.rm(`-Rf`, `${OUT_DIR}/**/*.scss`);
shell.ls(`${OUT_DIR}/**/*.css`).forEach(function (file) {
shell.mv(file, file.replace('.css', '.scss'));
});
shell.rm(`-Rf`, `${OUT_DIR}/**/*.scss`);
shell.ls(`${OUT_DIR}/**/*.css`).forEach(function (file) {
shell.mv(file, file.replace('.css', '.scss'));
});
}

/* AoT compilation */
shell.echo(`Start AoT compilation`);
if (shell.exec(`ngc -p ${OUT_DIR}/tsconfig-build.json`).code !== 0) {
shell.echo(chalk.red(`Error: AoT compilation failed`));
shell.exit(1);
shell.echo(chalk.red(`Error: AoT compilation failed`));
shell.exit(1);
}
shell.echo(chalk.green(`AoT compilation completed`));

Expand All @@ -56,29 +56,29 @@ shell.cp(`-Rf`, [`${NPM_DIR}/src/`, `${NPM_DIR}/*.js`, `${NPM_DIR}/*.js.map`], `
shell.echo(`Start bundling`);
shell.echo(`Rollup package`);
if (shell.exec(`rollup -c rollup.es.config.js -i ${NPM_DIR}/${PACKAGE}.js -o ${FESM2015_DIR}/${PACKAGE}.js`).code !== 0) {
shell.echo(chalk.red(`Error: Rollup package failed`));
shell.exit(1);
shell.echo(chalk.red(`Error: Rollup package failed`));
shell.exit(1);
}

shell.echo(`Produce ESM5/FESM5 versions`);
shell.exec(`ngc -p ${OUT_DIR}/tsconfig-build.json --target es5 -d false --outDir ${OUT_DIR_ESM5} --sourceMap`);
shell.cp(`-Rf`, [`${OUT_DIR_ESM5}/src/`, `${OUT_DIR_ESM5}/*.js`, `${OUT_DIR_ESM5}/*.js.map`], `${ESM5_DIR}`);
if (shell.exec(`rollup -c rollup.es.config.js -i ${OUT_DIR_ESM5}/${PACKAGE}.js -o ${FESM5_DIR}/${PACKAGE}.js`).code !== 0) {
shell.echo(chalk.red(`Error: FESM5 version failed`));
shell.exit(1);
shell.echo(chalk.red(`Error: FESM5 version failed`));
shell.exit(1);
}

shell.echo(`Run Rollup conversion on package`);
if (shell.exec(`rollup -c rollup.config.js -i ${FESM5_DIR}/${PACKAGE}.js -o ${BUNDLES_DIR}/${PACKAGE}.umd.js`).code !== 0) {
shell.echo(chalk.red(`Error: Rollup conversion failed`));
shell.exit(1);
shell.echo(chalk.red(`Error: Rollup conversion failed`));
shell.exit(1);
}

shell.echo(`Minifying`);
shell.cd(`${BUNDLES_DIR}`);
if (shell.exec(`uglifyjs ${PACKAGE}.umd.js -c --comments -o ${PACKAGE}.umd.min.js --source-map "includeSources=true,filename='${PACKAGE}.umd.min.js.map'"`).code !== 0) {
shell.echo(chalk.red(`Error: Minifying failed`));
shell.exit(1);
if (shell.exec(`uglifyjs ${PACKAGE}.umd.js -c --comments -o ${PACKAGE}.umd.min.js --source-map "includeSources=true,content='${PACKAGE}.umd.js.map',filename='${PACKAGE}.umd.min.js.map'"`).code !== 0) {
shell.echo(chalk.red(`Error: Minifying failed`));
shell.exit(1);
}
shell.cd(`..`);
shell.cd(`..`);
Expand Down
Loading

0 comments on commit bcd150d

Please sign in to comment.