-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(changeset): add
pnpm bump
script (#20)
* ci(changeset): add `pnpm bump` script * chore(changeset): add changeset
- Loading branch information
Showing
4 changed files
with
42 additions
and
1 deletion.
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,2 @@ | ||
--- | ||
--- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { execSync } from 'child_process'; | ||
import { readFileSync, writeFileSync } from 'fs'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
execSync('npx changeset version', { stdio: 'inherit' }); | ||
execSync('pnpm install --no-frozen-lockfile', { stdio: 'inherit' }); | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
||
const cargoFilePath = path.join(__dirname, '../src-tauri/Cargo.toml'); | ||
const nodeFilePath = path.join(__dirname, '../src-tauri/package.json'); | ||
const workspaceFilePath = path.join(__dirname, '../package.json'); | ||
|
||
const cargoData = readFileSync(cargoFilePath, 'utf8'); | ||
const nodeData = readFileSync(nodeFilePath, 'utf8'); | ||
const workspaceData = readFileSync(workspaceFilePath, 'utf8'); | ||
|
||
const newVersion = JSON.parse(workspaceData).version; | ||
const newCargoVersion = JSON.parse(nodeData).version; | ||
const updatedData = cargoData.replace( | ||
/version = ".*"/, | ||
`version = "${newCargoVersion}"` | ||
); | ||
|
||
writeFileSync(cargoFilePath, updatedData, 'utf8'); | ||
|
||
// const nodeChangelogFilePath = path.join(__dirname, '../CHANGELOG.md'); | ||
// const nodeChangelogData = readFileSync(nodeChangelogFilePath, 'utf8'); | ||
// const cargoChangeLogFilePath = path.join( | ||
// __dirname, | ||
// '../src-tauri/CHANGELOG.md' | ||
// ); | ||
// const cargoChangeLogData = readFileSync(cargoChangeLogFilePath, 'utf8'); |