Skip to content

build(deps): bump engine.io from 4.1.1 to 4.1.2 #16

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

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ ui-debug.log
#System Files
.DS_Store
Thumbs.db

/material-cn-prebuilt
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"@angular-eslint/template-parser": "^13.1.0",
"@angular/cli": "^14.0.0",
"@angular/compiler-cli": "^14.0.0",
"@awesome-fe/prerender": "^0.0.8",
"@awesome-fe/translate": "^1.1.3",
"@types/imagemin": "^7.0.0",
"@types/jasmine": "^3.7.7",
"@types/node": "^14.14.22",
Expand All @@ -78,6 +80,7 @@
"eslint-plugin-jsdoc": "^32.3.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"firebase-tools": "^11.0.1",
"http-server-spa": "^1.3.0",
"imagemin": "^7.0.1",
"imagemin-pngquant": "^9.0.2",
"jasmine-core": "^3.7.1",
Expand Down
17 changes: 17 additions & 0 deletions scenes/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
]
}
}
30 changes: 30 additions & 0 deletions scripts/ci/deploy-cn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -e
set -x

yarn build:content

yarn prod-build

npx nt mark './dist/**/*.html'

commitSha=$(git rev-parse --short HEAD)
commitMessage=$(git log --oneline -n 1)

if [[ ! -d "./material-cn-prebuilt" ]]; then
git clone [email protected]:ng-docs/[email protected]:ng-docs/material-cn-prebuilt.git
fi

cp -r ./dist/material-angular-io/* ./material-cn-prebuilt

cd ./material-cn-prebuilt

cp index.html 404.html

git add .
git commit --allow-empty -am "${commitMessage}" || true

git push prebuilt HEAD:master

cd -
14 changes: 9 additions & 5 deletions src/app/app-module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {NgModule} from '@angular/core';
import {APP_ID, NgModule} from '@angular/core';
import {LocationStrategy, PathLocationStrategy} from '@angular/common';
import {RouterModule} from '@angular/router';

Expand All @@ -14,18 +14,22 @@ const prefersReducedMotion = typeof matchMedia === 'function' ?

@NgModule({
imports: [
BrowserModule,
BrowserModule.withServerTransition({appId: 'material-docs'}),
BrowserAnimationsModule.withConfig({disableAnimations: prefersReducedMotion}),
RouterModule.forRoot(MATERIAL_DOCS_ROUTES, {
scrollPositionRestoration: 'enabled',
anchorScrolling: 'enabled',
relativeLinkResolution: 'corrected'
relativeLinkResolution: 'corrected',
}),
NavBarModule,
CookiePopupModule,
],
declarations: [MaterialDocsApp],
providers: [{provide: LocationStrategy, useClass: PathLocationStrategy}],
providers: [
{provide: LocationStrategy, useClass: PathLocationStrategy},
{provide: APP_ID, useFactory: () => 'material-docs'},
],
bootstrap: [MaterialDocsApp],
})
export class AppModule {}
export class AppModule {
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
alt=""
role="presentation"
aria-hidden="true">
<div class="docs-component-category-list-card-title">{{component.name}}</div>
<div class="docs-component-category-list-card-summary">{{component.summary}}</div>
<div class="docs-component-category-list-card-title">{{component.nameCn}}&nbsp;<small>{{component.name}}</small></div>
<div class="docs-component-category-list-card-summary">{{component.summaryCn}}</div>
</div>
</a>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export class ComponentCategoryList implements OnInit, OnDestroy {
const sectionName = params['section'];
const section = SECTIONS[sectionName];
this._componentPageTitle.title = section.name;
this._categoryListSummary = section.summary;
this._componentPageTitle.titleCn = section.nameCn || '';
this._categoryListSummary = section.summaryCn || section.summary;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<mat-icon>menu</mat-icon>
</button>

<h1>{{getTitle()}} </h1>
<h1>{{getTitleCn()}} <small>{{getTitle()}}</small></h1>
</header>
4 changes: 4 additions & 0 deletions src/app/pages/component-page-header/component-page-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export class ComponentPageHeader {
getTitle() {
return this._componentPageTitle.title;
}

getTitleCn() {
return this._componentPageTitle.titleCn;
}
}

@NgModule({
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/component-sidenav/component-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[routerLink]="'/' + section+ '/' + component.id"
routerLinkActive="docs-component-viewer-sidenav-item-selected"
[attr.aria-current]="currentItemId === component.id ? 'page': 'false'">
{{component.name}}
{{component.nameCn}}&nbsp;<small>{{component.name}}</small>
</a>
</mat-nav-list>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/component-sidenav/component-nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
small {
opacity: 0.4;
}
4 changes: 2 additions & 2 deletions src/app/pages/component-viewer/component-api.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ng-container *ngIf="componentViewer.componentDocItem | async; let docItem">
<span class="cdk-visually-hidden" tabindex="-1">
API for {{docItem.id}}
{{docItem.id}} 的 API
</span>

<!--
Expand All @@ -11,7 +11,7 @@
<div class="docs-component-api">
<doc-viewer [documentUrl]="getApiDocumentUrl(docItem)"
class="docs-component-view-text-content"
(contentRendered)="updateTableOfContents(docItem.name, $event)">
(contentRendered)="updateTableOfContents(docItem.nameCn + ' API 目录', $event)">
</doc-viewer>

<doc-viewer *ngFor="let additionalApiDoc of docItem.additionalApiDocs; let index = index"
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/component-viewer/component-examples.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ng-container *ngIf="componentViewer.componentDocItem | async; let docItem">
<span class="cdk-visually-hidden" tabindex="-1">
Examples for {{docItem.id}}
{{docItem.id}} 的范例
</span>
<example-viewer
*ngFor="let example of docItem.examples"
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/component-viewer/component-overview.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<ng-container *ngIf="componentViewer.componentDocItem | async; let docItem">
<h2 class="cdk-visually-hidden" tabindex="-1">
Overview for {{docItem.id}}
{{docItem.id}} 概览
</h2>
<doc-viewer [documentUrl]="getOverviewDocumentUrl(docItem)"
class="docs-component-view-text-content docs-component-overview"
(contentRendered)="updateTableOfContents('Overview Content', $event)">
(contentRendered)="updateTableOfContents('概览目录', $event)">
</doc-viewer>
<table-of-contents #toc container=".mat-drawer-content" *ngIf="showToc | async"></table-of-contents>
</ng-container>
2 changes: 1 addition & 1 deletion src/app/pages/component-viewer/component-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*ngFor="let section of sections"
[routerLink]="section.toLowerCase()"
routerLinkActive #rla="routerLinkActive"
[active]="rla.isActive">{{section}}</a>
[active]="rla.isActive">{{titleOf(section)}}</a>
</nav>

<div class="docs-component-viewer-content">
Expand Down
15 changes: 14 additions & 1 deletion src/app/pages/component-viewer/component-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class ComponentViewer implements OnDestroy {
if (docItemAndSection.doc !== undefined) {
this.componentDocItem.next(docItemAndSection.doc);
this._componentPageTitle.title = `${docItemAndSection.doc.name}`;

this._componentPageTitle.titleCn = `${docItemAndSection.doc.nameCn}`;
if (docItemAndSection.doc.examples && docItemAndSection.doc.examples.length) {
this.sections.add('examples');
} else {
Expand All @@ -70,6 +70,19 @@ export class ComponentViewer implements OnDestroy {
this._destroyed.next();
this._destroyed.complete();
}

titleOf(id: string): string {
switch (id) {
case 'overview':
return '概览';
case 'api':
return 'API';
case 'examples':
return '范例';
default:
return id;
}
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/guide-list/guide-list.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<header class="docs-primary-header">
<h1>Guides</h1>
<h1>指南 <small>Guides</small></h1>
</header>

<main focusOnNavigation aria-label="Guide list" id="guide-list" class="docs-guide">
<div class="docs-guide-list">
<a class='docs-guide-item' *ngFor="let guide of guideItems.getAllItems()"
routerLink='/guide/{{guide.id}}'>
<mat-card class="docs-guide-card">
<mat-card-title>{{guide.name}}</mat-card-title>
<mat-card-title>{{guide.nameCn}}</mat-card-title>
<div class="docs-guide-card-divider"></div>
<mat-card-content class="docs-guide-card-summary">
{{guide.overview}}
{{guide.overviewCn}}
</mat-card-content>
</mat-card>
</a>
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/guide-list/guide-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class GuideList implements OnInit {

ngOnInit(): void {
this._componentPageTitle.title = 'Guides';
this._componentPageTitle.titleCn = '使用指南';
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/guide-viewer/guide-viewer.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="docs-primary-header">
<h1>{{guide?.name}}</h1>
<h1>{{guide?.nameCn}}&nbsp;<small>{{guide?.name}}</small></h1>
</div>

<div class="docs-guide-wrapper">
<div class="docs-guide-toc-and-content">
<doc-viewer class="docs-guide-content"
(contentRendered)="toc.addHeaders('Guide Content', $event); toc.updateScrollPosition()"
(contentRendered)="toc.addHeaders('指南目录', $event); toc.updateScrollPosition()"
[documentUrl]="guide?.document"
focusOnNavigation
id="guide-content"
Expand Down
6 changes: 4 additions & 2 deletions src/app/pages/guide-viewer/guide-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ export class GuideViewer implements OnInit {
ngOnInit(): void {
if (this.guide !== undefined) {
this._componentPageTitle.title = this.guide.name;
this._componentPageTitle.titleCn = this.guide.nameCn;
}
}
}

const routes: Routes = [ {path : '', component : GuideViewer} ];
const routes: Routes = [{path: '', component: GuideViewer}];

// This module needs to include all of the modules required by the examples in the guides.
// For example, the custom form-field guide requires the ReactiveFormsModule.
Expand All @@ -54,4 +55,5 @@ const routes: Routes = [ {path : '', component : GuideViewer} ];
declarations: [GuideViewer],
providers: [GuideItems],
})
export class GuideViewerModule {}
export class GuideViewerModule {
}
Loading