豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 11e58e3

Browse files
committed
feat(apps): create base of prs application
Establish the base angular application and theming for prs application.
1 parent 28d1d81 commit 11e58e3

25 files changed

+1943
-39
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ yarn-error.log
5050
test-results/*
5151

5252
# Ignore firebase debug logs.
53-
apps/*-debug.log
53+
apps/*-debug.log

angular.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"cli": {
4+
"analytics": false
5+
},
6+
"version": 1,
7+
"newProjectRoot": "apps",
8+
"projects": {
9+
"prs": {
10+
"projectType": "application",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"style": "scss"
14+
},
15+
"@schematics/angular:application": {
16+
"strict": true
17+
}
18+
},
19+
"root": "apps/prs",
20+
"sourceRoot": "apps/prs/src",
21+
"prefix": "app",
22+
"architect": {
23+
"build": {
24+
"builder": "@angular-devkit/build-angular:browser",
25+
"options": {
26+
"outputPath": "dist/prs",
27+
"index": "apps/prs/src/index.html",
28+
"main": "apps/prs/src/main.ts",
29+
"polyfills": "apps/prs/src/polyfills.ts",
30+
"tsConfig": "apps/prs/tsconfig.app.json",
31+
"inlineStyleLanguage": "scss",
32+
"assets": ["apps/prs/src/favicon.ico", "apps/prs/src/assets"],
33+
"styles": ["apps/prs/src/styles.scss"],
34+
"scripts": []
35+
},
36+
"configurations": {
37+
"production": {
38+
"budgets": [
39+
{
40+
"type": "initial",
41+
"maximumWarning": "500kb",
42+
"maximumError": "1mb"
43+
},
44+
{
45+
"type": "anyComponentStyle",
46+
"maximumWarning": "2kb",
47+
"maximumError": "4kb"
48+
}
49+
],
50+
"fileReplacements": [
51+
{
52+
"replace": "apps/prs/src/environments/environment.ts",
53+
"with": "apps/prs/src/environments/environment.prod.ts"
54+
}
55+
],
56+
"outputHashing": "all"
57+
},
58+
"development": {
59+
"buildOptimizer": false,
60+
"optimization": false,
61+
"vendorChunk": true,
62+
"extractLicenses": false,
63+
"sourceMap": true,
64+
"namedChunks": true
65+
}
66+
},
67+
"defaultConfiguration": "production"
68+
},
69+
"serve": {
70+
"builder": "@angular-devkit/build-angular:dev-server",
71+
"configurations": {
72+
"production": {
73+
"browserTarget": "prs:build:production"
74+
},
75+
"development": {
76+
"browserTarget": "prs:build:development"
77+
}
78+
},
79+
"defaultConfiguration": "development"
80+
},
81+
"extract-i18n": {
82+
"builder": "@angular-devkit/build-angular:extract-i18n",
83+
"options": {
84+
"browserTarget": "prs:build"
85+
}
86+
},
87+
"test": {
88+
"builder": "@angular-devkit/build-angular:karma",
89+
"options": {
90+
"main": "apps/prs/src/test.ts",
91+
"polyfills": "apps/prs/src/polyfills.ts",
92+
"tsConfig": "apps/prs/tsconfig.spec.json",
93+
"karmaConfig": "apps/prs/karma.conf.js",
94+
"inlineStyleLanguage": "scss",
95+
"assets": ["apps/prs/src/favicon.ico", "apps/prs/src/assets"],
96+
"styles": ["apps/prs/src/styles.scss"],
97+
"scripts": []
98+
}
99+
}
100+
}
101+
}
102+
},
103+
"defaultProject": "prs"
104+
}

apps/prs/.browserslistrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR

apps/prs/karma.conf.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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'),
13+
require('@angular-devkit/build-angular/plugins/karma'),
14+
],
15+
client: {
16+
jasmine: {},
17+
clearContext: false,
18+
},
19+
jasmineHtmlReporter: {
20+
suppressAll: true,
21+
},
22+
coverageReporter: {
23+
dir: require('path').join(__dirname, '../../coverage/prs'),
24+
subdir: '.',
25+
reporters: [{type: 'html'}, {type: 'text-summary'}],
26+
},
27+
reporters: ['progress', 'kjhtml'],
28+
port: 9876,
29+
colors: true,
30+
logLevel: config.LOG_INFO,
31+
autoWatch: true,
32+
browsers: ['ChromeHeadless'],
33+
singleRun: false,
34+
restartOnFileChange: true,
35+
});
36+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import {NgModule} from '@angular/core';
2+
import {RouterModule, Routes} from '@angular/router';
3+
4+
const routes: Routes = [];
5+
6+
@NgModule({
7+
imports: [RouterModule.forRoot(routes)],
8+
exports: [RouterModule],
9+
})
10+
export class AppRoutingModule {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<mat-toolbar color="primary" class="app-header-bar"></mat-toolbar>
2+
<mat-sidenav-container class="sidenav-container">
3+
<mat-sidenav #drawer class="sidenav" mode="side">
4+
<!-- TODO(josephperrott): Establish need and content for sidenav once appropriate. -->
5+
</mat-sidenav>
6+
<mat-sidenav-content>
7+
<router-outlet></router-outlet>
8+
</mat-sidenav-content>
9+
</mat-sidenav-container>
10+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.app-header-bar {
2+
position: sticky;
3+
top: 0;
4+
z-index: 1;
5+
}
6+
7+
.sidenav {
8+
width: 250px;
9+
}
10+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {TestBed} from '@angular/core/testing';
2+
import {RouterTestingModule} from '@angular/router/testing';
3+
import {AppComponent} from './app.component';
4+
import {MatToolbarModule} from '@angular/material/toolbar';
5+
import {MatSidenavModule} from '@angular/material/sidenav';
6+
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
7+
8+
describe('AppComponent', () => {
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [RouterTestingModule, MatToolbarModule, MatSidenavModule, NoopAnimationsModule],
12+
declarations: [AppComponent],
13+
}).compileComponents();
14+
});
15+
16+
it('should initialize the application', () => {
17+
const fixture = TestBed.createComponent(AppComponent);
18+
const app = fixture.componentInstance;
19+
expect(app).toBeTruthy();
20+
});
21+
});

apps/prs/src/app/app.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {Component} from '@angular/core';
2+
3+
@Component({
4+
selector: 'app',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.scss'],
7+
})
8+
export class AppComponent {}

apps/prs/src/app/app.module.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import {NgModule} from '@angular/core';
2+
import {BrowserModule} from '@angular/platform-browser';
3+
4+
import {AppRoutingModule} from './app-routing.module';
5+
import {AppComponent} from './app.component';
6+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
7+
8+
import {provideFirebaseApp, initializeApp} from '@angular/fire/app';
9+
import {provideAuth, getAuth} from '@angular/fire/auth';
10+
import {provideFirestore, getFirestore} from '@angular/fire/firestore';
11+
import {environment} from '../environments/environment';
12+
import {LayoutModule} from '@angular/cdk/layout';
13+
import {MatToolbarModule} from '@angular/material/toolbar';
14+
import {MatSidenavModule} from '@angular/material/sidenav';
15+
16+
@NgModule({
17+
declarations: [AppComponent],
18+
imports: [
19+
BrowserModule,
20+
AppRoutingModule,
21+
BrowserAnimationsModule,
22+
provideFirebaseApp(() => initializeApp(environment.firebase)),
23+
provideAuth(() => getAuth()),
24+
provideFirestore(() => getFirestore()),
25+
LayoutModule,
26+
MatToolbarModule,
27+
MatSidenavModule,
28+
],
29+
providers: [],
30+
bootstrap: [AppComponent],
31+
})
32+
export class AppModule {}

0 commit comments

Comments
 (0)