diff --git a/package.json b/package.json index 03a6e7c5ce0..8d661be539c 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,7 @@ "packages": [ "packages/*", "packages/sdk/*", - "packages/sdk/wallets/*", - "packages/protocol/abis" + "packages/sdk/wallets/*" ], "nohoist": [ "**/openzeppelin-solidity", diff --git a/packages/protocol/abis/package.json b/packages/protocol/abis/package.json index e3a8a9a8b22..d0f6a38d0c6 100644 --- a/packages/protocol/abis/package.json +++ b/packages/protocol/abis/package.json @@ -1,10 +1,10 @@ { "name": "@celo/abis", - "version": "10.0.0-local", "author": "cLabs", "license": "LGPL-3.0", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", + "private": "true", "types": "./dist/types/index.d.ts", "typings": "./dist/types/index.d.ts", "repository": { diff --git a/packages/protocol/contracts/package.json b/packages/protocol/contracts/package.json index f5e3d544ead..b4be0dad47a 100644 --- a/packages/protocol/contracts/package.json +++ b/packages/protocol/contracts/package.json @@ -1,8 +1,8 @@ { "name": "@celo/contracts", - "version": "0.0.0-template.version", "author": "cLabs", "license": "LGPL-3.0", + "private": "true", "repository": { "type": "git", "url": "https://github.com/celo-org/celo-monorepo.git", diff --git a/packages/protocol/scripts/prepare-contracts-and-abis-publishing.ts b/packages/protocol/scripts/prepare-contracts-and-abis-publishing.ts index 25b298c4a76..2b3d0cffea3 100644 --- a/packages/protocol/scripts/prepare-contracts-and-abis-publishing.ts +++ b/packages/protocol/scripts/prepare-contracts-and-abis-publishing.ts @@ -229,25 +229,35 @@ function processRawJsonsAndPrepareExports() { return exports } -function prepareAbisPackageJson(exports) { - log('Preparing @celo/abis package.json') - const packageJsonPath = path.join(ABIS_PACKAGE_SRC_DIR, 'package.json') +function replacePackageVersionAndMakePublic(packageJsonPath: string, onDone?: (json) => void) { const json = JSON.parse(fs.readFileSync(packageJsonPath).toString()) if (process.env.RELEASE_VERSION) { - log('Replacing @celo/abis version with provided RELEASE_VERSION') + log(`Replacing ${json.name} version with provided RELEASE_VERSION`) json.version = process.env.RELEASE_VERSION + json.private = false } else { log('No RELEASE_VERSION provided') } - log('Setting @celo/abis exports') - json.exports = exports + if (onDone !== undefined) { + onDone(json) + } fs.writeFileSync(packageJsonPath, JSON.stringify(json, null, 2)) } +function prepareAbisPackageJson(exports) { + log('Preparing @celo/abis package.json') + const packageJsonPath = path.join(ABIS_PACKAGE_SRC_DIR, 'package.json') + + replacePackageVersionAndMakePublic(packageJsonPath, (json) => { + log('Setting @celo/abis exports') + json.exports = exports + }) +} + function prepareContractsPackage() { const contracts08CpCommand = `cp -r ${CONTRACTS_08_SOURCE_DIR} ${CONTRACTS_08_PACKAGE_DESTINATION_DIR}` log(contracts08CpCommand) @@ -255,13 +265,8 @@ function prepareContractsPackage() { if (process.env.RELEASE_VERSION) { log('Replacing @celo/contracts version with RELEASE_VERSION)') - const contractsPackageJsonPath = path.join(CONTRACTS_PACKAGE_SRC_DIR, 'package.json') - const contents = fs.readFileSync(contractsPackageJsonPath).toString() - - fs.writeFileSync( - contractsPackageJsonPath, - contents.replace('0.0.0-template.version', process.env.RELEASE_VERSION) - ) + const packageJsonPath = path.join(CONTRACTS_PACKAGE_SRC_DIR, 'package.json') + replacePackageVersionAndMakePublic(packageJsonPath) return }