Skip to content
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bf6697b
add workflow action
Aug 11, 2021
0778a30
add template for issues list
Aug 11, 2021
2e05dad
git shenannigans
Aug 11, 2021
f2d295a
Flat: latest data (2021-08-11T01:02:49.166Z)
flat-data Aug 11, 2021
2d19d52
add response processing
petronbot Aug 11, 2021
a58e3c5
i guess no subfolders in the workflows folder
petronbot Aug 11, 2021
e23c3d2
Flat: latest data (2021-08-11T01:27:24.536Z)
flat-data Aug 11, 2021
9e764b6
i guess no subfolders in the workflows folder
petronbot Aug 11, 2021
9066b90
Flat: latest data (2021-08-11T01:33:23.386Z)
flat-data Aug 11, 2021
bf87745
fiddle with the axios config
petronbot Aug 12, 2021
c61d87a
ignore pancake generated sass file
petronbot Aug 12, 2021
6b2fc65
remove dodgy Deno import
petronbot Aug 12, 2021
fd869f5
lol I'm so gonna squash this PR
petronbot Aug 12, 2021
38d8d00
what's deno anyway
petronbot Aug 12, 2021
8f6cebe
deno api changes
petronbot Aug 12, 2021
30387d4
oops
petronbot Aug 12, 2021
ec2df3e
i'm outta practice
petronbot Aug 12, 2021
f58d989
ok
petronbot Aug 12, 2021
edc9f0f
lol
petronbot Aug 12, 2021
4958658
jfc
petronbot Aug 12, 2021
380006b
debuggin postprocessing
petronbot Aug 12, 2021
3a2587e
save data file outside actions dir
petronbot Aug 12, 2021
1f7e1fb
Flat: latest data (2021-08-12T01:55:25.200Z)
flat-data Aug 12, 2021
60612c6
update postprocess file ref
petronbot Aug 12, 2021
22cd1e5
Flat: latest data (2021-08-12T01:57:59.047Z)
flat-data Aug 12, 2021
08c7fec
got it together
petronbot Aug 12, 2021
ea2b683
add new date filter
petronbot Aug 12, 2021
f761444
Flat: latest data (2021-08-12T04:26:48.863Z)
flat-data Aug 12, 2021
1096de7
fix typo
petronbot Aug 12, 2021
64c377f
line ending
petronbot Aug 12, 2021
25dfcae
apostrphes
petronbot Aug 12, 2021
0809094
remove unused data file
petronbot Aug 12, 2021
d8effb0
line ending
petronbot Aug 12, 2021
4ac008a
name change
petronbot Aug 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ module.exports = function (eleventyConfig) {
);
});

eleventyConfig.addFilter('readableDateFromIso', (dateString) => {
return DateTime.fromJSDate(new Date(dateString)).toFormat('dd LLL yyyy');
});

eleventyConfig.addFilter('htmlDateString', (dateObj) => {
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('yyyy-LL-dd');
});
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/repo-data-query.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we format this file at all?

"method": "post",
"data": {
"query": "{ repository(owner: \"designsystemau\", name: \"design-system-components\") { name url codeOfConduct { body } issues(first: 20, orderBy: {field: UPDATED_AT, direction: DESC}) { totalCount nodes { id url number state updatedAt createdAt title bodyHTML participants(first: 20) { totalCount nodes { id url name avatarUrl } } comments(first: 1) { totalCount nodes { id url updatedAt createdAt bodyHTML author { url avatarUrl login } } } } } pullRequests(first: 20, orderBy: {field: UPDATED_AT, direction: DESC}) { totalCount nodes { id number number createdAt permalink state title participants(first: 20) { totalCount nodes { id url name avatarUrl } } comments(first: 1) { totalCount nodes { id url createdAt bodyHTML author { url avatarUrl login } } } } } } }"
}
}
28 changes: 28 additions & 0 deletions .github/workflows/repo-data-response.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const decoder = new TextDecoder("utf-8");
const encoder = new TextEncoder();

let json;
let response;

try {
json = await Deno.readFile("src/data/repoData.json");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an advantage to using Deno here?

response = JSON.parse(decoder.decode(json));
} catch (error) {
console.log("There was an error parsing the JSON response:", error);
}

if (response?.errors?.length) {
console.log(
"There was an error response from the API:",
JSON.stringify(response.errors)
);
} else {
try {
await Deno.writeFile(
"src/data/repoData.json",
encoder.encode(JSON.stringify(response.data.repository))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, but for it to remain clear that this file is generated, you could prepend a comment at the top of file? maybe it would also include the generated date.

);
} catch (error) {
console.log("There was an error writing your JSON file:", error);
}
}
38 changes: 38 additions & 0 deletions .github/workflows/repo-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: repo-data
on:
workflow_dispatch: {}
push:
branches:
- main
pull_request:
branches:
- main
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Setup deno
uses: denoland/setup-deno@main
with:
deno-version: v1.x
- name: Check out repo (pull request)
uses: actions/checkout@v2
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

- name: Check out repo (push)
uses: actions/checkout@v2
if: github.event_name == 'push'
with:
fetch-depth: 0

- name: Fetch data
uses: githubocto/flat@v3
with:
http_url: https://api.github.com/graphql
downloaded_filename: src/data/repoData.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose renaming this to repo.json

authorization: "Bearer ${{ secrets.GITHUB_TOKEN }}"
axios_config: .github/workflows/repo-data-query.json
postprocess: .github/workflows/repo-data-response.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ public
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
pancake/sass/pancake.scss
13 changes: 13 additions & 0 deletions src/css/contributor-activity.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.contributor-activity__wrapper {
padding-top: 2rem;
}

.contributor-activity__list {
list-style: none;
padding-inline-start: 0;
}

.contributor-activity__list-item {
border-bottom: 1px solid #e6e6e6;
padding: 1rem 0;
}
3 changes: 2 additions & 1 deletion src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

/*@import 'typography.css';*/
@import 'post-list.css';
@import 'contributor-activity.css';

@import 'hero.css';
@import 'post.css';
@import 'about.css';
@import 'about.css';
1 change: 1 addition & 0 deletions src/data/repoData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"design-system-components","url":"https://github.com/designsystemau/design-system-components","codeOfConduct":{"body":"# Code of Conduct\n\n## 1. Purpose\n\nA primary goal of the design system components is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are\ncommitted to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status,\nand religion (or lack thereof).\n\nThis code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.\n\nWe invite all those who participate and contribute to the design system components to help us create safe and positive experiences for everyone.\n\n## 2. Open Source Citizenship\n\nA supplemental goal of this Code of Conduct is to increase open source citizenship by encouraging participants to recognize and strengthen the relationships\nbetween our actions and their effects on our community.\n\nCommunities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist\nin society.\n\nIf you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest\nextent, we want to know.\n\n## 3. Expected Behavior\n\nThe following behaviors are expected and requested of all community members:\n\n* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.\n* Exercise consideration and respect in your speech and actions.\n* Attempt collaboration before conflict.\n* Refrain from demeaning, discriminatory, or harassing behavior and speech.\n* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or\n violations of this Code of Conduct, even if they seem inconsequential.\n* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.\n\n## 4. Unacceptable Behavior\n\nThe following behaviors are considered harassment and are unacceptable within our community:\n\n* Violence, threats of violence or violent language directed against another person.\n* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.\n* Posting or displaying sexually explicit or violent material.\n* Posting or threatening to post other people’s personally identifying information (\"doxing\").\n* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.\n* Inappropriate photography or recording.\n* Inappropriate physical contact. You should have someone’s consent before touching them.\n* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.\n* Deliberate intimidation, stalking or following (online or in person).\n* Advocating for, or encouraging, any of the above behavior.\n* Sustained disruption of community events, including talks and presentations.\n\n## 5. Consequences of Unacceptable Behavior\n\nUnacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.\n\nAnyone asked to stop unacceptable behavior is expected to comply immediately.\n\nIf a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban\nor permanent expulsion from the community without warning (and without refund in the case of a paid event).\n\n## 6. Reporting Guidelines\n\nIf you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible via\[email protected].\n\nAdditionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing\nunacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.\n\n## 7. Addressing Grievances\n\nIf you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify the design system team with a concise description of your\ngrievance. Your grievance will be handled in accordance with our existing governing policies.\n\n## 8. Scope\n\nWe expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community\nvenues–online and in-person–as well as in all one-on-one communications pertaining to community business.\n\nThis code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has\nthe potential to adversely affect the safety and well-being of community members.\n\n## 9. Contact info\n\[email protected]\n\n## 10. License and attribution\n\nThis Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).\n\nPortions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment\nPolicy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).\n\nRetrieved on November 22, 2016 from [http://citizencodeofconduct.org/](http://citizencodeofconduct.org/)\n"},"issues":{"totalCount":0,"nodes":[]},"pullRequests":{"totalCount":0,"nodes":[]}}
29 changes: 29 additions & 0 deletions src/includes/contributor-activity.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<h3 class="au-display-lg">Recent contributor activity on <a href="{{ repoData.url }}">{{ repoData.name }}</a></h1>
<div class="contributor-activity__wrapper">
<h4 class="au-display-md">Latest issue updates</h4>
<ul class="contributor-activity__list">
{% for issue in repoData.issues.nodes %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this list need limiting?

<li class="contributor-activity__list-item">
<p>
<strong>{{ issue.title }}</strong><br />
<a href="{{ issue.url }}">#{{ issue.number }}</a> created on {{ issue.createdAt | readableDateFromIso }}, updated {{ pullRequest.updatedAt | readableDateFromIso }}
</p>
</li>
{% endfor %}
</ul>
<p><a href="">View all open issues</a></p>
Copy link
Contributor

@elisechant elisechant Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an href value here and in corresponding one below.

</div>
<div class="contributor-activity__wrapper">
<h4 class="au-display-md">Latest pull request updates</h4>
<ul class="contributor-activity__list">
{% for pullRequest in repoData.pullRequests.nodes %}
<li class="contributor-activity__list-item">
<p>
<strong>{{ pullRequest.title }}</strong><br />
<a href="{{ pullRequest.url }}">#{{ pullRequest.number }}</a> created on {{ pullRequest.createdAt | readableDateFromIso }}, updated {{ pullRequest.updatedAt | readableDateFromIso }}
</p>
</li>
{% endfor %}
</ul>
<p><a href="">View all pull requests</a></p>
</div>
6 changes: 6 additions & 0 deletions src/layouts/home.njk
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ layout: base
</section>

<a class="all-posts-link" href="{{ '/posts' | url }}">View All Posts</a>

<hr />

<section>
{% include "contributor-activity.njk" %}
</section>
</div>