From 997b680c45c77f53d18e0814f12dc175d4d70fe2 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:14:58 +0000 Subject: [PATCH 1/9] Add LICENSE and contribution guidelines --- .github/CONTRIBUTING.md | 72 +++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 .github/CONTRIBUTING.md create mode 100644 LICENSE diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..fdbaa18 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,72 @@ +# Contributing to our repos + +At Primer, we believe that endorsing and maintaining open source software is an important step towards building strong bonds with the wider engineering community. We appreciate and actively invite contribution from outside of our organisation. + +## Our Standards + +We have expectations of our own behaviour and the behaviour of others when conversing about our software. + +- Use welcoming and inclusive language at all times +- Be empathetic towards others at all times +- Be respectful of differing viewpoints and experiences +- Gracefully accept constructive criticism +- Focus on what is best for the existing members of the community + +There are some behaviours and forms of language that we won't tolerate when communicating with us about our software. Again, this applies to both our organisation members and those community members external to it. These include: + +- Sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting and/or derogatory comments, and personal or political attacks +- Public or private harassment of individuals or groups +- Publishing others' private information (a.k.a "doxxing"), such as a physical or electronic + address, without explicit permission from the owner +- Any other conduct that is antithetical to reasonable and polite discourse + +## Our Commitments + +We appreciate contributions of all forms, but we are not obliged to accept them such that we will make changes to our software or repos to accommodate them. + +We will always make best efforts to discuss contributions, but are not obliged to provide timelines, contact details, or other information concerning commitments that we may or may not make to the contribution in question. + +## Reporting issues + +A bug 🐛 is something nobody ever wants to receive. But, they happen 🤷‍♂️. + +Please read the following guidelines before you [report an issue](../issues): + +1. **Use the GitHub issue search** — check if the issue has already been + reported. If it has been, please comment on the existing issue. If it is closed, + please reference the closed issue in your new issue report. + +2. **Check if the issue has been fixed** — the latest `master`/`main` or + development branch may already contain a fix. + +3. **Isolate the problem** — make sure that the code in the + project's repository is responsible for the issue. Create a broken-down list of steps or an + extremely simple and immediately viewable example of the issue. + +4. **Include a live example** — provide a link, screenshot, video + or anything that could help us understand better the domain. + +Other advice for reporting an issue: + +- Please try to be as detailed as possible in your report. +- Please include: what steps will reproduce the issue, which browsers, devices and/or OS + you have recreated the issue with. +- Please state what would you expect the outcome to be. + +## Pull requests + +Good pull requests — patches, improvements, new features — are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +> [!WARNING] +> If your contribution involves a significant amount of work or substantial +> changes to any part of the project, **please open an issue to discuss it first**. + +## Thank you 🙏 + +> [!NOTE] +> +> You are helping us making our product better 👌, faster 🚀, stronger 💪 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..258b75b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Primer API + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. \ No newline at end of file From dcffa23fdf2bc8b621ffaf44fcfba576fb8e3dce Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:15:53 +0000 Subject: [PATCH 2/9] Align license text with other repos --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 258b75b..23bcd70 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Primer API +Copyright (c) 2023 Primer API Ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 27307ac4e4f52539334387e8d858339ddfdde446 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:17:41 +0000 Subject: [PATCH 3/9] Align contributing guidelines with other repos --- .github/CONTRIBUTING.md | 43 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fdbaa18..a5cccc8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,30 +4,31 @@ At Primer, we believe that endorsing and maintaining open source software is an ## Our Standards -We have expectations of our own behaviour and the behaviour of others when conversing about our software. +We have expectations of our own behaviour and the behaviour of others when interacting with us in our open source repos. -- Use welcoming and inclusive language at all times -- Be empathetic towards others at all times -- Be respectful of differing viewpoints and experiences -- Gracefully accept constructive criticism -- Focus on what is best for the existing members of the community +* Use welcoming and inclusive language at all times +* Be empathetic towards others at all times +* Be respectful of differing viewpoints and experiences +* Gracefully accept constructive criticism +* Focus on what is best for the existing members of the community There are some behaviours and forms of language that we won't tolerate when communicating with us about our software. Again, this applies to both our organisation members and those community members external to it. These include: -- Sexualized language or imagery and unwelcome sexual attention or - advances -- Trolling, insulting and/or derogatory comments, and personal or political attacks -- Public or private harassment of individuals or groups -- Publishing others' private information (a.k.a "doxxing"), such as a physical or electronic +* Sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting and/or derogatory comments, and personal or political attacks +* Public or private harassment of individuals or groups +* Publishing others' private information (a.k.a "doxxing"), such as a physical or electronic address, without explicit permission from the owner -- Any other conduct that is antithetical to reasonable and polite discourse +* Any other conduct that is antithetical to reasonable and polite discourse ## Our Commitments -We appreciate contributions of all forms, but we are not obliged to accept them such that we will make changes to our software or repos to accommodate them. +We appreciate contributions of all forms, but we are not obliged to accept them such that we will make changes to our software or repos to accommodate them. We will always make best efforts to discuss contributions, but are not obliged to provide timelines, contact details, or other information concerning commitments that we may or may not make to the contribution in question. + ## Reporting issues A bug 🐛 is something nobody ever wants to receive. But, they happen 🤷‍♂️. @@ -46,14 +47,14 @@ Please read the following guidelines before you [report an issue](../issues): extremely simple and immediately viewable example of the issue. 4. **Include a live example** — provide a link, screenshot, video - or anything that could help us understand better the domain. + or anything that could help us understand better the domain. Other advice for reporting an issue: -- Please try to be as detailed as possible in your report. -- Please include: what steps will reproduce the issue, which browsers, devices and/or OS - you have recreated the issue with. -- Please state what would you expect the outcome to be. +* Please try to be as detailed as possible in your report. +* Please include: what steps will reproduce the issue, which browsers, devices and/or OS +you have recreated the issue with. +* Please state what would you expect the outcome to be. ## Pull requests @@ -67,6 +68,6 @@ commits. ## Thank you 🙏 -> [!NOTE] -> -> You are helping us making our product better 👌, faster 🚀, stronger 💪 +👉 from all of the team at Primer ❤️ + +You are helping us making our product better 👌, faster 🚀, stronger 💪 \ No newline at end of file From 83f9d4e71a418672301bead57a3dcb2c7e818af5 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:21:00 +0000 Subject: [PATCH 4/9] Separate client session configs and make it more explicit that the user can change the session request data --- src/server.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server.ts b/src/server.ts index 772085b..4193a21 100644 --- a/src/server.ts +++ b/src/server.ts @@ -23,8 +23,9 @@ app.post('/client-session', async () => { const res = await post( `${primerApiUrl}/client-session`, - // ✨ Feel free to update this 👇 - // Check the API reference here: https://apiref.primer.io/reference/create_client_side_token_client_session_post + // Check the API reference here 👉 https://apiref.primer.io/reference/create_client_side_token_client_session_post + + // ✨ Try updating this to modify your client session 👇 { orderId: randomUUID(), From 438b797f6b0ed89c24f4970cf3ba1c772622f50b Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:23:28 +0000 Subject: [PATCH 5/9] better language in client session request body comment --- src/server.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server.ts b/src/server.ts index 4193a21..b6efaae 100644 --- a/src/server.ts +++ b/src/server.ts @@ -23,9 +23,8 @@ app.post('/client-session', async () => { const res = await post( `${primerApiUrl}/client-session`, - // Check the API reference here 👉 https://apiref.primer.io/reference/create_client_side_token_client_session_post - - // ✨ Try updating this to modify your client session 👇 + // 👀 Check the API reference here 👉 https://apiref.primer.io/reference/create_client_side_token_client_session_post + // ✨ Then, try modifying the client session below 👇 { orderId: randomUUID(), From 76066ba71088ab771528baca483b86ad56063ab6 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:28:02 +0000 Subject: [PATCH 6/9] Pin github action versions --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7a5c338..7a6997a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,9 +17,9 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 with: node-version-file: '.nvmrc' From c6ab03eaee7414d0a0a8802eedc6623ff3dba174 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:30:25 +0000 Subject: [PATCH 7/9] Excluded contributing guidelines from linting --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e48c63a..c9fedca 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint:ts": "echo 'Ignored for now...'", "format": "concurrently npm:format:*", "format:es": "npm run lint:es --fix", - "format:prettier": "prettier . --ignore-path .gitignore --write" + "format:prettier": "prettier . --ignore-path .gitignore --ignore-path .github/CONTRIBUTING.md --write" }, "engines": { "node": "16.x" From 55c368112408e59477fcec65b1e1be37353f9c35 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:32:11 +0000 Subject: [PATCH 8/9] convert prettier arguments to .prettierignore --- .prettierignore | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..70da203 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +.gitignore +.github/CONTRIBUTING.md \ No newline at end of file diff --git a/package.json b/package.json index c9fedca..2518e56 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint:ts": "echo 'Ignored for now...'", "format": "concurrently npm:format:*", "format:es": "npm run lint:es --fix", - "format:prettier": "prettier . --ignore-path .gitignore --ignore-path .github/CONTRIBUTING.md --write" + "format:prettier": "prettier . --write" }, "engines": { "node": "16.x" From 62aec25c1c62b5a2dabfc5352b884ee9a33f0dd6 Mon Sep 17 00:00:00 2001 From: Jack Newcombe Date: Thu, 22 Feb 2024 14:34:17 +0000 Subject: [PATCH 9/9] convert prettier arguments to .prettierignore #2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2518e56..81881f2 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint": "concurrently npm:lint:*", "lint:commit": "commitlint --from origin/main --to HEAD --verbose", "lint:es": "eslint . --ignore-path .gitignore --report-unused-disable-directives --max-warnings 0", - "lint:prettier": "prettier . --ignore-path .gitignore --check", + "lint:prettier": "prettier . --check", "lint:ts": "echo 'Ignored for now...'", "format": "concurrently npm:format:*", "format:es": "npm run lint:es --fix",