Skip to content

Commit

Permalink
chore: Sync GH workflows, changelogs, and templates with urql
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Mar 11, 2023
1 parent 6111f95 commit b32442a
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 81 deletions.
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: true
contact_links:
- name: Join the Discord
url: https://discord.gg/3EYgqrYJFS
about: Chat with maintainers and other community members
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: CI

on:
pull_request:
push:
branches: main
pull_request_review:
types: [submitted, edited]
branches: changeset-release/main

jobs:
check:
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,21 @@ jobs:

- name: PR or Publish
id: changesets
uses: changesets/action@b3300fad33b6ab794313da28d27424c0e2f78991
uses: changesets/action@v1.4.1
with:
publish: pnpm changeset publish
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Prerelease
if: steps.changesets.outputs.published != 'true'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
git reset --hard origin/main
pnpm changeset version --no-git-tag --snapshot canary
pnpm changeset publish --no-git-tag --snapshot canary --tag canary
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"build": "rollup -c scripts/rollup.config.mjs",
"clean": "rimraf dist node_modules/.cache",
"prepublishOnly": "run-s clean build check test",
"prepare": "node ./scripts/prepare.js"
"prepare": "node ./scripts/prepare.js",
"changeset:version": "changeset version && pnpm install --lockfile-only",
"changeset:publish": "changeset publish"
},
"repository": "https://github.com/0no-co/wonka",
"bugs": {
Expand Down Expand Up @@ -70,8 +72,8 @@
]
},
"devDependencies": {
"@changesets/cli": "^2.25.2",
"@changesets/get-github-info": "^0.5.1",
"@changesets/cli": "^2.26.0",
"@changesets/get-github-info": "0.5.0",
"@rollup/plugin-buble": "^1.0.1",
"@rollup/plugin-commonjs": "^23.0.3",
"@rollup/plugin-node-resolve": "^15.0.1",
Expand All @@ -84,6 +86,7 @@
"callbag-from-iter": "^1.3.0",
"callbag-iterate": "^1.0.0",
"callbag-take": "^1.5.0",
"dotenv": "^16.0.3",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
136 changes: 72 additions & 64 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions scripts/changelog.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
const { config } = require('dotenv');
const { getInfo } = require('@changesets/get-github-info');

config();

const REPO = '0no-co/wonka';
const SEE_LINE = /^See:\s*(.*)/i;
const TRAILING_CHAR = /[.;:]$/g;
const listFormatter = new Intl.ListFormat('en-US');

const getSummaryLines = cs => {
const lines = cs.summary
.trim()
.split(/[\r\n]+/)
.map(l => l.trim())
.filter(Boolean);
const size = lines.length;
if (size > 0) {
lines[size - 1] = lines[size - 1].replace(TRAILING_CHAR, '');
let lines = cs.summary.trim().split(/\r?\n/);
if (!lines.some(line => /```/.test(line))) {
lines = lines.map(l => l.trim()).filter(Boolean);
const size = lines.length;
if (size > 0) {
lines[size - 1] = lines[size - 1].replace(TRAILING_CHAR, '');
}
}

return lines;
};

Expand Down Expand Up @@ -102,8 +103,11 @@ const changelogFunctions = {
str += `\n${futureLines.map(l => ` ${l}`).join('\n')}`;
}

if (user) {
const endsWithParagraph = /(?<=(?:[!;?.]|```) *)$/g;
if (user && !endsWithParagraph) {
str += `, by ${user}`;
} else {
str += `\nSubmitted by ${user}`;
}

if (pull || commit) {
Expand Down

0 comments on commit b32442a

Please sign in to comment.