-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: drop assert syntax to support old and new nodejs versions (#…
…3036) Co-authored-by: tomiir <rocchitomas@gmail.com>
- Loading branch information
1 parent
392dd5d
commit 23a7613
Showing
7 changed files
with
50 additions
and
15 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,23 @@ | ||
--- | ||
'@reown/appkit': patch | ||
'@apps/demo': patch | ||
'@apps/gallery': patch | ||
'@apps/laboratory': patch | ||
'@reown/appkit-adapter-ethers': patch | ||
'@reown/appkit-adapter-ethers5': patch | ||
'@reown/appkit-adapter-polkadot': patch | ||
'@reown/appkit-adapter-solana': patch | ||
'@reown/appkit-adapter-wagmi': patch | ||
'@reown/appkit-utils': patch | ||
'@reown/appkit-cdn': patch | ||
'@reown/appkit-common': patch | ||
'@reown/appkit-core': patch | ||
'@reown/appkit-experimental': patch | ||
'@reown/appkit-polyfills': patch | ||
'@reown/appkit-scaffold-ui': patch | ||
'@reown/appkit-siwe': patch | ||
'@reown/appkit-ui': patch | ||
'@reown/appkit-wallet': patch | ||
--- | ||
|
||
Removes assert syntax to import json 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
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 @@ | ||
export const PACKAGE_VERSION = '1.0.7' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* This script injects the version from the packages/appkit/package.json into the packages/appkit/exports/constants.ts file. | ||
* This is a alternative solution to not import the package.json file in our packages due to restriction on bundlers. | ||
* It's run before the build process of the packages starts with `prebuild` script. | ||
* See https://pnpm.io/it/next/cli/run#enable-pre-post-scripts | ||
*/ | ||
import fs from 'node:fs' | ||
import packageJson from '../packages/appkit/package.json' assert { type: 'json' } | ||
|
||
const filePath = 'packages/appkit/exports/constants.ts' | ||
|
||
const fileContent = fs.readFileSync(filePath, 'utf8') | ||
const updatedContent = fileContent.replace( | ||
/export const PACKAGE_VERSION = '.*'/, | ||
`export const PACKAGE_VERSION = '${packageJson.version}'` | ||
) | ||
fs.writeFileSync(filePath, updatedContent, 'utf8') | ||
console.log(`Injected version ${packageJson.version} into ${filePath}`) |