@terrafirmagreg-team/changelog 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@terrafirmagreg-team/changelog",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "exports": {
6
+ "./lib/*": [
7
+ "./src/lib/*.ts",
8
+ "./src/lib/*.tsx",
9
+ "./src/lib/*/index.ts",
10
+ "./src/lib/*/index.tsx"
11
+ ],
12
+ "./locales": "./src/locales.ts"
13
+ },
14
+ "dependencies": {
15
+ "fumadocs-core": "16.17.8",
16
+ "@terrafirmagreg-team/kit": "0.1.0",
17
+ "@terrafirmagreg-team/translate": "0.1.0"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^26.6.5"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/TerraFirmaGreg-Team/Web-Foundation.git",
25
+ "directory": "packages/changelog"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "files": [
31
+ "src",
32
+ "styles",
33
+ "styles.css",
34
+ "locales"
35
+ ]
6
36
  }
@@ -0,0 +1,2 @@
1
+
2
+ export const changelogRoute = '/changelog';
@@ -0,0 +1,41 @@
1
+ import type * as PageTree from 'fumadocs-core/page-tree';
2
+ import type { SectionTrees } from '@terrafirmagreg-team/kit/types';
3
+
4
+ function groupVersionItems(root: PageTree.Root): PageTree.Root {
5
+ const children: PageTree.Node[] = [];
6
+ const groups = new Map<string, PageTree.Folder>();
7
+ for (const node of root.children) {
8
+ const title = node.type === 'page' ? String(node.name ?? '') : '';
9
+ const series = /^v?(\d+)\.(\d+)/.exec(title)?.slice(1, 3).join('.');
10
+ if (node.type !== 'page' || !series) {
11
+ children.push(node);
12
+ continue;
13
+ }
14
+ let folder = groups.get(series);
15
+ if (!folder) {
16
+ folder = {
17
+ $id: `${root.$id ?? 'root'}:${series}`,
18
+ type: 'folder',
19
+ name: `${series}.x`,
20
+ children: [],
21
+ };
22
+ groups.set(series, folder);
23
+ children.push(folder);
24
+ }
25
+ folder.children.push(node);
26
+ }
27
+ return { ...root, children };
28
+ }
29
+
30
+ export const groupTrees = (trees: SectionTrees): SectionTrees =>
31
+ Object.fromEntries(
32
+ Object.entries(trees).map(([lang, byDataset]) => [
33
+ lang,
34
+ Object.fromEntries(
35
+ Object.entries(byDataset).map(([id, root]) => [
36
+ id,
37
+ groupVersionItems(root),
38
+ ]),
39
+ ),
40
+ ]),
41
+ );
@@ -0,0 +1,8 @@
1
+ {
2
+ "sections": {
3
+ "changelog": "Changelog",
4
+ "desc": {
5
+ "changelog": "Release history and version notes"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "sections": {
3
+ "changelog": "Список изменений",
4
+ "desc": {
5
+ "changelog": "История релизов и заметки к версиям"
6
+ }
7
+ }
8
+ }
package/src/locales.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { createLocaleCatalog } from '@terrafirmagreg-team/translate/lib/locales';
2
+
3
+ export const locales = createLocaleCatalog(
4
+ import.meta.glob('./locales/*.json', { eager: true, import: 'default' }),
5
+ );
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.