Skip to content

Commit

Permalink
Angular 8 changes (#17)
Browse files Browse the repository at this point in the history
* remove sandbox

* update deps

* new sandbox v8

* pin rxjs for v8 schematics

* remove test.ts from tsconfig.spec.ts
- fixes #15

* Passing tests in v8
- move jest config to package.json
- remove jest.config.js file from schematic

v8 fixes appear to be
astTransformers, tsconfig.spec

* switch to circleci

* bump node image

* change sandbox build script
  • Loading branch information
schuchard authored Oct 1, 2019
1 parent 3a4e5be commit 43b2441
Show file tree
Hide file tree
Showing 35 changed files with 4,014 additions and 3,577 deletions.
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
jobs:
build:
docker:
- image: 'circleci/node:12.9.1-browsers'
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install
- save_cache:
paths:
- node_modules
- sandbox/node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
- run: yarn test
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
"license": "MIT",
"schematics": "./src/collection.json",
"dependencies": {
"@angular-devkit/core": "^7.0.5",
"@angular-devkit/schematics": "^7.0.5",
"@schematics/angular": "^7.0.5",
"rxjs": "^6.3.3"
"@angular-devkit/core": "^8.2.0",
"@angular-devkit/schematics": "^8.2.0",
"@schematics/angular": "^8.2.0",
"rxjs": "6.4.0"
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@types/jasmine": "^2.8.11",
"@types/node": "^10.12.7",
"jasmine": "^3.3.0",
"np": "^3.0.4",
"typescript": "^3.1.6"
"@types/jasmine": "^3.3.16",
"@types/node": "^12.6.9",
"jasmine": "^3.4.0",
"np": "^5.0.3",
"typescript": "^3.5.3"
}
}
2 changes: 1 addition & 1 deletion sandbox/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Editor configuration, see http://editorconfig.org
# Editor configuration, see https://editorconfig.org
root = true

[*]
Expand Down
7 changes: 7 additions & 0 deletions sandbox/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
/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
Expand All @@ -23,6 +29,7 @@
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
Expand Down
2 changes: 1 addition & 1 deletion sandbox/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sandbox

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

## Development server

Expand Down
58 changes: 26 additions & 32 deletions sandbox/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
"newProjectRoot": "projects",
"projects": {
"sandbox": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
Expand All @@ -17,13 +21,14 @@
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
"src/styles.scss"
],
"scripts": []
},
Expand All @@ -49,6 +54,11 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
Expand Down Expand Up @@ -76,37 +86,31 @@
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
]
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"sandbox-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand All @@ -118,18 +122,8 @@
"devServerTarget": "sandbox:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
}},
"defaultProject": "sandbox"
}
12 changes: 12 additions & 0 deletions sandbox/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'.
11 changes: 6 additions & 5 deletions sandbox/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
chromeOptions: {
args: ['--headless']
},
'browserName': 'chrome'
},
directConnect: true,
Expand All @@ -24,8 +25,8 @@ exports.config = {
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
};
11 changes: 10 additions & 1 deletion sandbox/e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;
Expand All @@ -9,6 +10,14 @@ describe('workspace-project App', () => {

it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to sandbox!');
expect(page.getTitleText()).toEqual('Welcome to sandbox!');
});

afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
6 changes: 3 additions & 3 deletions sandbox/e2e/src/app.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
return browser.get(browser.baseUrl) as Promise<any>;
}

getParagraphText() {
return element(by.css('app-root h1')).getText();
getTitleText() {
return element(by.css('app-root h1')).getText() as Promise<string>;
}
}
4 changes: 2 additions & 2 deletions sandbox/e2e/tsconfig.e2e.json → sandbox/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
Expand All @@ -10,4 +10,4 @@
"node"
]
}
}
}
9 changes: 5 additions & 4 deletions sandbox/src/karma.conf.js → sandbox/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
dir: require('path').join(__dirname, './coverage/sandbox'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
Expand All @@ -26,6 +26,7 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
singleRun: false,
restartOnFileChange: true
});
};
};
Loading

0 comments on commit 43b2441

Please sign in to comment.