@tummycrypt/tinyland-user-content 0.2.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/dist/config.d.ts +26 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +29 -0
- package/dist/config.js.map +1 -0
- package/dist/defaults.d.ts +9 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +38 -0
- package/dist/defaults.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +49 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +135 -0
- package/dist/loader.js.map +1 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +52 -0
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for the user content loader.
|
|
3
|
+
*/
|
|
4
|
+
export interface UserContentConfig {
|
|
5
|
+
/** Base users content directory (replaces process.cwd() + 'src/content/users') */
|
|
6
|
+
usersContentDir?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Configure the user content loader with custom settings.
|
|
10
|
+
* Merges provided config with existing config.
|
|
11
|
+
*/
|
|
12
|
+
export declare function configure(config: Partial<UserContentConfig>): void;
|
|
13
|
+
/**
|
|
14
|
+
* Get a copy of the current configuration.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getConfig(): UserContentConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Reset configuration to defaults.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resetConfig(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get the resolved users content directory path.
|
|
23
|
+
* Falls back to process.cwd() + 'src/content/users' if not configured.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getUsersContentDir(): string;
|
|
26
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAID;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAElE;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,iBAAiB,CAE7C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
let _config = {};
|
|
3
|
+
/**
|
|
4
|
+
* Configure the user content loader with custom settings.
|
|
5
|
+
* Merges provided config with existing config.
|
|
6
|
+
*/
|
|
7
|
+
export function configure(config) {
|
|
8
|
+
_config = { ..._config, ...config };
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get a copy of the current configuration.
|
|
12
|
+
*/
|
|
13
|
+
export function getConfig() {
|
|
14
|
+
return { ..._config };
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reset configuration to defaults.
|
|
18
|
+
*/
|
|
19
|
+
export function resetConfig() {
|
|
20
|
+
_config = {};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the resolved users content directory path.
|
|
24
|
+
* Falls back to process.cwd() + 'src/content/users' if not configured.
|
|
25
|
+
*/
|
|
26
|
+
export function getUsersContentDir() {
|
|
27
|
+
return _config.usersContentDir || join(process.cwd(), 'src/content/users');
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAU5B,IAAI,OAAO,GAAsB,EAAE,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAkC;IAC1D,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,mBAAmB,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get default page templates for a new user.
|
|
3
|
+
* Returns a record of page name to content structure.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDefaultUserPages(): Record<string, {
|
|
6
|
+
metadata: Record<string, unknown>;
|
|
7
|
+
content: string;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAC3C,MAAM,EACN;IAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CACvD,CAgCA"}
|
package/dist/defaults.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get default page templates for a new user.
|
|
3
|
+
* Returns a record of page name to content structure.
|
|
4
|
+
*/
|
|
5
|
+
export function getDefaultUserPages() {
|
|
6
|
+
return {
|
|
7
|
+
home: {
|
|
8
|
+
metadata: {
|
|
9
|
+
title: 'Home',
|
|
10
|
+
layout: 'user-home',
|
|
11
|
+
},
|
|
12
|
+
content: '# Welcome\n\nThis is my personal page on Tinyland.',
|
|
13
|
+
},
|
|
14
|
+
bio: {
|
|
15
|
+
metadata: {
|
|
16
|
+
title: 'About Me',
|
|
17
|
+
layout: 'user-bio',
|
|
18
|
+
},
|
|
19
|
+
content: '# About Me\n\nTell us about yourself!',
|
|
20
|
+
},
|
|
21
|
+
stack: {
|
|
22
|
+
metadata: {
|
|
23
|
+
title: 'My Stack',
|
|
24
|
+
layout: 'user-stack',
|
|
25
|
+
items: [],
|
|
26
|
+
},
|
|
27
|
+
content: '# Tech Stack\n\nTools and technologies I use.',
|
|
28
|
+
},
|
|
29
|
+
contact: {
|
|
30
|
+
metadata: {
|
|
31
|
+
title: 'Contact',
|
|
32
|
+
layout: 'user-contact',
|
|
33
|
+
},
|
|
34
|
+
content: '# Contact\n\nGet in touch!',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IAIjC,OAAO;QACL,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,WAAW;aACpB;YACD,OAAO,EAAE,oDAAoD;SAC9D;QACD,GAAG,EAAE;YACH,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,UAAU;aACnB;YACD,OAAO,EAAE,uCAAuC;SACjD;QACD,KAAK,EAAE;YACL,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,YAAY;gBACpB,KAAK,EAAE,EAAE;aACV;YACD,OAAO,EAAE,+CAA+C;SACzD;QACD,OAAO,EAAE;YACP,QAAQ,EAAE;gBACR,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,cAAc;aACvB;YACD,OAAO,EAAE,4BAA4B;SACtC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { UserPageContent, UserContentDirectory, StackItem, ContactInfo, } from './types.js';
|
|
2
|
+
export type { UserContentConfig } from './config.js';
|
|
3
|
+
export { configure, getConfig, resetConfig, getUsersContentDir } from './config.js';
|
|
4
|
+
export { loadUserPage, hasUserPage, getUserPages, getUsersWithContent, loadUserStack, loadUserContact, } from './loader.js';
|
|
5
|
+
export { getDefaultUserPages } from './defaults.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGpF,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { configure, getConfig, resetConfig, getUsersContentDir } from './config.js';
|
|
2
|
+
// Loaders
|
|
3
|
+
export { loadUserPage, hasUserPage, getUserPages, getUsersWithContent, loadUserStack, loadUserContact, } from './loader.js';
|
|
4
|
+
// Defaults
|
|
5
|
+
export { getDefaultUserPages } from './defaults.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpF,UAAU;AACV,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,WAAW;AACX,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/loader.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Content Loader
|
|
3
|
+
* Loads user-specific page content from the configured users content directory.
|
|
4
|
+
*
|
|
5
|
+
* Supports per-user customization of:
|
|
6
|
+
* - home.md (landing page)
|
|
7
|
+
* - bio.md (extended biography)
|
|
8
|
+
* - stack.md (tech stack)
|
|
9
|
+
* - contact.md (contact information)
|
|
10
|
+
*/
|
|
11
|
+
import type { UserPageContent, UserContentDirectory, StackItem, ContactInfo } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Load user-specific page content.
|
|
14
|
+
* @param handle - User handle (directory name)
|
|
15
|
+
* @param page - Page name (home, bio, stack, contact)
|
|
16
|
+
* @returns Parsed page content or null if not found
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadUserPage(handle: string, page: string): UserPageContent | null;
|
|
19
|
+
/**
|
|
20
|
+
* Check if a user has custom content for a specific page.
|
|
21
|
+
* @param handle - User handle
|
|
22
|
+
* @param page - Page name
|
|
23
|
+
* @returns true if the page file exists
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasUserPage(handle: string, page: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Get all custom page names for a user.
|
|
28
|
+
* @param handle - User handle
|
|
29
|
+
* @returns Array of page names (without .md extension)
|
|
30
|
+
*/
|
|
31
|
+
export declare function getUserPages(handle: string): string[];
|
|
32
|
+
/**
|
|
33
|
+
* Get all users that have custom content directories.
|
|
34
|
+
* @returns Array of user content directory summaries
|
|
35
|
+
*/
|
|
36
|
+
export declare function getUsersWithContent(): UserContentDirectory[];
|
|
37
|
+
/**
|
|
38
|
+
* Load a user's tech stack items from stack.md frontmatter.
|
|
39
|
+
* @param handle - User handle
|
|
40
|
+
* @returns Array of stack items, or empty array if not found
|
|
41
|
+
*/
|
|
42
|
+
export declare function loadUserStack(handle: string): StackItem[];
|
|
43
|
+
/**
|
|
44
|
+
* Load a user's contact information from contact.md frontmatter.
|
|
45
|
+
* @param handle - User handle
|
|
46
|
+
* @returns Contact info object or null if not found
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadUserContact(handle: string): ContactInfo | null;
|
|
49
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAuBjF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAIjE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAerD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,oBAAoB,EAAE,CAuB5D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAczD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAelE"}
|
package/dist/loader.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Content Loader
|
|
3
|
+
* Loads user-specific page content from the configured users content directory.
|
|
4
|
+
*
|
|
5
|
+
* Supports per-user customization of:
|
|
6
|
+
* - home.md (landing page)
|
|
7
|
+
* - bio.md (extended biography)
|
|
8
|
+
* - stack.md (tech stack)
|
|
9
|
+
* - contact.md (contact information)
|
|
10
|
+
*/
|
|
11
|
+
import { join } from 'path';
|
|
12
|
+
import { readFileSync, existsSync, readdirSync } from 'fs';
|
|
13
|
+
import matter from 'gray-matter';
|
|
14
|
+
import { getUsersContentDir } from './config.js';
|
|
15
|
+
/**
|
|
16
|
+
* Load user-specific page content.
|
|
17
|
+
* @param handle - User handle (directory name)
|
|
18
|
+
* @param page - Page name (home, bio, stack, contact)
|
|
19
|
+
* @returns Parsed page content or null if not found
|
|
20
|
+
*/
|
|
21
|
+
export function loadUserPage(handle, page) {
|
|
22
|
+
const contentDir = getUsersContentDir();
|
|
23
|
+
const pagePath = join(contentDir, handle, `${page}.md`);
|
|
24
|
+
if (!existsSync(pagePath)) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const fileContent = readFileSync(pagePath, 'utf-8');
|
|
29
|
+
const { data: metadata, content } = matter(fileContent);
|
|
30
|
+
return {
|
|
31
|
+
handle,
|
|
32
|
+
page,
|
|
33
|
+
content,
|
|
34
|
+
metadata,
|
|
35
|
+
lastModified: metadata.updated || metadata.date,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error(`[UserContentLoader] Failed to load ${handle}/${page}:`, error);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a user has custom content for a specific page.
|
|
45
|
+
* @param handle - User handle
|
|
46
|
+
* @param page - Page name
|
|
47
|
+
* @returns true if the page file exists
|
|
48
|
+
*/
|
|
49
|
+
export function hasUserPage(handle, page) {
|
|
50
|
+
const contentDir = getUsersContentDir();
|
|
51
|
+
const pagePath = join(contentDir, handle, `${page}.md`);
|
|
52
|
+
return existsSync(pagePath);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get all custom page names for a user.
|
|
56
|
+
* @param handle - User handle
|
|
57
|
+
* @returns Array of page names (without .md extension)
|
|
58
|
+
*/
|
|
59
|
+
export function getUserPages(handle) {
|
|
60
|
+
const contentDir = getUsersContentDir();
|
|
61
|
+
const userDir = join(contentDir, handle);
|
|
62
|
+
if (!existsSync(userDir)) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
return readdirSync(userDir)
|
|
67
|
+
.filter((f) => f.endsWith('.md'))
|
|
68
|
+
.map((f) => f.replace('.md', ''));
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get all users that have custom content directories.
|
|
76
|
+
* @returns Array of user content directory summaries
|
|
77
|
+
*/
|
|
78
|
+
export function getUsersWithContent() {
|
|
79
|
+
const contentDir = getUsersContentDir();
|
|
80
|
+
if (!existsSync(contentDir)) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const handles = readdirSync(contentDir, { withFileTypes: true })
|
|
85
|
+
.filter((d) => d.isDirectory())
|
|
86
|
+
.map((d) => d.name);
|
|
87
|
+
return handles.map((handle) => {
|
|
88
|
+
const pages = getUserPages(handle);
|
|
89
|
+
return {
|
|
90
|
+
handle,
|
|
91
|
+
pages,
|
|
92
|
+
hasCustomContent: pages.length > 0,
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Load a user's tech stack items from stack.md frontmatter.
|
|
102
|
+
* @param handle - User handle
|
|
103
|
+
* @returns Array of stack items, or empty array if not found
|
|
104
|
+
*/
|
|
105
|
+
export function loadUserStack(handle) {
|
|
106
|
+
const pageContent = loadUserPage(handle, 'stack');
|
|
107
|
+
if (!pageContent) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
const items = pageContent.metadata.items;
|
|
111
|
+
if (Array.isArray(items)) {
|
|
112
|
+
return items;
|
|
113
|
+
}
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Load a user's contact information from contact.md frontmatter.
|
|
118
|
+
* @param handle - User handle
|
|
119
|
+
* @returns Contact info object or null if not found
|
|
120
|
+
*/
|
|
121
|
+
export function loadUserContact(handle) {
|
|
122
|
+
const pageContent = loadUserPage(handle, 'contact');
|
|
123
|
+
if (!pageContent) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
email: pageContent.metadata.email,
|
|
128
|
+
phone: pageContent.metadata.phone,
|
|
129
|
+
address: pageContent.metadata.address,
|
|
130
|
+
social: pageContent.metadata.social,
|
|
131
|
+
availability: pageContent.metadata.availability,
|
|
132
|
+
preferredContact: pageContent.metadata.preferredContact,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,kBAAkB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C,MAAM,EAAE,OAAO,CAAC,CAAC;IAElD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAgC,CAAC;IAEpE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEpD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,KAA2B;QACvD,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,KAA2B;QACvD,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,OAA6B;QAC3D,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,MAA4C;QACzE,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,YAAkC;QACrE,gBAAgB,EAAE,WAAW,CAAC,QAAQ,CAAC,gBAAsC;KAC9E,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents loaded user page content with parsed frontmatter.
|
|
3
|
+
*/
|
|
4
|
+
export interface UserPageContent {
|
|
5
|
+
/** User handle (directory name) */
|
|
6
|
+
handle: string;
|
|
7
|
+
/** Page name (home, bio, stack, contact) */
|
|
8
|
+
page: string;
|
|
9
|
+
/** Markdown body content (after frontmatter) */
|
|
10
|
+
content: string;
|
|
11
|
+
/** Parsed frontmatter metadata */
|
|
12
|
+
metadata: Record<string, unknown>;
|
|
13
|
+
/** Last modified date from metadata (updated or date field) */
|
|
14
|
+
lastModified?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Summary of a user's content directory.
|
|
18
|
+
*/
|
|
19
|
+
export interface UserContentDirectory {
|
|
20
|
+
/** User handle (directory name) */
|
|
21
|
+
handle: string;
|
|
22
|
+
/** List of page names found */
|
|
23
|
+
pages: string[];
|
|
24
|
+
/** Whether the user has any custom content pages */
|
|
25
|
+
hasCustomContent: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A single item in a user's tech stack.
|
|
29
|
+
*/
|
|
30
|
+
export interface StackItem {
|
|
31
|
+
/** Technology name */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Category classification */
|
|
34
|
+
category?: 'language' | 'framework' | 'tool' | 'service' | 'platform' | 'other';
|
|
35
|
+
/** Short description */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Link to technology */
|
|
38
|
+
url?: string;
|
|
39
|
+
/** Icon identifier */
|
|
40
|
+
icon?: string;
|
|
41
|
+
/** User's proficiency level */
|
|
42
|
+
proficiency?: 'beginner' | 'intermediate' | 'advanced' | 'expert';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* User contact information parsed from frontmatter.
|
|
46
|
+
*/
|
|
47
|
+
export interface ContactInfo {
|
|
48
|
+
/** Email address */
|
|
49
|
+
email?: string;
|
|
50
|
+
/** Phone number */
|
|
51
|
+
phone?: string;
|
|
52
|
+
/** Physical address */
|
|
53
|
+
address?: string;
|
|
54
|
+
/** Social media handles (platform -> handle/url) */
|
|
55
|
+
social?: Record<string, string>;
|
|
56
|
+
/** Availability description */
|
|
57
|
+
availability?: string;
|
|
58
|
+
/** Preferred contact method */
|
|
59
|
+
preferredContact?: string;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW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/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tummycrypt/tinyland-user-content",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "User-specific page content loader (home, bio, stack, contact)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Zlib AND LicenseRef-Tinyland-Proprietary",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"dev": "tsc --watch",
|
|
23
|
+
"clean": "rm -rf dist",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"test:coverage": "vitest --coverage",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"author": "Tinyland.dev",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/tinyland-inc/tinyland.dev",
|
|
34
|
+
"directory": "packages/tinyland-user-content"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"gray-matter": "^4.0.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
41
|
+
"typescript": "^5.0.0",
|
|
42
|
+
"vitest": "^4.0.0"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=22.0.0"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"registry": "https://registry.npmjs.org/",
|
|
49
|
+
"access": "public",
|
|
50
|
+
"provenance": true
|
|
51
|
+
}
|
|
52
|
+
}
|