Skip to content

Commit

Permalink
Merge pull request #2 from thisissoon/feature/cli-ng-packagr
Browse files Browse the repository at this point in the history
feat(build): Move build and dev environment to angular cli and ng-packagr
  • Loading branch information
edoparearyee authored Dec 4, 2017
2 parents 4fb39f3 + 25855c6 commit b0e56bf
Show file tree
Hide file tree
Showing 81 changed files with 8,338 additions and 8,966 deletions.
60 changes: 60 additions & 0 deletions .angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular-timesince"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "sn",
"styles": [
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {}
}
}
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ lines_after_imports=2
indent_style = space
indent_size = 2

# Front End Languages (HTML, JS, CSS etc)
# Front End Languages (HTML, JS/TS, CSS etc)

[*.{ts, js, css, html}]
[*.{js, ts, css, html}]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true

## JS
[*.{js,ts}]
## JS/TS
[*.{js, ts}]
quote_type = single

# Misc
Expand Down
54 changes: 41 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
.DS_STORE
dist/
node_modules/
out-tsc/
debug.log
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
src/**/*.js
!src/demo/systemjs.config.js
!src/demo/systemjs.config.lib.js
!**/*systemjs-angular-loader.js
*.js.map
e2e/**/*.js
e2e/**/*.js.map
coverage
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ before_install:
# Install latest chrome.
- export CHROME_BIN=chromium-browser
install:
- npm install
- npm install --no-progress
script:
- npm run lint
- npm run test:once
- npm run integration
- npm run test -- --no-progress --code-coverage --single-run --browser=ChromeNoSandbox
- npm run e2e -- --no-progress
- npm run coverage
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2017 SOON_. http://thisissoon.com/
Copyright (c) 2017 SOON London Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
[![Build Status][travis-badge]][travis-badge-url]
[![Coverage Status][coveralls-badge]][coveralls-badge-url]

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4.

A simple lightweight library for [Angular (2/4+)][angular] which removes excess text and add timesince symbol to end of text before text overflows container.

This is a simple library for [Angular][angular], implemented in the [Angular Package Format v4.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx).
This is a simple library for [Angular][angular], implemented in the [Angular Package Format v5.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx).


## Install
Expand Down Expand Up @@ -32,6 +34,12 @@ export class AppModule { }
<p>{{ date | timeSince }} ago</p>
```

Result:

```html
<p>7 years ago</p>
```

`app.component.ts`

Use any `Date` object or `Date` parsable value
Expand All @@ -44,6 +52,31 @@ export class AppComponent {
}
```

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).


[travis-badge]: https://travis-ci.org/thisissoon/angular-timesince.svg?branch=master
[travis-badge-url]: https://travis-ci.org/thisissoon/angular-timesince
[coveralls-badge]: https://coveralls.io/repos/github/thisissoon/angular-timesince/badge.svg?branch=master
Expand Down
10 changes: 0 additions & 10 deletions bs-config.json

This file was deleted.

154 changes: 0 additions & 154 deletions build.js

This file was deleted.

Loading

0 comments on commit b0e56bf

Please sign in to comment.