-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display uncaught error by default
- Loading branch information
Showing
14 changed files
with
222 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"termost": minor | ||
--- | ||
|
||
Display uncaught error by default and allow `helpers.message` to accept Error-like objects. | ||
|
||
Please note that the `helpers.message` do not accept anymore an array of strings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Continuous integration | ||
|
||
on: | ||
push: | ||
branches-ignore: main | ||
|
||
jobs: | ||
main: | ||
uses: ./.github/workflows/workflow.yml |
4 changes: 2 additions & 2 deletions
4
.github/workflows/pull_request.yml → .github/workflows/conventional_commit.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Dependency changelog | ||
|
||
on: | ||
pull_request_target: | ||
paths: | ||
- "**/pnpm-lock.yaml" | ||
|
||
jobs: | ||
main: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
if: github.actor == 'renovate[bot]' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
ref: ${{ github.head_ref }} | ||
- name: Configure Git | ||
run: | | ||
git config --global user.email [email protected] | ||
git config --global user.name 'Ayoub Adib' | ||
- name: Create changelog entry | ||
uses: actions/github-script@v7 | ||
# Credits to https://github.com/backstage/backstage/blob/bcc11651add5a2589898dfb9d665ebb9d412201b/.github/workflows/sync_renovate-changesets.yml | ||
with: | ||
script: | | ||
const { promises: fs } = require("fs"); | ||
async function getPackagesNames(files) { | ||
const names = []; | ||
for (const file of files) { | ||
const data = JSON.parse(await fs.readFile(file, "utf8")); | ||
if (!data.private) { | ||
names.push(data.name); | ||
} | ||
} | ||
return names; | ||
} | ||
async function createChangeset(fileName, packageBumps, packages) { | ||
let message = ""; | ||
for (const [pkg, bump] of packageBumps) { | ||
message = message + `Updated dependency \`${pkg}\` to \`${bump}\`.\n`; | ||
} | ||
const pkgs = packages.map((pkg) => `"${pkg}": minor`).join("\n"); | ||
const body = `---\n${pkgs}\n---\n\n${message.trim()}\n`; | ||
await fs.writeFile(fileName, body); | ||
} | ||
async function getBumps(files) { | ||
const bumps = new Map(); | ||
for (const file of files) { | ||
const { stdout: changes } = await exec.getExecOutput("git", [ | ||
"show", | ||
file, | ||
]); | ||
for (const change of changes.split("\n")) { | ||
if (!change.match(/^\+\s/)) { | ||
continue; | ||
} | ||
const match = change.match(/"(.*?)"/g); | ||
bumps.set(match[0].replace(/"/g, ""), match[1].replace(/"/g, "")); | ||
} | ||
} | ||
return bumps; | ||
} | ||
const branch = await exec.getExecOutput("git branch --show-current"); | ||
if (!branch.stdout.startsWith("renovate/")) { | ||
console.log("Not a renovate branch, skipping"); | ||
return; | ||
} | ||
const diffOutput = await exec.getExecOutput("git diff --name-only HEAD~1"); | ||
const diffFiles = diffOutput.stdout.split("\n"); | ||
if (diffFiles.find((f) => f.startsWith(".changeset"))) { | ||
console.log("Changeset already exists, skipping"); | ||
return; | ||
} | ||
const files = diffFiles | ||
.filter((file) => file !== "package.json") // skip root package.json | ||
.filter((file) => file.includes("package.json")); | ||
const packageNames = await getPackagesNames(files); | ||
if (!packageNames.length) { | ||
console.log("No package.json changes to published packages, skipping"); | ||
return; | ||
} | ||
const { stdout: shortHash } = await exec.getExecOutput( | ||
"git rev-parse --short HEAD" | ||
); | ||
const fileName = `.changeset/renovate-${shortHash.trim()}.md`; | ||
const packageBumps = await getBumps(files); | ||
await createChangeset(fileName, packageBumps, packageNames); | ||
await exec.exec("git", ["add", fileName]); | ||
await exec.exec("git commit -C HEAD --amend --no-edit"); | ||
await exec.exec("git push --force"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.