Skip to content

Commit 2b74b5c

Browse files
committed
Init
1 parent 904e253 commit 2b74b5c

28 files changed

+9355
-1
lines changed

README.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
# ngx-responsive-angular-9.1
1+
# NgxResponsive
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.0.
4+
5+
## Development server
6+
7+
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.
8+
9+
## Code scaffolding
10+
11+
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`.
12+
13+
## Build
14+
15+
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.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
25+
## Further help
26+
27+
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).

angular.json

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ngx-responsive": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/ngx-responsive",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"aot": true,
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets"
29+
],
30+
"styles": [
31+
"src/styles.scss"
32+
],
33+
"scripts": []
34+
},
35+
"configurations": {
36+
"production": {
37+
"fileReplacements": [
38+
{
39+
"replace": "src/environments/environment.ts",
40+
"with": "src/environments/environment.prod.ts"
41+
}
42+
],
43+
"optimization": true,
44+
"outputHashing": "all",
45+
"sourceMap": false,
46+
"extractCss": true,
47+
"namedChunks": false,
48+
"extractLicenses": true,
49+
"vendorChunk": false,
50+
"buildOptimizer": true,
51+
"budgets": [
52+
{
53+
"type": "initial",
54+
"maximumWarning": "2mb",
55+
"maximumError": "5mb"
56+
},
57+
{
58+
"type": "anyComponentStyle",
59+
"maximumWarning": "6kb",
60+
"maximumError": "10kb"
61+
}
62+
]
63+
}
64+
}
65+
},
66+
"serve": {
67+
"builder": "@angular-devkit/build-angular:dev-server",
68+
"options": {
69+
"browserTarget": "ngx-responsive:build"
70+
},
71+
"configurations": {
72+
"production": {
73+
"browserTarget": "ngx-responsive:build:production"
74+
}
75+
}
76+
},
77+
"extract-i18n": {
78+
"builder": "@angular-devkit/build-angular:extract-i18n",
79+
"options": {
80+
"browserTarget": "ngx-responsive:build"
81+
}
82+
},
83+
"test": {
84+
"builder": "@angular-devkit/build-angular:karma",
85+
"options": {
86+
"main": "src/test.ts",
87+
"polyfills": "src/polyfills.ts",
88+
"tsConfig": "tsconfig.spec.json",
89+
"karmaConfig": "karma.conf.js",
90+
"assets": [
91+
"src/favicon.ico",
92+
"src/assets"
93+
],
94+
"styles": [
95+
"src/styles.scss"
96+
],
97+
"scripts": []
98+
}
99+
},
100+
"lint": {
101+
"builder": "@angular-devkit/build-angular:tslint",
102+
"options": {
103+
"tsConfig": [
104+
"tsconfig.app.json",
105+
"tsconfig.spec.json",
106+
"e2e/tsconfig.json"
107+
],
108+
"exclude": [
109+
"**/node_modules/**"
110+
]
111+
}
112+
},
113+
"e2e": {
114+
"builder": "@angular-devkit/build-angular:protractor",
115+
"options": {
116+
"protractorConfig": "e2e/protractor.conf.js",
117+
"devServerTarget": "ngx-responsive:serve"
118+
},
119+
"configurations": {
120+
"production": {
121+
"devServerTarget": "ngx-responsive:serve:production"
122+
}
123+
}
124+
}
125+
}
126+
}
127+
},
128+
"defaultProject": "ngx-responsive",
129+
"cli": {
130+
"analytics": false
131+
}
132+
}

browserslist

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

e2e/protractor.conf.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
// Protractor configuration file, see link for more information
3+
// https://github.com/angular/protractor/blob/master/lib/config.ts
4+
5+
const { SpecReporter } = require('jasmine-spec-reporter');
6+
7+
/**
8+
* @type { import("protractor").Config }
9+
*/
10+
exports.config = {
11+
allScriptsTimeout: 11000,
12+
specs: [
13+
'./src/**/*.e2e-spec.ts'
14+
],
15+
capabilities: {
16+
browserName: 'chrome'
17+
},
18+
directConnect: true,
19+
baseUrl: 'http://localhost:4200/',
20+
framework: 'jasmine',
21+
jasmineNodeOpts: {
22+
showColors: true,
23+
defaultTimeoutInterval: 30000,
24+
print: function() {}
25+
},
26+
onPrepare() {
27+
require('ts-node').register({
28+
project: require('path').join(__dirname, './tsconfig.json')
29+
});
30+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
}
32+
};

e2e/src/app.e2e-spec.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('ngx-responsive app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

e2e/src/app.po.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo(): Promise<unknown> {
5+
return browser.get(browser.baseUrl) as Promise<unknown>;
6+
}
7+
8+
getTitleText(): Promise<string> {
9+
return element(by.css('app-root .content span')).getText() as Promise<string>;
10+
}
11+
}

e2e/tsconfig.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

karma.conf.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, './coverage/ngx-responsive'),
20+
reports: ['html', 'lcovonly', 'text-summary'],
21+
fixWebpackSourcePaths: true
22+
},
23+
reporters: ['progress', 'kjhtml'],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_INFO,
27+
autoWatch: true,
28+
browsers: ['Chrome'],
29+
singleRun: false,
30+
restartOnFileChange: true
31+
});
32+
};

package.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "ngx-responsive",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"test": "ng test",
9+
"lint": "ng lint",
10+
"e2e": "ng e2e"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "~9.1.0",
15+
"@angular/common": "~9.1.0",
16+
"@angular/compiler": "~9.1.0",
17+
"@angular/core": "~9.1.0",
18+
"@angular/forms": "~9.1.0",
19+
"@angular/platform-browser": "~9.1.0",
20+
"@angular/platform-browser-dynamic": "~9.1.0",
21+
"@angular/router": "~9.1.0",
22+
"ngx-responsive": "^9.0.0",
23+
"rxjs": "~6.5.4",
24+
"tslib": "^1.10.0",
25+
"zone.js": "~0.10.2"
26+
},
27+
"devDependencies": {
28+
"@angular-devkit/build-angular": "~0.901.0",
29+
"@angular/cli": "~9.1.0",
30+
"@angular/compiler-cli": "~9.1.0",
31+
"@angular/language-service": "~9.1.0",
32+
"@types/jasmine": "~3.5.0",
33+
"@types/jasminewd2": "~2.0.3",
34+
"@types/node": "^12.11.1",
35+
"codelyzer": "^5.1.2",
36+
"jasmine-core": "~3.5.0",
37+
"jasmine-spec-reporter": "~4.2.1",
38+
"karma": "~4.4.1",
39+
"karma-chrome-launcher": "~3.1.0",
40+
"karma-coverage-istanbul-reporter": "~2.1.0",
41+
"karma-jasmine": "~3.0.1",
42+
"karma-jasmine-html-reporter": "^1.4.2",
43+
"protractor": "~5.4.3",
44+
"ts-node": "~8.3.0",
45+
"tslint": "~6.1.0",
46+
"typescript": "~3.8.3"
47+
}
48+
}

src/app/app.component.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<p *showItStandard="['iphone','ipad']">I'll show you if I'm a iPhone or ipad device.</p>
2+
<p *isIphone>I'll show you if I'm a iPhone device.</p>
3+
<p *isChrome>I'll show you if I'm a chrome browser.</p>
4+
<p *xl>I'll show you if I'm a xl screen size.</p>
5+
<p *lg>I'll show you if I'm a lg screen size.</p>
6+
<p *md>I'll show you if I'm a md screen size.</p>
7+
<p *sm>I'll show you if I'm a sm screen size.</p>
8+
<p *xs>I'll show you if I'm a xs screen size.</p>

src/app/app.component.scss

Whitespace-only changes.

src/app/app.component.spec.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { TestBed, async } from '@angular/core/testing';
2+
import { AppComponent } from './app.component';
3+
4+
describe('AppComponent', () => {
5+
beforeEach(async(() => {
6+
TestBed.configureTestingModule({
7+
declarations: [
8+
AppComponent
9+
],
10+
}).compileComponents();
11+
}));
12+
13+
it('should create the app', () => {
14+
const fixture = TestBed.createComponent(AppComponent);
15+
const app = fixture.componentInstance;
16+
expect(app).toBeTruthy();
17+
});
18+
19+
it(`should have as title 'ngx-responsive'`, () => {
20+
const fixture = TestBed.createComponent(AppComponent);
21+
const app = fixture.componentInstance;
22+
expect(app.title).toEqual('ngx-responsive');
23+
});
24+
25+
it('should render title', () => {
26+
const fixture = TestBed.createComponent(AppComponent);
27+
fixture.detectChanges();
28+
const compiled = fixture.nativeElement;
29+
expect(compiled.querySelector('.content span').textContent).toContain('ngx-responsive app is running!');
30+
});
31+
});

src/app/app.component.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.scss']
7+
})
8+
export class AppComponent {
9+
title = 'ngx-responsive';
10+
}

0 commit comments

Comments
 (0)