diff --git a/package.json b/package.json
index fe8d819..3b06516 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"cem": "custom-elements-manifest analyze --config 'lib/custom-elements-manifest.config.js'",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
- "preview-storybook": "storybook preview",
+ "preview-storybook": "storybook dev",
"test-storybook": "test-storybook --coverage",
"predist": "npm run cem && npm run build-storybook",
"dist": "node lib/esbuild.config.js",
diff --git a/src/devto/README.md b/src/devto/README.md
index 9035798..7adda9e 100644
--- a/src/devto/README.md
+++ b/src/devto/README.md
@@ -23,46 +23,6 @@ see README at root of repo for usage details
---
-## Members
-
-
-DEV-Post-Declarative-Shadow-DOM ⇒ string
-
-DEV-Declarative-Shadow-DOM ⇒ string
-
-
-
-## Objects
-
-
-DEVUtils : object
-Utility functions for fetching and parsing dev.to api data, getting
- styles and generating HTML for dev.to profile UIs
-
-
-
-
-
-## DEV-Post-Declarative-Shadow-DOM ⇒ string
-**Kind**: global variable
-**Returns**: string
- DEV post HTML wrapped in a `template`
-
-| Param | Type | Description |
-| --- | --- | --- |
-| content | ForemPostHTML
| Content about one post by dev.to (or Forem) user |
-| fetch | boolean
| |
-
-
-
-## DEV-Declarative-Shadow-DOM ⇒ string
-**Kind**: global variable
-**Returns**: string
- DEV HTML wrapped in a `template`
-
-| Param | Type | Description |
-| --- | --- | --- |
-| content | ForemUserHTML
| a content object representing a DEV user |
-| fetch | boolean
| |
-
## DEVUtils : object
@@ -74,6 +34,7 @@ Utility functions for fetching and parsing dev.to api data, getting
* [DEVUtils](#DEVUtils) : object
* [.post](#DEVUtils.post) : object
+ * [.dsd](#DEVUtils.post.dsd) ⇒ string
* [.html(content)](#DEVUtils.post.html) ⇒ string
* [.generateContent(content, [fetch])](#DEVUtils.post.generateContent) ⇒ ForemPost
\| ForemError
* [.ForemPost](#DEVUtils.post.ForemPost) : Object
@@ -82,6 +43,7 @@ Utility functions for fetching and parsing dev.to api data, getting
* [.styles](#DEVUtils.user.styles)
* [.html(content)](#DEVUtils.user.html) ⇒ string
* [.generateContent(content, [fetch])](#DEVUtils.user.generateContent) ⇒ ForemUserHTML
+ * [.dsd(content, fetch)](#DEVUtils.user.dsd) ⇒ string
* [.ForemUser](#DEVUtils.user.ForemUser) : Object
* [.ForemUserHTML](#DEVUtils.user.ForemUserHTML) : ForemUser
@@ -91,6 +53,27 @@ Utility functions for fetching and parsing dev.to api data, getting
Utility functions for a post
**Kind**: static namespace of [DEVUtils
](#DEVUtils)
+
+* [.post](#DEVUtils.post) : object
+ * [.dsd](#DEVUtils.post.dsd) ⇒ string
+ * [.html(content)](#DEVUtils.post.html) ⇒ string
+ * [.generateContent(content, [fetch])](#DEVUtils.post.generateContent) ⇒ ForemPost
\| ForemError
+ * [.ForemPost](#DEVUtils.post.ForemPost) : Object
+ * [.ForemPostHTML](#DEVUtils.post.ForemPostHTML) : ForemPost
+
+
+
+#### post.dsd ⇒ string
+Generate a `template` element with a shadowdom with a Post in it
+
+**Kind**: static namespace of [post
](#DEVUtils.post)
+**Returns**: string
- DEV post HTML wrapped in a `template`
+
+| Param | Type | Description |
+| --- | --- | --- |
+| content | ForemPostHTML
| Content about one post by dev.to (or Forem) user |
+| fetch | boolean
| |
+
**Example** *(Server side rendering a post with Declarative Shadow Dom)*
```js
@@ -101,13 +84,6 @@ const dsdHTML = post.dsd({id: '12345'}, true);
document.querySelector('devto-post').innerHTML = dsdHTML;
```
-
-* [.post](#DEVUtils.post) : object
- * [.html(content)](#DEVUtils.post.html) ⇒ string
- * [.generateContent(content, [fetch])](#DEVUtils.post.generateContent) ⇒ ForemPost
\| ForemError
- * [.ForemPost](#DEVUtils.post.ForemPost) : Object
- * [.ForemPostHTML](#DEVUtils.post.ForemPostHTML) : ForemPost
-
#### post.html(content) ⇒ string
@@ -168,21 +144,12 @@ Forem post content, ready for HTML
Utility functions for a user
**Kind**: static namespace of [DEVUtils
](#DEVUtils)
-**Example** *(Server side rendering with Declarative Shadow Dom)*
-```js
-
-
-
-```
* [.user](#DEVUtils.user) : object
* [.styles](#DEVUtils.user.styles)
* [.html(content)](#DEVUtils.user.html) ⇒ string
* [.generateContent(content, [fetch])](#DEVUtils.user.generateContent) ⇒ ForemUserHTML
+ * [.dsd(content, fetch)](#DEVUtils.user.dsd) ⇒ string
* [.ForemUser](#DEVUtils.user.ForemUser) : Object
* [.ForemUserHTML](#DEVUtils.user.ForemUserHTML) : ForemUser
@@ -217,6 +184,29 @@ Generates an object of content for the user HTML
| content | ForemUserHTML
|
| [fetch] | boolean
|
+
+
+#### user.dsd(content, fetch) ⇒ string
+Generate a `template` element with shadowrootmode with a User in it
+
+**Kind**: static method of [user
](#DEVUtils.user)
+**Returns**: string
- DEV HTML wrapped in a `template`
+
+| Param | Type | Description |
+| --- | --- | --- |
+| content | ForemUserHTML
| a content object representing a DEV user |
+| fetch | boolean
| |
+
+**Example** *(Server side rendering with Declarative Shadow Dom)*
+```js
+
+
+
+```
#### user.ForemUser : Object
diff --git a/src/devto/dsd.docs.mdx b/src/devto/dsd.docs.mdx
new file mode 100644
index 0000000..7b52a40
--- /dev/null
+++ b/src/devto/dsd.docs.mdx
@@ -0,0 +1,114 @@
+import { Meta, Title, Source } from '@storybook/blocks';
+
+
+
+
+
+Both DEV components can be implemented via Declarative Shadow DOM using methods exported from the `devto-utils.js` file.
+
+
+## Server Side Rendering HTML in Node.js
+
+
+ (...css styles for DEV component)
+
+
+*/
+
+const componentHTML = \`\${generatedTemplate} \`;
+`} language='js' />
+
+## Server side render in an Astro component
+
+
+
+`} language='jsx' />
+
+## Client side rendering via unpkg
+
+
+
+
+
+
+
+`} language='html' />
diff --git a/src/devto/dsd.stories.js b/src/devto/dsd.stories.js
new file mode 100644
index 0000000..03f6692
--- /dev/null
+++ b/src/devto/dsd.stories.js
@@ -0,0 +1,70 @@
+
+import { parseFetchedPost } from './post/content.js';
+import { parseFetchedUser } from './user/content.js';
+import { default as userScottnath } from './fixtures/generated/user--scottnath.json';
+import { default as postProfileComponents } from './fixtures/generated/post--profile-components.json';
+import { default as postDependabot } from './fixtures/generated/post--dependabot.json';
+import { default as postBugfix } from './fixtures/generated/post--bugfix-multi-vite.json';
+import { post, dsd } from './index.js';
+import docs from './dsd.docs.mdx';
+
+
+export default {
+ title: 'DevTo/Declarative Shadow DOM',
+ parameters: {
+ docs: {
+ page: docs
+ },
+ },
+ tags: ['autodocs'],
+ decorators: [(story) => `${story()}
+
+ `],
+};
+
+export const Post = {
+ loaders: [
+ async ({args}) => ({
+ dsdOutput: await (await post.dsd(args)),
+ }),
+ ],
+ render: (args, { loaded: { dsdOutput } }) => {
+ return `
+ ${dsdOutput}
+
+ `;
+ },
+ args: {
+ ...parseFetchedPost(postProfileComponents)
+ },
+}
+
+export const User = {
+ loaders: [
+ async ({args}) => ({
+ dsdOutput: await (await dsd(args)),
+ }),
+ ],
+ render: (args, { loaded: { dsdOutput } }) => {
+ return `
+ ${dsdOutput}
+
+ `;
+ },
+ args: {
+ ...parseFetchedUser(userScottnath),
+ latest_post: stringify(parseFetchedPost(postDependabot)),
+ popular_post: stringify(parseFetchedPost(postBugfix)),
+ },
+}
diff --git a/src/devto/fixtures/generated/post--bugfix-multi-vite.json b/src/devto/fixtures/generated/post--bugfix-multi-vite.json
index aaaa076..5d3a285 100644
--- a/src/devto/fixtures/generated/post--bugfix-multi-vite.json
+++ b/src/devto/fixtures/generated/post--bugfix-multi-vite.json
@@ -3,7 +3,7 @@
"id": 1466138,
"title": "Bugfix: Multiple Vite Storybooks from Same node_modules",
"description": "tl;dr Encountering Failed to fetch dynamically imported module or ENOTEMPTY: directory not...",
- "readable_publish_date": "May 12 2023",
+ "readable_publish_date": "May 12 '23",
"slug": "bugfix-multiple-vite-storybooks-from-same-nodemodules-4mg1",
"path": "/scottnath/bugfix-multiple-vite-storybooks-from-same-nodemodules-4mg1",
"url": "https://dev.to/scottnath/bugfix-multiple-vite-storybooks-from-same-nodemodules-4mg1",
@@ -40,4 +40,4 @@
"profile_image": "https://media.dev.to/cdn-cgi/image/width=640,height=640,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg",
"profile_image_90": "https://media.dev.to/cdn-cgi/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg"
}
-}
+}
\ No newline at end of file
diff --git a/src/devto/fixtures/generated/post--dependabot.json b/src/devto/fixtures/generated/post--dependabot.json
index 72f5f68..e4d70a2 100644
--- a/src/devto/fixtures/generated/post--dependabot.json
+++ b/src/devto/fixtures/generated/post--dependabot.json
@@ -3,7 +3,7 @@
"id": 1568661,
"title": "A crazy-simple way to bulk-update NPM dependencies with GitHub's Dependabot",
"description": "This is the simplest way I've found to keep your NPM dependencies up-to-date. This will update all...",
- "readable_publish_date": "Aug 15 2023",
+ "readable_publish_date": "Aug 15 '23",
"slug": "a-crazy-simple-way-to-bulk-update-npm-dependencies-with-githubs-dependabot-3e2o",
"path": "/scottnath/a-crazy-simple-way-to-bulk-update-npm-dependencies-with-githubs-dependabot-3e2o",
"url": "https://dev.to/scottnath/a-crazy-simple-way-to-bulk-update-npm-dependencies-with-githubs-dependabot-3e2o",
@@ -40,4 +40,4 @@
"profile_image": "https://media.dev.to/cdn-cgi/image/width=640,height=640,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg",
"profile_image_90": "https://media.dev.to/cdn-cgi/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg"
}
-}
+}
\ No newline at end of file
diff --git a/src/devto/fixtures/generated/post--profile-components-github.json b/src/devto/fixtures/generated/post--profile-components-github.json
index 5e911d8..84eb3a6 100644
--- a/src/devto/fixtures/generated/post--profile-components-github.json
+++ b/src/devto/fixtures/generated/post--profile-components-github.json
@@ -3,7 +3,7 @@
"id": 1631825,
"title": "GitHub Profile Native Web Components",
"description": "Learn about native web components that showcase GitHub profiles and repositories.",
- "readable_publish_date": "Oct 11 2023",
+ "readable_publish_date": "Oct 11 '23",
"slug": "github-profile-native-web-components-4ed7",
"path": "/scottnath/github-profile-native-web-components-4ed7",
"url": "https://dev.to/scottnath/github-profile-native-web-components-4ed7",
@@ -35,4 +35,4 @@
"profile_image": "https://media.dev.to/cdn-cgi/image/width=640,height=640,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg",
"profile_image_90": "https://media.dev.to/cdn-cgi/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg"
}
-}
+}
\ No newline at end of file
diff --git a/src/devto/fixtures/generated/post--profile-components.json b/src/devto/fixtures/generated/post--profile-components.json
index e558199..caf5f8f 100644
--- a/src/devto/fixtures/generated/post--profile-components.json
+++ b/src/devto/fixtures/generated/post--profile-components.json
@@ -3,7 +3,7 @@
"id": 1630208,
"title": "Profile Components: display social profiles in native web components",
"description": "Profile-components are a set of web components with zero dependencies that display publicly-available profile information from various social networks. Currently two: GitHub and dev.to.",
- "readable_publish_date": "Oct 10 2023",
+ "readable_publish_date": "Oct 10 '23",
"slug": "profile-components-display-social-profiles-in-native-web-components-49b2",
"path": "/scottnath/profile-components-display-social-profiles-in-native-web-components-49b2",
"url": "https://dev.to/scottnath/profile-components-display-social-profiles-in-native-web-components-49b2",
@@ -40,4 +40,4 @@
"profile_image": "https://media.dev.to/cdn-cgi/image/width=640,height=640,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg",
"profile_image_90": "https://media.dev.to/cdn-cgi/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055555%2F4d0bf90a-bec7-4228-b1ca-d663fa40adeb.jpeg"
}
-}
+}
\ No newline at end of file
diff --git a/src/devto/index.js b/src/devto/index.js
index 1321b3e..ed36bd1 100644
--- a/src/devto/index.js
+++ b/src/devto/index.js
@@ -18,6 +18,19 @@ import postHTML from './post/html.js';
* @param {ForemPostHTML} content - Content about one post by dev.to (or Forem) user
* @param {boolean} fetch
* @returns {string} DEV post HTML wrapped in a `template`
+ * @function
+ * @memberof DEVUtils.post
+ * @namespace dsd
+ * @description Generate a `template` element with a shadowdom with a Post in it
+ *
+ * @example Server side rendering a post with Declarative Shadow Dom
+ *
+ *
+ *
*/
const dsdPost = async (content, fetch = false) => {
const generated = await generatePostContent(content, fetch);
@@ -33,15 +46,6 @@ const dsdPost = async (content, fetch = false) => {
* @namespace post
* @memberof DEVUtils
* @description Utility functions for a post
- *
- * @example Server side rendering a post with Declarative Shadow Dom
- *
- *
- *
*/
const post = {
generateContent: generatePostContent,
@@ -52,9 +56,22 @@ const post = {
/**
* @name DEV-Declarative-Shadow-DOM
+ * @namespace dsd
* @param {ForemUserHTML} content - a content object representing a DEV user
* @param {boolean} fetch
* @returns {string} DEV HTML wrapped in a `template`
+ * @function
+ * @memberof DEVUtils.user
+ * @description Generate a `template` element with shadowrootmode with a User in it
+ *
+ * @example Server side rendering with Declarative Shadow Dom
+ *
+ *
+ *
*/
const dsd = async (content, fetch = false) => {
const generated = await generateUserContent(content, fetch);
@@ -70,15 +87,6 @@ const dsd = async (content, fetch = false) => {
* @namespace user
* @memberof DEVUtils
* @description Utility functions for a user
- *
- * @example Server side rendering with Declarative Shadow Dom
- *
- *
- *
*/
const user = {
generateContent: generateUserContent,
diff --git a/src/github/README.md b/src/github/README.md
index 17dcc0d..521edea 100644
--- a/src/github/README.md
+++ b/src/github/README.md
@@ -19,46 +19,6 @@ see README at root of repo for usage details
---
-## Members
-
-
-GitHub-Repository-Declarative-Shadow-DOM ⇒ string
-
-GitHub-Declarative-Shadow-DOM ⇒ string
-
-
-
-## Objects
-
-
-GitHubUtils : object
-Utility functions for fetching and parsing GitHub api data, getting
- styles and generating HTML for GitHub profile UIs
-
-
-
-
-
-## GitHub-Repository-Declarative-Shadow-DOM ⇒ string
-**Kind**: global variable
-**Returns**: string
- GitHub HTML wrapped in a `template`
-
-| Param | Type | Description |
-| --- | --- | --- |
-| content | GitHubRepositoryHTML
| a content object representing a GitHub repository |
-| fetch | boolean
| |
-
-
-
-## GitHub-Declarative-Shadow-DOM ⇒ string
-**Kind**: global variable
-**Returns**: string
- GitHub HTML wrapped in a `template`
-
-| Param | Type | Description |
-| --- | --- | --- |
-| content | GitHubUserHTML
| a content object representing a GitHub user |
-| fetch | boolean
| |
-
## GitHubUtils : object
@@ -71,11 +31,13 @@ Utility functions for fetching and parsing GitHub api data, getting
* [GitHubUtils](#GitHubUtils) : object
* [.repo](#GitHubUtils.repo) : object
* [.styles](#GitHubUtils.repo.styles)
+ * [.dsd](#GitHubUtils.repo.dsd) ⇒ string
* [.html(content)](#GitHubUtils.repo.html) ⇒ string
* [.generateContent(content, [fetch], [no_org])](#GitHubUtils.repo.generateContent) ⇒ GitHubRepositoryHTML
* [.GitHubRepositoryHTML](#GitHubUtils.repo.GitHubRepositoryHTML) : Object
* [.user](#GitHubUtils.user) : object
* [.styles](#GitHubUtils.user.styles)
+ * [.dsd](#GitHubUtils.user.dsd) ⇒ string
* [.html(content)](#GitHubUtils.user.html) ⇒ string
* [.generateContent(content, [fetch])](#GitHubUtils.user.generateContent) ⇒ GitHubUserHTML
* [.GitHubUserHTML](#GitHubUtils.user.GitHubUserHTML) : Object
@@ -86,19 +48,10 @@ Utility functions for fetching and parsing GitHub api data, getting
Utility functions for a repository
**Kind**: static namespace of [GitHubUtils
](#GitHubUtils)
-**Example** *(Server side rendering a Repository with Declarative Shadow Dom)*
-```js
-
-
-
-```
* [.repo](#GitHubUtils.repo) : object
* [.styles](#GitHubUtils.repo.styles)
+ * [.dsd](#GitHubUtils.repo.dsd) ⇒ string
* [.html(content)](#GitHubUtils.repo.html) ⇒ string
* [.generateContent(content, [fetch], [no_org])](#GitHubUtils.repo.generateContent) ⇒ GitHubRepositoryHTML
* [.GitHubRepositoryHTML](#GitHubUtils.repo.GitHubRepositoryHTML) : Object
@@ -109,6 +62,29 @@ document.querySelector('#github-repo-1').innerHTML = dsdHTML;
GitHub repository styles
**Kind**: static property of [repo
](#GitHubUtils.repo)
+
+
+#### repo.dsd ⇒ string
+Generate a `template` element with shadowrootmode and a repository in it
+
+**Kind**: static namespace of [repo
](#GitHubUtils.repo)
+**Returns**: string
- GitHub HTML wrapped in a `template`
+
+| Param | Type | Description |
+| --- | --- | --- |
+| content | GitHubRepositoryHTML
| a content object representing a GitHub repository |
+| fetch | boolean
| |
+
+**Example** *(Server side rendering a Repository with Declarative Shadow Dom)*
+```js
+
+
+
+```
#### repo.html(content) ⇒ string
@@ -161,19 +137,10 @@ Content needed to render a GitHub repository. This is a subset of the `repos` en
Utility functions for a user
**Kind**: static namespace of [GitHubUtils
](#GitHubUtils)
-**Example** *(Server side rendering with Declarative Shadow Dom)*
-```js
-
-
-
-```
* [.user](#GitHubUtils.user) : object
* [.styles](#GitHubUtils.user.styles)
+ * [.dsd](#GitHubUtils.user.dsd) ⇒ string
* [.html(content)](#GitHubUtils.user.html) ⇒ string
* [.generateContent(content, [fetch])](#GitHubUtils.user.generateContent) ⇒ GitHubUserHTML
* [.GitHubUserHTML](#GitHubUtils.user.GitHubUserHTML) : Object
@@ -184,6 +151,29 @@ document.querySelector('github-user').innerHTML = dsdHTML;
GitHub user styles
**Kind**: static property of [user
](#GitHubUtils.user)
+
+
+#### user.dsd ⇒ string
+Generate a `template` element with shadowrootmode with a User in it
+
+**Kind**: static namespace of [user
](#GitHubUtils.user)
+**Returns**: string
- GitHub HTML wrapped in a `template`
+
+| Param | Type | Description |
+| --- | --- | --- |
+| content | GitHubUserHTML
| a content object representing a GitHub user |
+| fetch | boolean
| |
+
+**Example** *(Server side rendering with Declarative Shadow Dom)*
+```js
+
+
+
+```
#### user.html(content) ⇒ string
diff --git a/src/github/dsd.docs.mdx b/src/github/dsd.docs.mdx
new file mode 100644
index 0000000..ba35d4e
--- /dev/null
+++ b/src/github/dsd.docs.mdx
@@ -0,0 +1,123 @@
+import { Meta, Title, Primary, Source, Stories } from '@storybook/blocks';
+
+
+
+
+
+Both GitHub components can be implemented via Declarative Shadow DOM using methods exported from the `github-utils.js` file.
+
+
+## Server Side Rendering HTML in Node.js
+
+
+ (...css styles for GitHub component)
+
+
+*/
+
+const componentHTML = \`\${generatedTemplate} \`;
+`} language='js' />
+
+## Server side render in an Astro component
+
+
+
+`} language='jsx' />
+
+## Client side rendering via unpkg
+
+
+
+
+
+
+
+`} language='html' />
diff --git a/src/github/dsd.stories.js b/src/github/dsd.stories.js
new file mode 100644
index 0000000..87c2f85
--- /dev/null
+++ b/src/github/dsd.stories.js
@@ -0,0 +1,71 @@
+
+import { parseFetchedRepo } from './repository/content.js';
+import { parseFetchedUser } from './user/content.js';
+import { repoProfileComponents, repoStorydocker, userScottnath, repoFreeCodeCamp } from './fixtures';
+import { repo, dsd } from './index.js';
+import docs from './dsd.docs.mdx';
+
+
+export default {
+ title: 'GitHub/Declarative Shadow DOM',
+ parameters: {
+ docs: {
+ page: docs
+ },
+ },
+ tags: ['autodocs'],
+ decorators: [(story) => `${story()}
+
+ `],
+};
+
+export const Repository = {
+ loaders: [
+ async ({args}) => ({
+ dsdOutput: await (await repo.dsd(args)),
+ }),
+ ],
+ render: (args, { loaded: { dsdOutput } }) => {
+ return `
+ ${dsdOutput}
+
+ `;
+ },
+ args: {
+ ...parseFetchedRepo(repoFreeCodeCamp),
+ },
+}
+
+export const User = {
+ loaders: [
+ async ({args}) => ({
+ dsdOutput: await (await dsd(args)),
+ }),
+ ],
+ render: (args, { loaded: { dsdOutput } }) => {
+ return `
+ ${dsdOutput}
+
+ `;
+ },
+ args: {
+ ...parseFetchedUser(userScottnath),
+ repos: stringify([
+ {
+ ...parseFetchedRepo(repoProfileComponents),
+ user_login: userScottnath.login
+ },
+ parseFetchedRepo(repoStorydocker)]),
+ },
+}
diff --git a/src/github/fixtures/generated/repo--freeCodeCamp-freeCodeCamp.json b/src/github/fixtures/generated/repo--freeCodeCamp-freeCodeCamp.json
index c46f084..1f1a9df 100644
--- a/src/github/fixtures/generated/repo--freeCodeCamp-freeCodeCamp.json
+++ b/src/github/fixtures/generated/repo--freeCodeCamp-freeCodeCamp.json
@@ -65,16 +65,16 @@
"releases_url": "https://api.github.com/repos/freeCodeCamp/freeCodeCamp/releases{/id}",
"deployments_url": "https://api.github.com/repos/freeCodeCamp/freeCodeCamp/deployments",
"created_at": "2014-12-24T17:49:19Z",
- "updated_at": "2024-02-13T19:26:21Z",
- "pushed_at": "2024-02-13T18:34:49Z",
+ "updated_at": "2024-02-21T20:40:00Z",
+ "pushed_at": "2024-02-21T19:07:44Z",
"git_url": "git://github.com/freeCodeCamp/freeCodeCamp.git",
"ssh_url": "git@github.com:freeCodeCamp/freeCodeCamp.git",
"clone_url": "https://github.com/freeCodeCamp/freeCodeCamp.git",
"svn_url": "https://github.com/freeCodeCamp/freeCodeCamp",
"homepage": "http://contribute.freecodecamp.org/",
- "size": 412666,
- "stargazers_count": 383225,
- "watchers_count": 383225,
+ "size": 417124,
+ "stargazers_count": 383862,
+ "watchers_count": 383862,
"language": "TypeScript",
"has_issues": true,
"has_projects": true,
@@ -82,11 +82,11 @@
"has_wiki": false,
"has_pages": true,
"has_discussions": false,
- "forks_count": 35816,
+ "forks_count": 34680,
"mirror_url": null,
"archived": false,
"disabled": false,
- "open_issues_count": 359,
+ "open_issues_count": 344,
"license": {
"key": "bsd-3-clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
@@ -116,9 +116,9 @@
"teachers"
],
"visibility": "public",
- "forks": 35816,
- "open_issues": 359,
- "watchers": 383225,
+ "forks": 34680,
+ "open_issues": 344,
+ "watchers": 383862,
"default_branch": "main",
"temp_clone_token": null,
"custom_properties": {},
@@ -142,6 +142,6 @@
"type": "Organization",
"site_admin": false
},
- "network_count": 35816,
- "subscribers_count": 8488
+ "network_count": 34680,
+ "subscribers_count": 8499
}
\ No newline at end of file
diff --git a/src/github/fixtures/generated/repo--scottnath-profile-components.json b/src/github/fixtures/generated/repo--scottnath-profile-components.json
index ffc580f..c274c2a 100644
--- a/src/github/fixtures/generated/repo--scottnath-profile-components.json
+++ b/src/github/fixtures/generated/repo--scottnath-profile-components.json
@@ -66,13 +66,13 @@
"deployments_url": "https://api.github.com/repos/scottnath/profile-components/deployments",
"created_at": "2023-08-16T13:36:29Z",
"updated_at": "2023-10-12T16:03:17Z",
- "pushed_at": "2023-11-10T18:26:22Z",
+ "pushed_at": "2024-02-14T15:19:26Z",
"git_url": "git://github.com/scottnath/profile-components.git",
"ssh_url": "git@github.com:scottnath/profile-components.git",
"clone_url": "https://github.com/scottnath/profile-components.git",
"svn_url": "https://github.com/scottnath/profile-components",
"homepage": "https://scottnath.com/profile-components/",
- "size": 14935,
+ "size": 18742,
"stargazers_count": 1,
"watchers_count": 1,
"language": "JavaScript",
diff --git a/src/github/fixtures/generated/user--scottnath.json b/src/github/fixtures/generated/user--scottnath.json
index 7294d4f..b0045d4 100644
--- a/src/github/fixtures/generated/user--scottnath.json
+++ b/src/github/fixtures/generated/user--scottnath.json
@@ -27,7 +27,7 @@
"twitter_username": null,
"public_repos": 134,
"public_gists": 24,
- "followers": 10,
+ "followers": 9,
"following": 18,
"created_at": "2010-03-06T01:59:25Z",
"updated_at": "2023-11-09T20:32:48Z"
diff --git a/src/github/fixtures/generated/user--sindresorhus.json b/src/github/fixtures/generated/user--sindresorhus.json
index c605749..825a56f 100644
--- a/src/github/fixtures/generated/user--sindresorhus.json
+++ b/src/github/fixtures/generated/user--sindresorhus.json
@@ -27,8 +27,8 @@
"twitter_username": "sindresorhus",
"public_repos": 1100,
"public_gists": 97,
- "followers": 64444,
- "following": 36,
+ "followers": 64767,
+ "following": 37,
"created_at": "2009-12-20T22:57:02Z",
"updated_at": "2024-02-08T17:59:12Z"
}
\ No newline at end of file
diff --git a/src/github/index.js b/src/github/index.js
index 4fa1c8a..39d5591 100644
--- a/src/github/index.js
+++ b/src/github/index.js
@@ -19,6 +19,19 @@ import repoHTML from './repository/html.js';
* @param {GitHubRepositoryHTML} content - a content object representing a GitHub repository
* @param {boolean} fetch
* @returns {string} GitHub HTML wrapped in a `template`
+ * @function
+ * @memberof GitHubUtils.repo
+ * @namespace dsd
+ * @description Generate a `template` element with shadowrootmode and a repository in it
+ *
+ * @example Server side rendering a Repository with Declarative Shadow Dom
+ *
+ *
+ *
*/
const dsdRepo = async (content, fetch = false) => {
const generated = await generateRepoContent(content, fetch);
@@ -34,15 +47,6 @@ const dsdRepo = async (content, fetch = false) => {
* @namespace repo
* @memberof GitHubUtils
* @description Utility functions for a repository
- *
- * @example Server side rendering a Repository with Declarative Shadow Dom
- *
- *
- *
*/
const repo = {
generateContent: generateRepoContent,
@@ -56,6 +60,19 @@ const repo = {
* @param {GitHubUserHTML} content - a content object representing a GitHub user
* @param {boolean} fetch
* @returns {string} GitHub HTML wrapped in a `template`
+ * @function
+ * @memberof GitHubUtils.user
+ * @namespace dsd
+ * @description Generate a `template` element with shadowrootmode with a User in it
+ *
+ * @example Server side rendering with Declarative Shadow Dom
+ *
+ *
+ *
*/
const dsd = async (content, fetch = false) => {
const generated = await generateUserContent(content, fetch);
@@ -71,15 +88,6 @@ const dsd = async (content, fetch = false) => {
* @namespace user
* @memberof GitHubUtils
* @description Utility functions for a user
- *
- * @example Server side rendering with Declarative Shadow Dom
- *
- *
- *
*/
const user = {
generateContent: generateUserContent,