Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/angular 8 support #34

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
node_js:
- "8"
- "10"
- "12"

dist: trusty
sudo: false # better for performance
Expand All @@ -15,7 +15,7 @@ before_install:
- AUTHOR_NAME="$(git log -1 $TRAVIS_COMMIT --pretty="%aN")"
- echo $AUTHOR_NAME
- export TZ=Europe/Brussels
- npm i -g npm@6.4.1
- npm i -g npm@6.9.0
- NODE_VERSION="$(node -v)"
- echo $NODE_VERSION
# This ensures that we are authenticated without requiring to have an actual .npmrc file within the project
Expand All @@ -27,7 +27,8 @@ install:
- mkdir -p $LOGS_DIR
- touch $LOGS_DIR/build-perf.log
- npm ci
- npm run install:ci:demo
- npm run install:ci:demo:ng-previous
- npm run install:ci:demo:ng-latest

env:
global:
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Finally, Travis executes `npm run release:publish`.
That script makes some checks then, if all succeed it publishes the different packages on npm.
Checks that are performed:

- node version: should be "8"
- node version: should be "10"
- NPM_TOKEN environment variable should be defined
- TRAVIS_REPO_SLUG should be "NationalBankBelgium/ngx-form-errors"
- TRAVIS_TAG should be defined and not empty (this is the case when Travis builds for a tag)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { browser, by, element } from "protractor";

export class AppPage {
public navigateTo() {
return browser.get("/") as Promise<string>;
return browser.get("/") as Promise<any>;
}

public getTitleText() {
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions demo-app/package-lock.json → demo-app/ng7/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions demo-app/package.json → demo-app/ng7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"clean": "npx rimraf ./dist ./reports",
"clean:modules": "npx rimraf ./node_modules package-lock.json",
"ng": "ng",
"start": "ng serve",
"start": "ng serve --disableHostCheck=true",
"build": "ng build",
"test": "ng test",
"test:ci": "ng test --watch=false --browsers=ChromeHeadless",
Expand All @@ -24,7 +24,7 @@
"@angular/platform-browser": "^7.1.3",
"@angular/platform-browser-dynamic": "^7.1.3",
"@angular/router": "^7.1.3",
"@nationalbankbelgium/ngx-form-errors": "../dist",
"@nationalbankbelgium/ngx-form-errors": "../../dist",
"@ngx-translate/core": "^11.0.1",
"core-js": "^2.6.0",
"eligrey-classlist-js-polyfill": "1.2.20180112",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NO_ERRORS_SCHEMA } from "@angular/core";
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserDynamicTestingModule } from "@angular/platform-browser-dynamic/testing";
import { MatButtonToggleModule } from "@angular/material/button-toggle";
import { MatCardModule } from "@angular/material/card";
import { MatFormFieldModule } from "@angular/material/form-field";
import { MatIconModule } from "@angular/material/icon";
import { MatInputModule } from "@angular/material/input";
import { MatListModule } from "@angular/material/list";
import { MatSidenavModule } from "@angular/material/sidenav";
Expand Down Expand Up @@ -38,7 +38,6 @@ describe("AppComponent", () => {
MatButtonToggleModule,
MatCardModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,
MatListModule,
MatSidenavModule,
Expand All @@ -49,7 +48,8 @@ describe("AppComponent", () => {
formErrorComponent: SimpleFormErrorComponent
}),
TranslateModule.forRoot()
]
],
schemas: [NO_ERRORS_SCHEMA] // don't want to import mat-icon in these tests
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*tslint:disable:typedef*/
export const environment = {
production: true
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

/*tslint:disable:typedef*/
export const environment = {
production: false
};
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion demo-app/src/index.html → demo-app/ng7/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8" />
<title>NgxFormErrors Showcase</title>
<base href="/" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions demo-app/src/polyfills.ts → demo-app/ng7/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,3 @@ import "zone.js/dist/zone"; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
// FixMe: Remove when NBB upgrades chrome browser (https://caniuse.com/#search=grid)
import "./polyfills/css-grid-layout-polyfill";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion demo-app/tsconfig.json → demo-app/ng7/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.json",
"extends": "../../tsconfig.json",
"buildOnSave": false,
"compileOnSave": false,
"compilerOptions": {
Expand Down
2 changes: 1 addition & 1 deletion demo-app/tslint.json → demo-app/ng7/tslint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../tslint.json"],
"extends": ["../../tslint.json"],
"rules": {
"completed-docs": false,
"directive-selector": [true, "attribute", "app", "camelCase"],
Expand Down
13 changes: 13 additions & 0 deletions demo-app/ng8/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions demo-app/ng8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# 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
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
1 change: 1 addition & 0 deletions demo-app/ng8/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
27 changes: 27 additions & 0 deletions demo-app/ng8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# DemoApp

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

## 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).
121 changes: 121 additions & 0 deletions demo-app/ng8/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"demo-app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/demo-app",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["node_modules/normalize.css/normalize.css", "src/styles/styles.scss"],
"stylePreprocessorOptions": {
"includePaths": ["src/styles"]
},
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "demo-app:build"
},
"configurations": {
"production": {
"browserTarget": "demo-app:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo-app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": ["node_modules/normalize.css/normalize.css", "src/styles/styles.scss"],
"stylePreprocessorOptions": {
"includePaths": ["src/styles"]
},
"scripts": [],
"assets": ["src/favicon.ico", "src/assets"]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json"],
"exclude": ["**/node_modules/**"],
"format": "codeFrame"
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "demo-app:serve"
},
"configurations": {
"production": {
"devServerTarget": "demo-app:serve:production"
}
}
}
}
}
},
"defaultProject": "demo-app"
}
12 changes: 12 additions & 0 deletions demo-app/ng8/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
Loading