-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automatically update version number on build (#270)
- Loading branch information
Showing
5 changed files
with
25 additions
and
7 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,18 @@ | ||
/* | ||
* This script is used to copy over the version number in the package.json to | ||
* the CONNECTKIT_VERSION constant in the index.ts file. This is done to | ||
* ensure that the version number attribute on the ConnectKit wrapper is always | ||
* up to date with the version number in the package.json file. | ||
*/ | ||
|
||
const fs = require('fs'); | ||
const config = require('./packages/connectkit/package.json'); | ||
|
||
const file = fs.readFileSync('packages/connectkit/src/index.ts', 'utf8'); | ||
const lines = file.split('\n'); | ||
const versionLine = lines.findIndex((line) => | ||
line.includes('export const CONNECTKIT_VERSION = ') | ||
); | ||
lines[versionLine] = `export const CONNECTKIT_VERSION = '${config.version}';`; | ||
|
||
fs.writeFileSync('packages/connectkit/src/index.ts', lines.join('\n'), 'utf8'); |
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
451230e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
connectkit-cra – ./
connectkit-cra.vercel.app
connectkit-cra-git-main-lfe.vercel.app
connectkit-cra-lfe.vercel.app
451230e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
connectkit-nextjs – ./
connectkit-nextjs-git-main-lfe.vercel.app
connectkit-nextjs.vercel.app
connectkit-nextjs-lfe.vercel.app
451230e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
connectkit-vite – ./
connectkit-vite-git-main-lfe.vercel.app
connectkit-vite-lfe.vercel.app
connectkit-vite.vercel.app
451230e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
connectkit-testbench – ./
connectkit-testbench-lfe.vercel.app
connectkit-testbench.vercel.app
connectkit-testbench-git-main-lfe.vercel.app