Skip to content

Commit

Permalink
🤡 more examples, update fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed Oct 11, 2023
1 parent e6ac335 commit 329822b
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/devto/fixtures/generated/user--scottnath.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Scott Nath",
"twitter_username": null,
"github_username": "scottnath",
"summary": "Front-end UI DevOps architect. Efficiency in all things and productivity will follow. former IBM, NBCUniversal",
"summary": "Front-end UI DevOps architect. Efficiency in all things and productivity will follow. \nformer IBM, NBCUniversal",
"location": "New York, United States",
"website_url": "https://scottnath.com",
"joined_at": "Mar 30, 2023",
Expand Down
24 changes: 12 additions & 12 deletions src/github/fixtures/generated/repo--freeCodeCamp-freeCodeCamp.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@
"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": "2023-09-13T23:27:20Z",
"pushed_at": "2023-09-13T16:20:11Z",
"updated_at": "2023-10-11T15:18:50Z",
"pushed_at": "2023-10-11T15:19:05Z",
"git_url": "git://github.com/freeCodeCamp/freeCodeCamp.git",
"ssh_url": "[email protected]:freeCodeCamp/freeCodeCamp.git",
"clone_url": "https://github.com/freeCodeCamp/freeCodeCamp.git",
"svn_url": "https://github.com/freeCodeCamp/freeCodeCamp",
"homepage": "http://contribute.freecodecamp.org/",
"size": 387674,
"stargazers_count": 373581,
"watchers_count": 373581,
"size": 380060,
"stargazers_count": 375781,
"watchers_count": 375781,
"language": "TypeScript",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": false,
"has_pages": true,
"has_discussions": false,
"forks_count": 33500,
"forks_count": 34217,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 251,
"open_issues_count": 284,
"license": {
"key": "bsd-3-clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
Expand Down Expand Up @@ -116,9 +116,9 @@
"teachers"
],
"visibility": "public",
"forks": 33500,
"open_issues": 251,
"watchers": 373581,
"forks": 34217,
"open_issues": 284,
"watchers": 375781,
"default_branch": "main",
"temp_clone_token": null,
"organization": {
Expand All @@ -141,6 +141,6 @@
"type": "Organization",
"site_admin": false
},
"network_count": 33500,
"subscribers_count": 8467
"network_count": 34217,
"subscribers_count": 8461
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
"releases_url": "https://api.github.com/repos/scottnath/profile-components/releases{/id}",
"deployments_url": "https://api.github.com/repos/scottnath/profile-components/deployments",
"created_at": "2023-08-16T13:36:29Z",
"updated_at": "2023-09-13T20:08:49Z",
"pushed_at": "2023-09-13T20:23:53Z",
"updated_at": "2023-09-22T17:21:21Z",
"pushed_at": "2023-10-11T15:09:13Z",
"git_url": "git://github.com/scottnath/profile-components.git",
"ssh_url": "[email protected]:scottnath/profile-components.git",
"clone_url": "https://github.com/scottnath/profile-components.git",
"svn_url": "https://github.com/scottnath/profile-components",
"homepage": null,
"size": 4329,
"homepage": "https://scottnath.com/profile-components/",
"size": 11164,
"stargazers_count": 1,
"watchers_count": 1,
"language": "JavaScript",
Expand All @@ -86,7 +86,7 @@
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"open_issues_count": 4,
"license": {
"key": "mit",
"name": "MIT License",
Expand All @@ -100,7 +100,7 @@
"topics": [],
"visibility": "public",
"forks": 0,
"open_issues": 0,
"open_issues": 4,
"watchers": 1,
"default_branch": "main",
"temp_clone_token": null,
Expand Down
14 changes: 7 additions & 7 deletions src/github/fixtures/generated/repo--scottnath-scottnath.com.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@
"releases_url": "https://api.github.com/repos/scottnath/scottnath.com/releases{/id}",
"deployments_url": "https://api.github.com/repos/scottnath/scottnath.com/deployments",
"created_at": "2023-07-03T16:45:49Z",
"updated_at": "2023-08-16T20:18:19Z",
"pushed_at": "2023-09-12T19:33:37Z",
"updated_at": "2023-09-15T19:56:25Z",
"pushed_at": "2023-10-10T19:51:09Z",
"git_url": "git://github.com/scottnath/scottnath.com.git",
"ssh_url": "[email protected]:scottnath/scottnath.com.git",
"clone_url": "https://github.com/scottnath/scottnath.com.git",
"svn_url": "https://github.com/scottnath/scottnath.com",
"homepage": "https://scottnath.com",
"size": 3093,
"size": 5504,
"stargazers_count": 0,
"watchers_count": 0,
"language": "HTML",
"has_issues": true,
"has_projects": true,
"has_projects": false,
"has_downloads": true,
"has_wiki": true,
"has_wiki": false,
"has_pages": false,
"has_discussions": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 1,
"open_issues_count": 5,
"license": {
"key": "mit",
"name": "MIT License",
Expand All @@ -100,7 +100,7 @@
"topics": [],
"visibility": "public",
"forks": 0,
"open_issues": 1,
"open_issues": 5,
"watchers": 0,
"default_branch": "main",
"temp_clone_token": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
"deployments_url": "https://api.github.com/repos/storydocker/storydocker/deployments",
"created_at": "2023-04-03T12:11:02Z",
"updated_at": "2023-08-16T20:18:32Z",
"pushed_at": "2023-09-12T10:26:37Z",
"pushed_at": "2023-10-11T10:47:00Z",
"git_url": "git://github.com/storydocker/storydocker.git",
"ssh_url": "[email protected]:storydocker/storydocker.git",
"clone_url": "https://github.com/storydocker/storydocker.git",
"svn_url": "https://github.com/storydocker/storydocker",
"homepage": "",
"size": 1599,
"size": 2419,
"stargazers_count": 1,
"watchers_count": 1,
"language": "JavaScript",
Expand All @@ -86,7 +86,7 @@
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 1,
"open_issues_count": 4,
"license": {
"key": "mit",
"name": "MIT License",
Expand All @@ -102,7 +102,7 @@
],
"visibility": "public",
"forks": 0,
"open_issues": 1,
"open_issues": 4,
"watchers": 1,
"default_branch": "main",
"temp_clone_token": null,
Expand Down
4 changes: 2 additions & 2 deletions src/github/fixtures/generated/user--sindresorhus.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"hireable": null,
"bio": "Full-Time Open-Sourcerer. Focuses on Swift & JavaScript. Makes macOS apps, CLI tools, npm packages. Likes unicorns.",
"twitter_username": "sindresorhus",
"public_repos": 1071,
"public_repos": 1072,
"public_gists": 96,
"followers": 58014,
"followers": 58419,
"following": 53,
"created_at": "2009-12-20T22:57:02Z",
"updated_at": "2023-09-12T05:57:55Z"
Expand Down
4 changes: 4 additions & 0 deletions src/github/repository/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { repository as styles } from '../styles/index.js';
* @property {boolean} [fetch] - when true, fetches repo from [GitHub api](https://docs.github.com/en/rest/repos/repos#get-a-repository)
* @property {string} [itemprop] - Itemprop content to go with a containing component's itemscope
* @property {string} [no_org] - Do not include the repo owner or organization
* @property {string} [theme] - color theme for the component
*
* @example
* <!-- import the web component -->
Expand Down Expand Up @@ -61,6 +62,9 @@ export class GitHubRepository extends HTMLElement {
if (this.attrs.itemprop) {
this.setAttribute('itemprop', this.attrs.itemprop);
}
if (this.attrs.theme) {
this.setAttribute('data-theme', this.attrs.theme);
}
}
}

Expand Down
16 changes: 15 additions & 1 deletion src/github/repository/repository.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const Repository = {
}
}


export const FullNameOnly = {
args: {
full_name: repoProfileComponents.full_name,
Expand All @@ -59,10 +58,25 @@ export const LanguageCircle = {
args: {
full_name: 'just-another/c-plus-plus-repo',
language: 'C++',
stargazers_count: '123',
forks_count: '456',
subscribers_count: '789',
description: 'This is meow meow.'
},
play: Repository.play,
}

export const Theme = {
args: {
...parseFetchedRepo(repoFreeCodeCamp),
theme: 'dark',
},
play: async ({ args, canvasElement, step }) => {
const elements = await getElements(canvasElement);
await ensureElements(elements, args);
}
}

export const Fetch = {
args: {
full_name: repoProfileComponents.full_name,
Expand Down

0 comments on commit 329822b

Please sign in to comment.