This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Update template for UI #84
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
dc09c61
feat: SHELL-1316 add package-lock to gitignore
1b50a17
fix: SHELL-1316 remove lint errors
05cd288
feat: SHELL-1316 add angular, testing and linting dependencies
59913d2
feat: update test environment
cc991e0
chore: SHELL-1316 update tslint and tsconfig
ebbcc80
fix: unpin angular versions
52c9353
fix: remove coveralls
143a198
chore: remove unused storybook dependencies
e2b962e
chore: remove comment
883a98a
fix: remove angular material css from test build
db55937
fix: use tslint-angular rules
346b84f
fix: remove rules from tslint config and fix lint errors
e90c7cd
fix: move shell to devDependencies
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,3 +50,5 @@ bower_components | |
# Releases | ||
dist | ||
|
||
# Package Lock for NPM | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
'use strict'; | ||
|
||
const {join} = require('path'); | ||
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); | ||
|
||
module.exports = function (config) { | ||
|
||
let configuration = { | ||
basePath: '../', | ||
frameworks: ['jasmine'], | ||
files: [ | ||
'test/main-index.ts' | ||
], | ||
customLaunchers: { | ||
Chrome_travis_ci: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
reporters: ['progress', 'coverage-istanbul'], | ||
coverageIstanbulReporter: { | ||
// reports can be any that are listed here: https://github.com/istanbuljs/istanbuljs/tree/aae256fb8b9a3d19414dcf069c592e88712c32c6/packages/istanbul-reports/lib | ||
reports: ['html', 'lcovonly', 'text-summary'], | ||
|
||
// base output directory. If you include %browser% in the path it will be replaced with the karma browser name | ||
dir: join('test', 'ui', 'coverage'), | ||
|
||
// Combines coverage information from multiple browsers into one report rather than outputting a report | ||
// for each browser. | ||
combineBrowserReports: true, | ||
|
||
// if using webpack and pre-loaders, work around webpack breaking the source path | ||
fixWebpackSourcePaths: true, | ||
|
||
// stop istanbul outputting messages like `File [filename] ignored, nothing could be mapped` | ||
skipFilesWithNoCoverage: false, | ||
|
||
verbose: false // output config used by istanbul for debugging | ||
}, | ||
preprocessors: { | ||
'test/main-index.ts': ['webpack'] | ||
}, | ||
webpackMiddleware: { | ||
stats: 'errors-only' | ||
}, | ||
exclude: [], | ||
port: 8080, | ||
browsers: ['ChromeHeadless'], | ||
singleRun: true, | ||
browserConsoleLogOptions: { | ||
level: 'log', | ||
format: '%b %T: %m', | ||
terminal: true | ||
}, | ||
// Workaround for test timeout issue: https://github.com/jasmine/jasmine/issues/1327#issuecomment-332939551 | ||
browserNoActivityTimeout: 150000, | ||
mime: { // Chrome version 55+ has a bug with TS. See: https://stackoverflow.com/a/41054760 | ||
'text/x-typescript': ['ts', 'tsx'] | ||
}, | ||
colors: true, | ||
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
webpack: { | ||
mode: 'development', | ||
resolve: { | ||
// Add '.ts' and '.tsx' as a resolvable extension. | ||
extensions: [".ts", ".tsx", ".js"] | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
use: { | ||
loader: 'ts-loader', | ||
options: {} | ||
}, | ||
exclude: '/node_modules' | ||
}, | ||
{ | ||
test: /ui\/.+(\.ts|\.js)$/, | ||
exclude: /(node_modules|spec\.ts$|spec.js$)/, | ||
loader: 'istanbul-instrumenter-loader', | ||
enforce: 'post', | ||
options: { | ||
esModules: true | ||
} | ||
}, | ||
{ | ||
test: /\.html$/, | ||
use: ['html-loader'] | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ['null-loader'] | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
use: ['null-loader'] | ||
}, | ||
{ | ||
test: /\.(jpe|jpg|png|woff|woff2|eot|ttf|svg)(\?.*$|$)/, | ||
loader: 'null-loader' | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new HardSourceWebpackPlugin() | ||
], | ||
cache: true, | ||
devtool: 'inline-source-map' | ||
} | ||
}; | ||
|
||
if (process.env.TRAVIS) { | ||
configuration.browsers = ['Chrome_travis_ci']; | ||
} | ||
|
||
config.set(configuration); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Error.stackTraceLimit = 5; | ||
|
||
import 'core-js/es6/symbol'; | ||
import 'core-js/es6/object'; | ||
import 'core-js/es6/function'; | ||
import 'core-js/es6/parse-int'; | ||
import 'core-js/es6/parse-float'; | ||
import 'core-js/es6/number'; | ||
import 'core-js/es6/math'; | ||
import 'core-js/es6/string'; | ||
import 'core-js/es6/date'; | ||
import 'core-js/es6/array'; | ||
import 'core-js/es6/regexp'; | ||
import 'core-js/es6/map'; | ||
import 'core-js/es6/weak-map'; | ||
import 'core-js/es6/set'; | ||
|
||
/* https://github.com/angular/angular/issues/15763#issuecomment-301618043 */ | ||
import 'reflect-metadata'; | ||
|
||
import 'zone.js/dist/zone'; | ||
|
||
import 'zone.js/dist/long-stack-trace-zone'; | ||
import 'zone.js/dist/proxy.js'; | ||
import 'zone.js/dist/sync-test'; | ||
import 'zone.js/dist/jasmine-patch'; | ||
import 'zone.js/dist/async-test'; | ||
import 'zone.js/dist/fake-async-test'; | ||
|
||
// Avoid missing dependencies in tests | ||
import 'hammerjs/hammer'; | ||
|
||
|
||
import { getTestBed } from '@angular/core/testing'; | ||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; | ||
|
||
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. | ||
declare const __karma__: any; | ||
declare const require: any; | ||
|
||
// Prevent Karma from running prematurely. | ||
__karma__.loaded = function () { | ||
}; | ||
|
||
// First, initialize the Angular testing environment. | ||
getTestBed().initTestEnvironment( | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting() | ||
); | ||
|
||
// Then we find all the tests. | ||
const context = require.context('../ui', true, /spec$/i); | ||
// And load the modules. | ||
context.keys().map(context); | ||
// Finally, start Karma to run the tests. | ||
__karma__.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"inlineSourceMap": true, | ||
"target": "es5", | ||
"module": "commonjs", | ||
"declaration": false, | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"inlineSources": true, | ||
"stripInternal": true, | ||
"lib": [ | ||
"es2015", | ||
"es2017", | ||
"dom" | ||
] | ||
}, | ||
"files": [ | ||
"ui/app.ts" | ||
], | ||
"paths": { | ||
"@angular/*": [ | ||
"../node_modules/@angular/*" | ||
] | ||
}, | ||
"compileOnSave": false, | ||
"buildOnSave": false, | ||
"exclude": [ | ||
"node_modules", | ||
"dist", | ||
"test" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"tslint-angular" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {async, ComponentFixture, TestBed} from '@angular/core/testing'; | ||
import {HomeComponent} from './home.component'; | ||
|
||
describe('HomeComponent', () => { | ||
let component: HomeComponent; | ||
let fixture: ComponentFixture<HomeComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
], | ||
declarations: [ | ||
HomeComponent | ||
] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(HomeComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelcalpena @labshare/shell should be a devDependency now after the latest changes.