Skip to content

Commit 592d8d4

Browse files
committed
feat: add roadmap page
1 parent 986ded5 commit 592d8d4

File tree

12 files changed

+141
-7
lines changed

12 files changed

+141
-7
lines changed

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
"cli": {
136136
"schematicCollections": [
137137
"@angular-eslint/schematics"
138-
]
138+
],
139+
"analytics": "327481a5-f266-47d9-8c71-490982d7676f"
139140
}
140141
}

community/docs/roadmap.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: "Roadmap"
3+
type: roadmap
4+
alias: roadmap
5+
---
6+
7+
# Roadmap
8+
9+
This roadmap means to provide users and contributors with a high-level summary of ongoing efforts in the Paimon community.
10+
The roadmap contains both efforts working in process as well as completed efforts, so that users may get a better impression
11+
of the overall status and direction of those developments.
12+

library/markdown-parser/handlers/document.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { parse as parseFileName } from 'path';
2424
import { BriefRelease, parseDocumentFromBuffer, ResolvedDocument, resolveDocument } from '../models/document';
2525
import { getDirectoryPath } from '../utils/directory';
2626

27-
const { downloadsSource, releasesSource, docsDist } = getDirectoryPath();
27+
const { markdownSource, releasesSource, docsDist } = getDirectoryPath();
2828

2929
export function processDocuments(): { releases: BriefRelease[] } {
3030
if (fs.existsSync(docsDist)) {
@@ -37,9 +37,12 @@ export function processDocuments(): { releases: BriefRelease[] } {
3737
}
3838

3939
const releases: ResolvedDocument[] = [];
40-
const downloads = parseDocumentFromBuffer('downloads', readFileSync(`${downloadsSource}/downloads.md`));
40+
const downloads = parseDocumentFromBuffer('downloads', readFileSync(`${markdownSource}/downloads.md`));
4141
const resolvedDownloads = resolveDocument(downloads);
4242
writeFileSync(`${docsDist}/downloads.json`, JSON.stringify(resolvedDownloads));
43+
const roadmap = parseDocumentFromBuffer('roadmap', readFileSync(`${markdownSource}/roadmap.md`));
44+
const resolvedRoadmap = resolveDocument(roadmap);
45+
writeFileSync(`${docsDist}/roadmap.json`, JSON.stringify(resolvedRoadmap));
4346

4447
readdirSync(releasesSource).forEach(file => {
4548
const { name } = parseFileName(file);

library/markdown-parser/handlers/prerender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const { dist } = getDirectoryPath();
2727
export function processRoutes(articles: ResolvedArticle[], releases: BriefRelease[]): void {
2828
const articleUrls = articles.map(item => `/blog/${item.id}`);
2929
const releaseUrls = releases.map(item => `/releases/${item.version}`);
30-
const homeUrls = ['/', '/blog', '/downloads', '/releases'];
30+
const homeUrls = ['/', '/blog', '/downloads', '/roadmap', '/releases'];
3131
const content = [...homeUrls, ...articleUrls, ...releaseUrls].join('\n');
3232
writeFileSync(`${dist}/routes.txt`, content);
3333
}

library/markdown-parser/utils/directory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const getDirectoryPath = (): {
2828
articleDist: string;
2929
profileDist: string;
3030
articleSource: string;
31-
downloadsSource: string;
31+
markdownSource: string;
3232
releasesSource: string;
3333
docsDist: string;
3434
profileSource: string;
@@ -44,7 +44,7 @@ export const getDirectoryPath = (): {
4444
articleDist: resolve(dist, Configuration.directory.article),
4545
profileDist: resolve(dist, Configuration.directory.profile),
4646
articleSource: resolve(source, Configuration.directory.article),
47-
downloadsSource: resolve(source, 'docs'),
47+
markdownSource: resolve(source, 'docs'),
4848
releasesSource: resolve(source, 'docs', Configuration.directory.release),
4949
docsDist: resolve(distRoot, `./assets/docs`),
5050
profileSource: resolve(source, Configuration.directory.profile)

src/app/app.routes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { Routes } from '@angular/router';
2020

2121
import { DownloadsComponent, downloadsResolver } from '@paimon/app/routers/downloads/downloads.component';
2222
import { HomeComponent } from '@paimon/app/routers/home/home.component';
23+
import { RoadmapComponent, roadmapResolver } from '@paimon/app/routers/roadmap/roadmap.component';
2324
import { SecurityComponent } from '@paimon/app/routers/security/security.component';
2425
import { TeamComponent } from '@paimon/app/routers/team/team.component';
2526
import { UsersComponent } from '@paimon/app/routers/users/users.component';
@@ -48,6 +49,13 @@ export const routes: Routes = [
4849
downloads: downloadsResolver
4950
}
5051
},
52+
{
53+
path: 'roadmap',
54+
component: RoadmapComponent,
55+
resolve: {
56+
roadmap: roadmapResolver
57+
}
58+
},
5159
{
5260
path: 'users',
5361
component: UsersComponent

src/app/components/header/header.component.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
DOWNLOADS
4949
</a>
5050
<paimon-divider></paimon-divider>
51+
<a
52+
[routerLink]="['/', 'roadmap']"
53+
class="px-3 py-2 text-sm font-medium text-gray-300 hover:text-white"
54+
translate
55+
>
56+
ROADMAP
57+
</a>
58+
<paimon-divider></paimon-divider>
5159
<a
5260
[routerLink]="
5361
latestReleaseVersion ? ['/', 'releases', latestReleaseVersion] : ['/', 'releases']
@@ -186,6 +194,15 @@
186194
DOWNLOADS
187195
</a>
188196
</li>
197+
<li class="hover:bg-paimon-gray-12">
198+
<a
199+
[routerLink]="['/', 'roadmap']"
200+
class="flex h-10 w-full items-center justify-start px-8 no-underline hover:text-paimon-text-hover"
201+
translate
202+
>
203+
ROADMAP
204+
</a>
205+
</li>
189206
<li class="hover:bg-paimon-gray-12">
190207
<a
191208
[routerLink]="
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<paimon-page-container>
2+
<div header>
3+
<div class="mt-16 text-6xl font-normal text-paimon-gray-3">Roadmap</div>
4+
</div>
5+
<div content>
6+
@if (roadmap) {
7+
<paimon-markdown-render [html]="roadmap.content" [toc]="roadmap.toc">
8+
<div footer class="my-8">
9+
<a
10+
class="group/link flex text-paimon-gray-14 hover:text-paimon-blue-primary"
11+
[attr.href]="['docs', roadmap.alias + '.md'] | githubUrl"
12+
target="_blank"
13+
translate
14+
>
15+
<svg class="mr-2 w-5 group-hover/link:fill-paimon-blue-primary" viewBox="0 0 1024 1024">
16+
<path
17+
d="M918.125 878h-0.875a0.125 0.125 0 0 0-0.125 0.125v5h-10.25v-10.25h5a0.125 0.125 0 0 0 0.125-0.125v-0.875a0.125 0.125 0 0 0-0.125-0.125h-5.625a0.5 0.5 0 0 0-0.5 0.5v11.5a0.5 0.5 0 0 0 0.5 0.5h11.5a0.5 0.5 0 0 0 0.5-0.5v-5.625a0.125 0.125 0 0 0-0.125-0.125z"
18+
></path>
19+
<path
20+
d="M909.56 878.358l-0.029 1.858a0.25 0.25 0 0 0 0.25 0.253h0.007l1.843-0.046a0.13 0.13 0 0 0 0.085-0.036l6.498-6.484a0.125 0.125 0 0 0 0-0.176l-1.942-1.941a0.13 0.13 0 0 0-0.178 0l-6.497 6.484a0.13 0.13 0 0 0-0.036 0.088z m0.993 0.369l5.63-5.618 0.706 0.705-5.633 5.62-0.714 0.018 0.011-0.725z"
21+
></path>
22+
<path
23+
d="M257.7 752c2 0 4-0.2 6-0.5L431.9 722c2-0.4 3.9-1.3 5.3-2.8l423.9-423.9c3.9-3.9 3.9-10.2 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9-2.7 0-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2c-1.9 11.1 1.5 21.9 9.4 29.8 6.6 6.4 14.9 9.9 23.8 9.9z m67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"
24+
></path>
25+
</svg>
26+
27+
Edit this page
28+
</a>
29+
</div>
30+
</paimon-markdown-render>
31+
}
32+
</div>
33+
</paimon-page-container>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';
20+
import { ActivatedRoute, ResolveFn } from '@angular/router';
21+
22+
import { ResolvedDocument } from '@paimon-markdown-parser/document';
23+
24+
import { MarkdownRenderComponent } from '@paimon/app/components/markdown-render/markdown-render.component';
25+
import { PageContainerComponent } from '@paimon/app/components/page-container/page-container.component';
26+
import { GithubUrlPipe } from '@paimon/app/components/pipes/github-url.pipe';
27+
import { DocumentService } from '@paimon/app/services/document.service';
28+
29+
export const roadmapResolver: ResolveFn<unknown> = () => {
30+
const documentService = inject(DocumentService);
31+
return documentService.getRoadmap();
32+
};
33+
34+
@Component({
35+
selector: 'paimon-roadmap',
36+
standalone: true,
37+
imports: [PageContainerComponent, MarkdownRenderComponent, GithubUrlPipe],
38+
templateUrl: './roadmap.component.html',
39+
changeDetection: ChangeDetectionStrategy.OnPush
40+
})
41+
export class RoadmapComponent implements OnInit {
42+
roadmap: ResolvedDocument | null = null;
43+
constructor(
44+
private activatedRoute: ActivatedRoute,
45+
private cdr: ChangeDetectorRef
46+
) {}
47+
48+
ngOnInit(): void {
49+
this.activatedRoute.data.subscribe(({ roadmap }) => {
50+
this.roadmap = roadmap;
51+
this.cdr.markForCheck();
52+
});
53+
}
54+
}

src/app/services/document.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export class DocumentService {
4747
return this.httpClient.get<ResolvedDocument>(`${this.baseUrl}/downloads.json`);
4848
}
4949

50+
getRoadmap(): Observable<ResolvedDocument> {
51+
return this.httpClient.get<ResolvedDocument>(`${this.baseUrl}/roadmap.json`);
52+
}
53+
5054
listRelease(): Observable<BriefRelease[]> {
5155
if (this.briefReleases$) {
5256
return this.briefReleases$;

0 commit comments

Comments
 (0)