-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
76 additions
and
0 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,5 @@ | ||
--- | ||
"ny": patch | ||
--- | ||
|
||
Fix handling of `--help` argument passed to scripts |
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,12 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [], | ||
"privatePackages": { "version": true, "tag": true } | ||
} |
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,5 @@ | ||
--- | ||
"ny": patch | ||
--- | ||
|
||
Gracefully skip not existing `@types` packages |
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,19 @@ | ||
/** | ||
* Syncs version stored in package.json (which is managed by changesets) with version stored in Cargo.toml | ||
*/ | ||
import { writeFileSync, readFileSync } from "fs"; | ||
import { join } from "path"; | ||
|
||
function rewriteVersionInCargoConfig(config: string, newVersion: string) { | ||
const regex = /version = "(\d+\.\d+\.\d+)"/; // note: no global flag -- we want to replace the first instance only | ||
return config.replace(regex, `version = "${newVersion}"`); | ||
} | ||
|
||
const currentVersion = require("../package.json").version; | ||
console.log(`Syncing Cargo.toml version to ${currentVersion}`); | ||
|
||
const cargoConfigRaw = readFileSync(join(__dirname, "../Cargo.toml"), "utf-8"); | ||
|
||
const newCargoConfig = rewriteVersionInCargoConfig(cargoConfigRaw, currentVersion); | ||
|
||
writeFileSync(join(__dirname, "../Cargo.toml"), newCargoConfig); |
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,23 @@ | ||
name: Changesets | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- run: bun install | ||
|
||
- name: Create Release Pull Request or Start release (tag) | ||
uses: changesets/action@v1 | ||
with: | ||
version: bun version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/target | ||
node_modules |
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,11 @@ | ||
{ | ||
"name": "ny", | ||
"private": true, | ||
"version": "0.1.2", | ||
"dependencies": { | ||
"@changesets/cli": "^2.26.2" | ||
}, | ||
"scripts": { | ||
"version": "changesets version && bun .changesets/sync-cargo-version.ts" | ||
} | ||
} |