Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
feat: upgrade to angular 5 (#53)
Browse files Browse the repository at this point in the history
* feat: upgrade to angular 5

* chore(packages): add request

* chore(package): update deps

* chore(package): update deps

* upgrade to Angular 5
  • Loading branch information
Burak Tasci authored Jan 7, 2018
1 parent 1d08333 commit a7f151b
Show file tree
Hide file tree
Showing 8 changed files with 741 additions and 616 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Server platform loaders [ngx-translate]
> Please support this project by simply putting a Github star. Share this library with friends on Twitter and everywhere else you can.
#### NOTICE
> This *[4.x.x] branch* is intented to work with `@angular v4.x.x`. If you're developing on a later release of **Angular**
than `v4.x.x`, then you should probably choose the appropriate version of this library by visiting the *[master] branch*.
> This *[5.x.x] branch* is intented to work with `@angular v5.x.x`. If you're developing on a later release of **Angular**
than `v5.x.x`, then you should probably choose the appropriate version of this library by visiting the *[master] branch*.

## Packages:
Name | Description | NPM
Expand All @@ -32,10 +32,10 @@ If you want to file a bug, contribute some code, or improve documentation, pleas
## License
The MIT License (MIT)

Copyright (c) 2017 [Burak Tasci]
Copyright (c) 2018 [Burak Tasci]

[master]: https://github.com/ngx-translate/core/tree/master
[4.x.x]: https://github.com/ngx-translate/core/tree/4.x.x
[5.x.x]: https://github.com/ngx-translate/core/tree/5.x.x
[ngx-translate]: https://github.com/ngx-translate/core
[ng-seed/universal]: https://github.com/ng-seed/universal
[Burak Tasci]: https://github.com/fulls1z3
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,34 @@
"release": "standard-version"
},
"devDependencies": {
"@angular/common": "~4.4.4",
"@angular/compiler": "~4.4.4",
"@angular/compiler-cli": "~4.4.4",
"@angular/core": "~4.4.4",
"core-js": "~2.5.1",
"rxjs": "~5.4.3",
"zone.js": "~0.8.18",
"@ngx-translate/core": "~6.0.1",
"@angular/common": "5.1.2",
"@angular/compiler": "5.1.2",
"@angular/compiler-cli": "5.1.2",
"@angular/core": "5.1.2",
"core-js": "~2.5.3",
"rxjs": "~5.5.6",
"zone.js": "~0.8.19",
"request": "~2.83.0",
"@ngx-translate/core": "~9.0.2",
"@ngx-cache/core": "4.0.1",
"@types/node": "~8.0.32",
"@types/jest": "~21.1.2",
"@types/node": "~8.5.7",
"@types/jest": "~22.0.1",
"rimraf": "~2.6.2",
"ts-node": "~3.3.0",
"ts-node": "~4.1.0",
"glob": "~7.1.2",
"camelcase": "~4.1.0",
"rollup": "~0.42.0",
"rollup-plugin-node-resolve": "~3.0.0",
"rollup-plugin-commonjs": "~8.2.1",
"rollup-plugin-commonjs": "~8.2.6",
"rollup-plugin-sourcemaps": "~0.4.2",
"rollup-plugin-uglify": "~2.0.1",
"jest": "~21.2.1",
"jest-preset-angular": "~4.0.0",
"jest": "~22.0.4",
"jest-preset-angular": "~5.0.0",
"jest-junit-reporter": "~1.1.0",
"standard-version": "~4.2.0",
"codelyzer": "~3.2.0",
"tslint": "~5.7.0",
"angular-tslint-rules": "1.0.4",
"standard-version": "~4.3.0",
"codelyzer": "~4.0.2",
"tslint": "~5.8.0",
"angular-tslint-rules": "1.1.0",
"typescript": "~2.5.3"
},
"jest": {
Expand Down
13 changes: 7 additions & 6 deletions packages/@ngx-universal/translate-loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Loader for [ngx-translate] that provides application settings to **browser**/**s
> Please support this project by simply putting a Github star. Share this library with friends on Twitter and everywhere else you can.
#### NOTICE
> This *[4.x.x] branch* is intented to work with `@angular v4.x.x`. If you're developing on a later release of **Angular**
than `v4.x.x`, then you should probably choose the appropriate version of this library by visiting the *[master] branch*.
> This *[5.x.x] branch* is intented to work with `@angular v5.x.x`. If you're developing on a later release of **Angular**
than `v5.x.x`, then you should probably choose the appropriate version of this library by visiting the *[master] branch*.

## Table of contents:
- [Prerequisites](#prerequisites)
Expand All @@ -27,7 +27,7 @@ than `v4.x.x`, then you should probably choose the appropriate version of this l
## <a name="prerequisites"></a> Prerequisites
This library depends on `Angular v4.0.0`. Older versions contain outdated dependencies, might produce errors.

Also, please ensure that you are using **`Typescript v2.3.4`** or higher.
Also, please ensure that you are using **`Typescript v2.5.3`** or higher.

## <a name="getting-started"></a> Getting started
### <a name="installation"></a> Installation
Expand Down Expand Up @@ -65,12 +65,13 @@ the imports property of **app.module**.
#### app.module.ts
```TypeScript
...
import { HttpClient } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { UniversalTranslateLoader } from '@ngx-universal/translate-loader';
...

export function translateFactory(platformId: any, http: Http): TranslateLoader {
export function translateFactory(platformId: any, http: HttpClient): TranslateLoader {
const browserLoader = new TranslateHttpLoader(http);

return new UniversalTranslateLoader(platformId, browserLoader, './public/assets/i18n');
Expand Down Expand Up @@ -112,10 +113,10 @@ export class AppModule {
## <a name="license"></a> License
The MIT License (MIT)

Copyright (c) 2017 [Burak Tasci]
Copyright (c) 2018 [Burak Tasci]

[master]: https://github.com/ngx-translate/core/tree/master
[4.x.x]: https://github.com/ngx-translate/core/tree/4.x.x
[5.x.x]: https://github.com/ngx-translate/core/tree/5.x.x
[ngx-translate]: https://github.com/ngx-translate/core
[ng-seed/universal]: https://github.com/ng-seed/universal
[@ngx-translate/http-loader]: https://github.com/ngx-translate/http-loader
Expand Down
12 changes: 6 additions & 6 deletions packages/@ngx-universal/translate-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngx-universal/translate-loader",
"version": "4.0.1",
"version": "5.0.0",
"description": "Loader for ngx-translate that provides translations to browser/server platforms",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,12 +31,12 @@
"es2015": "./@ngx-universal/translate-loader.js",
"typings": "./translate-loader.d.ts",
"dependencies": {
"tslib": "~1.7.1"
"tslib": "~1.8.1"
},
"peerDependencies": {
"@angular/common": ">=4.0.0 <5.0.0",
"rxjs": ">=5.0.1",
"@ngx-translate/core": ">=6.0.1",
"@ngx-cache/core": ">=4.0.0 <5.0.0"
"@angular/common": ">=5.0.0 <6.0.0",
"rxjs": ">=5.5.0",
"@ngx-translate/core": ">=8.0.0",
"@ngx-cache/core": ">=5.0.0 <6.0.0"
}
}
34 changes: 16 additions & 18 deletions tools/build/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,22 @@ const build = (group: string, item: string, settings: any) => {
// tslint:disable-next-line
.then(() => console.log(`>>> ${group}/${item}: Inlining succeeded`))
)
.then(() => ngc({project: `${paths.temp}/tsconfig.es2015.json`})
.then(exitCode => new Promise((res, reject) => {
exitCode === 0
? res()
: reject();
}))
// tslint:disable-next-line
.then(() => console.log(`>>> ${group}/${item}: ES2015 compilation succeeded`))
)
.then(() => ngc({project: `${paths.temp}/tsconfig.es5.json`})
.then(exitCode => new Promise((res, reject) => {
exitCode === 0
? res()
: reject();
}))
// tslint:disable-next-line
.then(() => console.log(`>>> ${group}/${item}: ES5 compilation succeeded`))
)
.then(() => ngc(['--project', `${paths.temp}/tsconfig.es2015.json`]))
.then(exitCode => new Promise((res, reject) => {
exitCode === 0
? res()
: reject();
}))
// tslint:disable-next-line
.then(() => console.log(`>>> ${group}/${item}: ES2015 compilation succeeded`))
.then(() => ngc(['--project', `${paths.temp}/tsconfig.es5.json`]))
.then(exitCode => new Promise((res, reject) => {
exitCode === 0
? res()
: reject();
}))
// tslint:disable-next-line
.then(() => console.log(`>>> ${group}/${item}: ES5 compilation succeeded`))
.then(() => Promise.resolve()
.then(() => relativeCopy('**/*.d.ts', paths.es2015, paths.dist))
.then(() => relativeCopy('**/*.metadata.json', paths.es2015, paths.dist))
Expand Down
11 changes: 11 additions & 0 deletions tools/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": [
"../tslint.json"
],
"rules": {
"no-implicit-dependencies": [
true,
"dev"
]
}
}
11 changes: 10 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@
"rulesDirectory": [
"node_modules/codelyzer"
],
"extends": ["angular-tslint-rules"]
"extends": [
"angular-tslint-rules"
],
"rules": {
"pipe-naming": [
true,
"camelCase",
"config"
]
}
}
Loading

0 comments on commit a7f151b

Please sign in to comment.