Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
fix!: Update to new SDK npm package. (#31)
Browse files Browse the repository at this point in the history
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
elribonazo authored Nov 13, 2023
1 parent 450390e commit 1b300cc
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 105 deletions.
126 changes: 65 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"author": "elribonazo@gmail.com",
"license": "Apache-2.0",
"peerDependencies": {
"@input-output-hk/atala-prism-wallet-sdk": "^2.5.0"
"@atala/prism-wallet-sdk": "^3.1.0"
},
"dependencies": {
"dexie": "^3.2.4",
Expand Down
6 changes: 1 addition & 5 deletions rollup/rollup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import ignore from "rollup-plugin-ignore";
import json from "@rollup/plugin-json";
import commonjs from "@rollup/plugin-commonjs";

const externals = [
"@input-output-hk/atala-prism-wallet-sdk",
"dexie",
"dexie-encrypted",
];
const externals = ["@atala/prism-wallet-sdk", "dexie", "dexie-encrypted"];

function CreateConfig(buildPath, plugins = [], extraInputs = []) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Domain } from "@input-output-hk/atala-prism-wallet-sdk";
import { Domain } from "@atala/prism-wallet-sdk";
import { getRxStorageDexie } from "rxdb/plugins/storage-dexie";
import { wrappedKeyEncryptionCryptoJsStorage } from "rxdb/plugins/encryption-crypto-js";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/Credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Domain,
JWTCredential,
JWTVerifiableCredentialRecoveryId,
} from "@input-output-hk/atala-prism-wallet-sdk";
} from "@atala/prism-wallet-sdk";
import type { Schema } from "../types";
import { RxCollection, RxDocument } from "rxdb";

Expand Down
2 changes: 1 addition & 1 deletion src/schemas/CredentialRequestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Domain,
JWTCredential,
JWTVerifiableCredentialRecoveryId,
} from "@input-output-hk/atala-prism-wallet-sdk";
} from "@atala/prism-wallet-sdk";
import type { Schema } from "../types";
import { RxCollection, RxDocument } from "rxdb";

Expand Down
2 changes: 1 addition & 1 deletion src/schemas/LinkSecret.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Domain } from "@input-output-hk/atala-prism-wallet-sdk";
import { Domain } from "@atala/prism-wallet-sdk";
import type { Schema } from "../types";
import { RxCollection, RxDocument } from "rxdb";

Expand Down
2 changes: 1 addition & 1 deletion src/schemas/Mediator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RxCollection, RxDocument } from "rxdb";
import type { Schema } from "../types";
import { Domain } from "@input-output-hk/atala-prism-wallet-sdk";
import { Domain } from "@atala/prism-wallet-sdk";

export type MediatorSchemaType = {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/Message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Domain } from "@input-output-hk/atala-prism-wallet-sdk";
import { Domain } from "@atala/prism-wallet-sdk";
import type { Schema } from "../types";
import { RxCollection, RxDocument } from "rxdb";

Expand Down
2 changes: 1 addition & 1 deletion src/schemas/PrivateKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Secp256k1PrivateKey,
X25519PrivateKey,
Domain,
} from "@input-output-hk/atala-prism-wallet-sdk";
} from "@atala/prism-wallet-sdk";
import type { Schema } from "../types";
import { RxCollection, RxDocument } from "rxdb";

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
X25519KeyPair,
X25519PrivateKey,
Domain,
} from "@input-output-hk/atala-prism-wallet-sdk";
} from "@atala/prism-wallet-sdk";
const secpPrivateKey = new Secp256k1PrivateKey(
new Uint8Array([
45, 182, 188, 189, 107, 229, 136, 180, 199, 177, 110, 84, 98, 140, 121, 84,
Expand Down
2 changes: 1 addition & 1 deletion tests/pluto.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Domain,
JWTCredential,
Pollux,
} from "@input-output-hk/atala-prism-wallet-sdk";
} from "@atala/prism-wallet-sdk";
import * as Fixtures from "./fixtures";
import * as sinon from "sinon";

Expand Down
62 changes: 33 additions & 29 deletions versioning.cjs
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);

0 comments on commit 1b300cc

Please sign in to comment.