diff --git a/PUBLISH.md b/PUBLISH.md new file mode 100644 index 0000000..67675ac --- /dev/null +++ b/PUBLISH.md @@ -0,0 +1,63 @@ +# Publishing to NPM + +This document outlines the steps for publishing production and beta releases to NPM. + +## Publish Production Release + +1. **Set Release Versions**: Update the version number in the `package.json` files of the CLI, SDK, and root directory. + +2. **Build and Test**: Ensure all packages are built and tested. + +3. **Update Dependencies**: + - In `packages/cli/package.json`, replace the wildcard version in dependencies with the specific version you intend to publish. For example, change `"@apillon/sdk": "*"` to `"@apillon/sdk": "1.0.0"`. + + ```json + { + ... + "dependencies": { + ... + "@apillon/sdk": "1.0.0" + } + } + ``` + +4. **Publish Packages**: Use `npm publish` to publish each package, starting with the base package that has no internal dependencies (like SDK). + +5. **Revert Changes**: Remember to revert the changes made in step 3 before committing to Git! + +## Publish Beta Release + +1. **Set Beta Version**: Assign the beta release version in the `package.json` files of the CLI and SDK. Use the format `X.Y.Z-beta.V`. + + ```json + { + "version": "1.0.1-beta.0" + } + ``` + +2. **Build and Test**: Ensure all packages are built and tested. + +3. **Update Dependencies**: + - Similar to the production release, update the internal dependencies in `packages/cli/package.json` to the beta version you are about to publish. + + ```json + { + ... + "dependencies": { + ... + "@apillon/sdk": "1.0.1-beta.0" + ... + } + } + ``` + +4. **Publish with Beta Tag**: Publish each package with the beta tag using `npm publish --tag beta`, starting with the base package. + + ```sh + npm publish --tag beta + ``` + +5. **Update Beta Version**: If re-publishing a beta version, increment the beta version tag (e.g., `1.0.1-beta.1`) and repeat the above steps. + +6. **Revert Changes**: Remember to revert the changes made in step 3 before committing to Git! + diff --git a/package-lock.json b/package-lock.json index c8552ac..2b98c68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "apillon-web3-tools", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "apillon-web3-tools", - "version": "1.0.0", + "version": "1.0.2", "license": "MIT", "workspaces": [ "packages/*" @@ -2534,6 +2534,7 @@ "version": "16.0.3", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "dev": true, "engines": { "node": ">=12" } @@ -6267,14 +6268,13 @@ }, "packages/cli": { "name": "@apillon/cli", - "version": "1.0.0", + "version": "1.0.2", "license": "MIT", "dependencies": { "@apillon/sdk": "*", "axios": "^1.3.4", "chalk": "^4.1.2", - "commander": "^10.0.0", - "dotenv": "^16.0.3" + "commander": "^10.0.0" }, "bin": { "apillon": "dist/index.js", @@ -6371,7 +6371,7 @@ }, "packages/sdk": { "name": "@apillon/sdk", - "version": "1.0.0", + "version": "1.0.2", "license": "MIT", "dependencies": { "axios": "^1.3.4" @@ -6472,7 +6472,6 @@ "axios": "^1.3.4", "chalk": "^4.1.2", "commander": "^10.0.0", - "dotenv": "^16.0.3", "eslint-config-common": "*", "nodemon": "^2.0.20", "rimraf": "^5.0.5", @@ -8450,7 +8449,8 @@ "dotenv": { "version": "16.0.3", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "dev": true }, "eastasianwidth": { "version": "0.2.0", diff --git a/package.json b/package.json index 2c8d856..a5972a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "apillon-web3-tools", - "version": "1.0.1", + "version": "1.0.2", "description": "Monorepo for Apillon tools", "author": "Apillon", "license": "MIT", diff --git a/packages/cli/package.json b/packages/cli/package.json index b6a59ca..78cad29 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@apillon/cli", "description": "▶◀ Apillon CLI tools ▶◀", - "version": "1.0.1", + "version": "1.0.2", "author": "Apillon", "license": "MIT", "main": "./dist/index.js", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 1341682..d479392 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,7 +1,7 @@ { "name": "@apillon/sdk", "description": "▶◀ Apillon SDK for NodeJS ▶◀", - "version": "1.0.1", + "version": "1.0.2", "author": "Apillon", "license": "MIT", "main": "./dist/index.js", diff --git a/packages/sdk/src/lib/apillon.ts b/packages/sdk/src/lib/apillon.ts index 3273a08..cc78181 100644 --- a/packages/sdk/src/lib/apillon.ts +++ b/packages/sdk/src/lib/apillon.ts @@ -34,7 +34,7 @@ export class ApillonModule { public constructor(config?: ApillonConfig) { ApillonApi.initialize(config); ApillonLogger.initialize( - config.debug ? LogLevel.VERBOSE : config.logLevel || LogLevel.ERROR, + config?.debug ? LogLevel.VERBOSE : config?.logLevel || LogLevel.ERROR, ); } }