Skip to content

Commit

Permalink
feat: initial version (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Apr 8, 2021
1 parent 68d7219 commit 536088b
Show file tree
Hide file tree
Showing 20 changed files with 14,761 additions and 16 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---

name: "🐛 Bug Report"
about: "If something isn't working as expected 🤔"
labels: bug

---

<!-- Please replace all placeholders such as this below -->

**What happened?**

<!-- Describe the problem and how to reproduce it. Add screenshots or a link to your repository if helpful. Ideally create a reproducible test case on runkit.com (Example: https://runkit.com/gr2m/octokit-rest-js-1808) -->

**What did you expect to happen?**

<!-- Describe what you expected to happen instead -->

**What the problem might be**

<!-- If you have an idea where the bug might lie, please share here. Otherwise remove the whole section -->
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/02_feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---

name: "🧚‍♂️ Feature Request"
about: "Wouldn’t it be nice if 💭"
labels: feature

---

<!-- Please replace all placeholders such as this below -->

**What’s missing?**

<!-- Describe your feature idea -->

**Why?**

<!-- Describe the problem you are facing -->

**Alternatives you tried**

<!-- Describe the workarounds you tried so far and how they worked for you -->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 🆘 I need Help
url: https://github.com/octokit/rest.js/discussions
about: Got a question? An idea? Feedback? Start here.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
branches:
- main
- next
- beta
- "*.x" # maintenance release branches, e.g. v1.x

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12.x"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run build
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.OCTOKITBOT_NPM_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]

jobs:
test_matrix:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: ["12", "14"]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm test

test:
runs-on: ubuntu-latest
needs: test_matrix
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run test:typescript
- run: npm run lint
- run: npm run build
30 changes: 30 additions & 0 deletions .github/workflows/update-prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update Prettier
on:
push:
branches:
- "dependabot/npm_and_yarn/prettier-*"
workflow_dispatch: {}
jobs:
update_prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
version: 12
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run lint:fix
- uses: gr2m/create-or-update-pull-request-action@v1.x
env:
GITHUB_TOKEN: ${{ secrets.OCTOKITBOT_PAT }}
with:
title: "Prettier updated"
body: "An update to prettier required updates to your code."
branch: ${{ github.ref }}
commit-message: "style: prettier"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage/
node_modules/
pkg/
71 changes: 71 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# How to contribute

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.

We appreciate you taking the time to contribute to `@octokit/auth-oauth-user-client`. Especially as a new contributor, you have a valuable perspective that we lost a long time ago: you will find things confusing and run into problems that no longer occur to us. Please share them with us, so we can make the experience for future contributors the best it could be.

Thank you 💖

## Creating an Issue

Before you create a new Issue:

1. Please make sure there is no [open issue](https://github.com/octokit/auth-oauth-user-client.js/issues?utf8=%E2%9C%93&q=is%3Aissue) yet.
2. If it is a bug report, include the steps to reproduce the issue and please create a reproducible test case on [runkit.com](https://runkit.com/). Example: https://runkit.com/gr2m/octokit-rest-js-1808
3. If it is a feature request, please share the motivation for the new feature, what alternatives you tried, and how you would implement it.
4. Please include links to the corresponding github documentation.

## Setup the repository locally

First, fork the repository.

Setup the repository locally. Replace `<your account name>` with the name of the account you forked to.

```shell
git clone https://github.com/<your account name>/auth-oauth-user-client.js.git
cd auth-oauth-user-client.js
npm install
```

Run the tests before making changes to make sure the local setup is working as expected

```shell
npm test
```

## Submitting the Pull Request

- Create a new branch locally.
- Make your changes in that branch and push them to your fork
- Submit a pull request from your topic branch to the main branch on the `octokit/auth-oauth-user-client.js` repository.
- Be sure to tag any issues your pull request is taking care of / contributing to. Adding "Closes #123" to a pull request description will automatically close the issue once the pull request is merged in.

## Testing a pull request from github repo locally:

You can install `@octokit/auth-oauth-user-client` from each pull request. Replace `[PULL REQUEST NUMBER]`:

```
npm install https://github.pika.dev/octokit/auth-oauth-user-client.js/pr/[PULL REQUEST NUMBER]
```

Once you are done testing, you can revert back to the default module `@octokit/auth-oauth-user-client` from npm with `npm install @octokit/auth-oauth-user-client`

## Maintainers only

### Merging the Pull Request & releasing a new version

Releases are automated using [semantic-release](https://github.com/semantic-release/semantic-release).
The following commit message conventions determine which version is released:

1. `fix: ...` or `fix(scope name): ...` prefix in subject: bumps fix version, e.g. `1.2.3``1.2.4`
2. `feat: ...` or `feat(scope name): ...` prefix in subject: bumps feature version, e.g. `1.2.3``1.3.0`
3. `BREAKING CHANGE:` in body: bumps breaking version, e.g. `1.2.3``2.0.0`

Only one version number is bumped at a time, the highest version change trumps the others.
Besides publishing a new version to npm, semantic-release also creates a git tag and release
on GitHub, generates changelogs from the commit messages and puts them into the release notes.

Before the publish it runs the `npm run build` script which creates a `pkg/` folder with distributions for browsers, node and Typescript definitions. The contents of the `pkg/` folder are published to the npm registry.

If the pull request looks good but does not follow the commit conventions, use the <kbd>Squash & merge</kbd> button.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# 🚧 THIS IS WORK IN PROGRESS

There is no code. This repository is documentation only, laying out what the final `octokit` package should look like.

# octokit.js

> The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
Expand Down Expand Up @@ -71,7 +67,7 @@ Deno
Load <code>octokit</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>

```ts
import { Octokit, App, Action } from "https://cdn.skypack.dev/octokit";
import { Octokit, App, Action } from "https://cdn.skypack.dev/octokit?dts";
```

</td></tr>
Expand Down Expand Up @@ -353,7 +349,7 @@ For example, to implement the above using `App`

```js
const app = new App({ appId, privateKey });
const { data: slug } = await app.octokit.apps.getAuthenticated();
const { data: slug } = await app.octokit.rest.apps.getAuthenticated();
const { octokit } = await app.getInstallationOctokit(123);
await octokit.issues.create({
owner: "octocat",
Expand Down
3 changes: 0 additions & 3 deletions index.js

This file was deleted.

Loading

0 comments on commit 536088b

Please sign in to comment.