Skip to content

Commit

Permalink
馃敡 Add embed lib auto patch script
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Apr 3, 2024
1 parent fb290b8 commit 69446ad
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"locales:push": "tolgee push ./apps/builder/src/i18n",
"locales:sync": "tolgee sync './apps/builder/src/**/*.ts?(x)' --continue-on-warning --remove-unused",
"create-new-block": "cd packages/forge/cli && pnpm start",
"format:check": "turbo run format:check"
"format:check": "turbo run format:check",
"patch-embed-libs": "bun scripts/patch-embed-libs.ts"
},
"devDependencies": {
"@tolgee/cli": "1.3.2",
Expand Down
48 changes: 48 additions & 0 deletions scripts/patch-embed-libs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import jsPackageJson from '../packages/embeds/js/package.json'
import reactPackageJson from '../packages/embeds/react/package.json'
import nextjsPackageJson from '../packages/embeds/nextjs/package.json'
import { writeFileSync } from 'fs'

const currentVersion = jsPackageJson.version

const patchNumber = parseInt(currentVersion.split('.')[2], 10)

const newVersion = `${currentVersion.split('.')[0]}.${
currentVersion.split('.')[1]
}.${patchNumber + 1}`

writeFileSync(
'./packages/embeds/js/package.json',
JSON.stringify(
{
...jsPackageJson,
version: newVersion,
},
null,
2
) + '\n'
)

writeFileSync(
'./packages/embeds/react/package.json',
JSON.stringify(
{
...reactPackageJson,
version: newVersion,
},
null,
2
) + '\n'
)

writeFileSync(
'./packages/embeds/nextjs/package.json',
JSON.stringify(
{
...nextjsPackageJson,
version: newVersion,
},
null,
2
) + '\n'
)

0 comments on commit 69446ad

Please sign in to comment.