Skip to content

Commit 21389c6

Browse files
committed
First
0 parents  commit 21389c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+11023
-0
lines changed

.eslintrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": [
3+
"plugin:@typescript-eslint/recommended",
4+
"next",
5+
"next/core-web-vitals",
6+
"prettier"
7+
],
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": {
10+
"ecmaFeatures": {
11+
"jsx": true
12+
},
13+
"ecmaVersion": 12,
14+
"sourceType": "module"
15+
},
16+
"plugins": ["@typescript-eslint"]
17+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#### ℹ️ Repository information
2+
3+
**The repository has**:
4+
5+
- [ ] At least three issues with the `good first issue`, or other labels specified in `firstissue.json` (see `labels` and the end).
6+
- Link:
7+
- [ ] At least 10 contributors.
8+
- [ ] At least 1000 stars.
9+
- [ ] Detailed setup instructions for the project.
10+
- Link:
11+
- [ ] CONTRIBUTING.md
12+
- [ ] Actively maintained (last updated less than 1 months ago).

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/deploy.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Deploy to firstissue.dev
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Allows you to trigger this workflow from another workflow
12+
workflow_call:
13+
14+
# Cron schedule, everyday at midnight
15+
schedule:
16+
- cron: '0 0 * * *'
17+
18+
19+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
20+
permissions:
21+
contents: write
22+
pages: write
23+
id-token: write
24+
25+
# Allow one concurrent deployment
26+
concurrency:
27+
group: "pages"
28+
cancel-in-progress: true
29+
30+
jobs:
31+
# Build job
32+
build:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
- name: Setup Node
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: "18"
41+
cache: ${{ steps.detect-package-manager.outputs.manager }}
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v2
44+
with:
45+
# Automatically inject basePath in your Next.js configuration file and disable
46+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
47+
#
48+
# You may remove this line if you want to manage the configuration yourself.
49+
static_site_generator: next
50+
- name: Restore cache
51+
uses: actions/cache@v3
52+
with:
53+
path: |
54+
.next/cache
55+
# Generate a new cache whenever packages or source files change.
56+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
57+
# If source files changed but packages didn't, rebuild from a prior cache.
58+
restore-keys: |
59+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
60+
- name: Install dependencies
61+
run: npm install
62+
- name: Build with Next.js
63+
run: npm run build
64+
env:
65+
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
66+
- name: Update firstissue.json
67+
uses: stefanzweifel/git-auto-commit-action@v4
68+
with:
69+
commit_message: update firstissue.json [skip actions]
70+
branch: json-updates
71+
file_pattern: 'firstissue.json'
72+
skip_checkout: true
73+
push_options: '--force'
74+
- name: Static HTML export with Next.js
75+
run: npm run export
76+
- name: Upload artifact
77+
uses: actions/upload-pages-artifact@v1
78+
with:
79+
path: ./out
80+
81+
# Deployment job
82+
deploy:
83+
environment:
84+
name: github-pages
85+
url: ${{ steps.deployment.outputs.page_url }}
86+
runs-on: ubuntu-latest
87+
needs: build
88+
steps:
89+
- name: Deploy to GitHub Pages
90+
id: deployment
91+
uses: actions/deploy-pages@v1

.github/workflows/pr.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check pull request
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
# Build job
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Setup Node
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: "18"
16+
cache: ${{ steps.detect-package-manager.outputs.manager }}
17+
- name: Setup Pages
18+
uses: actions/configure-pages@v2
19+
with:
20+
# Automatically inject basePath in your Next.js configuration file and disable
21+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
22+
#
23+
# You may remove this line if you want to manage the configuration yourself.
24+
static_site_generator: next
25+
- name: Restore cache
26+
uses: actions/cache@v3
27+
with:
28+
path: |
29+
.next/cache
30+
# Generate a new cache whenever packages or source files change.
31+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
32+
# If source files changed but packages didn't, rebuild from a prior cache.
33+
restore-keys: |
34+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
35+
- name: Install dependencies
36+
run: npm install
37+
- name: Build with Next.js
38+
run: npm run build
39+
env:
40+
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
41+
NODE_ENV: "development"
42+
- name: Static HTML export with Next.js
43+
run: npm run export
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v1
46+
with:
47+
path: ./out

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
/.history
3+
4+
# dependencies
5+
/node_modules
6+
/.pnp
7+
.pnp.js
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
.pnpm-debug.log*
28+
29+
# local env files
30+
.env*.local
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts
38+
.vscode
39+
.todo
40+
public/sitemap.xml

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"trailingComma": "none",
5+
"bracketSpacing": true,
6+
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
7+
"importOrderSeparation": true,
8+
"importOrderSortSpecifiers": true
9+
}

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Copyright 2020 DeepSource Corp.
2+
Copyright 2022 Luca Cavallin <nillavac@gmail.com>
3+
Copyright 2023 GitHub Social Impact and Ruby for Good
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<p align="center">
2+
<img src="/public/meta.png" width="100%"/>
3+
</p>
4+
5+
---
6+
7+
Welcome! 👋🏼
8+
9+
**First Issue** is an initiative to curate a list of accessible issues from popular projects, so developers looking for a new (or first) project to contribute to can get started quickly.
10+
11+
Open-source maintainers are always looking to get more people involved, but it can be challenging to become a contributor. We believe First Issue lowers the barrier for future contributions - and this is why it exists.
12+
13+
## Adding a new project
14+
15+
You're welcome to add a new project in First Issue, just follow these steps:
16+
17+
- To maintain the quality of projects in First Issue, please make sure the GitHub repository you want to add meets the following criteria:
18+
19+
- It has at least three issues with the `good first issue` label or other labels defined in `firstissue.json` (see `labels` and the end).
20+
21+
- It has at least 10 contributors.
22+
23+
- It has at least 1000 stars.
24+
25+
- It contains a README.md with detailed setup instructions for the project, and a CONTRIBUTING.md with guidelines for new contributors.
26+
27+
- It is actively maintained (last update less than 1 month ago).
28+
29+
- Add your repository's path (in the format `owner/name` and lexicographic order) to [firstissue.json](firstissue.json).
30+
31+
- Create a new pull-request. Please add the link to the issues page of the repository in the PR description. Once the pull request is merged, the changes will be live on [firstissue.dev](https://firstissue.dev/).
32+
33+
## How does it work?
34+
35+
First Issue is a static website that uses Next.js, React and Typescript. The data shown on the website is loaded from the [generated.json](generated.json) file, which is generated by [generate.ts](generate.ts) by querying the GitHub API to fetch issues from the repositories listed in [firstissue.json](firstissue.json). The labels defined in [firstissue.json](firstissue.json) are used to filter issues for the repositories.
36+
37+
To contribute new features and changes to the website, you would want to run the app locally. Please follow these steps:
38+
39+
40+
## How to setup the project locally
41+
1. Fork the repository, clone it locally, create a new branch to work on a specific feature or bug fix without affecting the main branch of the repository. Make sure you have a recent version of Node.js installed on your computer.
42+
1. You can use the included [generated.json](generated.json) as dummy data or you can run `npm run prebuild` to fetch the latest data from GitHub yourself: for this, you will need to set the `GH_PERSONAL_ACCESS_TOKEN` environment variable to a valid GitHub Personal Access Token (PAT). Notice: repositories not maching the criteria listed above (see rules in [generated.json](generated.json)) are automatically removed from [firstissue.json](firstissue.json) when the [generated.json](generated.json) script runs.
43+
1. Start the development server and open the app in your browser.
44+
45+
```bash
46+
# install the dependencies
47+
$ npm install
48+
# start the development server
49+
$ npm run dev
50+
```
51+
52+
Good to know when you commit: the project contains a `pre-commit` hook that runs linters automatically to ensure code quality!
53+
54+
#### Credits
55+
56+
This project is based on [good-first-issue](https://github.com/deepsourcelabs/good-first-issue) and [first-issue](https://github.com/lucavallin/first-issue).
57+
58+
59+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const AddYourProjectLinkButton = () => {
2+
return (
3+
<div className="pt-6">
4+
<a
5+
className="block bg-juniper hover:bg-light_juniper text-ink-400 uppercase rounded-md font-bold text-center px-1 py-3"
6+
href="https://github.com/"
7+
target="_blank"
8+
rel="noopener noreferrer"
9+
>
10+
Add your project
11+
</a>
12+
</div>
13+
);
14+
};

components/IssueItem.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { faComment } from "@fortawesome/free-regular-svg-icons";
2+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3+
4+
import { Issue } from "../types";
5+
6+
type IssueItemProps = {
7+
issue: Issue;
8+
};
9+
10+
type IssueCommentNumProps = {
11+
numIssues: number;
12+
};
13+
14+
const IssueCommentNum = ({ numIssues }: IssueCommentNumProps) => {
15+
return (
16+
<div className="flex flex-row items-center justify-end mt-1 w-10">
17+
<span className="mr-2 text-sm leading-snug">{numIssues}</span>
18+
<FontAwesomeIcon icon={faComment} />
19+
</div>
20+
);
21+
};
22+
23+
export const IssueItem = ({ issue }: IssueItemProps) => {
24+
return (
25+
<li key={issue.url} className="flex flex-row items-start justify-start py-1">
26+
<span className="text-slate text-right w-30 px-2 leading-snug">#{issue.number}</span>
27+
<div className="flex items-start flex-row flex-auto">
28+
<a
29+
className="break-all mr-4 leading-snug font-semibold hover:text-juniper text-vanilla-300 block flex-auto"
30+
href={issue.url}
31+
rel="noopener noreferrer"
32+
target="_blank"
33+
title="Open issue on GitHub"
34+
>
35+
{issue.title}
36+
</a>
37+
{issue.comments_count > 0 && <IssueCommentNum numIssues={issue.comments_count} />}
38+
</div>
39+
</li>
40+
);
41+
};

components/IssueList.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Issue } from "../types";
2+
import { IssueItem } from "./IssueItem";
3+
4+
type IssueListProps = {
5+
issues: Issue[];
6+
};
7+
8+
export const IssuesList = ({ issues }: IssueListProps) => {
9+
return (
10+
<ol className="px-5 py-3 text-base leading-loose border-t border-ink-200">
11+
{issues.map((issue) => (
12+
<IssueItem issue={issue} key={issue.id} />
13+
))}
14+
</ol>
15+
);
16+
};

0 commit comments

Comments
 (0)