diff --git a/package.json b/package.json index fbc7b974f..a1fc2cc8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "web3-onboard-monorepo", - "version": "2.24.18", + "name": "subwallet-connect-monorepo", + "version": "1.0.1", "private": true, "workspaces": { "packages": [ @@ -11,9 +11,11 @@ "**/csstype" ] }, - "description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", + "description": "SubWallet-Connect fork from Web3-Onboard. It makes it simple to connect not only Ethereum but also Polkadot hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", + "Polkadot", + "SubWallet", "Web3", "EVM", "dapp", @@ -46,11 +48,11 @@ ], "repository": { "type": "git", - "url": "https://github.com/blocknative/web3-onboard.git", + "url": "https://github.com/Koniverse/SubWallet-Connect.git", "directory": "packages/core" }, "homepage": "https://onboard.blocknative.com", - "bugs": "https://github.com/blocknative/web3-onboard/issues", + "bugs": "https://github.com/Koniverse/SubWallet-Connect/issues", "scripts": { "install-m1-mac": "yarn install --ignore-optional", "format": "prettier --write 'packages/**/*.ts'", @@ -59,7 +61,9 @@ "type-check": "yarn wsrun type-check", "file-check": "yarn install --check-files", "check-all": "yarn build && yarn file-check && yarn type-check", - "test-playwright": "cd test && yarn && yarn playwright test" + "test-playwright": "cd test && yarn && yarn playwright test", + "update-version": "node scripts/update-version.js", + "publish-version": "node scripts/publish-version.js" }, "devDependencies": { "prettier": "^2.4.1", diff --git a/scripts/publish-version.js b/scripts/publish-version.js new file mode 100644 index 000000000..fedf04e77 --- /dev/null +++ b/scripts/publish-version.js @@ -0,0 +1,32 @@ +const glob = require('glob'); +const execa = require('execa'); +const path = require('path'); + +const prefix = '@subwallet-connect'; + +// Function to publish a package +async function publishPackage(packagePath) { + try { + const { stdout } = await execa('npm', ['publish', '--access', 'public'], { cwd: packagePath }); + console.log(stdout); + } catch (error) { + console.error(`Failed to publish package at ${packagePath}:`, error.stderr); + } +} + +// Find and publish all packages with the specified prefix +glob('packages/*/package.json', async (err, files) => { + if (err) { + return console.error('Error finding package.json files:', err); + } + + for (const file of files) { + const packageJsonPath = path.resolve(file); + const packageJson = require(packageJsonPath); + + if (packageJson.name && packageJson.name.startsWith(prefix)) { + console.log(`Publishing ${packageJson.name}...`); + await publishPackage(path.dirname(packageJsonPath)); + } + } +}); diff --git a/scripts/set-version.js b/scripts/update-version.js similarity index 66% rename from scripts/set-version.js rename to scripts/update-version.js index 187f6dbc8..ef154386f 100644 --- a/scripts/set-version.js +++ b/scripts/update-version.js @@ -1,38 +1,19 @@ -const jsonfile = require('jsonfile'); const glob = require('glob'); const path = require('path'); +const jsonfile = require('jsonfile'); +const {getAllPackageNames} = require("./utils"); // Get the target version from the command line arguments -const targetVersion = process.argv[2]; +// Read the version from the root package.json +const rootPackageJsonPath = path.resolve('package.json'); +const rootPackageJson = jsonfile.readFileSync(rootPackageJsonPath); +const targetVersion = rootPackageJson.version; if (!targetVersion) { - console.error('Usage: node set-version.js '); + console.error('No version found in root package.json'); process.exit(1); } -// This function reads all package.json files to collect package names -async function getAllPackageNames() { - return new Promise((resolve, reject) => { - glob('packages/*/package.json', async (err, files) => { - if (err) { - reject('Error finding package.json files:', err); - return; - } - - const packageNames = []; - for (const file of files) { - try { - const packageJson = await jsonfile.readFile(path.resolve(file)); - packageNames.push(packageJson.name); - } catch (error) { - console.error(`Error reading ${file}:`, error); - } - } - resolve(packageNames); - }); - }); -} - // Function to update package.json dependencies async function updatePackageJson(filePath, packageNames) { let fileUpdated = false; diff --git a/scripts/utils.js b/scripts/utils.js new file mode 100644 index 000000000..464c8cca2 --- /dev/null +++ b/scripts/utils.js @@ -0,0 +1,30 @@ +const jsonfile = require('jsonfile'); +const glob = require('glob'); +const path = require('path'); + +// This function reads all package.json files to collect package names +async function getAllPackageNames() { + return new Promise((resolve, reject) => { + glob('packages/*/package.json', async (err, files) => { + if (err) { + reject('Error finding package.json files:', err); + return; + } + + const packageNames = []; + for (const file of files) { + try { + const packageJson = await jsonfile.readFile(path.resolve(file)); + packageNames.push(packageJson.name); + } catch (error) { + console.error(`Error reading ${file}:`, error); + } + } + resolve(packageNames); + }); + }); +} + +module.exports = { + getAllPackageNames +} \ No newline at end of file