This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: Update to new SDK npm package. (#31)
BREAKING: updated SDK to the latest published version 3.1.0 in NPM https://www.npmjs.com/package/@atala/prism-wallet-sdk which does not require authentication token anymore.
- Loading branch information
1 parent
450390e
commit 1b300cc
Showing
13 changed files
with
109 additions
and
105 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,49 +1,53 @@ | ||
const fs = require('fs'); | ||
const fs = require("fs"); | ||
|
||
function findPackageVersion(packageName) { | ||
try { | ||
// Read the package.json file | ||
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); | ||
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8")); | ||
|
||
// Check if the package is in the dependencies | ||
if (packageJson.peerDependencies && packageJson.peerDependencies[packageName]) { | ||
if ( | ||
packageJson.peerDependencies && | ||
packageJson.peerDependencies[packageName] | ||
) { | ||
return packageJson.peerDependencies[packageName]; | ||
} else { | ||
return undefined; // Package not found | ||
} | ||
} catch (error) { | ||
console.error('Error reading or parsing package.json:', error); | ||
console.error("Error reading or parsing package.json:", error); | ||
return undefined; | ||
} | ||
} | ||
|
||
function updateReadme(version) { | ||
const readmeFilePath = 'README.md'; | ||
|
||
try { | ||
// Read the content of the README.md file | ||
let readmeContent = fs.readFileSync(readmeFilePath, 'utf-8').split('\n'); | ||
|
||
// Check if there are at least 4 lines in the file | ||
if (readmeContent.length >= 4) { | ||
// Replace the 4th line with "123" | ||
readmeContent[3] = `This package is compatible with Atala Prism Wallet SDK v${version.slice(1)}`; | ||
|
||
// Join the lines back together | ||
readmeContent = readmeContent.join('\n'); | ||
|
||
// Write the modified content back to the README.md file | ||
fs.writeFileSync(readmeFilePath, readmeContent, 'utf-8'); | ||
console.log('README.md updated successfully.'); | ||
} else { | ||
console.log('README.md does not have at least 4 lines.'); | ||
} | ||
} catch (error) { | ||
console.error('Error reading or updating README.md:', error); | ||
const readmeFilePath = "README.md"; | ||
|
||
try { | ||
// Read the content of the README.md file | ||
let readmeContent = fs.readFileSync(readmeFilePath, "utf-8").split("\n"); | ||
|
||
// Check if there are at least 4 lines in the file | ||
if (readmeContent.length >= 4) { | ||
// Replace the 4th line with "123" | ||
readmeContent[3] = `This package is compatible with Atala Prism Wallet SDK v${version.slice( | ||
1 | ||
)}`; | ||
|
||
// Join the lines back together | ||
readmeContent = readmeContent.join("\n"); | ||
|
||
// Write the modified content back to the README.md file | ||
fs.writeFileSync(readmeFilePath, readmeContent, "utf-8"); | ||
console.log("README.md updated successfully."); | ||
} else { | ||
console.log("README.md does not have at least 4 lines."); | ||
} | ||
} catch (error) { | ||
console.error("Error reading or updating README.md:", error); | ||
} | ||
} | ||
|
||
|
||
const packageNameToFind = '@input-output-hk/atala-prism-wallet-sdk'; // Replace with the package name you want to find | ||
const packageNameToFind = "@atala/prism-wallet-sdk"; // Replace with the package name you want to find | ||
const packageVersion = findPackageVersion(packageNameToFind); | ||
updateReadme(packageVersion) | ||
updateReadme(packageVersion); |