From d7afbe237f5dfed793e0c295c630e21d20f68de2 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 11 May 2023 00:30:38 -0700 Subject: [PATCH 01/46] Add additional checks & improve ci cd --- .eslintignore | 2 +- .github/dependabot.yml | 26 +++ .github/release-drafter.yml | 11 ++ .github/workflows/ci.yml | 21 ++- .github/workflows/release-drafter.yml | 14 ++ .pre-commit-config.yaml | 35 ++++ .prettierignore | 12 ++ .prettierrc.yml | 9 + examples/create-autotask/code/deps.js | 2 +- examples/create-autotask/code/index.js | 4 +- examples/create-autotask/index.js | 8 +- examples/create-secret/index.js | 6 +- examples/create-sentinel/index.js | 13 +- examples/deploy-contract/index.js | 4 +- examples/pause-proposal/index.js | 2 +- examples/relayer-actions/index.js | 2 +- examples/simulate-proposal/index.js | 47 +++--- examples/unpause-proposal/index.js | 2 +- examples/update-autotask/code/deps.js | 2 +- examples/update-autotask/code/index.js | 4 +- .../update-notification-category/index.js | 58 +++---- examples/update-sentinel/index.js | 6 +- .../verify-contract/compilation-artifact.json | 2 +- examples/verify-contract/index.js | 10 +- examples/web3-provider/index.js | 4 +- lerna.json | 3 +- nx.json | 17 ++ package.json | 21 ++- packages/admin/jest.config.js | 2 +- .../fixtures/invalid/notindex.js | 2 +- .../autotask-client/fixtures/valid/data.json | 2 +- .../autotask-client/fixtures/valid/index.js | 2 +- .../fixtures/valid/subfolder/nested.json | 2 +- packages/autotask-client/jest.config.js | 2 +- packages/autotask-utils/jest.config.js | 2 +- packages/base/README.md | 2 +- packages/base/jest.config.js | 2 +- .../base/src/api/__mocks__/axios-error.ts | 12 +- packages/base/src/api/api.test.ts | 2 +- packages/base/src/api/api.ts | 2 +- packages/base/src/utils/network.ts | 52 +++--- packages/deploy/jest.config.js | 2 +- packages/deploy/lerna.json | 2 +- packages/kvstore/README.md | 6 +- packages/kvstore/jest.config.js | 2 +- packages/relay/jest.config.js | 2 +- packages/relay/src/ethers/signer.test.ts | 9 +- packages/relay/src/ethers/signer.ts | 4 +- packages/relay/src/relayer.ts | 7 +- packages/relay/src/test/relayClient.test.ts | 10 +- packages/relay/src/web3/sender.test.ts | 4 +- packages/sentinel/jest.config.js | 2 +- packages/sentinel/src/api/index.test.ts | 12 +- yarn.lock | 156 +++++++++++++++++- 54 files changed, 490 insertions(+), 161 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yml create mode 100644 .pre-commit-config.yaml create mode 100644 .prettierignore create mode 100644 .prettierrc.yml create mode 100644 nx.json diff --git a/.eslintignore b/.eslintignore index 55dd585f..7313d1f8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ /lib -/test \ No newline at end of file +/test diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..fc0b27f1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,26 @@ +--- +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + + # Maintain dependencies for npm + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + ignore: + - dependency-name: '*' + update-types: [version-update:semver-major] + commit-message: + # Prefix all commit messages + prefix: defender-client-deps + labels: + - dependabot + - dependencies + - vulnerabilites + # Allow up to 5 open pull requests + open-pull-requests-limit: 5 diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..cbcd459f --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,11 @@ +--- +template: | + ## Next Release Version: v$NEXT_MINOR_VERSION + + ## Changes + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$NEXT_MINOR_VERSION + +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: \<*_& diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d0e1861..7aa82f35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,26 @@ name: CI -on: [push] +on: + push: + branches: + - master + pull_request: + types: [assigned, opened, synchronize, reopened, labeled] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + checks: write + contents: read + pull-requests: write jobs: build: runs-on: ubuntu-22.04 - + steps: - uses: actions/checkout@v3.1.0 @@ -70,6 +84,9 @@ jobs: - name: Install dependencies run: yarn --frozen-lockfile + - name: Lint & format checks + run: yarn style + - name: Build run: yarn build diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..4c96d50a --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,14 @@ +--- +# This action can be used to draft the next release notes as pull requests are merged into the master. +name: Release Drafter +on: + push: + branches: + - master +jobs: + update_release_draft: + runs-on: ubuntu-22.04 + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..8bc6415c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +--- +minimum_pre_commit_version: 1.15.0 +default_stages: + - commit + - push + +repos: + - repo: local + hooks: + - id: pre-commit + name: Update pre-commit + entry: pre-commit install --install-hooks -t pre-commit -t pre-push + pass_filenames: false + language: system + files: ^\.pre-commit-config.yaml$ + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-merge-conflict + - id: forbid-new-submodules + - id: detect-aws-credentials + - id: detect-private-key + - id: double-quote-string-fixer + files: \.yaml$ + - id: trailing-whitespace + - id: end-of-file-fixer + - repo: local + hooks: + - id: style-fixes + stages: + - push + name: Run lint & format with fixes + exclude: (\.md|\.sh)$ + entry: yarn style + language: system diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..cdb0a19b --- /dev/null +++ b/.prettierignore @@ -0,0 +1,12 @@ +# Ignore relevant files in fixtures, sometimes they are intentionally malformed +packages/**/fixtures/**/*.json +packages/**/fixtures/**/*.md + +# Ignore all YAML file +*.yaml +*.yml + +# Ignore gitignore +.gitignore + +dist diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 00000000..868f6d06 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,9 @@ +# https://prettier.io/docs/en/options.html +printWidth: 120 +trailingComma: 'all' +singleQuote: true +useTabs: false +tabWidth: 2 +semi: true +arrowParens: 'always' +quoteProps: 'consistent' diff --git a/examples/create-autotask/code/deps.js b/examples/create-autotask/code/deps.js index 6e96ef1e..a410e90e 100644 --- a/examples/create-autotask/code/deps.js +++ b/examples/create-autotask/code/deps.js @@ -1 +1 @@ -exports.foo = () => 42; \ No newline at end of file +exports.foo = () => 42; diff --git a/examples/create-autotask/code/index.js b/examples/create-autotask/code/index.js index 58270f35..2cd54e4d 100644 --- a/examples/create-autotask/code/index.js +++ b/examples/create-autotask/code/index.js @@ -1,7 +1,7 @@ const deps = require('./deps'); -exports.handler = async function() { +exports.handler = async function () { const value = deps.foo(); console.log(value); return value; -} \ No newline at end of file +}; diff --git a/examples/create-autotask/index.js b/examples/create-autotask/index.js index 82948292..f2630bc4 100644 --- a/examples/create-autotask/index.js +++ b/examples/create-autotask/index.js @@ -7,19 +7,19 @@ async function main() { const client = new AutotaskClient(creds); const myAutotask = { - name: "my-autotask", + name: 'my-autotask', encodedZippedCode: await client.getEncodedZippedCodeFromFolder('./code'), trigger: { type: 'schedule', frequencyMinutes: 1500, }, - paused: false + paused: false, }; const createdAutotask = await client.create(myAutotask); - console.log(createdAutotask) + console.log(createdAutotask); } if (require.main === module) { main().catch(console.error); -} \ No newline at end of file +} diff --git a/examples/create-secret/index.js b/examples/create-secret/index.js index b1fbf051..3c184d79 100644 --- a/examples/create-secret/index.js +++ b/examples/create-secret/index.js @@ -6,10 +6,10 @@ async function main() { const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET }; const client = new AutotaskClient(creds); - const createSecrets = await client.createSecrets({ deletes: [], secrets: { "foo": "bar" } }); - console.log(createSecrets) + const createSecrets = await client.createSecrets({ deletes: [], secrets: { foo: 'bar' } }); + console.log(createSecrets); } if (require.main === module) { main().catch(console.error); -} \ No newline at end of file +} diff --git a/examples/create-sentinel/index.js b/examples/create-sentinel/index.js index 47d731a4..37d14f7b 100644 --- a/examples/create-sentinel/index.js +++ b/examples/create-sentinel/index.js @@ -36,8 +36,11 @@ async function main() { // optional paused: false, eventConditions: [ - { eventSignature: 'OwnershipTransferred(address,address)', expression: 'previousOwner=0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2' }, - { eventSignature: 'Transfer(address,address,uint256)' } + { + eventSignature: 'OwnershipTransferred(address,address)', + expression: 'previousOwner=0x0f06aB75c7DD497981b75CD82F6566e3a5CAd8f2', + }, + { eventSignature: 'Transfer(address,address,uint256)' }, ], functionConditions: [{ functionSignature: 'renounceOwnership()' }], // optional @@ -55,8 +58,8 @@ async function main() { alertTimeoutMs: 0, notificationChannels: [notification.notificationId], // optional - riskCategory: "TECHNICAL" - } + riskCategory: 'TECHNICAL', + }; const fortaRequestParameters = { type: 'FORTA', // BLOCK or FORTA @@ -86,7 +89,7 @@ async function main() { // optional alertTimeoutMs: 0, notificationChannels: [notification.notificationId], - } + }; // call create with the request parameters const sentinelResponse = await client.create(blockRequestParameters); // or fortaRequestParameters diff --git a/examples/deploy-contract/index.js b/examples/deploy-contract/index.js index 08bc5460..71c6c0e3 100644 --- a/examples/deploy-contract/index.js +++ b/examples/deploy-contract/index.js @@ -34,5 +34,5 @@ async function main() { } if (require.main === module) { - main().catch(console.error); -} \ No newline at end of file + main().catch(console.error); +} diff --git a/examples/pause-proposal/index.js b/examples/pause-proposal/index.js index e960f271..2230b854 100644 --- a/examples/pause-proposal/index.js +++ b/examples/pause-proposal/index.js @@ -15,7 +15,7 @@ async function main() { via: '0xF608FA64c4fF8aDdbEd106E69f3459effb4bC3D1', viaType: 'Gnosis Safe', }, - { network, address } + { network, address }, ); const siteUrl = process.env.SITE_URL || 'https://defender.openzeppelin.com'; diff --git a/examples/relayer-actions/index.js b/examples/relayer-actions/index.js index 04bbdacc..b206338a 100644 --- a/examples/relayer-actions/index.js +++ b/examples/relayer-actions/index.js @@ -44,7 +44,7 @@ async function query(id) { async function list() { const list = await relayer.list({ limit: 3 }); - console.log(list.map(tx => JSON.stringify(tx, null, 2)).join('\n')); + console.log(list.map((tx) => JSON.stringify(tx, null, 2)).join('\n')); } async function balance(addr) { diff --git a/examples/simulate-proposal/index.js b/examples/simulate-proposal/index.js index dd185410..3ad9055f 100644 --- a/examples/simulate-proposal/index.js +++ b/examples/simulate-proposal/index.js @@ -19,11 +19,11 @@ async function main() { description: 'Call the Flash() function', type: 'custom', metadata: { - sendTo: "0xA91382E82fB676d4c935E601305E5253b3829dCD", - sendValue: "10000000000000000", + sendTo: '0xA91382E82fB676d4c935E601305E5253b3829dCD', + sendValue: '10000000000000000', sendCurrency: { - name: "Ethereum", - symbol: "ETH", + name: 'Ethereum', + symbol: 'ETH', decimals: 18, type: 'native', }, @@ -36,10 +36,9 @@ async function main() { console.log(`Created proposal (${proposal.proposalId})`); - const contractInterface = new utils.Interface(contractABI); // encode function data - const data = contractInterface.encodeFunctionData(proposal.functionInterface.name, proposal.functionInputs) + const data = contractInterface.encodeFunctionData(proposal.functionInterface.name, proposal.functionInputs); try { // Simulate the proposal @@ -48,22 +47,22 @@ async function main() { proposal.proposalId, // proposalId { transactionData: { - from: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", // change this to impersonate the `from` address + from: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', // change this to impersonate the `from` address data, to: proposal.contract.address, - value: proposal.metadata.sendValue ?? "10000000000000000" + value: proposal.metadata.sendValue ?? '10000000000000000', }, - // default to latest finalized block, - // can be up to 100 blocks ahead of current block, + // default to latest finalized block, + // can be up to 100 blocks ahead of current block, // does not support previous blocks - blockNumber: undefined - } + blockNumber: undefined, + }, ); - // Check if simulation reverted under `simulation.meta.reverted` + // Check if simulation reverted under `simulation.meta.reverted` // and the reason string `simulation.meta.returnString` if (simulation.meta.reverted) { - console.log("Transaction reverted:", simulation.meta.returnString ?? simulation.meta.returnValue) + console.log('Transaction reverted:', simulation.meta.returnString ?? simulation.meta.returnValue); } else { console.log(simulation); } @@ -87,11 +86,11 @@ async function main() { description: 'Call the Flash() function', type: 'custom', metadata: { - sendTo: "0xA91382E82fB676d4c935E601305E5253b3829dCD", - sendValue: "10000000000000000", + sendTo: '0xA91382E82fB676d4c935E601305E5253b3829dCD', + sendValue: '10000000000000000', sendCurrency: { - name: "Ethereum", - symbol: "ETH", + name: 'Ethereum', + symbol: 'ETH', decimals: 18, type: 'native', }, @@ -106,19 +105,21 @@ async function main() { overrideSimulationOpts: { transactionData: { // or instead of ABI, you can provide data - data: "0xd336c82d" - } - } + data: '0xd336c82d', + }, + }, }); console.log(`Created proposal (${proposalWithSimulation.proposalId})`); if (proposalWithSimulation.simulation.meta.reverted) { - console.log("Transaction reverted:", proposalWithSimulation.simulation.meta.returnString ?? proposalWithSimulation.simulation.meta.returnValue) + console.log( + 'Transaction reverted:', + proposalWithSimulation.simulation.meta.returnString ?? proposalWithSimulation.simulation.meta.returnValue, + ); } else { console.log(proposalWithSimulation.simulation); } - } if (require.main === module) { diff --git a/examples/unpause-proposal/index.js b/examples/unpause-proposal/index.js index bc0f016c..b8b926ed 100644 --- a/examples/unpause-proposal/index.js +++ b/examples/unpause-proposal/index.js @@ -15,7 +15,7 @@ async function main() { via: '0xF608FA64c4fF8aDdbEd106E69f3459effb4bC3D1', viaType: 'Gnosis Safe', }, - { network, address } + { network, address }, ); const siteUrl = process.env.SITE_URL || 'https://defender.openzeppelin.com'; diff --git a/examples/update-autotask/code/deps.js b/examples/update-autotask/code/deps.js index 6e96ef1e..a410e90e 100644 --- a/examples/update-autotask/code/deps.js +++ b/examples/update-autotask/code/deps.js @@ -1 +1 @@ -exports.foo = () => 42; \ No newline at end of file +exports.foo = () => 42; diff --git a/examples/update-autotask/code/index.js b/examples/update-autotask/code/index.js index 58270f35..2cd54e4d 100644 --- a/examples/update-autotask/code/index.js +++ b/examples/update-autotask/code/index.js @@ -1,7 +1,7 @@ const deps = require('./deps'); -exports.handler = async function() { +exports.handler = async function () { const value = deps.foo(); console.log(value); return value; -} \ No newline at end of file +}; diff --git a/examples/update-notification-category/index.js b/examples/update-notification-category/index.js index 336f34b4..da3d0c3f 100644 --- a/examples/update-notification-category/index.js +++ b/examples/update-notification-category/index.js @@ -3,39 +3,39 @@ require('dotenv').config(); const { SentinelClient } = require('defender-sentinel-client'); async function main() { - const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET }; - const client = new SentinelClient(creds); + const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET }; + const client = new SentinelClient(creds); - let notification; - // use an existing notification channel - const notificationChannels = await client.listNotificationChannels(); - if (notificationChannels.length > 0) { - // Select your desired notification channel - notification = notificationChannels[0]; - } else { - // OR create a new notification channel - notification = await client.createNotificationChannel({ - type: 'email', - name: 'MyEmailNotification', - config: { - emails: ['john@example.com'], - }, - paused: false, - }); - } + let notification; + // use an existing notification channel + const notificationChannels = await client.listNotificationChannels(); + if (notificationChannels.length > 0) { + // Select your desired notification channel + notification = notificationChannels[0]; + } else { + // OR create a new notification channel + notification = await client.createNotificationChannel({ + type: 'email', + name: 'MyEmailNotification', + config: { + emails: ['john@example.com'], + }, + paused: false, + }); + } - const getExistingCategory = (await client.listNotificationCategories())[0]; + const getExistingCategory = (await client.listNotificationCategories())[0]; - const category = { - ...getExistingCategory, - description: "Attach this category to high-risk monitors", - notificationIds: [{ notificationId: notification.notificationId, type: notification.type }] - } - // call update with the request parameters - const response = await client.updateNotificationCategory(category); - console.log(response); + const category = { + ...getExistingCategory, + description: 'Attach this category to high-risk monitors', + notificationIds: [{ notificationId: notification.notificationId, type: notification.type }], + }; + // call update with the request parameters + const response = await client.updateNotificationCategory(category); + console.log(response); } if (require.main === module) { - main().catch(console.error); + main().catch(console.error); } diff --git a/examples/update-sentinel/index.js b/examples/update-sentinel/index.js index 768c3822..03149a3e 100644 --- a/examples/update-sentinel/index.js +++ b/examples/update-sentinel/index.js @@ -6,10 +6,10 @@ async function main() { const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET }; const client = new SentinelClient(creds); - const currentSentinel = await client.get("58b3d255-e357-4b0d-aa16-e86f745e63b9"); + const currentSentinel = await client.get('58b3d255-e357-4b0d-aa16-e86f745e63b9'); console.log(currentSentinel); - const updatedSentinel = await client.update(currentSentinel.subscriberId, { name: "Test 2" }) - console.log(updatedSentinel) + const updatedSentinel = await client.update(currentSentinel.subscriberId, { name: 'Test 2' }); + console.log(updatedSentinel); } if (require.main === module) { diff --git a/examples/verify-contract/compilation-artifact.json b/examples/verify-contract/compilation-artifact.json index 31b0693c..8f332f69 100644 --- a/examples/verify-contract/compilation-artifact.json +++ b/examples/verify-contract/compilation-artifact.json @@ -67819,4 +67819,4 @@ } } } -} \ No newline at end of file +} diff --git a/examples/verify-contract/index.js b/examples/verify-contract/index.js index 132bca7f..2a99078a 100644 --- a/examples/verify-contract/index.js +++ b/examples/verify-contract/index.js @@ -27,11 +27,12 @@ async function main() { // the deployed bytecode by calling `verify` with an artifact URI console.log(`Verifying deployment using uploaded artifact`); let verification = await client.verifyDeployment({ - artifactUri: 'https://raw.githubusercontent.com/OpenZeppelin/defender-client/fa441208febac7f46fe7bb03c787659089315f78/examples/verify-contract/compilation-artifact.json', + artifactUri: + 'https://raw.githubusercontent.com/OpenZeppelin/defender-client/fa441208febac7f46fe7bb03c787659089315f78/examples/verify-contract/compilation-artifact.json', solidityFilePath: 'contracts/Vault.sol', contractName: 'VaultV2', contractAddress: '0x38e373CC414e90dDec45cf7166d497409902e998', - contractNetwork: 'goerli' + contractNetwork: 'goerli', }); printVerificationToConsole(verification); @@ -41,11 +42,12 @@ async function main() { console.log(`Verifying deployment with inline artifact`); verification = await client.verifyDeployment({ artifactPayload: JSON.stringify(require('./compilation-artifact.json')), - referenceUri: 'https://github.com/OpenZeppelin/defender-client/blob/master/examples/verify-contract/compilation-artifact.json', + referenceUri: + 'https://github.com/OpenZeppelin/defender-client/blob/master/examples/verify-contract/compilation-artifact.json', solidityFilePath: 'contracts/Vault.sol', contractName: 'VaultV2', contractAddress: '0x38e373CC414e90dDec45cf7166d497409902e998', - contractNetwork: 'goerli' + contractNetwork: 'goerli', }); printVerificationToConsole(verification); diff --git a/examples/web3-provider/index.js b/examples/web3-provider/index.js index e836e8d0..442f744a 100644 --- a/examples/web3-provider/index.js +++ b/examples/web3-provider/index.js @@ -7,11 +7,11 @@ const ERC20Bytecode = require('./bytecode.json')[0].data.bytecode.object; const Beneficiary = '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'; async function main(provider) { - const web3 = new Web3(provider) + const web3 = new Web3(provider); const [from] = await web3.eth.getAccounts(); const balance = await web3.eth.getBalance(from); console.log(`Relayer address is ${from} with balance ${balance}`); - + console.log(`Deploying ERC20 contract`); const factory = new web3.eth.Contract(ERC20Abi, null, { data: ERC20Bytecode, from }); const erc20 = await factory.deploy({ arguments: [100] }).send(); diff --git a/lerna.json b/lerna.json index 254146ef..763d35c1 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,6 @@ "packages/sentinel", "examples/*" ], - "version": "1.44.0-rc.1" + "version": "1.44.0-rc.1", + "useNx": true } diff --git a/nx.json b/nx.json new file mode 100644 index 00000000..5c1acafb --- /dev/null +++ b/nx.json @@ -0,0 +1,17 @@ +{ + "tasksRunnerOptions": { + "default": { + "runner": "nx-cloud", + "options": { + "cacheableOperations": [ + "build", + "compile", + "lint", + "test" + ], + "accessToken": "N2UxN2YyYWYtZDgyYS00OTYyLTg0YjMtMTFjMzEyMWU2MWMxfHJlYWQtd3JpdGU=" + } + } + }, + "defaultBase": "master" +} diff --git a/package.json b/package.json index 2f31e34b..e75a06f4 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,13 @@ "examples/*" ], "devDependencies": { + "@npmcli/fs": "3.1.0", + "@types/glob": "^8.1.0", "@types/jest": "^24.0.23", "@types/lodash": "^4.14.157", "@types/node": "^12.12.7", "@typescript-eslint/eslint-plugin": "^3.7.0", "@typescript-eslint/parser": "^2.1.0", - "@types/glob": "^8.1.0", - "@npmcli/fs": "3.1.0", "code-style": "git+https://github.com/OpenZeppelin/code-style.git", "eslint": "^6.3.0", "eslint-config-prettier": "^6.2.0", @@ -23,13 +23,17 @@ "lerna": "^6.6.1", "prettier": "^2.0.4", "ts-jest": "^25.3.0", - "typescript": "^3.6.2" + "typescript": "^3.6.2", + "nx-cloud": "latest" }, "scripts": { - "build": "lerna run build", + "build": "nx run-many -t build", "lint": "yarn lint:check --fix", + "format:check": "prettier --check '**/*.{js,ts,tsx}'", + "format": "yarn format:check --write", "lint:check": "eslint 'packages/**/src/**/*.{js,ts}' --quiet", - "test": "lerna run test" + "test": "nx run-many -t test", + "style": "yarn lint && yarn format" }, "repository": { "type": "git", @@ -40,5 +44,8 @@ "bugs": { "url": "https://github.com/OpenZeppelin/defender-client/issues" }, - "homepage": "https://github.com/OpenZeppelin/defender-client#readme" -} \ No newline at end of file + "homepage": "https://github.com/OpenZeppelin/defender-client#readme", + "dependencies": { + "nx": "^16.1.4" + } +} diff --git a/packages/admin/jest.config.js b/packages/admin/jest.config.js index 7f882458..990bd442 100644 --- a/packages/admin/jest.config.js +++ b/packages/admin/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/autotask-client/fixtures/invalid/notindex.js b/packages/autotask-client/fixtures/invalid/notindex.js index e031d352..1a3f30d4 100644 --- a/packages/autotask-client/fixtures/invalid/notindex.js +++ b/packages/autotask-client/fixtures/invalid/notindex.js @@ -1 +1 @@ -exports.handler = () => {}; \ No newline at end of file +exports.handler = () => {}; diff --git a/packages/autotask-client/fixtures/valid/data.json b/packages/autotask-client/fixtures/valid/data.json index abee32e0..00dfcb7f 100644 --- a/packages/autotask-client/fixtures/valid/data.json +++ b/packages/autotask-client/fixtures/valid/data.json @@ -1 +1 @@ -{ "value": 42 } \ No newline at end of file +{ "value": 42 } diff --git a/packages/autotask-client/fixtures/valid/index.js b/packages/autotask-client/fixtures/valid/index.js index e031d352..1a3f30d4 100644 --- a/packages/autotask-client/fixtures/valid/index.js +++ b/packages/autotask-client/fixtures/valid/index.js @@ -1 +1 @@ -exports.handler = () => {}; \ No newline at end of file +exports.handler = () => {}; diff --git a/packages/autotask-client/fixtures/valid/subfolder/nested.json b/packages/autotask-client/fixtures/valid/subfolder/nested.json index 21b4688e..6bf6923b 100644 --- a/packages/autotask-client/fixtures/valid/subfolder/nested.json +++ b/packages/autotask-client/fixtures/valid/subfolder/nested.json @@ -1 +1 @@ -{ "nested": true } \ No newline at end of file +{ "nested": true } diff --git a/packages/autotask-client/jest.config.js b/packages/autotask-client/jest.config.js index 7f882458..990bd442 100644 --- a/packages/autotask-client/jest.config.js +++ b/packages/autotask-client/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/autotask-utils/jest.config.js b/packages/autotask-utils/jest.config.js index 7f882458..990bd442 100644 --- a/packages/autotask-utils/jest.config.js +++ b/packages/autotask-utils/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/base/README.md b/packages/base/README.md index f431bfe6..bc536393 100644 --- a/packages/base/README.md +++ b/packages/base/README.md @@ -2,4 +2,4 @@ OpenZeppelin Defender provides a security operations (SecOps) platform for Ethereum with built-in best practices. Development teams implement Defender to ship faster and minimize security risks. -Certain components of Defender, such as Admin or Relay, can be interacted with programmatically via an API. This library provides the base class for the clients. \ No newline at end of file +Certain components of Defender, such as Admin or Relay, can be interacted with programmatically via an API. This library provides the base class for the clients. diff --git a/packages/base/jest.config.js b/packages/base/jest.config.js index 7f882458..990bd442 100644 --- a/packages/base/jest.config.js +++ b/packages/base/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/base/src/api/__mocks__/axios-error.ts b/packages/base/src/api/__mocks__/axios-error.ts index bb6d7a59..1568e21c 100644 --- a/packages/base/src/api/__mocks__/axios-error.ts +++ b/packages/base/src/api/__mocks__/axios-error.ts @@ -7,9 +7,9 @@ export const mockAxiosError: AxiosError = { url: '/relayer', method: 'get', headers: { - Accept: 'application/json, text/plain, */*', + 'Accept': 'application/json, text/plain, */*', 'X-Api-Key': '4Rfp2GEHDjgesA6MdseUM1n8B8kT9hgs', - Authorization: 'Bearer WRONG', + 'Authorization': 'Bearer WRONG', 'Content-Type': 'application/json', 'User-Agent': 'axios/0.21.4', }, @@ -113,21 +113,21 @@ export const mockAxiosError: AxiosError = { status: 401, statusText: 'Unauthorized', headers: { - date: 'Thu, 21 Jul 2022 14:54:13 GMT', + 'date': 'Thu, 21 Jul 2022 14:54:13 GMT', 'content-type': 'application/json', 'content-length': '26', - connection: 'close', + 'connection': 'close', 'x-amzn-requestid': 'f18f6866-a9e7-4470-92b4-7c50d62330a4', 'x-amzn-errortype': 'UnauthorizedException', 'x-amz-apigw-id': 'Vn1HTHt3PHcF_2w=', 'x-amzn-trace-id': 'Root=1-62d96894-1766d59626818111787bf38a', 'x-cache': 'Error from cloudfront', - via: '1.1 fcad480c2a8351d8cd68e3adc43dff3e.cloudfront.net (CloudFront)', + 'via': '1.1 fcad480c2a8351d8cd68e3adc43dff3e.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'CDG50-C2', 'x-amz-cf-id': 'MCT4JHArIztgReF1WvWDoee_m96JGjWcVZpeb3AU7NHwYrVA6sGqgQ==', 'cf-cache-status': 'DYNAMIC', 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', - server: 'cloudflare', + 'server': 'cloudflare', 'cf-ray': '72e4c540dfa999a5-CDG', }, config: { diff --git a/packages/base/src/api/api.test.ts b/packages/base/src/api/api.test.ts index 72f5ee2c..0bb37f2d 100644 --- a/packages/base/src/api/api.test.ts +++ b/packages/base/src/api/api.test.ts @@ -14,7 +14,7 @@ describe('createApi', () => { baseURL: apiUrl, headers: { 'X-Api-Key': key, - Authorization: `Bearer ${token}`, + 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json', }, }); diff --git a/packages/base/src/api/api.ts b/packages/base/src/api/api.ts index f4d5d90a..fd139212 100644 --- a/packages/base/src/api/api.ts +++ b/packages/base/src/api/api.ts @@ -13,7 +13,7 @@ export function createApi(key: string, token: string, apiUrl: string, httpsAgent baseURL: apiUrl, headers: { 'X-Api-Key': key, - Authorization: `Bearer ${token}`, + 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json', }, httpsAgent, diff --git a/packages/base/src/utils/network.ts b/packages/base/src/utils/network.ts index 4ce7dfdf..3c98c4ff 100644 --- a/packages/base/src/utils/network.ts +++ b/packages/base/src/utils/network.ts @@ -89,37 +89,37 @@ export function toChainId(network: Network): number | undefined { } const chainIds: { [key in Network]: number } = { - mainnet: 1, - sepolia: 11155111, - goerli: 5, - xdai: 100, - sokol: 77, - fuse: 122, - bsc: 56, - bsctest: 97, - fantom: 250, - fantomtest: 0xfa2, - moonbase: 1287, - moonriver: 1285, - moonbeam: 1284, - matic: 137, - mumbai: 80001, - avalanche: 0xa86a, - fuji: 0xa869, - optimism: 10, + 'mainnet': 1, + 'sepolia': 11155111, + 'goerli': 5, + 'xdai': 100, + 'sokol': 77, + 'fuse': 122, + 'bsc': 56, + 'bsctest': 97, + 'fantom': 250, + 'fantomtest': 0xfa2, + 'moonbase': 1287, + 'moonriver': 1285, + 'moonbeam': 1284, + 'matic': 137, + 'mumbai': 80001, + 'avalanche': 0xa86a, + 'fuji': 0xa869, + 'optimism': 10, 'optimism-goerli': 420, - arbitrum: 42161, + 'arbitrum': 42161, 'arbitrum-nova': 42170, 'arbitrum-goerli': 421613, - celo: 42220, - alfajores: 44787, + 'celo': 42220, + 'alfajores': 44787, 'harmony-s0': 1666600000, 'harmony-test-s0': 1666700000, - aurora: 1313161554, - auroratest: 1313161555, - hedera: 295, - hederatest: 296, - zksync: 324, + 'aurora': 1313161554, + 'auroratest': 1313161555, + 'hedera': 295, + 'hederatest': 296, + 'zksync': 324, 'base-goerli': 84531, 'zksync-goerli': 280, 'x-dfk-avax-chain': 53935, diff --git a/packages/deploy/jest.config.js b/packages/deploy/jest.config.js index 7f882458..990bd442 100644 --- a/packages/deploy/jest.config.js +++ b/packages/deploy/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/deploy/lerna.json b/packages/deploy/lerna.json index fde39f46..639720a2 100644 --- a/packages/deploy/lerna.json +++ b/packages/deploy/lerna.json @@ -2,4 +2,4 @@ "npmClient": "yarn", "packages": ["."], "version": "0.1.0" - } \ No newline at end of file + } diff --git a/packages/kvstore/README.md b/packages/kvstore/README.md index a97212c6..53ff6742 100644 --- a/packages/kvstore/README.md +++ b/packages/kvstore/README.md @@ -31,10 +31,10 @@ exports.handler = async function(event) { // Associates myValue to myKey await store.put('myKey', 'myValue'); - + // Returns myValue associated to myKey const value = await store.get('myKey'); - + // Deletes the entry for myKey await store.del('myKey'); } @@ -58,7 +58,7 @@ async function local() { ## Considerations -- All data in the key-value store is persisted as strings, both keys and values. +- All data in the key-value store is persisted as strings, both keys and values. - Keys are limited to 1kb in size, and values to 300kb. - The data store is shared across all your Autotasks; consider prefixing the keys with a namespace if you want to have different data buckets. - A key-value entry is expired after 90 days of the last time it was `put` into the store. diff --git a/packages/kvstore/jest.config.js b/packages/kvstore/jest.config.js index 7f882458..990bd442 100644 --- a/packages/kvstore/jest.config.js +++ b/packages/kvstore/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/relay/jest.config.js b/packages/relay/jest.config.js index 7f882458..990bd442 100644 --- a/packages/relay/jest.config.js +++ b/packages/relay/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/relay/src/ethers/signer.test.ts b/packages/relay/src/ethers/signer.test.ts index 2503b162..d1a5313f 100644 --- a/packages/relay/src/ethers/signer.test.ts +++ b/packages/relay/src/ethers/signer.test.ts @@ -10,7 +10,9 @@ import { randomBytes } from '@ethersproject/random'; import { DefenderRelaySigner } from './signer'; import { _TypedDataEncoder } from '@ethersproject/hash'; -type ProviderWithWrapTransaction = Provider & { _wrapTransaction(tx: Transaction, hash?: string): TransactionResponse }; +type ProviderWithWrapTransaction = Provider & { + _wrapTransaction(tx: Transaction, hash?: string): TransactionResponse; +}; describe('ethers/signer', () => { const relayer = mock(); @@ -130,7 +132,10 @@ describe('ethers/signer', () => { }); it('sends a tx with fixed gasPrice', async () => { - relayer.sendTransaction.mockResolvedValue({ ...omit(tx, 'maxFeePerGas', 'maxPriorityFeePerGas'), gasPrice: 1e9 }); + relayer.sendTransaction.mockResolvedValue({ + ...omit(tx, 'maxFeePerGas', 'maxPriorityFeePerGas'), + gasPrice: 1e9, + }); const signer = new DefenderRelaySigner(relayer, provider, { speed: 'safeLow' }); const request = { ...pick(tx, 'to', 'data', 'value', 'gasLimit'), gasPrice: 1e9 }; diff --git a/packages/relay/src/ethers/signer.ts b/packages/relay/src/ethers/signer.ts index 025c0841..f90f363c 100644 --- a/packages/relay/src/ethers/signer.ts +++ b/packages/relay/src/ethers/signer.ts @@ -38,7 +38,9 @@ export type DefenderRelaySignerOptions = Partial< } >; -type ProviderWithWrapTransaction = Provider & { _wrapTransaction(tx: Transaction, hash?: string): TransactionResponse }; +type ProviderWithWrapTransaction = Provider & { + _wrapTransaction(tx: Transaction, hash?: string): TransactionResponse; +}; export class DefenderRelaySigner extends Signer implements TypedDataSigner { private readonly relayer: Relayer; diff --git a/packages/relay/src/relayer.ts b/packages/relay/src/relayer.ts index 9678ec86..25ebb080 100644 --- a/packages/relay/src/relayer.ts +++ b/packages/relay/src/relayer.ts @@ -185,9 +185,10 @@ export function isLegacyTx( } // If a tx-like object is representing a EIP1559 transaction (type 2) -export function isEIP1559Tx( - tx: TransactionLikeType, -): tx is TransactionLikeType & { maxPriorityFeePerGas: NonNullable; maxFeePerGas: NonNullable } { +export function isEIP1559Tx(tx: TransactionLikeType): tx is TransactionLikeType & { + maxPriorityFeePerGas: NonNullable; + maxFeePerGas: NonNullable; +} { return 'maxPriorityFeePerGas' in tx && 'maxFeePerGas' in tx; } diff --git a/packages/relay/src/test/relayClient.test.ts b/packages/relay/src/test/relayClient.test.ts index e4a83c46..657eaed2 100644 --- a/packages/relay/src/test/relayClient.test.ts +++ b/packages/relay/src/test/relayClient.test.ts @@ -82,11 +82,17 @@ describe('RelayClient', () => { [policiesUpdate1, policiesUpdate1.policies as UpdateRelayerPoliciesRequest], [ policiesUpdate2, - { ...mockRelayerResponseWithPolicies.policies, ...policiesUpdate2.policies } as UpdateRelayerPoliciesRequest, + { + ...mockRelayerResponseWithPolicies.policies, + ...policiesUpdate2.policies, + } as UpdateRelayerPoliciesRequest, ], [ policiesUpdate3, - { ...mockRelayerResponseWithPolicies.policies, ...policiesUpdate3.policies } as UpdateRelayerPoliciesRequest, + { + ...mockRelayerResponseWithPolicies.policies, + ...policiesUpdate3.policies, + } as UpdateRelayerPoliciesRequest, ], ])( 'calls put with expected policy update given base policy %s', diff --git a/packages/relay/src/web3/sender.test.ts b/packages/relay/src/web3/sender.test.ts index 90220d19..dce06790 100644 --- a/packages/relay/src/web3/sender.test.ts +++ b/packages/relay/src/web3/sender.test.ts @@ -6,7 +6,9 @@ import { Relayer, RelayerTransaction } from '../relayer'; import { DefenderRelayQueryProvider } from './query'; import { DefenderRelaySenderOptions, DefenderRelaySenderProvider } from './sender'; -type DefenderRelaySenderProviderWithOptions = DefenderRelaySenderProvider & { options: DefenderRelaySenderOptions }; +type DefenderRelaySenderProviderWithOptions = DefenderRelaySenderProvider & { + options: DefenderRelaySenderOptions; +}; describe('web3/sender', () => { const relayer = mock(); diff --git a/packages/sentinel/jest.config.js b/packages/sentinel/jest.config.js index 7f882458..990bd442 100644 --- a/packages/sentinel/jest.config.js +++ b/packages/sentinel/jest.config.js @@ -1 +1 @@ -module.exports = require('../../jest.config'); \ No newline at end of file +module.exports = require('../../jest.config'); diff --git a/packages/sentinel/src/api/index.test.ts b/packages/sentinel/src/api/index.test.ts index 6c0046cd..78d56818 100644 --- a/packages/sentinel/src/api/index.test.ts +++ b/packages/sentinel/src/api/index.test.ts @@ -207,7 +207,11 @@ describe('SentinelClient', () => { txConditions: [{ expression: txCondition, status: 'any' }], functionConditions: [], }, - { eventConditions: [], txConditions: [{ expression: txCondition, status: 'any' }], functionConditions }, + { + eventConditions: [], + txConditions: [{ expression: txCondition, status: 'any' }], + functionConditions, + }, ], }, ], @@ -311,7 +315,11 @@ describe('SentinelClient', () => { txConditions: [{ expression: txCondition, status: 'any' }], functionConditions: [], }, - { eventConditions: [], txConditions: [{ expression: txCondition, status: 'any' }], functionConditions }, + { + eventConditions: [], + txConditions: [{ expression: txCondition, status: 'any' }], + functionConditions, + }, ], }, ], diff --git a/yarn.lock b/yarn.lock index 8ece9485..d3fcd5d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1610,6 +1610,13 @@ tmp "~0.2.1" tslib "^2.3.0" +"@nrwl/nx-cloud@16.0.5": + version "16.0.5" + resolved "https://registry.yarnpkg.com/@nrwl/nx-cloud/-/nx-cloud-16.0.5.tgz#c963480a71c4afa964fbbe9e4d6bbf222764e9cd" + integrity sha512-1p82ym8WE9ziejwgPslstn19iV/VkHfHfKr/5YOnfCHQS+NxUf92ogcYhHXtqWLblVZ9Zs4W4pkSXK4e04wCmQ== + dependencies: + nx-cloud "16.0.5" + "@nrwl/nx-darwin-arm64@15.9.3": version "15.9.3" resolved "https://registry.yarnpkg.com/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.9.3.tgz#a365c081637a002d0cb31b829e7b8cff1765477f" @@ -1662,6 +1669,58 @@ dependencies: nx "15.9.3" +"@nrwl/tao@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-16.1.4.tgz#695dba647e20661ff48700f8bc2d56e128584968" + integrity sha512-aArX3E7j+foUUzutsrgOc1lh9Rj5LDCAncHlszu0XGgHRO2EHE4qxZHvmgogGEpRf1ojTNAfN72xhVCSjtca/Q== + dependencies: + nx "16.1.4" + +"@nx/nx-darwin-arm64@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.1.4.tgz#4bc8db556dedd820084f0aead7c3551894e0de53" + integrity sha512-0eITl+18xLtdiAVlv+LRukCHBLSLk8L8OkMnfLoK286sIblK31p2pzr1jL68ILUWPGGbdgo+nDEaaDTwh4tYRA== + +"@nx/nx-darwin-x64@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-darwin-x64/-/nx-darwin-x64-16.1.4.tgz#d18a3e4b8f7489464ae95c884cc66cb68026bbf4" + integrity sha512-owgIq/KsCU/QBK6Y7FsblnPPI0oSccJXaISKbPcCWnkD38rtUkaR99Eh2LvoUpcnvvpL0yldkkdMBzVvDwOSZg== + +"@nx/nx-linux-arm-gnueabihf@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-16.1.4.tgz#5abe9c94ebf4ea1265cf38b0f6aea3afe93e2892" + integrity sha512-TqphSqAvQcgu83hE/XvJfGALq6EFqfRROct92whj+K5sz/AH67jnFPW+cHnXDwqIlgRB3lj/DFVqlNED8pBHfg== + +"@nx/nx-linux-arm64-gnu@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-16.1.4.tgz#47d4e6ba6f5540a4dd955af6c4cabda8285d455a" + integrity sha512-0AmO57zf5+ZrIa9XIkmRSbPF/gMqDNlMtMj8q1S+uYRU+WOAW+k1RbcFKdN0voH5eBDVQ03sqkgj9wTNS/m/vQ== + +"@nx/nx-linux-arm64-musl@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-16.1.4.tgz#67a76291b348c58aabcfd2830daffcd9277bee9c" + integrity sha512-10zAgZP+xh7HwyfDJyiyjAQD2gjvb4ZfCDAOE2Boe5yYcD27SqwAIzgrCc4DjRbUWSdufA4rclyXXp2tSb3uyA== + +"@nx/nx-linux-x64-gnu@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-16.1.4.tgz#d9703193faf2b8487072302b86f3dcba582b7e83" + integrity sha512-vVea3E6uHvrVieaOHIXKziN/vMbn9g2caiE4N7WiuAPrp2t4jbhtYqcQoNeNVjl92trQu/l2Ma3knmbn75J7jA== + +"@nx/nx-linux-x64-musl@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-16.1.4.tgz#09b79bdb28205008f615f7ecb9d848bdc30ebded" + integrity sha512-HhJPPU0rBzGeqTrylEjOu190rnMvA0HK7nghyEtTGhdCcTRs1ulfgl6swjAjXtXtGA/rXXkk0IKI7luGBcH6zg== + +"@nx/nx-win32-arm64-msvc@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-16.1.4.tgz#6da2004760fbb71cd9dfdfa4b884c97fa20dad3d" + integrity sha512-+iaU0yXkgF0Y5fvWFPP2cziDvd+QjQDnhk7/+i9Nk1C8vOaNHkMjx6qL2dNO2qoT49qMhjnI/hzL7+FBVPh11w== + +"@nx/nx-win32-x64-msvc@16.1.4": + version "16.1.4" + resolved "https://registry.yarnpkg.com/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-16.1.4.tgz#4aa82ecb3bb24aa40e18818c7d7d3764b800445c" + integrity sha512-s+H59UBB/dtdvZ+KWCe2PrVWZyoxsl6Vx+hzdUvCwI8f+cZmLRblTThLhUaBgdWLVqzFPemTkWIUasiRx/+3PQ== + "@octokit/auth-token@^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.3.tgz#ce7e48a3166731f26068d7a7a7996b5da58cbe0c" @@ -2558,6 +2617,15 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.3.tgz#8274250dada2edf53814ed7db644b9c2866c1e35" + integrity sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^0.21.2: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" @@ -3699,6 +3767,17 @@ defender-base-client@1.37.0-rc.2: lodash "^4.17.19" node-fetch "^2.6.0" +defender-base-client@^1.40.0: + version "1.43.0" + resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.43.0.tgz#0b915ea9a1ac7f9ce67c381043aa4db035f43c5c" + integrity sha512-PFQPDZ08SznSlsKiHcvf1TzvKtnd/fv2/P5s2Y8jYPIb7OtANHw94oDFOOvRpg54o8EQItIb9v7H4g4kp/7fng== + dependencies: + amazon-cognito-identity-js "^6.0.1" + async-retry "^1.3.3" + axios "^0.21.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" @@ -7546,6 +7625,11 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== +node-machine-id@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/node-machine-id/-/node-machine-id-1.1.12.tgz#37904eee1e59b320bb9c5d6c0a59f3b469cb6267" + integrity sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ== + node-notifier@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12" @@ -7845,6 +7929,22 @@ nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== +nx-cloud@16.0.5, nx-cloud@latest: + version "16.0.5" + resolved "https://registry.yarnpkg.com/nx-cloud/-/nx-cloud-16.0.5.tgz#fa0b0185d254405ec47fcbcdbbd8b12ff1add096" + integrity sha512-13P7r0aKikjBtmdZrNorwXzVPeVIV4MLEwqGY+DEG6doLBtI5KqEQk/d5B5l2dCF2BEi/LXEmLYCmf9gwbOJ+Q== + dependencies: + "@nrwl/nx-cloud" "16.0.5" + axios "1.1.3" + chalk "^4.1.0" + dotenv "~10.0.0" + fs-extra "^11.1.0" + node-machine-id "^1.1.12" + open "~8.4.0" + strip-json-comments "^3.1.1" + tar "6.1.11" + yargs-parser ">=21.1.1" + nx@15.9.3, "nx@>=15.5.2 < 16": version "15.9.3" resolved "https://registry.yarnpkg.com/nx/-/nx-15.9.3.tgz#72f4186ea41ccf0e2713ce248848a22464c8949e" @@ -7896,6 +7996,56 @@ nx@15.9.3, "nx@>=15.5.2 < 16": "@nrwl/nx-win32-arm64-msvc" "15.9.3" "@nrwl/nx-win32-x64-msvc" "15.9.3" +nx@16.1.4, nx@^16.1.4: + version "16.1.4" + resolved "https://registry.yarnpkg.com/nx/-/nx-16.1.4.tgz#cbdc4896e4cf4fd25d0ec52fab2dc3307984f329" + integrity sha512-fSkgC8wXLdW6QMaBHDXeEUJINgxBa0Vsut6Hq2SxEhtxmnx+lx++7NlhYVNZixTMRmI4a5vK0jdfPpe9hknsRA== + dependencies: + "@nrwl/tao" "16.1.4" + "@parcel/watcher" "2.0.4" + "@yarnpkg/lockfile" "^1.1.0" + "@yarnpkg/parsers" "^3.0.0-rc.18" + "@zkochan/js-yaml" "0.0.6" + axios "^1.0.0" + chalk "^4.1.0" + cli-cursor "3.1.0" + cli-spinners "2.6.1" + cliui "^7.0.2" + dotenv "~10.0.0" + enquirer "~2.3.6" + fast-glob "3.2.7" + figures "3.2.0" + flat "^5.0.2" + fs-extra "^11.1.0" + glob "7.1.4" + ignore "^5.0.4" + js-yaml "4.1.0" + jsonc-parser "3.2.0" + lines-and-columns "~2.0.3" + minimatch "3.0.5" + npm-run-path "^4.0.1" + open "^8.4.0" + semver "7.3.4" + string-width "^4.2.3" + strong-log-transformer "^2.1.0" + tar-stream "~2.2.0" + tmp "~0.2.1" + tsconfig-paths "^4.1.2" + tslib "^2.3.0" + v8-compile-cache "2.3.0" + yargs "^17.6.2" + yargs-parser "21.1.1" + optionalDependencies: + "@nx/nx-darwin-arm64" "16.1.4" + "@nx/nx-darwin-x64" "16.1.4" + "@nx/nx-linux-arm-gnueabihf" "16.1.4" + "@nx/nx-linux-arm64-gnu" "16.1.4" + "@nx/nx-linux-arm64-musl" "16.1.4" + "@nx/nx-linux-x64-gnu" "16.1.4" + "@nx/nx-linux-x64-musl" "16.1.4" + "@nx/nx-win32-arm64-msvc" "16.1.4" + "@nx/nx-win32-x64-msvc" "16.1.4" + oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -7977,7 +8127,7 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -open@^8.4.0: +open@^8.4.0, open@~8.4.0: version "8.4.2" resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ== @@ -9624,7 +9774,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@^3.0.1: +strip-json-comments@^3.0.1, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -10912,7 +11062,7 @@ yargs-parser@20.2.4: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@21.1.1, yargs-parser@^21.1.1: +yargs-parser@21.1.1, yargs-parser@>=21.1.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== From c1b13e5daa9ea5b69fe6d347e25c2ba7daec3732 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 11 May 2023 00:32:21 -0700 Subject: [PATCH 02/46] format readme & additional format fixes --- README.md | 8 +- .../verify-contract/compilation-artifact.json | 480 ++++-------------- nx.json | 7 +- packages/deploy/lerna.json | 8 +- 4 files changed, 108 insertions(+), 395 deletions(-) diff --git a/README.md b/README.md index bab10fde..97e52b40 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,13 @@ Use `lerna` for publishing a new version of all Defender Client packages (exclud The following publishes a release candidate with the npm tag `next`: -``` +```bash yarn run lerna publish v1.3.0-rc.4 --preid rc --dist-tag next --pre-dist-tag next --exact ``` And to publish the final release: -``` +```bash yarn run lerna publish --exact --force-publish ``` @@ -43,7 +43,7 @@ yarn run lerna publish --exact --force-publish Change to the `packages/deploy` directory, login to npm, and publish using the native `yarn publish` command as shown below. We are not tagging versions for the time being as they conflict with previous Defender Client releases. Note this process is being introduced for the Platform Deploy Client v0 release, but will be migrated to a new Platform Client-specific repository. -``` +```bash npm login cd packages/deploy git checkout master @@ -59,7 +59,7 @@ git push origin master The `examples` repo has sample code for both clients. Note that most examples rely on dotenv for loading API keys and secrets. Note that you can set the following environment variables to control to which instance your client will connect to, which is useful for testing against your Defender development instance: -``` +```bash # Example config # relay signer DEFENDER_RELAY_SIGNER_API_URL= diff --git a/examples/verify-contract/compilation-artifact.json b/examples/verify-contract/compilation-artifact.json index 8f332f69..23167457 100644 --- a/examples/verify-contract/compilation-artifact.json +++ b/examples/verify-contract/compilation-artifact.json @@ -23,15 +23,8 @@ }, "outputSelection": { "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers" - ], - "": [ - "ast" - ] + "*": ["abi", "evm.bytecode", "evm.deployedBytecode", "evm.methodIdentifiers"], + "": ["ast"] } } } @@ -52341,30 +52334,14 @@ "ast": { "absolutePath": "contracts/Proxiable.sol", "exportedSymbols": { - "Address": [ - 348 - ], - "ERC1967Proxy": [ - 881 - ], - "ERC1967Storage": [ - 495 - ], - "ERC1967Upgrade": [ - 739 - ], - "IBeacon": [ - 356 - ], - "Proxiable": [ - 783 - ], - "Proxy": [ - 833 - ], - "StorageSlot": [ - 54 - ] + "Address": [348], + "ERC1967Proxy": [881], + "ERC1967Storage": [495], + "ERC1967Upgrade": [739], + "IBeacon": [356], + "Proxiable": [783], + "Proxy": [833], + "StorageSlot": [54] }, "id": 882, "license": "MIT", @@ -52372,12 +52349,7 @@ "nodes": [ { "id": 1, - "literals": [ - "solidity", - "^", - "0.8", - ".0" - ], + "literals": ["solidity", "^", "0.8", ".0"], "nodeType": "PragmaDirective", "src": "33:23:0" }, @@ -52388,9 +52360,7 @@ "contractKind": "library", "fullyImplemented": true, "id": 54, - "linearizedBaseContracts": [ - 54 - ], + "linearizedBaseContracts": [54], "name": "StorageSlot", "nameLocation": "66:11:0", "nodeType": "ContractDefinition", @@ -53133,9 +53103,7 @@ }, "fullyImplemented": true, "id": 348, - "linearizedBaseContracts": [ - 348 - ], + "linearizedBaseContracts": [348], "name": "Address", "nameLocation": "835:7:0", "nodeType": "ContractDefinition", @@ -53147,9 +53115,7 @@ "src": "1485:347:0", "statements": [ { - "assignments": [ - 64 - ], + "assignments": [64], "declarations": [ { "constant": false, @@ -53520,10 +53486,7 @@ "id": 80, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "2830:7:0", "typeDescriptions": { @@ -53551,10 +53514,7 @@ "src": "2830:73:0" }, { - "assignments": [ - 92, - null - ], + "assignments": [92, null], "declarations": [ { "constant": false, @@ -53649,9 +53609,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "names": [ - "value" - ], + "names": ["value"], "nodeType": "FunctionCallOptions", "options": [ { @@ -53737,10 +53695,7 @@ "id": 100, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "3055:7:0", "typeDescriptions": { @@ -53924,10 +53879,7 @@ "id": 116, "name": "functionCall", "nodeType": "Identifier", - "overloadedDeclarations": [ - 123, - 143 - ], + "overloadedDeclarations": [123, 143], "referencedDeclaration": 143, "src": "3985:12:0", "typeDescriptions": { @@ -54156,10 +54108,7 @@ "id": 135, "name": "functionCallWithValue", "nodeType": "Identifier", - "overloadedDeclarations": [ - 163, - 213 - ], + "overloadedDeclarations": [163, 213], "referencedDeclaration": 213, "src": "4408:21:0", "typeDescriptions": { @@ -54415,10 +54364,7 @@ "id": 155, "name": "functionCallWithValue", "nodeType": "Identifier", - "overloadedDeclarations": [ - 163, - 213 - ], + "overloadedDeclarations": [163, 213], "referencedDeclaration": 213, "src": "4959:21:0", "typeDescriptions": { @@ -54730,10 +54676,7 @@ "id": 177, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "5452:7:0", "typeDescriptions": { @@ -54842,10 +54785,7 @@ "id": 188, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "5543:7:0", "typeDescriptions": { @@ -54873,10 +54813,7 @@ "src": "5543:60:0" }, { - "assignments": [ - 196, - 198 - ], + "assignments": [196, 198], "declarations": [ { "constant": false, @@ -54993,9 +54930,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "names": [ - "value" - ], + "names": ["value"], "nodeType": "FunctionCallOptions", "options": [ { @@ -55360,10 +55295,7 @@ "id": 223, "name": "functionStaticCall", "nodeType": "Identifier", - "overloadedDeclarations": [ - 230, - 265 - ], + "overloadedDeclarations": [230, 265], "referencedDeclaration": 265, "src": "6118:18:0", "typeDescriptions": { @@ -55596,10 +55528,7 @@ "id": 242, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "6520:7:0", "typeDescriptions": { @@ -55627,10 +55556,7 @@ "src": "6520:67:0" }, { - "assignments": [ - 250, - 252 - ], + "assignments": [250, 252], "declarations": [ { "constant": false, @@ -56051,10 +55977,7 @@ "id": 275, "name": "functionDelegateCall", "nodeType": "Identifier", - "overloadedDeclarations": [ - 282, - 317 - ], + "overloadedDeclarations": [282, 317], "referencedDeclaration": 317, "src": "7091:20:0", "typeDescriptions": { @@ -56287,10 +56210,7 @@ "id": 294, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "7496:7:0", "typeDescriptions": { @@ -56318,10 +56238,7 @@ "src": "7496:69:0" }, { - "assignments": [ - 302, - 304 - ], + "assignments": [302, 304], "declarations": [ { "constant": false, @@ -56790,10 +56707,7 @@ "id": 338, "name": "revert", "nodeType": "Identifier", - "overloadedDeclarations": [ - -19, - -19 - ], + "overloadedDeclarations": [-19, -19], "referencedDeclaration": -19, "src": "8458:6:0", "typeDescriptions": { @@ -57117,9 +57031,7 @@ }, "fullyImplemented": false, "id": 356, - "linearizedBaseContracts": [ - 356 - ], + "linearizedBaseContracts": [356], "name": "IBeacon", "nameLocation": "8604:7:0", "nodeType": "ContractDefinition", @@ -57203,9 +57115,7 @@ }, "fullyImplemented": true, "id": 495, - "linearizedBaseContracts": [ - 495 - ], + "linearizedBaseContracts": [495], "name": "ERC1967Storage", "nameLocation": "9017:14:0", "nodeType": "ContractDefinition", @@ -57514,10 +57424,7 @@ "id": 380, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "9756:7:0", "typeDescriptions": { @@ -58019,10 +57926,7 @@ "id": 421, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "10619:7:0", "typeDescriptions": { @@ -58215,10 +58119,7 @@ "id": 429, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "10742:7:0", "typeDescriptions": { @@ -58747,10 +58648,7 @@ "id": 474, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "11595:7:0", "typeDescriptions": { @@ -58968,9 +58866,7 @@ "src": "11923:14:0" } ], - "contractDependencies": [ - 495 - ], + "contractDependencies": [495], "contractKind": "contract", "documentation": { "id": 496, @@ -58980,10 +58876,7 @@ }, "fullyImplemented": true, "id": 739, - "linearizedBaseContracts": [ - 739, - 495 - ], + "linearizedBaseContracts": [739, 495], "name": "ERC1967Upgrade", "nameLocation": "11905:14:0", "nodeType": "ContractDefinition", @@ -59278,10 +59171,7 @@ "id": 526, "name": "_upgradeToAndCall", "nodeType": "Identifier", - "overloadedDeclarations": [ - 533, - 566 - ], + "overloadedDeclarations": [533, 566], "referencedDeclaration": 566, "src": "12753:17:0", "typeDescriptions": { @@ -59873,10 +59763,7 @@ "id": 574, "name": "_upgradeToAndCallSecure", "nodeType": "Identifier", - "overloadedDeclarations": [ - 581, - 669 - ], + "overloadedDeclarations": [581, 669], "referencedDeclaration": 669, "src": "13383:23:0", "typeDescriptions": { @@ -59999,9 +59886,7 @@ "src": "13555:1172:0", "statements": [ { - "assignments": [ - 591 - ], + "assignments": [591], "declarations": [ { "constant": false, @@ -60067,9 +59952,7 @@ "src": "13565:48:0" }, { - "assignments": [ - 599 - ], + "assignments": [599], "declarations": [ { "constant": false, @@ -60835,10 +60718,7 @@ "id": 650, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "14457:7:0", "typeDescriptions": { @@ -61152,10 +61032,7 @@ "id": 677, "name": "_upgradeBeaconToAndCall", "nodeType": "Identifier", - "overloadedDeclarations": [ - 684, - 721 - ], + "overloadedDeclarations": [684, 721], "referencedDeclaration": 721, "src": "14953:23:0", "typeDescriptions": { @@ -61976,18 +61853,11 @@ "src": "15607:14:0" } ], - "contractDependencies": [ - 495, - 739 - ], + "contractDependencies": [495, 739], "contractKind": "contract", "fullyImplemented": false, "id": 783, - "linearizedBaseContracts": [ - 783, - 739, - 495 - ], + "linearizedBaseContracts": [783, 739, 495], "name": "Proxiable", "nameLocation": "15594:9:0", "nodeType": "ContractDefinition", @@ -62141,10 +62011,7 @@ "id": 750, "name": "_upgradeToAndCallSecure", "nodeType": "Identifier", - "overloadedDeclarations": [ - 581, - 669 - ], + "overloadedDeclarations": [581, 669], "referencedDeclaration": 581, "src": "15744:23:0", "typeDescriptions": { @@ -62349,10 +62216,7 @@ "id": 770, "name": "_upgradeToAndCallSecure", "nodeType": "Identifier", - "overloadedDeclarations": [ - 581, - 669 - ], + "overloadedDeclarations": [581, 669], "referencedDeclaration": 669, "src": "15960:23:0", "typeDescriptions": { @@ -62535,9 +62399,7 @@ }, "fullyImplemented": false, "id": 833, - "linearizedBaseContracts": [ - 833 - ], + "linearizedBaseContracts": [833], "name": "Proxy", "nameLocation": "16716:5:0", "nodeType": "ContractDefinition", @@ -63305,11 +63167,7 @@ "src": "19636:14:0" } ], - "contractDependencies": [ - 495, - 739, - 833 - ], + "contractDependencies": [495, 739, 833], "contractKind": "contract", "documentation": { "id": 834, @@ -63319,12 +63177,7 @@ }, "fullyImplemented": true, "id": 881, - "linearizedBaseContracts": [ - 881, - 739, - 495, - 833 - ], + "linearizedBaseContracts": [881, 739, 495, 833], "name": "ERC1967Proxy", "nameLocation": "19613:12:0", "nodeType": "ContractDefinition", @@ -63622,10 +63475,7 @@ "id": 862, "name": "_upgradeToAndCall", "nodeType": "Identifier", - "overloadedDeclarations": [ - 533, - 566 - ], + "overloadedDeclarations": [533, 566], "referencedDeclaration": 533, "src": "20168:17:0", "typeDescriptions": { @@ -63742,9 +63592,7 @@ "visibility": "public" }, { - "baseFunctions": [ - 798 - ], + "baseFunctions": [798], "body": { "id": 879, "nodeType": "Block", @@ -63882,15 +63730,9 @@ "ast": { "absolutePath": "contracts/Vault.sol", "exportedSymbols": { - "Vault": [ - 1076 - ], - "VaultV2": [ - 1161 - ], - "VaultV3": [ - 1173 - ] + "Vault": [1076], + "VaultV2": [1161], + "VaultV3": [1173] }, "id": 1174, "license": "MIT", @@ -63898,12 +63740,7 @@ "nodes": [ { "id": 883, - "literals": [ - "solidity", - "^", - "0.8", - ".0" - ], + "literals": ["solidity", "^", "0.8", ".0"], "nodeType": "PragmaDirective", "src": "31:23:1" }, @@ -63914,9 +63751,7 @@ "contractKind": "contract", "fullyImplemented": true, "id": 1076, - "linearizedBaseContracts": [ - 1076 - ], + "linearizedBaseContracts": [1076], "name": "Vault", "nameLocation": "65:5:1", "nodeType": "ContractDefinition", @@ -64465,10 +64300,7 @@ "id": 921, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "470:7:1", "typeDescriptions": { @@ -64646,10 +64478,7 @@ "id": 940, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "618:7:1", "typeDescriptions": { @@ -65008,9 +64837,7 @@ "src": "877:177:1", "statements": [ { - "assignments": [ - 975 - ], + "assignments": [975], "declarations": [ { "constant": false, @@ -65467,9 +65294,7 @@ "src": "1093:157:1", "statements": [ { - "assignments": [ - 1011 - ], + "assignments": [1011], "declarations": [ { "constant": false, @@ -66285,16 +66110,11 @@ "src": "1518:5:1" } ], - "contractDependencies": [ - 1076 - ], + "contractDependencies": [1076], "contractKind": "contract", "fullyImplemented": true, "id": 1161, - "linearizedBaseContracts": [ - 1161, - 1076 - ], + "linearizedBaseContracts": [1161, 1076], "name": "VaultV2", "nameLocation": "1507:7:1", "nodeType": "ContractDefinition", @@ -66422,10 +66242,7 @@ "id": 1086, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "1621:7:1", "typeDescriptions": { @@ -66474,9 +66291,7 @@ "visibility": "internal" }, { - "baseFunctions": [ - 971 - ], + "baseFunctions": [971], "body": { "id": 1102, "nodeType": "Block", @@ -66633,10 +66448,7 @@ "id": 1106, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "1803:7:1", "typeDescriptions": { @@ -66825,10 +66637,7 @@ "id": 1123, "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], + "overloadedDeclarations": [-18, -18], "referencedDeclaration": -18, "src": "1925:7:1", "typeDescriptions": { @@ -66966,9 +66775,7 @@ "visibility": "public" }, { - "baseFunctions": [ - 1040 - ], + "baseFunctions": [1040], "body": { "id": 1147, "nodeType": "Block", @@ -67072,9 +66879,7 @@ "visibility": "public" }, { - "baseFunctions": [ - 1007 - ], + "baseFunctions": [1007], "body": { "id": 1159, "nodeType": "Block", @@ -67197,26 +67002,17 @@ "src": "2201:7:1" } ], - "contractDependencies": [ - 1076, - 1161 - ], + "contractDependencies": [1076, 1161], "contractKind": "contract", "fullyImplemented": true, "id": 1173, - "linearizedBaseContracts": [ - 1173, - 1161, - 1076 - ], + "linearizedBaseContracts": [1173, 1161, 1076], "name": "VaultV3", "nameLocation": "2190:7:1", "nodeType": "ContractDefinition", "nodes": [ { - "baseFunctions": [ - 1103 - ], + "baseFunctions": [1103], "body": { "id": 1171, "nodeType": "Block", @@ -67319,48 +67115,20 @@ "ast": { "absolutePath": "contracts/VaultUUPS.sol", "exportedSymbols": { - "Address": [ - 348 - ], - "ERC1967Proxy": [ - 881 - ], - "ERC1967Storage": [ - 495 - ], - "ERC1967Upgrade": [ - 739 - ], - "IBeacon": [ - 356 - ], - "Proxiable": [ - 783 - ], - "Proxy": [ - 833 - ], - "StorageSlot": [ - 54 - ], - "Vault": [ - 1076 - ], - "VaultProxiable": [ - 1191 - ], - "VaultProxiableV2": [ - 1205 - ], - "VaultProxiableV3": [ - 1219 - ], - "VaultV2": [ - 1161 - ], - "VaultV3": [ - 1173 - ] + "Address": [348], + "ERC1967Proxy": [881], + "ERC1967Storage": [495], + "ERC1967Upgrade": [739], + "IBeacon": [356], + "Proxiable": [783], + "Proxy": [833], + "StorageSlot": [54], + "Vault": [1076], + "VaultProxiable": [1191], + "VaultProxiableV2": [1205], + "VaultProxiableV3": [1219], + "VaultV2": [1161], + "VaultV3": [1173] }, "id": 1220, "license": "MIT", @@ -67368,12 +67136,7 @@ "nodes": [ { "id": 1175, - "literals": [ - "solidity", - "^", - "0.8", - ".0" - ], + "literals": ["solidity", "^", "0.8", ".0"], "nodeType": "PragmaDirective", "src": "31:23:2" }, @@ -67429,30 +67192,17 @@ "src": "139:9:2" } ], - "contractDependencies": [ - 495, - 739, - 783, - 1076 - ], + "contractDependencies": [495, 739, 783, 1076], "contractKind": "contract", "fullyImplemented": true, "id": 1191, - "linearizedBaseContracts": [ - 1191, - 783, - 739, - 495, - 1076 - ], + "linearizedBaseContracts": [1191, 783, 739, 495, 1076], "name": "VaultProxiable", "nameLocation": "114:14:2", "nodeType": "ContractDefinition", "nodes": [ { - "baseFunctions": [ - 782 - ], + "baseFunctions": [782], "body": { "id": 1189, "nodeType": "Block", @@ -67564,32 +67314,17 @@ "src": "287:9:2" } ], - "contractDependencies": [ - 495, - 739, - 783, - 1076, - 1161 - ], + "contractDependencies": [495, 739, 783, 1076, 1161], "contractKind": "contract", "fullyImplemented": true, "id": 1205, - "linearizedBaseContracts": [ - 1205, - 783, - 739, - 495, - 1161, - 1076 - ], + "linearizedBaseContracts": [1205, 783, 739, 495, 1161, 1076], "name": "VaultProxiableV2", "nameLocation": "258:16:2", "nodeType": "ContractDefinition", "nodes": [ { - "baseFunctions": [ - 782 - ], + "baseFunctions": [782], "body": { "id": 1203, "nodeType": "Block", @@ -67701,34 +67436,17 @@ "src": "435:9:2" } ], - "contractDependencies": [ - 495, - 739, - 783, - 1076, - 1161, - 1173 - ], + "contractDependencies": [495, 739, 783, 1076, 1161, 1173], "contractKind": "contract", "fullyImplemented": true, "id": 1219, - "linearizedBaseContracts": [ - 1219, - 783, - 739, - 495, - 1173, - 1161, - 1076 - ], + "linearizedBaseContracts": [1219, 783, 739, 495, 1173, 1161, 1076], "name": "VaultProxiableV3", "nameLocation": "406:16:2", "nodeType": "ContractDefinition", "nodes": [ { - "baseFunctions": [ - 782 - ], + "baseFunctions": [782], "body": { "id": 1217, "nodeType": "Block", diff --git a/nx.json b/nx.json index 5c1acafb..ce0c453c 100644 --- a/nx.json +++ b/nx.json @@ -3,12 +3,7 @@ "default": { "runner": "nx-cloud", "options": { - "cacheableOperations": [ - "build", - "compile", - "lint", - "test" - ], + "cacheableOperations": ["build", "compile", "lint", "test"], "accessToken": "N2UxN2YyYWYtZDgyYS00OTYyLTg0YjMtMTFjMzEyMWU2MWMxfHJlYWQtd3JpdGU=" } } diff --git a/packages/deploy/lerna.json b/packages/deploy/lerna.json index 639720a2..0591018e 100644 --- a/packages/deploy/lerna.json +++ b/packages/deploy/lerna.json @@ -1,5 +1,5 @@ { - "npmClient": "yarn", - "packages": ["."], - "version": "0.1.0" - } + "npmClient": "yarn", + "packages": ["."], + "version": "0.1.0" +} From ba30299bef3aac15a4dc4ab94d4e76816ea9be7e Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 11 May 2023 00:33:21 -0700 Subject: [PATCH 03/46] run styling in commit stage --- .pre-commit-config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bc6415c..90fcda8e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,8 +27,6 @@ repos: - repo: local hooks: - id: style-fixes - stages: - - push name: Run lint & format with fixes exclude: (\.md|\.sh)$ entry: yarn style From 512cfa5a8ba0d4b6013d6ee19737e985b00a3d54 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 16 May 2023 00:49:06 -0700 Subject: [PATCH 04/46] Add release github action --- .github/workflows/ci.yml | 5 +- .github/workflows/deploy.yml | 3 - .github/workflows/release.yml | 112 +++++++++++ package.json | 14 +- packages/admin/package.json | 2 +- packages/autotask-client/README.md | 14 +- packages/autotask-client/package.json | 4 +- packages/base/package.json | 2 +- packages/deploy/lerna.json | 2 +- packages/deploy/package.json | 4 +- packages/kvstore/package.json | 4 +- packages/relay/package.json | 4 +- packages/sentinel/package.json | 4 +- yarn.lock | 269 +++++++++++++------------- 14 files changed, 280 insertions(+), 163 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7aa82f35..957986ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,12 +57,13 @@ jobs: needs: build steps: - - uses: actions/checkout@v3.1.0 + - name: Checkout + uses: actions/checkout@v3.5.2 - name: Use node@16 uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 16.20 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index d9dfcea0..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,3 +0,0 @@ -# Write github action to deploy to npm using lerna for all packages in this monorepo - -name: Deploy to npm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..cf8df249 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,112 @@ +# Write github action in yaml for publishing packages from this mono repo to npm using lerna everytime there is a push to master + +name: Publish to NPM +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20 + + - name: Node modules cache + uses: actions/cache@v3 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + ~/.cache/node-gyp-cache + key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}" + restore-keys: | + ${{ runner.os }}-yarn-${{ env.cache-name }}- + env: + cache-name: v4 + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Check build + run: yarn build + + - name: Check linting + run: yarn lint:check + + test: + name: Unit Tests + runs-on: ubuntu-22.04 + needs: build + + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Node modules cache + uses: actions/cache@v3 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + ~/.cache/node-gyp-cache + key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}" + restore-keys: | + ${{ runner.os }}-yarn-${{ env.cache-name }}- + env: + cache-name: v4 + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Lint & format checks + run: yarn style + + - name: Build + run: yarn build + + - name: Run tests + run: yarn test + + # Git tag the commit for publishing + tag: + name: Tag RC candidate for all packages + runs-on: ubuntu-22.04 + needs: test + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + + - name: Update RC candidate version for deploy client + run: | + yarn versionup-deploy:preminor + + - name: Update RC candidate version ( excluding deploy client ) + id: update_version + run: | + yarn versionup:preminor + TAG_NAME=$(node -p "require('./lerna.json').version") + git add . + git commit -m "Update version to $TAG_NAME" --no-verify + echo "::set-output name=next_rc_version::$TAG_NAME" + + - name: Create Tag + run: | + git tag -s ${{ steps.update_version.outputs.next_rc_version }} + git push origin ${{ steps.update_version.outputs.next_rc_version }} diff --git a/package.json b/package.json index e75a06f4..65bdd1e1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "defender-client", "private": true, - "version": "1.3.0-rc.5", + "version": "1.44.0", "description": "Root package for the defender-client set of packages", "workspaces": [ "packages/*", @@ -20,7 +20,7 @@ "eslint-config-prettier": "^6.2.0", "eslint-plugin-prettier": "^3.1.0", "jest": "^25.2.4", - "lerna": "^6.6.1", + "lerna": "^6.6.2", "prettier": "^2.0.4", "ts-jest": "^25.3.0", "typescript": "^3.6.2", @@ -33,7 +33,15 @@ "format": "yarn format:check --write", "lint:check": "eslint 'packages/**/src/**/*.{js,ts}' --quiet", "test": "nx run-many -t test", - "style": "yarn lint && yarn format" + "style": "yarn lint && yarn format", + "versionup:preminor": "lerna version preminor --conventional-commits --conventional-prerelease --preid=rc --no-git-tag-version --yes --exact --no-changelog", + "versionup-deploy:preminor": "cd packages/deploy && lerna version preminor --conventional-commits --conventional-prerelease --preid=rc --no-git-tag-version --yes --exact --no-changelog", + "versionup:premajor": "lerna version premajor --conventional-commits --conventional-prerelease --preid=rc --no-git-tag-version --yes --exact --no-changelog", + "versionup-deploy:premajor": "cd packages/deploy && lerna version premajor --conventional-commits --conventional-prerelease --preid=rc --no-git-tag-version --yes --exact --no-changelog", + "versionup:stableminor": "lerna version minor --conventional-commits --yes --exact --no-changelog", + "versionup-deploy:stableminor": "cd packages/deploy && lerna version minor --conventional-commits --yes --exact --no-changelog", + "versionup:stablemajor": "lerna version major --conventional-commits --yes --exact --no-changelog", + "versionup-deploy:stablemajor": "cd packages/deploy && lerna version major --conventional-commits --yes --exact --no-changelog" }, "repository": { "type": "git", diff --git a/packages/admin/package.json b/packages/admin/package.json index 1b055f36..d8c9d7a2 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -1,5 +1,5 @@ { - "name": "defender-admin-client", + "name": "@openzeppelin/defender-admin-client", "version": "1.44.0", "description": "", "main": "./lib/index.js", diff --git a/packages/autotask-client/README.md b/packages/autotask-client/README.md index 3acf5983..033b15b2 100644 --- a/packages/autotask-client/README.md +++ b/packages/autotask-client/README.md @@ -7,7 +7,7 @@ This client allows you to update the code of your Autotasks programmatically, so Example usage: ```bash -$ defender-autotask update-code 19ef0257-bba4-4723-a18f-67d96726213e ./lib/my-autotask +defender-autotask update-code 19ef0257-bba4-4723-a18f-67d96726213e ./lib/my-autotask ``` ## Install @@ -39,9 +39,9 @@ Note that you can only use the client to update the code of an existing Autotask Set the environment variables `API_KEY` and `API_SECRET` to the Team API key/secret you created on Defender, and invoke the `defender-autotask` bin: ```bash -$ defender-autotask update-code $AUTOTASK_ID $PATH_TO_CODE -$ defender-autotask execute-run $AUTOTASK_ID -$ defender-autotask tail-runs $AUTOTASK_ID +defender-autotask update-code $AUTOTASK_ID $PATH_TO_CODE +defender-autotask execute-run $AUTOTASK_ID +defender-autotask tail-runs $AUTOTASK_ID ``` Beware that the `defender-autotask` CLI will automatically load environment variables from a local `.env` file if found. @@ -185,11 +185,7 @@ await client.getAutotaskRun(autotaskRunId); **How do I find the ID of my Autotask?** -You can retrieve it from the _Edit Code_ page of your Autotask, or directly from the URL. For instance, in the following URL, the ID is `19ef0257-bba4-4723-a18f-67d96726213e`. - -``` -https://defender.openzeppelin.com/#/autotask/19ef0257-bba4-4723-a18f-67d96726213e -``` +You can retrieve it from the _Edit Code_ page of your Autotask, or directly from the [URL](https://defender.openzeppelin.com/#/autotask/19ef0257-bba4-4723-a18f-67d96726213e). For instance, in the following URL, the ID is `19ef0257-bba4-4723-a18f-67d96726213e`. **Can I use this package in a browser?** diff --git a/packages/autotask-client/package.json b/packages/autotask-client/package.json index 3d093228..e3d04df8 100644 --- a/packages/autotask-client/package.json +++ b/packages/autotask-client/package.json @@ -1,5 +1,5 @@ { - "name": "defender-autotask-client", + "name": "@openzeppelin/defender-autotask-client", "version": "1.44.0", "description": "Client library for managing Defender Autotasks", "bin": { @@ -24,8 +24,8 @@ "author": "Santiago Palladino ", "license": "MIT", "dependencies": { + "@openzeppelin/defender-base-client": "1.44.0", "axios": "^0.21.2", - "defender-base-client": "1.44.0", "dotenv": "^10.0.0", "glob": "^7.1.6", "jszip": "^3.5.0", diff --git a/packages/base/package.json b/packages/base/package.json index d97f3daa..71bd5abf 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -1,5 +1,5 @@ { - "name": "defender-base-client", + "name": "@openzeppelin/defender-base-client", "version": "1.44.0", "description": "", "main": "./lib/index.js", diff --git a/packages/deploy/lerna.json b/packages/deploy/lerna.json index 0591018e..521e8810 100644 --- a/packages/deploy/lerna.json +++ b/packages/deploy/lerna.json @@ -1,5 +1,5 @@ { "npmClient": "yarn", "packages": ["."], - "version": "0.1.0" + "version": "0.6.0" } diff --git a/packages/deploy/package.json b/packages/deploy/package.json index 7c75c297..387f5e7c 100644 --- a/packages/deploy/package.json +++ b/packages/deploy/package.json @@ -1,5 +1,5 @@ { - "name": "platform-deploy-client", + "name": "@openzeppelin/platform-deploy-client", "version": "0.6.0", "description": "Client library for managing Platform Deployments", "main": "./lib/index.js", @@ -24,7 +24,7 @@ "dependencies": { "@ethersproject/abi": "^5.6.3", "axios": "^0.21.2", - "defender-base-client": "^1.44.0", + "@openzeppelin/defender-base-client": "^1.44.0", "lodash": "^4.17.19", "node-fetch": "^2.6.0" }, diff --git a/packages/kvstore/package.json b/packages/kvstore/package.json index 411ca5ce..4a9e29d8 100644 --- a/packages/kvstore/package.json +++ b/packages/kvstore/package.json @@ -1,5 +1,5 @@ { - "name": "defender-kvstore-client", + "name": "@openzeppelin/defender-kvstore-client", "version": "1.44.0", "description": "", "main": "./lib/index.js", @@ -21,8 +21,8 @@ "author": "Santiago Palladino ", "license": "MIT", "dependencies": { + "@openzeppelin/defender-base-client": "1.44.0", "axios": "^0.21.2", - "defender-base-client": "1.44.0", "fs-extra": "^10.0.0", "lodash": "^4.17.19", "node-fetch": "^2.6.0" diff --git a/packages/relay/package.json b/packages/relay/package.json index 701725a5..6d43363e 100644 --- a/packages/relay/package.json +++ b/packages/relay/package.json @@ -1,5 +1,5 @@ { - "name": "defender-relay-client", + "name": "@openzeppelin/defender-relay-client", "version": "1.44.0", "description": "", "main": "./lib/index.js", @@ -31,9 +31,9 @@ "web3-core-helpers": "^1.8.2" }, "dependencies": { + "@openzeppelin/defender-base-client": "1.44.0", "amazon-cognito-identity-js": "^6.0.1", "axios": "^0.21.2", - "defender-base-client": "1.44.0", "lodash": "^4.17.19", "node-fetch": "^2.6.0" }, diff --git a/packages/sentinel/package.json b/packages/sentinel/package.json index 7cf609bf..ef783652 100644 --- a/packages/sentinel/package.json +++ b/packages/sentinel/package.json @@ -1,5 +1,5 @@ { - "name": "defender-sentinel-client", + "name": "@openzeppelin/defender-sentinel-client", "version": "1.44.0", "description": "", "main": "./lib/index.js", @@ -22,8 +22,8 @@ "license": "MIT", "dependencies": { "@ethersproject/abi": "^5.6.3", + "@openzeppelin/defender-base-client": "1.44.0", "axios": "^0.21.2", - "defender-base-client": "1.44.0", "lodash": "^4.17.19", "node-fetch": "^2.6.0" }, diff --git a/yarn.lock b/yarn.lock index d3fcd5d3..8c834293 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1272,27 +1272,27 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@lerna/child-process@6.6.1": - version "6.6.1" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-6.6.1.tgz#e31bc411ad6d474cf7b676904da6f77f58fd64eb" - integrity sha512-yUCDCcRNNbI9UUsUB6FYEmDHpo5Tn/f0q5D7vhDP4i6Or8kBj82y7+e31hwfLvK2ykOYlDVs2MxAluH/+QUBOQ== +"@lerna/child-process@6.6.2": + version "6.6.2" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-6.6.2.tgz#5d803c8dee81a4e013dc428292e77b365cba876c" + integrity sha512-QyKIWEnKQFnYu2ey+SAAm1A5xjzJLJJj3bhIZd3QKyXKKjaJ0hlxam/OsWSltxTNbcyH1jRJjC6Cxv31usv0Ag== dependencies: chalk "^4.1.0" execa "^5.0.0" strong-log-transformer "^2.1.0" -"@lerna/create@6.6.1": - version "6.6.1" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-6.6.1.tgz#fc20f09e10b612d424a576775ad6eefe6aa96517" - integrity sha512-GDmHFhQ0mr0RcXWXrsLyfMV6ch/dZV/Ped1e6sFVQhsLL9P+FFXX1ZWxa/dQQ90VWF2qWcmK0+S/L3kUz2xvTA== +"@lerna/create@6.6.2": + version "6.6.2" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-6.6.2.tgz#39a36d80cddb355340c297ed785aa76f4498177f" + integrity sha512-xQ+1Y7D+9etvUlE+unhG/TwmM6XBzGIdFBaNoW8D8kyOa9M2Jf3vdEtAxVa7mhRz66CENfhL/+I/QkVaa7pwbQ== dependencies: - "@lerna/child-process" "6.6.1" + "@lerna/child-process" "6.6.2" dedent "^0.7.0" fs-extra "^9.1.0" init-package-json "^3.0.2" npm-package-arg "8.1.1" p-reduce "^2.1.0" - pacote "^13.6.1" + pacote "15.1.1" pify "^5.0.0" semver "^7.3.4" slash "^3.0.0" @@ -1300,10 +1300,10 @@ validate-npm-package-name "^4.0.0" yargs-parser "20.2.4" -"@lerna/legacy-package-management@6.6.1": - version "6.6.1" - resolved "https://registry.yarnpkg.com/@lerna/legacy-package-management/-/legacy-package-management-6.6.1.tgz#1f44af40098b9396a4f698514ff2b87016b1ee3d" - integrity sha512-0EYxSFr34VgeudA5rvjGJSY7s4seITMVB7AJ9LRFv9QDUk6jpvapV13ZAaKnhDTxX5vNCfnJuWHXXWq0KyPF/Q== +"@lerna/legacy-package-management@6.6.2": + version "6.6.2" + resolved "https://registry.yarnpkg.com/@lerna/legacy-package-management/-/legacy-package-management-6.6.2.tgz#411c395e72e563ab98f255df77e4068627a85bb0" + integrity sha512-0hZxUPKnHwehUO2xC4ldtdX9bW0W1UosxebDIQlZL2STnZnA2IFmIk2lJVUyFW+cmTPQzV93jfS0i69T9Z+teg== dependencies: "@npmcli/arborist" "6.2.3" "@npmcli/run-script" "4.1.7" @@ -1334,7 +1334,7 @@ inquirer "8.2.4" is-ci "2.0.0" is-stream "2.0.0" - libnpmpublish "6.0.4" + libnpmpublish "7.1.4" load-json-file "6.2.0" make-dir "3.1.0" minimatch "3.0.5" @@ -1348,7 +1348,7 @@ p-map-series "2.1.0" p-queue "6.6.2" p-waterfall "2.1.1" - pacote "13.6.2" + pacote "15.1.1" pify "5.0.0" pretty-format "29.4.3" read-cmd-shim "3.0.0" @@ -1443,21 +1443,6 @@ "@gar/promisify" "^1.1.3" semver "^7.3.5" -"@npmcli/git@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-3.0.2.tgz#5c5de6b4d70474cf2d09af149ce42e4e1dacb931" - integrity sha512-CAcd08y3DWBJqJDpfuVL0uijlq5oaXaOJEKHKc4wqrjd00gkvTZB+nFuLn+doOOKddaQS9JfqtNoFCO2LCvA3w== - dependencies: - "@npmcli/promise-spawn" "^3.0.0" - lru-cache "^7.4.4" - mkdirp "^1.0.4" - npm-pick-manifest "^7.0.0" - proc-log "^2.0.0" - promise-inflight "^1.0.1" - promise-retry "^2.0.1" - semver "^7.3.5" - which "^2.0.2" - "@npmcli/git@^4.0.0": version "4.0.4" resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-4.0.4.tgz#cdf74f21b1d440c0756fb28159d935129d9daa33" @@ -1472,14 +1457,6 @@ semver "^7.3.5" which "^3.0.0" -"@npmcli/installed-package-contents@^1.0.7": - version "1.0.7" - resolved "https://registry.yarnpkg.com/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz#ab7408c6147911b970a8abe261ce512232a3f4fa" - integrity sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw== - dependencies: - npm-bundled "^1.1.1" - npm-normalize-package-bin "^1.0.1" - "@npmcli/installed-package-contents@^2.0.0", "@npmcli/installed-package-contents@^2.0.1": version "2.0.2" resolved "https://registry.yarnpkg.com/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz#bfd817eccd9e8df200919e73f57f9e3d9e4f9e33" @@ -1570,17 +1547,6 @@ read-package-json-fast "^2.0.3" which "^2.0.2" -"@npmcli/run-script@^4.1.0": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-4.2.1.tgz#c07c5c71bc1c70a5f2a06b0d4da976641609b946" - integrity sha512-7dqywvVudPSrRCW5nTHpHgeWnbBtz8cFkOuKrecm6ih+oO9ciydhWt6OF7HlqupRRmB8Q/gECVdB9LMfToJbRg== - dependencies: - "@npmcli/node-gyp" "^2.0.0" - "@npmcli/promise-spawn" "^3.0.0" - node-gyp "^9.0.0" - read-package-json-fast "^2.0.3" - which "^2.0.2" - "@npmcli/run-script@^6.0.0": version "6.0.1" resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-6.0.1.tgz#a94404783d9afaff62decb71944435d0d8a29f8e" @@ -2992,7 +2958,7 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -cacache@^16.0.0, cacache@^16.1.0: +cacache@^16.1.0: version "16.1.3" resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.3.tgz#a02b9f34ecfaf9a78c9f4bc16fceb94d5d67a38e" integrity sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ== @@ -3170,6 +3136,11 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +ci-info@^3.6.1: + version "3.8.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" + integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== + cids@^0.7.1: version "0.7.5" resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" @@ -3756,6 +3727,30 @@ defender-admin-client@1.37.0-rc.2: lodash "^4.17.19" node-fetch "^2.6.0" +defender-admin-client@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/defender-admin-client/-/defender-admin-client-1.44.0.tgz#74a6019d064460487148952f3a5d92d432b63f8c" + integrity sha512-Uxt6Ca4/spH1KS5pCHJPc0X2TNVpXsah97mShu4E+WaV4Vhy2yaTjQ9ZpdoTBay0gADKZCBtIuVJ9YwBxiIOqA== + dependencies: + axios "^0.21.2" + defender-base-client "1.44.0" + ethers "^5.7.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + +defender-autotask-client@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/defender-autotask-client/-/defender-autotask-client-1.44.0.tgz#72842f585e611a99eb1c0b6a108069b53f26a40e" + integrity sha512-IOEju6vi3i/4blzFRFzxrk/PLzHeoCh4tltp6/8fnTenWP3A+miGIEq6US2KLkrDMOYFhEfW9R3ZDO/3L0ckCg== + dependencies: + axios "^0.21.2" + defender-base-client "1.44.0" + dotenv "^10.0.0" + glob "^7.1.6" + jszip "^3.5.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + defender-base-client@1.37.0-rc.2: version "1.37.0-rc.2" resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.37.0-rc.2.tgz#affda3621e356863eea1de363aa22f4bfed6b1b5" @@ -3767,6 +3762,17 @@ defender-base-client@1.37.0-rc.2: lodash "^4.17.19" node-fetch "^2.6.0" +defender-base-client@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.44.0.tgz#afe724447c0f9177b999b70b9f14dd70d61d5a7a" + integrity sha512-8ZgGA93+FlxNwG9LN1nu/Au5AyCKwAWJGNf0VLiPmh4GX/Nali/7kv72K+OtZgGxTLtKDKfgN4cnhEZwfrc8dg== + dependencies: + amazon-cognito-identity-js "^6.0.1" + async-retry "^1.3.3" + axios "^0.21.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + defender-base-client@^1.40.0: version "1.43.0" resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.43.0.tgz#0b915ea9a1ac7f9ce67c381043aa4db035f43c5c" @@ -3778,6 +3784,28 @@ defender-base-client@^1.40.0: lodash "^4.17.19" node-fetch "^2.6.0" +defender-relay-client@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/defender-relay-client/-/defender-relay-client-1.44.0.tgz#8272a5fe734f34136a15be62f958cbfabe4c724f" + integrity sha512-9ohzq8wt7xm2ieoSPsCC/RvidxKOCDjEZH7aFn8R/WWfK5ehJMlDGE0daugfffoOL2eL2zqwQLVxtzNN2OSBDA== + dependencies: + amazon-cognito-identity-js "^6.0.1" + axios "^0.21.2" + defender-base-client "1.44.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + +defender-sentinel-client@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/defender-sentinel-client/-/defender-sentinel-client-1.44.0.tgz#3e2caa608980b5489ee26dee77a247fbb3eb4978" + integrity sha512-s9EPqWQCySw6Mo8i0IMsks0SbBZ/crf3xAw3mwl/1CDs4cyP0Vjc80TreyPhQpL2z3RpVNiqlzcb5gYLDj025g== + dependencies: + "@ethersproject/abi" "^5.6.3" + axios "^0.21.2" + defender-base-client "1.44.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" @@ -6796,14 +6824,14 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -lerna@^6.6.1: - version "6.6.1" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-6.6.1.tgz#4897171aed64e244a2d0f9000eef5c5b228f9332" - integrity sha512-WJtrvmbmR+6hMB9b5pvsxJzew0lRL6hARgW/My9BM4vYaxwPIA2I0riv3qQu5Zd7lYse7FEqJkTnl9Kn1bXhLA== +lerna@^6.6.2: + version "6.6.2" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-6.6.2.tgz#ad921f913aca4e7307123a598768b6f15ca5804f" + integrity sha512-W4qrGhcdutkRdHEaDf9eqp7u4JvI+1TwFy5woX6OI8WPe4PYBdxuILAsvhp614fUG41rKSGDKlOh+AWzdSidTg== dependencies: - "@lerna/child-process" "6.6.1" - "@lerna/create" "6.6.1" - "@lerna/legacy-package-management" "6.6.1" + "@lerna/child-process" "6.6.2" + "@lerna/create" "6.6.2" + "@lerna/legacy-package-management" "6.6.2" "@npmcli/arborist" "6.2.3" "@npmcli/run-script" "4.1.7" "@nrwl/devkit" ">=15.5.2 < 16" @@ -6837,8 +6865,8 @@ lerna@^6.6.1: is-ci "2.0.0" is-stream "2.0.0" js-yaml "^4.1.0" - libnpmaccess "6.0.3" - libnpmpublish "6.0.4" + libnpmaccess "^6.0.3" + libnpmpublish "7.1.4" load-json-file "6.2.0" make-dir "3.1.0" minimatch "3.0.5" @@ -6855,7 +6883,7 @@ lerna@^6.6.1: p-queue "6.6.2" p-reduce "2.1.0" p-waterfall "2.1.1" - pacote "13.6.2" + pacote "15.1.1" pify "5.0.0" read-cmd-shim "3.0.0" read-package-json "5.0.1" @@ -6891,26 +6919,29 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libnpmaccess@6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-6.0.3.tgz#473cc3e4aadb2bc713419d92e45d23b070d8cded" - integrity sha512-4tkfUZprwvih2VUZYMozL7EMKgQ5q9VW2NtRyxWtQWlkLTAWHRklcAvBN49CVqEkhUw7vTX2fNgB5LzgUucgYg== +libnpmaccess@^6.0.3: + version "6.0.4" + resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-6.0.4.tgz#2dd158bd8a071817e2207d3b201d37cf1ad6ae6b" + integrity sha512-qZ3wcfIyUoW0+qSFkMBovcTrSGJ3ZeyvpR7d5N9pEYv/kXs8sHP2wiqEIXBKLFrZlmM0kR0RJD7mtfLngtlLag== dependencies: aproba "^2.0.0" minipass "^3.1.1" npm-package-arg "^9.0.1" npm-registry-fetch "^13.0.0" -libnpmpublish@6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-6.0.4.tgz#adb41ec6b0c307d6f603746a4d929dcefb8f1a0b" - integrity sha512-lvAEYW8mB8QblL6Q/PI/wMzKNvIrF7Kpujf/4fGS/32a2i3jzUXi04TNyIBcK6dQJ34IgywfaKGh+Jq4HYPFmg== +libnpmpublish@7.1.4: + version "7.1.4" + resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-7.1.4.tgz#a0d138e00e52a0c71ffc82273acf0082fc2dfb36" + integrity sha512-mMntrhVwut5prP4rJ228eEbEyvIzLWhqFuY90j5QeXBCTT2pWSMno7Yo2S2qplPUr02zPurGH4heGLZ+wORczg== dependencies: - normalize-package-data "^4.0.0" - npm-package-arg "^9.0.1" - npm-registry-fetch "^13.0.0" + ci-info "^3.6.1" + normalize-package-data "^5.0.0" + npm-package-arg "^10.1.0" + npm-registry-fetch "^14.0.3" + proc-log "^3.0.0" semver "^7.3.7" - ssri "^9.0.0" + sigstore "^1.4.0" + ssri "^10.0.1" lie@~3.3.0: version "3.3.0" @@ -7717,20 +7748,13 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== -npm-bundled@^1.1.1, npm-bundled@^1.1.2: +npm-bundled@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" integrity sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ== dependencies: npm-normalize-package-bin "^1.0.1" -npm-bundled@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-2.0.1.tgz#94113f7eb342cd7a67de1e789f896b04d2c600f4" - integrity sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw== - dependencies: - npm-normalize-package-bin "^2.0.0" - npm-bundled@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-3.0.0.tgz#7e8e2f8bb26b794265028491be60321a25a39db7" @@ -7738,13 +7762,6 @@ npm-bundled@^3.0.0: dependencies: npm-normalize-package-bin "^3.0.0" -npm-install-checks@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-5.0.0.tgz#5ff27d209a4e3542b8ac6b0c1db6063506248234" - integrity sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA== - dependencies: - semver "^7.1.1" - npm-install-checks@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-6.1.1.tgz#b459b621634d06546664207fde16810815808db1" @@ -7786,7 +7803,7 @@ npm-package-arg@^10.0.0, npm-package-arg@^10.1.0: semver "^7.3.5" validate-npm-package-name "^5.0.0" -npm-package-arg@^9.0.0, npm-package-arg@^9.0.1: +npm-package-arg@^9.0.1: version "9.1.2" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-9.1.2.tgz#fc8acecb00235f42270dda446f36926ddd9ac2bc" integrity sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg== @@ -7806,16 +7823,6 @@ npm-packlist@5.1.1: npm-bundled "^1.1.2" npm-normalize-package-bin "^1.0.1" -npm-packlist@^5.1.0: - version "5.1.3" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-5.1.3.tgz#69d253e6fd664b9058b85005905012e00e69274b" - integrity sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg== - dependencies: - glob "^8.0.1" - ignore-walk "^5.0.1" - npm-bundled "^2.0.0" - npm-normalize-package-bin "^2.0.0" - npm-packlist@^7.0.0: version "7.0.4" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-7.0.4.tgz#033bf74110eb74daf2910dc75144411999c5ff32" @@ -7823,16 +7830,6 @@ npm-packlist@^7.0.0: dependencies: ignore-walk "^6.0.0" -npm-pick-manifest@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz#1d372b4e7ea7c6712316c0e99388a73ed3496e84" - integrity sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw== - dependencies: - npm-install-checks "^5.0.0" - npm-normalize-package-bin "^2.0.0" - npm-package-arg "^9.0.0" - semver "^7.3.5" - npm-pick-manifest@^8.0.0, npm-pick-manifest@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-8.0.1.tgz#c6acd97d1ad4c5dbb80eac7b386b03ffeb289e5f" @@ -7856,7 +7853,7 @@ npm-registry-fetch@14.0.3: npm-package-arg "^10.0.0" proc-log "^3.0.0" -npm-registry-fetch@^13.0.0, npm-registry-fetch@^13.0.1: +npm-registry-fetch@^13.0.0: version "13.3.1" resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-13.3.1.tgz#bb078b5fa6c52774116ae501ba1af2a33166af7e" integrity sha512-eukJPi++DKRTjSBRcDZSDDsGqRK3ehbxfFUcgaRd0Yp6kRwOwh2WVn0r+8rMB4nnuzvAk6rQVzl6K5CkYOmnvw== @@ -8289,31 +8286,28 @@ p-waterfall@2.1.1: dependencies: p-reduce "^2.0.0" -pacote@13.6.2, pacote@^13.6.1: - version "13.6.2" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.6.2.tgz#0d444ba3618ab3e5cd330b451c22967bbd0ca48a" - integrity sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg== +pacote@15.1.1: + version "15.1.1" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-15.1.1.tgz#94d8c6e0605e04d427610b3aacb0357073978348" + integrity sha512-eeqEe77QrA6auZxNHIp+1TzHQ0HBKf5V6c8zcaYZ134EJe1lCi+fjXATkNiEEfbG+e50nu02GLvUtmZcGOYabQ== dependencies: - "@npmcli/git" "^3.0.0" - "@npmcli/installed-package-contents" "^1.0.7" - "@npmcli/promise-spawn" "^3.0.0" - "@npmcli/run-script" "^4.1.0" - cacache "^16.0.0" - chownr "^2.0.0" - fs-minipass "^2.1.0" - infer-owner "^1.0.4" - minipass "^3.1.6" - mkdirp "^1.0.4" - npm-package-arg "^9.0.0" - npm-packlist "^5.1.0" - npm-pick-manifest "^7.0.0" - npm-registry-fetch "^13.0.1" - proc-log "^2.0.0" + "@npmcli/git" "^4.0.0" + "@npmcli/installed-package-contents" "^2.0.1" + "@npmcli/promise-spawn" "^6.0.1" + "@npmcli/run-script" "^6.0.0" + cacache "^17.0.0" + fs-minipass "^3.0.0" + minipass "^4.0.0" + npm-package-arg "^10.0.0" + npm-packlist "^7.0.0" + npm-pick-manifest "^8.0.0" + npm-registry-fetch "^14.0.0" + proc-log "^3.0.0" promise-retry "^2.0.1" - read-package-json "^5.0.0" - read-package-json-fast "^2.0.3" - rimraf "^3.0.2" - ssri "^9.0.0" + read-package-json "^6.0.0" + read-package-json-fast "^3.0.0" + sigstore "^1.0.0" + ssri "^10.0.0" tar "^6.1.11" pacote@^15.0.0, pacote@^15.0.8: @@ -9417,6 +9411,15 @@ signal-exit@^4.0.1: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.1.tgz#96a61033896120ec9335d96851d902cc98f0ba2a" integrity sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw== +sigstore@^1.0.0, sigstore@^1.4.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-1.5.1.tgz#92b9e371a37d1f53d3baa991a2c63b89bbe3cee5" + integrity sha512-FIPThk7S1oeFXn8O8yh7gpyiQb6lYXzMIlOBzXhId/f81VvU587xNCHc4jd2lZ9724UkKUYYTuKSYcjhDSRD/Q== + dependencies: + "@sigstore/protobuf-specs" "^0.1.0" + make-fetch-happen "^11.0.1" + tuf-js "^1.1.3" + sigstore@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-1.4.0.tgz#2e3a28c08b1b8246744c27cfb179c525c3f164d8" From ab3092d8e2e9e4eb81f106d55c2e920810ed3692 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Wed, 17 May 2023 18:13:35 -0700 Subject: [PATCH 05/46] Add tagging capabilities --- .github/workflows/ci.yml | 4 +-- .github/workflows/{release.yml => tag.yml} | 39 +++++++++++++++++++--- 2 files changed, 36 insertions(+), 7 deletions(-) rename .github/workflows/{release.yml => tag.yml} (67%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 957986ea..22a6ea9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,12 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v3.5.2 - name: Use node@16 uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 16.20 - name: Node modules cache uses: actions/cache@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/tag.yml similarity index 67% rename from .github/workflows/release.yml rename to .github/workflows/tag.yml index cf8df249..e63d9338 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/tag.yml @@ -1,18 +1,21 @@ # Write github action in yaml for publishing packages from this mono repo to npm using lerna everytime there is a push to master -name: Publish to NPM +name: Create Git Tag with RC on: push: branches: - - master + - improve-ci-cd + +permissions: + contents: write # for checkout and tag + pull-requests: write # for comments + jobs: build: runs-on: ubuntu-22.04 steps: - name: Checkout Repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 + uses: actions/checkout@v3.5.2 - name: Use node@16 uses: actions/setup-node@v3 @@ -93,6 +96,31 @@ jobs: - name: Checkout uses: actions/checkout@v3.5.2 + - name: Git Identity + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + + - name: Tag Check + id: tag_check + run: | + CURRENT_VERSION=$(node -p 'require("./lerna.json").version') + GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}" + http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \ + -H "Authorization: token ${GITHUB_TOKEN}") + if [ "$http_status_code" -ne "404" ] ; then + echo "::set-output name=exists_tag::true" + else + echo "::set-output name=exists_tag::false" + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + - name: Update RC candidate version for deploy client run: | yarn versionup-deploy:preminor @@ -107,6 +135,7 @@ jobs: echo "::set-output name=next_rc_version::$TAG_NAME" - name: Create Tag + if: steps.tag_check.outputs.exists_tag == 'false' run: | git tag -s ${{ steps.update_version.outputs.next_rc_version }} git push origin ${{ steps.update_version.outputs.next_rc_version }} From 215661361c0b86c4f0f5d48b50ada6f89c014768 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Wed, 17 May 2023 18:19:40 -0700 Subject: [PATCH 06/46] Fix node version --- .github/workflows/ci.yml | 4 ++-- .github/workflows/tag.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22a6ea9f..46dca3e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Use node@16 uses: actions/setup-node@v3 with: - node-version: 16.20 + node-version: 16.20.0 - name: Node modules cache uses: actions/cache@v3 @@ -63,7 +63,7 @@ jobs: - name: Use node@16 uses: actions/setup-node@v3 with: - node-version: 16.20 + node-version: 16.20.0 - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index e63d9338..92ee92f2 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -1,6 +1,6 @@ # Write github action in yaml for publishing packages from this mono repo to npm using lerna everytime there is a push to master -name: Create Git Tag with RC +name: Tag on: push: branches: @@ -20,7 +20,7 @@ jobs: - name: Use node@16 uses: actions/setup-node@v3 with: - node-version: 16.20 + node-version: 16.20.0 - name: Node modules cache uses: actions/cache@v3 @@ -56,7 +56,7 @@ jobs: - name: Use node@16 uses: actions/setup-node@v3 with: - node-version: 16.20 + node-version: 16.20.0 - name: Get yarn cache directory path id: yarn-cache-dir-path From 2f3b65638ef8be81dfe047197f012bd536db70e2 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Wed, 17 May 2023 19:47:51 -0700 Subject: [PATCH 07/46] Exclude fixtures from pre-commit EOF to fix failed tests --- .pre-commit-config.yaml | 1 + examples/batch-proposal/package.json | 2 +- examples/simulate-proposal/package.json | 2 +- .../autotask-client/fixtures/valid/data.json | 2 +- .../fixtures/valid/subfolder/nested.json | 2 +- packages/autotask-client/src/zip.test.ts | 2 + packages/deploy/package.json | 2 +- packages/relay/src/ethers/signer.ts | 2 + packages/sentinel/package.json | 2 +- yarn.lock | 52 +------------------ 10 files changed, 13 insertions(+), 56 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90fcda8e..9d5cb808 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,6 +24,7 @@ repos: files: \.yaml$ - id: trailing-whitespace - id: end-of-file-fixer + exclude: fixtures/.* - repo: local hooks: - id: style-fixes diff --git a/examples/batch-proposal/package.json b/examples/batch-proposal/package.json index bc9ae92c..6f68aec6 100644 --- a/examples/batch-proposal/package.json +++ b/examples/batch-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "1.37.0-rc.2", + "defender-admin-client": "^1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/simulate-proposal/package.json b/examples/simulate-proposal/package.json index fad31c89..6b28612a 100644 --- a/examples/simulate-proposal/package.json +++ b/examples/simulate-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "1.37.0-rc.2", + "defender-admin-client": "^1.44.0", "dotenv": "^8.2.0", "ethers": "^5.7.2" } diff --git a/packages/autotask-client/fixtures/valid/data.json b/packages/autotask-client/fixtures/valid/data.json index 00dfcb7f..abee32e0 100644 --- a/packages/autotask-client/fixtures/valid/data.json +++ b/packages/autotask-client/fixtures/valid/data.json @@ -1 +1 @@ -{ "value": 42 } +{ "value": 42 } \ No newline at end of file diff --git a/packages/autotask-client/fixtures/valid/subfolder/nested.json b/packages/autotask-client/fixtures/valid/subfolder/nested.json index 6bf6923b..21b4688e 100644 --- a/packages/autotask-client/fixtures/valid/subfolder/nested.json +++ b/packages/autotask-client/fixtures/valid/subfolder/nested.json @@ -1 +1 @@ -{ "nested": true } +{ "nested": true } \ No newline at end of file diff --git a/packages/autotask-client/src/zip.test.ts b/packages/autotask-client/src/zip.test.ts index 7af80cb6..bae5f225 100644 --- a/packages/autotask-client/src/zip.test.ts +++ b/packages/autotask-client/src/zip.test.ts @@ -1,6 +1,7 @@ import JSZip from 'jszip'; import { zipFolder, zipSources } from './zip'; import { resolve } from 'path'; +import os from 'os'; describe('zip', () => { describe('zipSources', () => { @@ -35,6 +36,7 @@ async function expectZip(zipContent: string) { const zip = new JSZip(); await zip.loadAsync(Buffer.from(zipContent, 'base64')); expect(Object.keys(zip.files).sort()).toEqual(['data.json', 'index.js', 'subfolder/', 'subfolder/nested.json']); + console.log(await zip.file('index.js')?.async('text')); expect(await zip.file('index.js')?.async('text')).toEqual('exports.handler = () => {};'); expect(await zip.file('data.json')?.async('text')).toEqual('{ "value": 42 }'); expect(await zip.file('subfolder/nested.json')?.async('text')).toEqual('{ "nested": true }'); diff --git a/packages/deploy/package.json b/packages/deploy/package.json index 387f5e7c..6a414bdc 100644 --- a/packages/deploy/package.json +++ b/packages/deploy/package.json @@ -24,7 +24,7 @@ "dependencies": { "@ethersproject/abi": "^5.6.3", "axios": "^0.21.2", - "@openzeppelin/defender-base-client": "^1.44.0", + "defender-base-client": "^1.44.0", "lodash": "^4.17.19", "node-fetch": "^2.6.0" }, diff --git a/packages/relay/src/ethers/signer.ts b/packages/relay/src/ethers/signer.ts index f90f363c..2b5cb2e7 100644 --- a/packages/relay/src/ethers/signer.ts +++ b/packages/relay/src/ethers/signer.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { toUtf8Bytes } from '@ethersproject/strings'; import { Provider, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider'; import { Signer, TypedDataDomain, TypedDataField, TypedDataSigner } from '@ethersproject/abstract-signer'; diff --git a/packages/sentinel/package.json b/packages/sentinel/package.json index ef783652..bb8067c3 100644 --- a/packages/sentinel/package.json +++ b/packages/sentinel/package.json @@ -22,7 +22,7 @@ "license": "MIT", "dependencies": { "@ethersproject/abi": "^5.6.3", - "@openzeppelin/defender-base-client": "1.44.0", + "defender-base-client": "1.44.0", "axios": "^0.21.2", "lodash": "^4.17.19", "node-fetch": "^2.6.0" diff --git a/yarn.lock b/yarn.lock index 8c834293..e986ca24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2331,17 +2331,6 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -amazon-cognito-identity-js@^4.3.3: - version "4.6.3" - resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-4.6.3.tgz#889410379a5fc5e883edc95f4ce233cc628e354c" - integrity sha512-MPVJfirbdmSGo7l4h7Kbn3ms1eJXT5Xq8ly+mCPPi8yAxaxdg7ouMUUNTqtDykoZxIdDLF/P6F3Zbg3dlGKOWg== - dependencies: - buffer "4.9.2" - crypto-js "^4.0.0" - fast-base64-decode "^1.0.0" - isomorphic-unfetch "^3.0.0" - js-cookie "^2.2.1" - amazon-cognito-identity-js@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-6.0.1.tgz#d0de66a6cbed41413b202066f7b2acbb35c00de8" @@ -3583,11 +3572,6 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-js@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" - integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== - crypto-random-string@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" @@ -3717,17 +3701,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -defender-admin-client@1.37.0-rc.2: - version "1.37.0-rc.2" - resolved "https://registry.yarnpkg.com/defender-admin-client/-/defender-admin-client-1.37.0-rc.2.tgz#77af078c7a48f534f54a4ebc749d9ed0f3050c2f" - integrity sha512-zQr0FxPKGqV/+zcszUJNzhoQRGZ8RxN3vcUYW+U75WCbPz9wGBJuD1F6HdS7bJ+SGI+HzMYzCjw3gsoyTq7Jag== - dependencies: - axios "^0.21.2" - defender-base-client "1.37.0-rc.2" - lodash "^4.17.19" - node-fetch "^2.6.0" - -defender-admin-client@1.44.0: +defender-admin-client@1.44.0, defender-admin-client@^1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/defender-admin-client/-/defender-admin-client-1.44.0.tgz#74a6019d064460487148952f3a5d92d432b63f8c" integrity sha512-Uxt6Ca4/spH1KS5pCHJPc0X2TNVpXsah97mShu4E+WaV4Vhy2yaTjQ9ZpdoTBay0gADKZCBtIuVJ9YwBxiIOqA== @@ -3751,18 +3725,7 @@ defender-autotask-client@1.44.0: lodash "^4.17.19" node-fetch "^2.6.0" -defender-base-client@1.37.0-rc.2: - version "1.37.0-rc.2" - resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.37.0-rc.2.tgz#affda3621e356863eea1de363aa22f4bfed6b1b5" - integrity sha512-bArjGlLR7yl5Y2lPY3QsGWyNP9MMMC/evV9+yEt5jzd+ge+QFsVJIsNUtVroVjfXoCUMgCdsyy9oXZCzcOPyUA== - dependencies: - amazon-cognito-identity-js "^4.3.3" - async-retry "^1.3.3" - axios "^0.21.2" - lodash "^4.17.19" - node-fetch "^2.6.0" - -defender-base-client@1.44.0: +defender-base-client@1.44.0, defender-base-client@^1.40.0, defender-base-client@^1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.44.0.tgz#afe724447c0f9177b999b70b9f14dd70d61d5a7a" integrity sha512-8ZgGA93+FlxNwG9LN1nu/Au5AyCKwAWJGNf0VLiPmh4GX/Nali/7kv72K+OtZgGxTLtKDKfgN4cnhEZwfrc8dg== @@ -3773,17 +3736,6 @@ defender-base-client@1.44.0: lodash "^4.17.19" node-fetch "^2.6.0" -defender-base-client@^1.40.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.43.0.tgz#0b915ea9a1ac7f9ce67c381043aa4db035f43c5c" - integrity sha512-PFQPDZ08SznSlsKiHcvf1TzvKtnd/fv2/P5s2Y8jYPIb7OtANHw94oDFOOvRpg54o8EQItIb9v7H4g4kp/7fng== - dependencies: - amazon-cognito-identity-js "^6.0.1" - async-retry "^1.3.3" - axios "^0.21.2" - lodash "^4.17.19" - node-fetch "^2.6.0" - defender-relay-client@1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/defender-relay-client/-/defender-relay-client-1.44.0.tgz#8272a5fe734f34136a15be62f958cbfabe4c724f" From 8a59ea7cd8022a8a8363820fd69c5efcd2da8a11 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Wed, 17 May 2023 19:48:44 -0700 Subject: [PATCH 08/46] Exclude fixtures from pre-commit EOF to fix failed tests --- .prettierignore | 1 + packages/autotask-client/fixtures/invalid/notindex.js | 2 +- packages/autotask-client/fixtures/valid/index.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.prettierignore b/.prettierignore index cdb0a19b..51d177f0 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,7 @@ # Ignore relevant files in fixtures, sometimes they are intentionally malformed packages/**/fixtures/**/*.json packages/**/fixtures/**/*.md +packages/**/fixtures/**/*.js # Ignore all YAML file *.yaml diff --git a/packages/autotask-client/fixtures/invalid/notindex.js b/packages/autotask-client/fixtures/invalid/notindex.js index 1a3f30d4..e031d352 100644 --- a/packages/autotask-client/fixtures/invalid/notindex.js +++ b/packages/autotask-client/fixtures/invalid/notindex.js @@ -1 +1 @@ -exports.handler = () => {}; +exports.handler = () => {}; \ No newline at end of file diff --git a/packages/autotask-client/fixtures/valid/index.js b/packages/autotask-client/fixtures/valid/index.js index 1a3f30d4..e031d352 100644 --- a/packages/autotask-client/fixtures/valid/index.js +++ b/packages/autotask-client/fixtures/valid/index.js @@ -1 +1 @@ -exports.handler = () => {}; +exports.handler = () => {}; \ No newline at end of file From 22221f1d17df40bbf16d077a71eecc2aea74a36c Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Wed, 17 May 2023 21:34:36 -0700 Subject: [PATCH 09/46] Fix tests using resolutions --- examples/action-proposal/package.json | 2 +- examples/batch-proposal/package.json | 2 +- examples/create-autotask/package.json | 2 +- examples/create-relayer-key/package-lock.json | 6 +- examples/create-relayer-key/package.json | 2 +- examples/create-relayer/package-lock.json | 6 +- examples/create-relayer/package.json | 2 +- examples/create-secret/package.json | 2 +- examples/create-sentinel/package-lock.json | 6 +- examples/create-sentinel/package.json | 2 +- examples/ethers-signer/package.json | 4 +- examples/keeper-network/package.json | 4 +- examples/pause-proposal/package.json | 2 +- examples/relayer-actions/package.json | 2 +- examples/relayer-autotasks/package.json | 2 +- examples/simulate-proposal/package.json | 2 +- examples/unpause-proposal/package.json | 2 +- examples/update-autotask/package.json | 2 +- .../update-notification-category/package.json | 2 +- examples/update-relayer/package.json | 2 +- examples/update-sentinel/package.json | 2 +- examples/upgrade-proposal/package.json | 2 +- examples/verify-contract/package.json | 2 +- examples/web3-provider/package.json | 2 +- package.json | 5 +- packages/admin/package.json | 2 +- packages/autotask-utils/package.json | 2 +- packages/deploy/package.json | 2 +- packages/sentinel/package.json | 2 +- yarn.lock | 477 +++++------------- 30 files changed, 174 insertions(+), 380 deletions(-) diff --git a/examples/action-proposal/package.json b/examples/action-proposal/package.json index 472aaed5..8a6a60f8 100644 --- a/examples/action-proposal/package.json +++ b/examples/action-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "1.44.0", + "@openzeppelin/defender-admin-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/batch-proposal/package.json b/examples/batch-proposal/package.json index 6f68aec6..c0ff726d 100644 --- a/examples/batch-proposal/package.json +++ b/examples/batch-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "^1.44.0", + "@openzeppelin/defender-admin-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/create-autotask/package.json b/examples/create-autotask/package.json index 060a2182..89dfed29 100644 --- a/examples/create-autotask/package.json +++ b/examples/create-autotask/package.json @@ -9,7 +9,7 @@ "run": "node index.js" }, "dependencies": { - "defender-autotask-client": "1.44.0", + "@openzeppelin/defender-autotask-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/create-relayer-key/package-lock.json b/examples/create-relayer-key/package-lock.json index 4237d19f..4c523c1b 100644 --- a/examples/create-relayer-key/package-lock.json +++ b/examples/create-relayer-key/package-lock.json @@ -44,7 +44,7 @@ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, - "defender-base-client": { + "@openzeppelin/defender-base-client": { "version": "1.21.3", "resolved": "https://registry.npmjs.org/defender-base-client/-/defender-base-client-1.21.3.tgz", "integrity": "sha512-q16VhYZOfV4RjtFQkV/8DIGsSmVyco8W6Osv3oA88XxoUIW9gzR0MG1Yd+bOCLclNyHOP6rz54B0t+sjRV3guw==", @@ -55,14 +55,14 @@ "node-fetch": "^2.6.0" } }, - "defender-relay-client": { + "@openzeppelin/defender-relay-client": { "version": "1.21.3", "resolved": "https://registry.npmjs.org/defender-relay-client/-/defender-relay-client-1.21.3.tgz", "integrity": "sha512-8appJETkh+va7bIO8iEXf4wTT1jjVFoP19Q81SAvjkwjhFXY/neu2Uhu4XhqlYO7NDUIBuaQhIKRV4QSc8kOig==", "requires": { "amazon-cognito-identity-js": "^4.3.3", "axios": "^0.21.2", - "defender-base-client": "1.21.3", + "@openzeppelin/defender-base-client": "1.21.3", "lodash": "^4.17.19", "node-fetch": "^2.6.0" } diff --git a/examples/create-relayer-key/package.json b/examples/create-relayer-key/package.json index e20ae8f8..8e0d96b2 100644 --- a/examples/create-relayer-key/package.json +++ b/examples/create-relayer-key/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/create-relayer/package-lock.json b/examples/create-relayer/package-lock.json index 56002605..881b08b3 100644 --- a/examples/create-relayer/package-lock.json +++ b/examples/create-relayer/package-lock.json @@ -44,7 +44,7 @@ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, - "defender-base-client": { + "@openzeppelin/defender-base-client": { "version": "1.21.3", "resolved": "https://registry.npmjs.org/defender-base-client/-/defender-base-client-1.21.3.tgz", "integrity": "sha512-q16VhYZOfV4RjtFQkV/8DIGsSmVyco8W6Osv3oA88XxoUIW9gzR0MG1Yd+bOCLclNyHOP6rz54B0t+sjRV3guw==", @@ -55,14 +55,14 @@ "node-fetch": "^2.6.0" } }, - "defender-relay-client": { + "@openzeppelin/defender-relay-client": { "version": "1.21.3", "resolved": "https://registry.npmjs.org/defender-relay-client/-/defender-relay-client-1.21.3.tgz", "integrity": "sha512-8appJETkh+va7bIO8iEXf4wTT1jjVFoP19Q81SAvjkwjhFXY/neu2Uhu4XhqlYO7NDUIBuaQhIKRV4QSc8kOig==", "requires": { "amazon-cognito-identity-js": "^4.3.3", "axios": "^0.21.2", - "defender-base-client": "1.21.3", + "@openzeppelin/defender-base-client": "1.21.3", "lodash": "^4.17.19", "node-fetch": "^2.6.0" } diff --git a/examples/create-relayer/package.json b/examples/create-relayer/package.json index cb8be7e3..43b73255 100644 --- a/examples/create-relayer/package.json +++ b/examples/create-relayer/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/create-secret/package.json b/examples/create-secret/package.json index 85b35b2a..3b4d2c7d 100644 --- a/examples/create-secret/package.json +++ b/examples/create-secret/package.json @@ -9,7 +9,7 @@ "run": "node index.js" }, "dependencies": { - "defender-autotask-client": "1.44.0", + "@openzeppelin/defender-autotask-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/create-sentinel/package-lock.json b/examples/create-sentinel/package-lock.json index 801d5319..57ea7704 100644 --- a/examples/create-sentinel/package-lock.json +++ b/examples/create-sentinel/package-lock.json @@ -247,7 +247,7 @@ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, - "defender-base-client": { + "@openzeppelin/defender-base-client": { "version": "1.21.3", "resolved": "https://registry.npmjs.org/defender-base-client/-/defender-base-client-1.21.3.tgz", "integrity": "sha512-q16VhYZOfV4RjtFQkV/8DIGsSmVyco8W6Osv3oA88XxoUIW9gzR0MG1Yd+bOCLclNyHOP6rz54B0t+sjRV3guw==", @@ -258,14 +258,14 @@ "node-fetch": "^2.6.0" } }, - "defender-sentinel-client": { + "@openzeppelin/defender-sentinel-client": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/defender-sentinel-client/-/defender-sentinel-client-1.22.0.tgz", "integrity": "sha512-K/Sj7yekkZ5MYJ1h8KsMSxnxXn/5PuyQPyhIVzIzfJUpmFxdiaA7cjjvzF3sC1bMigWMxn/tjy/7D9e6McIFIg==", "requires": { "@ethersproject/abi": "^5.5.0", "axios": "^0.21.2", - "defender-base-client": "1.21.3", + "@openzeppelin/defender-base-client": "1.21.3", "lodash": "^4.17.19", "node-fetch": "^2.6.0" } diff --git a/examples/create-sentinel/package.json b/examples/create-sentinel/package.json index 0747a196..7a256810 100644 --- a/examples/create-sentinel/package.json +++ b/examples/create-sentinel/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-sentinel-client": "1.44.0", + "@openzeppelin/defender-sentinel-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/ethers-signer/package.json b/examples/ethers-signer/package.json index 6d29ed8b..acf1d25b 100644 --- a/examples/ethers-signer/package.json +++ b/examples/ethers-signer/package.json @@ -6,8 +6,8 @@ "author": "Santiago Palladino ", "license": "MIT", "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0", - "ethers": "^5.0.7" + "ethers": "^5.7.2" } } diff --git a/examples/keeper-network/package.json b/examples/keeper-network/package.json index cc3d9ba3..ee265305 100644 --- a/examples/keeper-network/package.json +++ b/examples/keeper-network/package.json @@ -5,8 +5,8 @@ "private": true, "license": "MIT", "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0", - "ethers": "^5.0.19" + "ethers": "^5.7.2" } } diff --git a/examples/pause-proposal/package.json b/examples/pause-proposal/package.json index 735901b6..28802597 100644 --- a/examples/pause-proposal/package.json +++ b/examples/pause-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "1.44.0", + "@openzeppelin/defender-admin-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/relayer-actions/package.json b/examples/relayer-actions/package.json index afd70488..c5d99cc4 100644 --- a/examples/relayer-actions/package.json +++ b/examples/relayer-actions/package.json @@ -6,7 +6,7 @@ "license": "MIT", "private": true, "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/relayer-autotasks/package.json b/examples/relayer-autotasks/package.json index 0b4e7c7f..ead8023c 100644 --- a/examples/relayer-autotasks/package.json +++ b/examples/relayer-autotasks/package.json @@ -5,7 +5,7 @@ "private": true, "license": "MIT", "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/simulate-proposal/package.json b/examples/simulate-proposal/package.json index 6b28612a..a2026ae4 100644 --- a/examples/simulate-proposal/package.json +++ b/examples/simulate-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "^1.44.0", + "@openzeppelin/defender-admin-client": "^1.44.0", "dotenv": "^8.2.0", "ethers": "^5.7.2" } diff --git a/examples/unpause-proposal/package.json b/examples/unpause-proposal/package.json index 59d1ebd6..fdfb6f1c 100644 --- a/examples/unpause-proposal/package.json +++ b/examples/unpause-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "1.44.0", + "@openzeppelin/defender-admin-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/update-autotask/package.json b/examples/update-autotask/package.json index cfab22d3..6fea736b 100644 --- a/examples/update-autotask/package.json +++ b/examples/update-autotask/package.json @@ -9,7 +9,7 @@ "update-code": "node update-code.js" }, "dependencies": { - "defender-autotask-client": "1.44.0", + "@openzeppelin/defender-autotask-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/update-notification-category/package.json b/examples/update-notification-category/package.json index caf54082..e2b5866b 100644 --- a/examples/update-notification-category/package.json +++ b/examples/update-notification-category/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-sentinel-client": "1.44.0", + "@openzeppelin/defender-sentinel-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/update-relayer/package.json b/examples/update-relayer/package.json index 5c7899d4..3466385c 100644 --- a/examples/update-relayer/package.json +++ b/examples/update-relayer/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/update-sentinel/package.json b/examples/update-sentinel/package.json index 650fa84e..0f0739bc 100644 --- a/examples/update-sentinel/package.json +++ b/examples/update-sentinel/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-sentinel-client": "1.44.0", + "@openzeppelin/defender-sentinel-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/upgrade-proposal/package.json b/examples/upgrade-proposal/package.json index 9c10cc60..7e2902b6 100644 --- a/examples/upgrade-proposal/package.json +++ b/examples/upgrade-proposal/package.json @@ -9,7 +9,7 @@ "start": "node index.js" }, "dependencies": { - "defender-admin-client": "1.44.0", + "@openzeppelin/defender-admin-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/verify-contract/package.json b/examples/verify-contract/package.json index 17bb67b4..4bdf0959 100644 --- a/examples/verify-contract/package.json +++ b/examples/verify-contract/package.json @@ -10,7 +10,7 @@ "author": "Martin Verzilli ", "license": "MIT", "dependencies": { - "defender-admin-client": "1.44.0", + "@openzeppelin/defender-admin-client": "1.44.0", "dotenv": "^8.2.0" } } diff --git a/examples/web3-provider/package.json b/examples/web3-provider/package.json index 138a3748..dff6f1ec 100644 --- a/examples/web3-provider/package.json +++ b/examples/web3-provider/package.json @@ -6,7 +6,7 @@ "author": "Santiago Palladino ", "license": "MIT", "dependencies": { - "defender-relay-client": "1.44.0", + "@openzeppelin/defender-relay-client": "1.44.0", "dotenv": "^8.2.0", "web3": "^1.8.2" } diff --git a/package.json b/package.json index 65bdd1e1..6549fcd4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "defender-client", + "name": "@openzeppelin/defender-client", "private": true, "version": "1.44.0", "description": "Root package for the defender-client set of packages", @@ -55,5 +55,8 @@ "homepage": "https://github.com/OpenZeppelin/defender-client#readme", "dependencies": { "nx": "^16.1.4" + }, + "resolutions": { + "@ethersproject/abstract-provider": "^5.6.1" } } diff --git a/packages/admin/package.json b/packages/admin/package.json index d8c9d7a2..d600097a 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -22,7 +22,7 @@ "license": "MIT", "dependencies": { "axios": "^0.21.2", - "defender-base-client": "1.44.0", + "@openzeppelin/defender-base-client": "1.44.0", "ethers": "^5.7.2", "lodash": "^4.17.19", "node-fetch": "^2.6.0" diff --git a/packages/autotask-utils/package.json b/packages/autotask-utils/package.json index 4793430c..cbb0a8b3 100644 --- a/packages/autotask-utils/package.json +++ b/packages/autotask-utils/package.json @@ -1,5 +1,5 @@ { - "name": "defender-autotask-utils", + "name": "@openzeppelin/defender-autotask-utils", "version": "1.44.0", "description": "Utils library for writing Defender Autotasks", "main": "./lib/index.js", diff --git a/packages/deploy/package.json b/packages/deploy/package.json index 6a414bdc..387f5e7c 100644 --- a/packages/deploy/package.json +++ b/packages/deploy/package.json @@ -24,7 +24,7 @@ "dependencies": { "@ethersproject/abi": "^5.6.3", "axios": "^0.21.2", - "defender-base-client": "^1.44.0", + "@openzeppelin/defender-base-client": "^1.44.0", "lodash": "^4.17.19", "node-fetch": "^2.6.0" }, diff --git a/packages/sentinel/package.json b/packages/sentinel/package.json index bb8067c3..ef783652 100644 --- a/packages/sentinel/package.json +++ b/packages/sentinel/package.json @@ -22,7 +22,7 @@ "license": "MIT", "dependencies": { "@ethersproject/abi": "^5.6.3", - "defender-base-client": "1.44.0", + "@openzeppelin/defender-base-client": "1.44.0", "axios": "^0.21.2", "lodash": "^4.17.19", "node-fetch": "^2.6.0" diff --git a/yarn.lock b/yarn.lock index e986ca24..0849ad12 100644 --- a/yarn.lock +++ b/yarn.lock @@ -334,21 +334,6 @@ "@ethereumjs/common" "^2.5.0" ethereumjs-util "^7.1.2" -"@ethersproject/abi@5.6.3", "@ethersproject/abi@^5.6.3": - version "5.6.3" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.3.tgz#2d643544abadf6e6b63150508af43475985c23db" - integrity sha512-CxKTdoZY4zDJLWXG6HzNH6znWK0M79WzzxHegDoecE3+K32pzfHOzuXg2/oGSTecZynFgpkjYXNPOqXVJlqClw== - dependencies: - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/hash" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.1" - "@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" @@ -364,7 +349,22 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/abstract-provider@5.6.1", "@ethersproject/abstract-provider@^5.6.1": +"@ethersproject/abi@^5.6.3": + version "5.6.3" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.3.tgz#2d643544abadf6e6b63150508af43475985c23db" + integrity sha512-CxKTdoZY4zDJLWXG6HzNH6znWK0M79WzzxHegDoecE3+K32pzfHOzuXg2/oGSTecZynFgpkjYXNPOqXVJlqClw== + dependencies: + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.6.1", "@ethersproject/abstract-provider@^5.7.0": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz#02ddce150785caf0c77fe036a0ebfcee61878c59" integrity sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ== @@ -377,20 +377,18 @@ "@ethersproject/transactions" "^5.6.2" "@ethersproject/web" "^5.6.1" -"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" - integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== dependencies: + "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/bignumber" "^5.7.0" "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" -"@ethersproject/abstract-signer@5.6.2", "@ethersproject/abstract-signer@^5.6.2": +"@ethersproject/abstract-signer@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz#491f07fc2cbd5da258f46ec539664713950b0b33" integrity sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ== @@ -401,18 +399,18 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" - integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== dependencies: - "@ethersproject/abstract-provider" "^5.7.0" "@ethersproject/bignumber" "^5.7.0" "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" -"@ethersproject/address@5.6.1", "@ethersproject/address@^5.6.1": +"@ethersproject/address@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.1.tgz#ab57818d9aefee919c5721d28cd31fd95eff413d" integrity sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q== @@ -423,24 +421,6 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/rlp" "^5.6.1" -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" - integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - -"@ethersproject/base64@5.6.1", "@ethersproject/base64@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.1.tgz#2c40d8a0310c9d1606c2c37ae3092634b41d87cb" - integrity sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw== - dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" @@ -448,13 +428,12 @@ dependencies: "@ethersproject/bytes" "^5.7.0" -"@ethersproject/basex@5.6.1", "@ethersproject/basex@^5.6.1": +"@ethersproject/base64@^5.6.1": version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.1.tgz#badbb2f1d4a6f52ce41c9064f01eab19cc4c5305" - integrity sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA== + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.1.tgz#2c40d8a0310c9d1606c2c37ae3092634b41d87cb" + integrity sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw== dependencies: "@ethersproject/bytes" "^5.6.1" - "@ethersproject/properties" "^5.6.0" "@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": version "5.7.0" @@ -464,14 +443,13 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/bignumber@5.6.2", "@ethersproject/bignumber@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" - integrity sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw== +"@ethersproject/basex@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.1.tgz#badbb2f1d4a6f52ce41c9064f01eab19cc4c5305" + integrity sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA== dependencies: "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - bn.js "^5.2.1" + "@ethersproject/properties" "^5.6.0" "@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": version "5.7.0" @@ -482,12 +460,14 @@ "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" -"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" - integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== +"@ethersproject/bignumber@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" + integrity sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw== dependencies: + "@ethersproject/bytes" "^5.6.1" "@ethersproject/logger" "^5.6.0" + bn.js "^5.2.1" "@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": version "5.7.0" @@ -496,12 +476,12 @@ dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/constants@5.6.1", "@ethersproject/constants@^5.6.1": +"@ethersproject/bytes@^5.6.1": version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370" - integrity sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg== + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" + integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== dependencies: - "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/logger" "^5.6.0" "@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": version "5.7.0" @@ -510,21 +490,12 @@ dependencies: "@ethersproject/bignumber" "^5.7.0" -"@ethersproject/contracts@5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.2.tgz#20b52e69ebc1b74274ff8e3d4e508de971c287bc" - integrity sha512-hguUA57BIKi6WY0kHvZp6PwPlWF87MCeB4B7Z7AbUpTxfFXFdn/3b0GmjZPagIHS+3yhcBJDnuEfU4Xz+Ks/8g== +"@ethersproject/constants@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370" + integrity sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg== dependencies: - "@ethersproject/abi" "^5.6.3" - "@ethersproject/abstract-provider" "^5.6.1" - "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/address" "^5.6.1" "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/transactions" "^5.6.2" "@ethersproject/contracts@5.7.0": version "5.7.0" @@ -542,20 +513,6 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/transactions" "^5.7.0" -"@ethersproject/hash@5.6.1", "@ethersproject/hash@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" - integrity sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA== - dependencies: - "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.1" - "@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" @@ -571,23 +528,19 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/hdnode@5.6.2", "@ethersproject/hdnode@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.2.tgz#26f3c83a3e8f1b7985c15d1db50dc2903418b2d2" - integrity sha512-tERxW8Ccf9CxW2db3WsN01Qao3wFeRsfYY9TCuhmG0xNpl2IO8wgXU3HtWIZ49gUWPggRy4Yg5axU0ACaEKf1Q== +"@ethersproject/hash@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" + integrity sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA== dependencies: "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/basex" "^5.6.1" + "@ethersproject/address" "^5.6.1" "@ethersproject/bignumber" "^5.6.2" "@ethersproject/bytes" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" "@ethersproject/logger" "^5.6.0" - "@ethersproject/pbkdf2" "^5.6.1" "@ethersproject/properties" "^5.6.0" - "@ethersproject/sha2" "^5.6.1" - "@ethersproject/signing-key" "^5.6.2" "@ethersproject/strings" "^5.6.1" - "@ethersproject/transactions" "^5.6.2" - "@ethersproject/wordlists" "^5.6.1" "@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": version "5.7.0" @@ -607,25 +560,6 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/wordlists" "^5.7.0" -"@ethersproject/json-wallets@5.6.1", "@ethersproject/json-wallets@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz#3f06ba555c9c0d7da46756a12ac53483fe18dd91" - integrity sha512-KfyJ6Zwz3kGeX25nLihPwZYlDqamO6pfGKNnVMWWfEVVp42lTfCZVXXy5Ie8IZTN0HKwAngpIPi7gk4IJzgmqQ== - dependencies: - "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/address" "^5.6.1" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/hdnode" "^5.6.2" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/pbkdf2" "^5.6.1" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/random" "^5.6.1" - "@ethersproject/strings" "^5.6.1" - "@ethersproject/transactions" "^5.6.2" - aes-js "3.0.0" - scrypt-js "3.0.1" - "@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" @@ -645,14 +579,6 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.6.1", "@ethersproject/keccak256@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.1.tgz#b867167c9b50ba1b1a92bccdd4f2d6bd168a91cc" - integrity sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA== - dependencies: - "@ethersproject/bytes" "^5.6.1" - js-sha3 "0.8.0" - "@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" @@ -661,22 +587,23 @@ "@ethersproject/bytes" "^5.7.0" js-sha3 "0.8.0" -"@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" - integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== +"@ethersproject/keccak256@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.1.tgz#b867167c9b50ba1b1a92bccdd4f2d6bd168a91cc" + integrity sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA== + dependencies: + "@ethersproject/bytes" "^5.6.1" + js-sha3 "0.8.0" "@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== -"@ethersproject/networks@5.6.3", "@ethersproject/networks@^5.6.3": - version "5.6.3" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.3.tgz#3ee3ab08f315b433b50c99702eb32e0cf31f899f" - integrity sha512-QZxRH7cA5Ut9TbXwZFiCyuPchdWi87ZtVNHWZd0R6YFgYtes2jQ3+bsslJ0WdyDe0i6QumqtoYqvY3rrQFRZOQ== - dependencies: - "@ethersproject/logger" "^5.6.0" +"@ethersproject/logger@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" + integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== "@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": version "5.7.1" @@ -685,13 +612,12 @@ dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/pbkdf2@5.6.1", "@ethersproject/pbkdf2@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz#f462fe320b22c0d6b1d72a9920a3963b09eb82d1" - integrity sha512-k4gRQ+D93zDRPNUfmduNKq065uadC2YjMP/CqwwX5qG6R05f47boq6pLZtV/RnC4NZAYOPH1Cyo54q0c9sshRQ== +"@ethersproject/networks@^5.6.3": + version "5.6.3" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.3.tgz#3ee3ab08f315b433b50c99702eb32e0cf31f899f" + integrity sha512-QZxRH7cA5Ut9TbXwZFiCyuPchdWi87ZtVNHWZd0R6YFgYtes2jQ3+bsslJ0WdyDe0i6QumqtoYqvY3rrQFRZOQ== dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/sha2" "^5.6.1" + "@ethersproject/logger" "^5.6.0" "@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": version "5.7.0" @@ -701,13 +627,6 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/sha2" "^5.7.0" -"@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" - integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== - dependencies: - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" @@ -715,31 +634,12 @@ dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/providers@5.6.8", "@ethersproject/providers@^5.6.8": - version "5.6.8" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.8.tgz#22e6c57be215ba5545d3a46cf759d265bb4e879d" - integrity sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w== +"@ethersproject/properties@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" + integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== dependencies: - "@ethersproject/abstract-provider" "^5.6.1" - "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/address" "^5.6.1" - "@ethersproject/base64" "^5.6.1" - "@ethersproject/basex" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/hash" "^5.6.1" "@ethersproject/logger" "^5.6.0" - "@ethersproject/networks" "^5.6.3" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/random" "^5.6.1" - "@ethersproject/rlp" "^5.6.1" - "@ethersproject/sha2" "^5.6.1" - "@ethersproject/strings" "^5.6.1" - "@ethersproject/transactions" "^5.6.2" - "@ethersproject/web" "^5.6.1" - bech32 "1.1.4" - ws "7.4.6" "@ethersproject/providers@5.7.2": version "5.7.2" @@ -767,13 +667,31 @@ bech32 "1.1.4" ws "7.4.6" -"@ethersproject/random@5.6.1", "@ethersproject/random@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.1.tgz#66915943981bcd3e11bbd43733f5c3ba5a790255" - integrity sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA== +"@ethersproject/providers@^5.6.8": + version "5.6.8" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.8.tgz#22e6c57be215ba5545d3a46cf759d265bb4e879d" + integrity sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w== dependencies: + "@ethersproject/abstract-provider" "^5.6.1" + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/address" "^5.6.1" + "@ethersproject/base64" "^5.6.1" + "@ethersproject/basex" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/hash" "^5.6.1" "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks" "^5.6.3" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.1" + "@ethersproject/rlp" "^5.6.1" + "@ethersproject/sha2" "^5.6.1" + "@ethersproject/strings" "^5.6.1" + "@ethersproject/transactions" "^5.6.2" + "@ethersproject/web" "^5.6.1" + bech32 "1.1.4" + ws "7.4.6" "@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": version "5.7.0" @@ -783,10 +701,10 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/rlp@5.6.1", "@ethersproject/rlp@^5.6.1": +"@ethersproject/random@^5.6.1": version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.1.tgz#df8311e6f9f24dcb03d59a2bac457a28a4fe2bd8" - integrity sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ== + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.1.tgz#66915943981bcd3e11bbd43733f5c3ba5a790255" + integrity sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA== dependencies: "@ethersproject/bytes" "^5.6.1" "@ethersproject/logger" "^5.6.0" @@ -799,14 +717,13 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/sha2@5.6.1", "@ethersproject/sha2@^5.6.1": +"@ethersproject/rlp@^5.6.1": version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.1.tgz#211f14d3f5da5301c8972a8827770b6fd3e51656" - integrity sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g== + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.1.tgz#df8311e6f9f24dcb03d59a2bac457a28a4fe2bd8" + integrity sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ== dependencies: "@ethersproject/bytes" "^5.6.1" "@ethersproject/logger" "^5.6.0" - hash.js "1.1.7" "@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": version "5.7.0" @@ -817,16 +734,13 @@ "@ethersproject/logger" "^5.7.0" hash.js "1.1.7" -"@ethersproject/signing-key@5.6.2", "@ethersproject/signing-key@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.2.tgz#8a51b111e4d62e5a62aee1da1e088d12de0614a3" - integrity sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ== +"@ethersproject/sha2@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.1.tgz#211f14d3f5da5301c8972a8827770b6fd3e51656" + integrity sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g== dependencies: "@ethersproject/bytes" "^5.6.1" "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - bn.js "^5.2.1" - elliptic "6.5.4" hash.js "1.1.7" "@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": @@ -841,17 +755,17 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/solidity@5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.6.1.tgz#5845e71182c66d32e6ec5eefd041fca091a473e2" - integrity sha512-KWqVLkUUoLBfL1iwdzUVlkNqAUIFMpbbeH0rgCfKmJp0vFtY4AsaN91gHKo9ZZLkC4UOm3cI3BmMV4N53BOq4g== +"@ethersproject/signing-key@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.2.tgz#8a51b111e4d62e5a62aee1da1e088d12de0614a3" + integrity sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ== dependencies: - "@ethersproject/bignumber" "^5.6.2" "@ethersproject/bytes" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" "@ethersproject/logger" "^5.6.0" - "@ethersproject/sha2" "^5.6.1" - "@ethersproject/strings" "^5.6.1" + "@ethersproject/properties" "^5.6.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" "@ethersproject/solidity@5.7.0": version "5.7.0" @@ -865,15 +779,6 @@ "@ethersproject/sha2" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/strings@5.6.1", "@ethersproject/strings@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.1.tgz#dbc1b7f901db822b5cafd4ebf01ca93c373f8952" - integrity sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw== - dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" @@ -883,20 +788,14 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/transactions@5.6.2", "@ethersproject/transactions@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.2.tgz#793a774c01ced9fe7073985bb95a4b4e57a6370b" - integrity sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q== +"@ethersproject/strings@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.1.tgz#dbc1b7f901db822b5cafd4ebf01ca93c373f8952" + integrity sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw== dependencies: - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" "@ethersproject/bytes" "^5.6.1" "@ethersproject/constants" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/rlp" "^5.6.1" - "@ethersproject/signing-key" "^5.6.2" "@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": version "5.7.0" @@ -913,14 +812,20 @@ "@ethersproject/rlp" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" -"@ethersproject/units@5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.6.1.tgz#ecc590d16d37c8f9ef4e89e2005bda7ddc6a4e6f" - integrity sha512-rEfSEvMQ7obcx3KWD5EWWx77gqv54K6BKiZzKxkQJqtpriVsICrktIQmKl8ReNToPeIYPnFHpXvKpi068YFZXw== +"@ethersproject/transactions@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.2.tgz#793a774c01ced9fe7073985bb95a4b4e57a6370b" + integrity sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q== dependencies: + "@ethersproject/address" "^5.6.1" "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" "@ethersproject/constants" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/rlp" "^5.6.1" + "@ethersproject/signing-key" "^5.6.2" "@ethersproject/units@5.7.0": version "5.7.0" @@ -931,27 +836,6 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/wallet@5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.2.tgz#cd61429d1e934681e413f4bc847a5f2f87e3a03c" - integrity sha512-lrgh0FDQPuOnHcF80Q3gHYsSUODp6aJLAdDmDV0xKCN/T7D99ta1jGVhulg3PY8wiXEngD0DfM0I2XKXlrqJfg== - dependencies: - "@ethersproject/abstract-provider" "^5.6.1" - "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/hash" "^5.6.1" - "@ethersproject/hdnode" "^5.6.2" - "@ethersproject/json-wallets" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/random" "^5.6.1" - "@ethersproject/signing-key" "^5.6.2" - "@ethersproject/transactions" "^5.6.2" - "@ethersproject/wordlists" "^5.6.1" - "@ethersproject/wallet@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" @@ -973,17 +857,6 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/wordlists" "^5.7.0" -"@ethersproject/web@5.6.1", "@ethersproject/web@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.1.tgz#6e2bd3ebadd033e6fe57d072db2b69ad2c9bdf5d" - integrity sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA== - dependencies: - "@ethersproject/base64" "^5.6.1" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.1" - "@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" @@ -995,13 +868,13 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/wordlists@5.6.1", "@ethersproject/wordlists@^5.6.1": +"@ethersproject/web@^5.6.1": version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.6.1.tgz#1e78e2740a8a21e9e99947e47979d72e130aeda1" - integrity sha512-wiPRgBpNbNwCQFoCr8bcWO8o5I810cqO6mkdtKfLKFlLxeCWcnzDi4Alu8iyNzlhYuS9npCwivMbRWF19dyblw== + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.1.tgz#6e2bd3ebadd033e6fe57d072db2b69ad2c9bdf5d" + integrity sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA== dependencies: + "@ethersproject/base64" "^5.6.1" "@ethersproject/bytes" "^5.6.1" - "@ethersproject/hash" "^5.6.1" "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" @@ -3701,31 +3574,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -defender-admin-client@1.44.0, defender-admin-client@^1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/defender-admin-client/-/defender-admin-client-1.44.0.tgz#74a6019d064460487148952f3a5d92d432b63f8c" - integrity sha512-Uxt6Ca4/spH1KS5pCHJPc0X2TNVpXsah97mShu4E+WaV4Vhy2yaTjQ9ZpdoTBay0gADKZCBtIuVJ9YwBxiIOqA== - dependencies: - axios "^0.21.2" - defender-base-client "1.44.0" - ethers "^5.7.2" - lodash "^4.17.19" - node-fetch "^2.6.0" - -defender-autotask-client@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/defender-autotask-client/-/defender-autotask-client-1.44.0.tgz#72842f585e611a99eb1c0b6a108069b53f26a40e" - integrity sha512-IOEju6vi3i/4blzFRFzxrk/PLzHeoCh4tltp6/8fnTenWP3A+miGIEq6US2KLkrDMOYFhEfW9R3ZDO/3L0ckCg== - dependencies: - axios "^0.21.2" - defender-base-client "1.44.0" - dotenv "^10.0.0" - glob "^7.1.6" - jszip "^3.5.0" - lodash "^4.17.19" - node-fetch "^2.6.0" - -defender-base-client@1.44.0, defender-base-client@^1.40.0, defender-base-client@^1.44.0: +defender-base-client@^1.40.0: version "1.44.0" resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.44.0.tgz#afe724447c0f9177b999b70b9f14dd70d61d5a7a" integrity sha512-8ZgGA93+FlxNwG9LN1nu/Au5AyCKwAWJGNf0VLiPmh4GX/Nali/7kv72K+OtZgGxTLtKDKfgN4cnhEZwfrc8dg== @@ -3736,28 +3585,6 @@ defender-base-client@1.44.0, defender-base-client@^1.40.0, defender-base-client@ lodash "^4.17.19" node-fetch "^2.6.0" -defender-relay-client@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/defender-relay-client/-/defender-relay-client-1.44.0.tgz#8272a5fe734f34136a15be62f958cbfabe4c724f" - integrity sha512-9ohzq8wt7xm2ieoSPsCC/RvidxKOCDjEZH7aFn8R/WWfK5ehJMlDGE0daugfffoOL2eL2zqwQLVxtzNN2OSBDA== - dependencies: - amazon-cognito-identity-js "^6.0.1" - axios "^0.21.2" - defender-base-client "1.44.0" - lodash "^4.17.19" - node-fetch "^2.6.0" - -defender-sentinel-client@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/defender-sentinel-client/-/defender-sentinel-client-1.44.0.tgz#3e2caa608980b5489ee26dee77a247fbb3eb4978" - integrity sha512-s9EPqWQCySw6Mo8i0IMsks0SbBZ/crf3xAw3mwl/1CDs4cyP0Vjc80TreyPhQpL2z3RpVNiqlzcb5gYLDj025g== - dependencies: - "@ethersproject/abi" "^5.6.3" - axios "^0.21.2" - defender-base-client "1.44.0" - lodash "^4.17.19" - node-fetch "^2.6.0" - defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" @@ -4309,42 +4136,6 @@ ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.2, ethereum ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@^5.0.19, ethers@^5.0.7: - version "5.6.8" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.8.tgz#d36b816b4896341a80a8bbd2a44e8cb6e9b98dd4" - integrity sha512-YxIGaltAOdvBFPZwIkyHnXbW40f1r8mHUgapW6dxkO+6t7H6wY8POUn0Kbxrd/N7I4hHxyi7YCddMAH/wmho2w== - dependencies: - "@ethersproject/abi" "5.6.3" - "@ethersproject/abstract-provider" "5.6.1" - "@ethersproject/abstract-signer" "5.6.2" - "@ethersproject/address" "5.6.1" - "@ethersproject/base64" "5.6.1" - "@ethersproject/basex" "5.6.1" - "@ethersproject/bignumber" "5.6.2" - "@ethersproject/bytes" "5.6.1" - "@ethersproject/constants" "5.6.1" - "@ethersproject/contracts" "5.6.2" - "@ethersproject/hash" "5.6.1" - "@ethersproject/hdnode" "5.6.2" - "@ethersproject/json-wallets" "5.6.1" - "@ethersproject/keccak256" "5.6.1" - "@ethersproject/logger" "5.6.0" - "@ethersproject/networks" "5.6.3" - "@ethersproject/pbkdf2" "5.6.1" - "@ethersproject/properties" "5.6.0" - "@ethersproject/providers" "5.6.8" - "@ethersproject/random" "5.6.1" - "@ethersproject/rlp" "5.6.1" - "@ethersproject/sha2" "5.6.1" - "@ethersproject/signing-key" "5.6.2" - "@ethersproject/solidity" "5.6.1" - "@ethersproject/strings" "5.6.1" - "@ethersproject/transactions" "5.6.2" - "@ethersproject/units" "5.6.1" - "@ethersproject/wallet" "5.6.2" - "@ethersproject/web" "5.6.1" - "@ethersproject/wordlists" "5.6.1" - ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" From 2dc17bc3ad5c788173b9f06b1e5b0d60a91f6dad Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 00:14:00 -0700 Subject: [PATCH 10/46] Create RC github action --- .github/workflows/{tag.yml => rc.yml} | 29 +++++++++++++------- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 9 deletions(-) rename .github/workflows/{tag.yml => rc.yml} (87%) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/tag.yml b/.github/workflows/rc.yml similarity index 87% rename from .github/workflows/tag.yml rename to .github/workflows/rc.yml index 92ee92f2..f121828b 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/rc.yml @@ -1,6 +1,6 @@ # Write github action in yaml for publishing packages from this mono repo to npm using lerna everytime there is a push to master -name: Tag +name: Tag & Release on: push: branches: @@ -92,6 +92,8 @@ jobs: name: Tag RC candidate for all packages runs-on: ubuntu-22.04 needs: test + outputs: + next_rc_version: ${{ steps.update_version.outputs.next_rc_version }} steps: - name: Checkout uses: actions/checkout@v3.5.2 @@ -105,6 +107,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ github.repository }} + - name: Update RC candidate version for deploy client + run: | + yarn versionup-deploy:preminor + - name: Tag Check id: tag_check run: | @@ -113,18 +119,14 @@ jobs: http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \ -H "Authorization: token ${GITHUB_TOKEN}") if [ "$http_status_code" -ne "404" ] ; then - echo "::set-output name=exists_tag::true" + echo "tag_exists=true" >> $GITHUB_OUTPUT else - echo "::set-output name=exists_tag::false" + echo "tag_exists=false" >> $GITHUB_OUTPUT fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ github.repository }} - - name: Update RC candidate version for deploy client - run: | - yarn versionup-deploy:preminor - - name: Update RC candidate version ( excluding deploy client ) id: update_version run: | @@ -132,10 +134,19 @@ jobs: TAG_NAME=$(node -p "require('./lerna.json').version") git add . git commit -m "Update version to $TAG_NAME" --no-verify - echo "::set-output name=next_rc_version::$TAG_NAME" + echo "next_rc_version=$TAG_NAME" >> $GITHUB_OUTPUT - name: Create Tag - if: steps.tag_check.outputs.exists_tag == 'false' + if: steps.tag_check.outputs.tag_exists == 'false' run: | git tag -s ${{ steps.update_version.outputs.next_rc_version }} git push origin ${{ steps.update_version.outputs.next_rc_version }} + + release: + name: Create Release + runs-on: ubuntu-22.04 + needs: tag + uses: ./.github/workflows/release.yml + with: + tag: ${{ needs.tag.outputs.next_rc_version }} + prerelease: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d3e0d905 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + workflow_dispatch: + inputs: + tag: + required: true + description: Tag to trigger release + type: string + prerelease: + required: true + description: Whether to release as a prerelease + type: boolean + workflow_call: + inputs: + tag: + type: string + required: true + prerelease: + type: boolean + required: true + +jobs: + release: + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - name: Checkout Repo + uses: actions/checkout@v3.5.2 + - name: Create release + uses: ncipollo/release-action@v1 + with: + tag: ${{ inputs.tag }} + skipIfReleaseExists: true + generateReleaseNotes: true + draft: ${{ github.event.inputs.prerelease }} + prerelease: ${{ inputs.prerelease }} From 1ef36d1d18080dd741885a67795de60391ac474c Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 00:32:37 -0700 Subject: [PATCH 11/46] Fix syntax --- .github/workflows/rc.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index f121828b..ba433c3f 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -142,9 +142,8 @@ jobs: git tag -s ${{ steps.update_version.outputs.next_rc_version }} git push origin ${{ steps.update_version.outputs.next_rc_version }} - release: + create-release: name: Create Release - runs-on: ubuntu-22.04 needs: tag uses: ./.github/workflows/release.yml with: From ca84c0274b742dc74490556f94dbf269dc36d310 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 00:39:08 -0700 Subject: [PATCH 12/46] Validate tag exists condition --- .github/workflows/rc.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index ba433c3f..d19212cf 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -123,6 +123,8 @@ jobs: else echo "tag_exists=false" >> $GITHUB_OUTPUT fi + echo $http_status_code + echo $GITHUB_OUTPUT env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ github.repository }} @@ -137,7 +139,7 @@ jobs: echo "next_rc_version=$TAG_NAME" >> $GITHUB_OUTPUT - name: Create Tag - if: steps.tag_check.outputs.tag_exists == 'false' + if: steps.tag_check.outputs.tag_exists == false run: | git tag -s ${{ steps.update_version.outputs.next_rc_version }} git push origin ${{ steps.update_version.outputs.next_rc_version }} From c4c6465340c4fb0b0e21fb194d73c770eccfaf5b Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 00:45:04 -0700 Subject: [PATCH 13/46] So dumb i missed it --- .github/workflows/rc.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index d19212cf..74ba11be 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -111,6 +111,15 @@ jobs: run: | yarn versionup-deploy:preminor + - name: Update RC candidate version ( excluding deploy client ) + id: update_version + run: | + yarn versionup:preminor + TAG_NAME=$(node -p "require('./lerna.json').version") + git add . + git commit -m "Update version to $TAG_NAME" --no-verify + echo "next_rc_version=$TAG_NAME" >> $GITHUB_OUTPUT + - name: Tag Check id: tag_check run: | @@ -123,23 +132,12 @@ jobs: else echo "tag_exists=false" >> $GITHUB_OUTPUT fi - echo $http_status_code - echo $GITHUB_OUTPUT env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ github.repository }} - - name: Update RC candidate version ( excluding deploy client ) - id: update_version - run: | - yarn versionup:preminor - TAG_NAME=$(node -p "require('./lerna.json').version") - git add . - git commit -m "Update version to $TAG_NAME" --no-verify - echo "next_rc_version=$TAG_NAME" >> $GITHUB_OUTPUT - - name: Create Tag - if: steps.tag_check.outputs.tag_exists == false + if: steps.tag_check.outputs.tag_exists == 'false' run: | git tag -s ${{ steps.update_version.outputs.next_rc_version }} git push origin ${{ steps.update_version.outputs.next_rc_version }} From ee70fd93ecc07dfbcbb542bbf4f14f38307a20e8 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 00:54:58 -0700 Subject: [PATCH 14/46] Add tag message --- .github/workflows/rc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 74ba11be..38f61510 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -139,8 +139,8 @@ jobs: - name: Create Tag if: steps.tag_check.outputs.tag_exists == 'false' run: | - git tag -s ${{ steps.update_version.outputs.next_rc_version }} - git push origin ${{ steps.update_version.outputs.next_rc_version }} + git tag -s ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" --no-verify + git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify create-release: name: Create Release From 7f100132e3306be0489f77ef3f000b15f27e93f7 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 00:58:38 -0700 Subject: [PATCH 15/46] Fix typo --- .github/workflows/rc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 38f61510..6b176a74 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -139,7 +139,7 @@ jobs: - name: Create Tag if: steps.tag_check.outputs.tag_exists == 'false' run: | - git tag -s ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" --no-verify + git tag -s ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify create-release: From 1b447c5b4e4c5b58d3dec31a50f8a7fcc9021044 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 01:02:54 -0700 Subject: [PATCH 16/46] test remove signing --- .github/workflows/rc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 6b176a74..14694170 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -139,7 +139,7 @@ jobs: - name: Create Tag if: steps.tag_check.outputs.tag_exists == 'false' run: | - git tag -s ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" + git tag -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify create-release: From 3cea1042c32ed74874c7ee60bd44146105911987 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 16:48:48 -0700 Subject: [PATCH 17/46] Use service account to sign commits & tag --- .github/workflows/rc.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 14694170..383e1f01 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -100,12 +100,12 @@ jobs: - name: Git Identity run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REPOSITORY: ${{ github.repository }} + git config --global user.name 'svc-gh-is-01' + git config --global user.email '116854830+svc-gh-is-01@users.noreply.github.com' + echo "${{ secrets.SVC_GPG_KEY }}" | base64 --decode | gpg --batch --import + echo "${{ secrets.SVC_GPG_PASSPHRASE }}" | gpg-connect-agent --no-autostart --quiet /bye + git config --global commit.gpgsign true + export GPG_TTY=$(tty) - name: Update RC candidate version for deploy client run: | @@ -117,7 +117,7 @@ jobs: yarn versionup:preminor TAG_NAME=$(node -p "require('./lerna.json').version") git add . - git commit -m "Update version to $TAG_NAME" --no-verify + git commit -S -m "Update version to $TAG_NAME" --no-verify echo "next_rc_version=$TAG_NAME" >> $GITHUB_OUTPUT - name: Tag Check @@ -139,7 +139,7 @@ jobs: - name: Create Tag if: steps.tag_check.outputs.tag_exists == 'false' run: | - git tag -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" + git tag -s -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify create-release: From 9110122e3a409e96e08181235fe93341c5453c04 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 20:12:49 -0700 Subject: [PATCH 18/46] Fix gpg key verification --- .github/workflows/rc.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 383e1f01..e9ebe910 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -98,14 +98,15 @@ jobs: - name: Checkout uses: actions/checkout@v3.5.2 - - name: Git Identity - run: | - git config --global user.name 'svc-gh-is-01' - git config --global user.email '116854830+svc-gh-is-01@users.noreply.github.com' - echo "${{ secrets.SVC_GPG_KEY }}" | base64 --decode | gpg --batch --import - echo "${{ secrets.SVC_GPG_PASSPHRASE }}" | gpg-connect-agent --no-autostart --quiet /bye - git config --global commit.gpgsign true - export GPG_TTY=$(tty) + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.SVC_GPG_KEY }} + passphrase: ${{ secrets.SVC_GPG_PASSPHRASE }} + git_config_global: true + git_tag_gpgsign: true + git_user_signingkey: true + git_commit_gpgsign: true - name: Update RC candidate version for deploy client run: | @@ -117,7 +118,7 @@ jobs: yarn versionup:preminor TAG_NAME=$(node -p "require('./lerna.json').version") git add . - git commit -S -m "Update version to $TAG_NAME" --no-verify + git commit -m "Update version to $TAG_NAME" --no-verify echo "next_rc_version=$TAG_NAME" >> $GITHUB_OUTPUT - name: Tag Check @@ -139,7 +140,7 @@ jobs: - name: Create Tag if: steps.tag_check.outputs.tag_exists == 'false' run: | - git tag -s -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" + git tag -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify create-release: From dcde90642736ee2dc6503d4478c414006bc194cb Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Thu, 18 May 2023 20:23:46 -0700 Subject: [PATCH 19/46] verify git config --- .github/workflows/rc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index e9ebe910..3c385ed0 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -140,6 +140,7 @@ jobs: - name: Create Tag if: steps.tag_check.outputs.tag_exists == 'false' run: | + git config --list git tag -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify From 26ff436f5349cf572c5de6c26eeac1ae200c02e8 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 00:53:41 -0700 Subject: [PATCH 20/46] Add stable release publisher --- .github/workflows/ci.yml | 4 +- .github/workflows/rc.yml | 31 ++++++++-- .github/workflows/release.yml | 4 +- .github/workflows/stable.yml | 106 ++++++++++++++++++++++++++++++++++ package.json | 3 +- 5 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/stable.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46dca3e2..8ce82965 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI +name: ci on: push: @@ -67,7 +67,7 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Node modules cache uses: actions/cache@v3 diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 3c385ed0..e336472f 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -1,18 +1,38 @@ -# Write github action in yaml for publishing packages from this mono repo to npm using lerna everytime there is a push to master - -name: Tag & Release +name: tag-release-candidate on: push: branches: - - improve-ci-cd + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + permissions: contents: write # for checkout and tag pull-requests: write # for comments jobs: + check_author: + runs-on: ubuntu-22.04 + outputs: + latest_commit_author: ${{ steps.commit.outputs.author }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3.5.2 + + - name: Get last commit details + id: commit + run: | + COMMIT_SHA=$(git rev-parse HEAD) + COMMIT_DETAILS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/commits/$COMMIT_SHA") + echo "author=$(echo $COMMIT_DETAILS | yq '.author.login')" >> $GITHUB_OUTPUT build: + needs: check_author runs-on: ubuntu-22.04 + if: ${{ needs.check_author.outputs.latest_commit_author != 'svc-gh-is-01' }} steps: - name: Checkout Repo uses: actions/checkout@v3.5.2 @@ -60,7 +80,7 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Node modules cache uses: actions/cache@v3 @@ -140,7 +160,6 @@ jobs: - name: Create Tag if: steps.tag_check.outputs.tag_exists == 'false' run: | - git config --list git tag -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3e0d905..3d97df26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: release on: workflow_dispatch: @@ -28,6 +28,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3.5.2 + with: + ref: refs/tags/${{ inputs.tag }} - name: Create release uses: ncipollo/release-action@v1 with: diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml new file mode 100644 index 00000000..76bceca2 --- /dev/null +++ b/.github/workflows/stable.yml @@ -0,0 +1,106 @@ +name: publish-stable + +on: + workflow_dispatch: + inputs: + branch: + required: true + description: Branch to trigger publish + type: string + default: master + +jobs: + tag: + runs-on: ubuntu-22.04 + permissions: + contents: write + outputs: + next_stable_version: ${{ steps.update_version.outputs.next_stable_version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3.5.2 + with: + ref: ${{ github.event.inputs.branch }} + + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.SVC_GPG_KEY }} + passphrase: ${{ secrets.SVC_GPG_PASSPHRASE }} + git_config_global: true + git_tag_gpgsign: true + git_user_signingkey: true + git_commit_gpgsign: true + + - name: Update RC candidate version for deploy client + run: | + yarn versionup-deploy:stableminor + + - name: Update RC candidate version ( excluding deploy client ) + id: update_version + run: | + yarn versionup:stableminor + TAG_NAME=$(node -p "require('./lerna.json').version") + git add . + git commit -m "Update version to $TAG_NAME" --no-verify + git push origin master + echo "next_stable_version=$TAG_NAME" >> $GITHUB_OUTPUT + + - name: Tag Check + id: tag_check + run: | + CURRENT_VERSION=$(node -p 'require("./lerna.json").version') + GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}" + http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \ + -H "Authorization: token ${GITHUB_TOKEN}") + if [ "$http_status_code" -ne "404" ] ; then + echo "tag_exists=true" >> $GITHUB_OUTPUT + else + echo "tag_exists=false" >> $GITHUB_OUTPUT + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + + - name: Create Tag + if: steps.tag_check.outputs.tag_exists == 'false' + run: | + git tag -a ${{ steps.update_version.outputs.next_stable_version }} -m "Release ${{ steps.update_version.outputs.next_stable_version }}" + git push origin ${{ steps.update_version.outputs.next_stable_version }} --no-verify + + create-release: + name: Create Release + needs: tag + uses: ./.github/workflows/release.yml + with: + tag: ${{ needs.tag.outputs.next_stable_version }} + prerelease: false + + publish: + name: Publish + needs: [tag, create-release] + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - name: Checkout Repo + uses: actions/checkout@v3.5.2 + with: + ref: refs/tags/${{ needs.tag.outputs.next_stable_version }} + + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 + + - name: Authenticate NPM + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Publish + run: | + yarn publish:stable diff --git a/package.json b/package.json index 6549fcd4..94471938 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,8 @@ "versionup:stableminor": "lerna version minor --conventional-commits --yes --exact --no-changelog", "versionup-deploy:stableminor": "cd packages/deploy && lerna version minor --conventional-commits --yes --exact --no-changelog", "versionup:stablemajor": "lerna version major --conventional-commits --yes --exact --no-changelog", - "versionup-deploy:stablemajor": "cd packages/deploy && lerna version major --conventional-commits --yes --exact --no-changelog" + "versionup-deploy:stablemajor": "cd packages/deploy && lerna version major --conventional-commits --yes --exact --no-changelog", + "publish:stable": "lerna publish from-git --yes --exact --no-changelog --force-publish" }, "repository": { "type": "git", From 127daa4ec709f32fb69ac18b603f63b60ee605b1 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 01:10:59 -0700 Subject: [PATCH 21/46] Fix push order to master --- .github/workflows/rc.yml | 1 + .github/workflows/stable.yml | 2 +- README.md | 13 ++++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index e336472f..0b078fae 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -162,6 +162,7 @@ jobs: run: | git tag -a ${{ steps.update_version.outputs.next_rc_version }} -m "Release ${{ steps.update_version.outputs.next_rc_version }}" git push origin ${{ steps.update_version.outputs.next_rc_version }} --no-verify + git push origin master --no-verify create-release: name: Create Release diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 76bceca2..ea89c9f3 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -48,7 +48,6 @@ jobs: TAG_NAME=$(node -p "require('./lerna.json').version") git add . git commit -m "Update version to $TAG_NAME" --no-verify - git push origin master echo "next_stable_version=$TAG_NAME" >> $GITHUB_OUTPUT - name: Tag Check @@ -72,6 +71,7 @@ jobs: run: | git tag -a ${{ steps.update_version.outputs.next_stable_version }} -m "Release ${{ steps.update_version.outputs.next_stable_version }}" git push origin ${{ steps.update_version.outputs.next_stable_version }} --no-verify + git push origin master --no-verify create-release: name: Create Release diff --git a/README.md b/README.md index 97e52b40..1ebbf863 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,10 @@ yarn run lerna publish v1.3.0-rc.4 --preid rc --dist-tag next --pre-dist-tag nex And to publish the final release: +- Make sure the tag is stable (e.g. `v1.3.0`) and not a release candidate (e.g. `v1.3.0-rc.4`) + ```bash -yarn run lerna publish --exact --force-publish +yarn publish:stable ``` ### Platform Deploy Client @@ -82,3 +84,12 @@ DEFENDER_SENTINEL_API_URL= DEFENDER_SENTINEL_POOL_ID= DEFENDER_SENTINEL_POOL_CLIENT_ID= ``` + +--- + +### CI/CD + +- We use github actions for CI/CD. See [workflows](.github/workflows) for more info. + - `ci.yml` - runs on every push to any branch --> runs tests. + - `rc.yml` - runs on every push to master --> creates a rc tag --> creates a pre-release draft. + - `stable.yml` - Manual trigger workflow --> creates a stable tag --> creates a latest release --> publishes to npm. From 541a9ca593c299135cedff7696b2aa8befa325f7 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 01:41:32 -0700 Subject: [PATCH 22/46] Fix typos --- .github/workflows/stable.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index ea89c9f3..0622b909 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -22,20 +22,20 @@ jobs: with: ref: ${{ github.event.inputs.branch }} - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 - - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v5 - with: - gpg_private_key: ${{ secrets.SVC_GPG_KEY }} - passphrase: ${{ secrets.SVC_GPG_PASSPHRASE }} - git_config_global: true - git_tag_gpgsign: true - git_user_signingkey: true - git_commit_gpgsign: true + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.SVC_GPG_KEY }} + passphrase: ${{ secrets.SVC_GPG_PASSPHRASE }} + git_config_global: true + git_tag_gpgsign: true + git_user_signingkey: true + git_commit_gpgsign: true - name: Update RC candidate version for deploy client run: | From b3107a55dc106151e0c64f774574be93283e3b65 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 02:19:50 -0700 Subject: [PATCH 23/46] Format tabs --- .github/workflows/stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 0622b909..760098d3 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -90,7 +90,7 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3.5.2 - with: + with: ref: refs/tags/${{ needs.tag.outputs.next_stable_version }} - name: Use node@16 From 38f67066cbf4a1c69cb1048d6051f8c79863eeaa Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 15:46:25 -0700 Subject: [PATCH 24/46] Add publish workflow --- .github/actions/prepare/action.yml | 38 +++++++++++++++++++ .github/workflows/ci.yml | 61 +++--------------------------- .github/workflows/publish.yml | 26 +++++++++++++ .github/workflows/rc.yml | 60 ++--------------------------- .github/workflows/stable.yml | 12 ++---- README.md | 1 + package.json | 2 +- 7 files changed, 80 insertions(+), 120 deletions(-) create mode 100644 .github/actions/prepare/action.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml new file mode 100644 index 00000000..e8b7474c --- /dev/null +++ b/.github/actions/prepare/action.yml @@ -0,0 +1,38 @@ +--- +name: Pre-requisites +description: | + Setup Pre-requisites + +runs: + using: composite + steps: + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Node modules cache + uses: actions/cache@v3 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + ~/.cache/node-gyp-cache + key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}" + restore-keys: | + ${{ runner.os }}-yarn-${{ env.cache-name }}- + env: + cache-name: v4 + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Lint & format checks + run: yarn style + + - name: Build + run: yarn build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ce82965..38a13ad4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,6 @@ name: ci on: - push: - branches: - - master pull_request: types: [assigned, opened, synchronize, reopened, labeled] @@ -24,33 +21,15 @@ jobs: steps: - uses: actions/checkout@v3.5.2 - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 + - name: Prepare pre-requisites + uses: ./.github/actions/prepare - - name: Node modules cache - uses: actions/cache@v3 - id: yarn-cache - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/node-gyp-cache - key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}" - restore-keys: | - ${{ runner.os }}-yarn-${{ env.cache-name }}- - env: - cache-name: v4 - - - name: Install dependencies - run: yarn --frozen-lockfile + - name: Check linting + run: yarn style - name: Check build run: yarn build - - name: Check linting - run: yarn lint:check - test: name: Unit Tests runs-on: ubuntu-22.04 @@ -60,36 +39,8 @@ jobs: - name: Checkout uses: actions/checkout@v3.5.2 - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - - name: Node modules cache - uses: actions/cache@v3 - id: yarn-cache - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/node-gyp-cache - key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}" - restore-keys: | - ${{ runner.os }}-yarn-${{ env.cache-name }}- - env: - cache-name: v4 - - - name: Install dependencies - run: yarn --frozen-lockfile - - - name: Lint & format checks - run: yarn style - - - name: Build - run: yarn build + - name: Prepare pre-requisites + uses: ./.github/actions/prepare - name: Run tests run: yarn test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..940dfa1e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: publish +description: + +on: + workflow_dispatch: + tags: + - 'v*' + +jobs: + publish: + - name: Checkout Repo + uses: actions/checkout@v3.5.2 + with: + ref: refs/tags/${{ github.ref }} + + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 + + - name: Authenticate NPM + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Publish + run: | + yarn publish diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 0b078fae..6030a618 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -37,32 +37,8 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3.5.2 - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 - - - name: Node modules cache - uses: actions/cache@v3 - id: yarn-cache - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/node-gyp-cache - key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}" - restore-keys: | - ${{ runner.os }}-yarn-${{ env.cache-name }}- - env: - cache-name: v4 - - - name: Install dependencies - run: yarn --frozen-lockfile - - - name: Check build - run: yarn build - - - name: Check linting - run: yarn lint:check + - name: Prepare pre-requisites + uses: ./.github/actions/prepare test: name: Unit Tests @@ -73,36 +49,8 @@ jobs: - name: Checkout uses: actions/checkout@v3.5.2 - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - - name: Node modules cache - uses: actions/cache@v3 - id: yarn-cache - with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/node-gyp-cache - key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}" - restore-keys: | - ${{ runner.os }}-yarn-${{ env.cache-name }}- - env: - cache-name: v4 - - - name: Install dependencies - run: yarn --frozen-lockfile - - - name: Lint & format checks - run: yarn style - - - name: Build - run: yarn build + - name: Prepare pre-requisites + uses: ./.github/actions/prepare - name: Run tests run: yarn test diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 760098d3..b2b1a557 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -2,12 +2,8 @@ name: publish-stable on: workflow_dispatch: - inputs: - branch: - required: true - description: Branch to trigger publish - type: string - default: master + branches: + - master jobs: tag: @@ -20,7 +16,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3.5.2 with: - ref: ${{ github.event.inputs.branch }} + ref: master - name: Use node@16 uses: actions/setup-node@v3 @@ -103,4 +99,4 @@ jobs: - name: Publish run: | - yarn publish:stable + yarn publish diff --git a/README.md b/README.md index 1ebbf863..752e5bef 100644 --- a/README.md +++ b/README.md @@ -93,3 +93,4 @@ DEFENDER_SENTINEL_POOL_CLIENT_ID= - `ci.yml` - runs on every push to any branch --> runs tests. - `rc.yml` - runs on every push to master --> creates a rc tag --> creates a pre-release draft. - `stable.yml` - Manual trigger workflow --> creates a stable tag --> creates a latest release --> publishes to npm. + - `publish.yml` - Manual trigger workflow ( for any given tag ) --> publishes to npm. diff --git a/package.json b/package.json index 94471938..d1fed08f 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "versionup-deploy:stableminor": "cd packages/deploy && lerna version minor --conventional-commits --yes --exact --no-changelog", "versionup:stablemajor": "lerna version major --conventional-commits --yes --exact --no-changelog", "versionup-deploy:stablemajor": "cd packages/deploy && lerna version major --conventional-commits --yes --exact --no-changelog", - "publish:stable": "lerna publish from-git --yes --exact --no-changelog --force-publish" + "publish": "lerna publish from-git --yes --exact --no-changelog --force-publish" }, "repository": { "type": "git", From eb4fd8687c56c7932e4dc642cda643ecc0323422 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 15:47:52 -0700 Subject: [PATCH 25/46] Fix indents --- .github/workflows/publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 940dfa1e..2712fbaf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,9 +9,9 @@ on: jobs: publish: - name: Checkout Repo - uses: actions/checkout@v3.5.2 - with: - ref: refs/tags/${{ github.ref }} + uses: actions/checkout@v3.5.2 + with: + ref: refs/tags/${{ github.ref }} - name: Use node@16 uses: actions/setup-node@v3 @@ -19,7 +19,7 @@ jobs: node-version: 16.20.0 - name: Authenticate NPM - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - name: Publish run: | From 71f138069ce31be2c6773d64c2ed1aaebda06aee Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 16:44:13 -0700 Subject: [PATCH 26/46] remove ref/tags --- .github/actions/prepare/action.yml | 4 ++++ .github/workflows/publish.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index e8b7474c..8a37e614 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -13,6 +13,7 @@ runs: - name: Get yarn cache directory path id: yarn-cache-dir-path + shell: bash run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Node modules cache @@ -29,10 +30,13 @@ runs: cache-name: v4 - name: Install dependencies + shell: bash run: yarn --frozen-lockfile - name: Lint & format checks + shell: bash run: yarn style - name: Build + shell: bash run: yarn build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2712fbaf..16942826 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3.5.2 with: - ref: refs/tags/${{ github.ref }} + ref: ${{ github.ref }} - name: Use node@16 uses: actions/setup-node@v3 From 05f3e5797787fbab895da130fc3339ef79398f60 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Fri, 19 May 2023 16:57:11 -0700 Subject: [PATCH 27/46] Fix missing keys --- .github/workflows/publish.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 16942826..7d0fe67b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,19 +8,23 @@ on: jobs: publish: - - name: Checkout Repo - uses: actions/checkout@v3.5.2 - with: - ref: ${{ github.ref }} + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - name: Checkout Repo + uses: actions/checkout@v3.5.2 + with: + ref: ${{ github.ref }} - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 - - name: Authenticate NPM - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + - name: Authenticate NPM + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Publish - run: | - yarn publish + - name: Publish + run: | + yarn publish From 91f630e347c5f63a2dd049383eaaaa60ef728984 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Sat, 20 May 2023 23:15:45 -0700 Subject: [PATCH 28/46] Add yq installation step --- .github/workflows/rc.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 6030a618..720ea3af 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -22,6 +22,13 @@ jobs: - name: Checkout Repo uses: actions/checkout@v3.5.2 + - name: Install yq + run: | + sudo apt-get update &&\ + sudo apt-get install wget -y &&\ + sudo wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq &&\ + sudo chmod +x /usr/bin/yq + - name: Get last commit details id: commit run: | From 951cedde6acec5a568bdeb105cfa44ba5a600ddb Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 11:40:07 -0700 Subject: [PATCH 29/46] remove manual publish details --- README.md | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 752e5bef..df4975ac 100644 --- a/README.md +++ b/README.md @@ -25,21 +25,9 @@ Run `yarn lint` at the project root. ### Defender Client -Use `lerna` for publishing a new version of all Defender Client packages (excludes Platform Deploy Client as it is versioned separately). +> We Use `lerna` for publishing a new version of all Defender Client packages (excludes Platform Deploy Client as it is versioned separately). -The following publishes a release candidate with the npm tag `next`: - -```bash -yarn run lerna publish v1.3.0-rc.4 --preid rc --dist-tag next --pre-dist-tag next --exact -``` - -And to publish the final release: - -- Make sure the tag is stable (e.g. `v1.3.0`) and not a release candidate (e.g. `v1.3.0-rc.4`) - -```bash -yarn publish:stable -``` +- We use github actions for CI/CD to tag, release & publish the packages. See details about workflows below. ### Platform Deploy Client From caa080b4e3aea153a60f112b64c7d286128ee7fc Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 14:56:56 -0700 Subject: [PATCH 30/46] Add deterministic build checks & use provenance for publishing --- .github/actions/prepare/action.yml | 22 +++++++++++--------- .github/workflows/ci.yml | 33 +++++++++++++----------------- .github/workflows/publish.yml | 10 ++++----- .github/workflows/stable.yml | 2 ++ 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 8a37e614..41871dd5 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -3,6 +3,14 @@ name: Pre-requisites description: | Setup Pre-requisites +outputs: + package-name: ${{ steps.provenance.package-name }} + package-download-name: ${{ steps.provenance.package-download-name }} + package-download-sha256: ${{ steps.provenance.package-download-sha256 }} + provenance-name: ${{ steps.provenance.provenance-name }} + provenance-download-name: ${{ steps.provenance.provenance-download-name }} + provenance-download-sha256: ${{ steps.provenance.provenance-download-sha256 }} + runs: using: composite steps: @@ -29,14 +37,8 @@ runs: env: cache-name: v4 - - name: Install dependencies - shell: bash - run: yarn --frozen-lockfile - - - name: Lint & format checks - shell: bash - run: yarn style - - name: Build - shell: bash - run: yarn build + id: provenance + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 + with: + run-scripts: "yarn --frozen-lockfile, yarn style, yarn build" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38a13ad4..18f4c9f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,37 +10,32 @@ concurrency: permissions: checks: write + pull-requests: read + id-token: write # For signing contents: read - pull-requests: write + actions: read jobs: - build: - - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Prepare pre-requisites - uses: ./.github/actions/prepare - - - name: Check linting - run: yarn style - - - name: Check build - run: yarn build - test: name: Unit Tests runs-on: ubuntu-22.04 - needs: build steps: - name: Checkout uses: actions/checkout@v3.5.2 - - name: Prepare pre-requisites + - name: Build + id: build uses: ./.github/actions/prepare + - name: Get outputs + run: | + echo "package_name=${{ steps.build.outputs.package-name }}" >> $GITHUB_OUTPUT + echo "package_download_name=${{ steps.build.outputs.package-download-name }}" >> $GITHUB_OUTPUT + echo "package_download_sha256: ${{ steps.build.outputs.package-download-sha256 }}" >> $GITHUB_OUTPUT + echo "provenance_name: ${{ steps.build.outputs.provenance-name }}" >> $GITHUB_OUTPUT + echo "provenance_download_name: ${{ steps.build.outputs.provenance-download-name }}" >> $GITHUB_OUTPUT + echo "provenance_download_sha256: ${{ steps.build.outputs.provenance-download-sha256 }}" >> $GITHUB_OUTPUT + echo $GITHUB_OUTPUT - name: Run tests run: yarn test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7d0fe67b..2e8cee40 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,20 +11,20 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: write + checks: write + id-token: write # For signing + actions: read steps: - name: Checkout Repo uses: actions/checkout@v3.5.2 with: ref: ${{ github.ref }} - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 - - name: Authenticate NPM run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - name: Publish run: | yarn publish + env: + NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index b2b1a557..03e0b059 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -100,3 +100,5 @@ jobs: - name: Publish run: | yarn publish + env: + NPM_CONFIG_PROVENANCE: true From 86e5fdab1fefd75860ef8d1cd8e2f3bcd3b39be1 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 15:03:39 -0700 Subject: [PATCH 31/46] Fix action outputs --- .github/actions/prepare/action.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 41871dd5..13d79990 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -4,12 +4,18 @@ description: | Setup Pre-requisites outputs: - package-name: ${{ steps.provenance.package-name }} - package-download-name: ${{ steps.provenance.package-download-name }} - package-download-sha256: ${{ steps.provenance.package-download-sha256 }} - provenance-name: ${{ steps.provenance.provenance-name }} - provenance-download-name: ${{ steps.provenance.provenance-download-name }} - provenance-download-sha256: ${{ steps.provenance.provenance-download-sha256 }} + package-name: + value: ${{ steps.provenance.package-name }} + package-download-name: + value: ${{ steps.provenance.package-download-name }} + package-download-sha256: + value: ${{ steps.provenance.package-download-sha256 }} + provenance-name: + value: ${{ steps.provenance.provenance-name }} + provenance-download-name: + value: ${{ steps.provenance.provenance-download-name }} + provenance-download-sha256: + value: ${{ steps.provenance.provenance-download-sha256 }} runs: using: composite From 995cb72243ffd60a6624644e1d2a99a49a29e841 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 15:35:31 -0700 Subject: [PATCH 32/46] Move slsa to workflow instead of composite action --- .github/actions/prepare/action.yml | 32 ++++++++++++------------------ .github/workflows/ci.yml | 25 ++++++++++++++--------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 13d79990..a50e3e0a 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -3,19 +3,19 @@ name: Pre-requisites description: | Setup Pre-requisites -outputs: - package-name: - value: ${{ steps.provenance.package-name }} - package-download-name: - value: ${{ steps.provenance.package-download-name }} - package-download-sha256: - value: ${{ steps.provenance.package-download-sha256 }} - provenance-name: - value: ${{ steps.provenance.provenance-name }} - provenance-download-name: - value: ${{ steps.provenance.provenance-download-name }} - provenance-download-sha256: - value: ${{ steps.provenance.provenance-download-sha256 }} +# outputs: +# package-name: +# value: ${{ steps.provenance.package-name }} +# package-download-name: +# value: ${{ steps.provenance.package-download-name }} +# package-download-sha256: +# value: ${{ steps.provenance.package-download-sha256 }} +# provenance-name: +# value: ${{ steps.provenance.provenance-name }} +# provenance-download-name: +# value: ${{ steps.provenance.provenance-download-name }} +# provenance-download-sha256: +# value: ${{ steps.provenance.provenance-download-sha256 }} runs: using: composite @@ -42,9 +42,3 @@ runs: ${{ runner.os }}-yarn-${{ env.cache-name }}- env: cache-name: v4 - - - name: Build - id: provenance - uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 - with: - run-scripts: "yarn --frozen-lockfile, yarn style, yarn build" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18f4c9f5..7008aa60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,15 +11,16 @@ concurrency: permissions: checks: write pull-requests: read - id-token: write # For signing contents: read - actions: read jobs: test: name: Unit Tests runs-on: ubuntu-22.04 - + permissions: + contents: read + actions: read + id-token: write steps: - name: Checkout uses: actions/checkout@v3.5.2 @@ -28,14 +29,20 @@ jobs: id: build uses: ./.github/actions/prepare + - name: Build + id: provenance + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 + with: + run-scripts: "yarn --frozen-lockfile, yarn style, yarn build" + - name: Get outputs run: | - echo "package_name=${{ steps.build.outputs.package-name }}" >> $GITHUB_OUTPUT - echo "package_download_name=${{ steps.build.outputs.package-download-name }}" >> $GITHUB_OUTPUT - echo "package_download_sha256: ${{ steps.build.outputs.package-download-sha256 }}" >> $GITHUB_OUTPUT - echo "provenance_name: ${{ steps.build.outputs.provenance-name }}" >> $GITHUB_OUTPUT - echo "provenance_download_name: ${{ steps.build.outputs.provenance-download-name }}" >> $GITHUB_OUTPUT - echo "provenance_download_sha256: ${{ steps.build.outputs.provenance-download-sha256 }}" >> $GITHUB_OUTPUT + echo "package_name=${{ steps.provenance.outputs.package-name }}" >> $GITHUB_OUTPUT + echo "package_download_name=${{ steps.provenance.outputs.package-download-name }}" >> $GITHUB_OUTPUT + echo "package_download_sha256: ${{ steps.provenance.outputs.package-download-sha256 }}" >> $GITHUB_OUTPUT + echo "provenance_name: ${{ steps.provenance.outputs.provenance-name }}" >> $GITHUB_OUTPUT + echo "provenance_download_name: ${{ steps.provenance.outputs.provenance-download-name }}" >> $GITHUB_OUTPUT + echo "provenance_download_sha256: ${{ steps.provenance.outputs.provenance-download-sha256 }}" >> $GITHUB_OUTPUT echo $GITHUB_OUTPUT - name: Run tests run: yarn test From fa158612b641736c4859bac43af84e82ef37b321 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 17:29:23 -0700 Subject: [PATCH 33/46] Use slsa reusable workflow --- .github/workflows/ci.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7008aa60..8b7fab27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,12 @@ permissions: contents: read jobs: + provenance: + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 + with: + run-scripts: "yarn --frozen-lockfile, yarn style, yarn build" test: + needs: provenance name: Unit Tests runs-on: ubuntu-22.04 permissions: @@ -29,20 +34,14 @@ jobs: id: build uses: ./.github/actions/prepare - - name: Build - id: provenance - uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 - with: - run-scripts: "yarn --frozen-lockfile, yarn style, yarn build" - - name: Get outputs run: | - echo "package_name=${{ steps.provenance.outputs.package-name }}" >> $GITHUB_OUTPUT - echo "package_download_name=${{ steps.provenance.outputs.package-download-name }}" >> $GITHUB_OUTPUT - echo "package_download_sha256: ${{ steps.provenance.outputs.package-download-sha256 }}" >> $GITHUB_OUTPUT - echo "provenance_name: ${{ steps.provenance.outputs.provenance-name }}" >> $GITHUB_OUTPUT - echo "provenance_download_name: ${{ steps.provenance.outputs.provenance-download-name }}" >> $GITHUB_OUTPUT - echo "provenance_download_sha256: ${{ steps.provenance.outputs.provenance-download-sha256 }}" >> $GITHUB_OUTPUT + echo "package_name=${{ needs.provenance.outputs.package-name }}" >> $GITHUB_OUTPUT + echo "package_download_name=${{ needs.provenance.outputs.package-download-name }}" >> $GITHUB_OUTPUT + echo "package_download_sha256: ${{ needs.provenance.outputs.package-download-sha256 }}" >> $GITHUB_OUTPUT + echo "provenance_name: ${{ needs.provenance.outputs.provenance-name }}" >> $GITHUB_OUTPUT + echo "provenance_download_name: ${{ needs.provenance.outputs.provenance-download-name }}" >> $GITHUB_OUTPUT + echo "provenance_download_sha256: ${{ needs.provenance.outputs.provenance-download-sha256 }}" >> $GITHUB_OUTPUT echo $GITHUB_OUTPUT - name: Run tests run: yarn test From 6c7a43c243d8ceabff708f1a44471de7bc97cde3 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 17:31:52 -0700 Subject: [PATCH 34/46] Fix permissions --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b7fab27..424b0919 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,9 @@ concurrency: permissions: checks: write pull-requests: read - contents: read + contents: write + actions: read + id-token: write jobs: provenance: @@ -22,10 +24,6 @@ jobs: needs: provenance name: Unit Tests runs-on: ubuntu-22.04 - permissions: - contents: read - actions: read - id-token: write steps: - name: Checkout uses: actions/checkout@v3.5.2 From 85a8a01b4fa204d5b9381d04742c87231163ffad Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 19:29:41 -0700 Subject: [PATCH 35/46] Fix provenance file --- .github/workflows/ci.yml | 2 +- package.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 424b0919..236db171 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: provenance: uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: - run-scripts: "yarn --frozen-lockfile, yarn style, yarn build" + run-scripts: "install, build" test: needs: provenance name: Unit Tests diff --git a/package.json b/package.json index d1fed08f..55e55209 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,13 @@ "nx-cloud": "latest" }, "scripts": { - "build": "nx run-many -t build", + "build": "nx run-many -t build --skip-nx-cache", + "install": "yarn install --frozen-lockfile", "lint": "yarn lint:check --fix", "format:check": "prettier --check '**/*.{js,ts,tsx}'", "format": "yarn format:check --write", "lint:check": "eslint 'packages/**/src/**/*.{js,ts}' --quiet", - "test": "nx run-many -t test", + "test": "nx run-many -t test --skip-nx-cache", "style": "yarn lint && yarn format", "versionup:preminor": "lerna version preminor --conventional-commits --conventional-prerelease --preid=rc --no-git-tag-version --yes --exact --no-changelog", "versionup-deploy:preminor": "cd packages/deploy && lerna version preminor --conventional-commits --conventional-prerelease --preid=rc --no-git-tag-version --yes --exact --no-changelog", From e51eb1798ce165e426f7e8782e1734f8c099eb01 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 19:33:16 -0700 Subject: [PATCH 36/46] Remove commented code --- .github/actions/prepare/action.yml | 14 -------------- .github/workflows/ci.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index a50e3e0a..8cd86328 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -3,20 +3,6 @@ name: Pre-requisites description: | Setup Pre-requisites -# outputs: -# package-name: -# value: ${{ steps.provenance.package-name }} -# package-download-name: -# value: ${{ steps.provenance.package-download-name }} -# package-download-sha256: -# value: ${{ steps.provenance.package-download-sha256 }} -# provenance-name: -# value: ${{ steps.provenance.provenance-name }} -# provenance-download-name: -# value: ${{ steps.provenance.provenance-download-name }} -# provenance-download-sha256: -# value: ${{ steps.provenance.provenance-download-sha256 }} - runs: using: composite steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 236db171..88f4d973 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,10 +16,22 @@ permissions: id-token: write jobs: + prepare: + name: Prepare pre-requisites + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + + - name: Prepare pre-requisites + uses: ./.github/actions/prepare + provenance: + needs: prepare uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: run-scripts: "install, build" + test: needs: provenance name: Unit Tests From 5a9088af3227eba6b6da25a7fca63e3c5843453f Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Mon, 22 May 2023 20:52:08 -0700 Subject: [PATCH 37/46] Fix infinite loop in install --- .github/workflows/ci.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88f4d973..9a348730 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: needs: prepare uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: - run-scripts: "install, build" + run-scripts: "install-deps, build" test: needs: provenance diff --git a/package.json b/package.json index 55e55209..7e40b95f 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "nx-cloud": "latest" }, "scripts": { + "install-deps": "yarn install --frozen-lockfile", "build": "nx run-many -t build --skip-nx-cache", - "install": "yarn install --frozen-lockfile", "lint": "yarn lint:check --fix", "format:check": "prettier --check '**/*.{js,ts,tsx}'", "format": "yarn format:check --write", From 9cf14e78102d24ccdb5185412b94811bbba0adff Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 00:07:25 -0700 Subject: [PATCH 38/46] Add provenance checks before publishing --- .github/workflows/ci.yml | 65 +++++++++++++++++++++++++----------- .github/workflows/rc.yml | 31 ++++++++--------- .github/workflows/stable.yml | 39 +++++++++++++++++++++- package.json | 5 ++- 4 files changed, 101 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a348730..86f2e23e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,32 +26,59 @@ jobs: - name: Prepare pre-requisites uses: ./.github/actions/prepare + # Deterministic Build & tests provenance: needs: prepare uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: - run-scripts: "install-deps, build" + run-scripts: "install-deps, build-test" + node-version: "16.20.0" - test: + publish: + name: Publish needs: provenance - name: Unit Tests runs-on: ubuntu-22.04 + permissions: + contents: write + id-token: write + actions: read steps: - - name: Checkout - uses: actions/checkout@v3.5.2 + - name: Checkout Repo + uses: actions/checkout@v3.5.2 + with: + ref: refs/tags/${{ needs.tag.outputs.next_stable_version }} - - name: Build - id: build - uses: ./.github/actions/prepare + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 + + - name: Create temp dir + id: temp-dir + run: | + set -euo pipefail + + temp_dir=$(mktemp -d) + echo "path=${temp_dir}" >>"${GITHUB_OUTPUT}" + + - name: Download tarball + uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@main + with: + name: ${{ needs.provenance.outputs.package-download-name }} + path: "${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }}" + sha256: ${{ needs.provenance.outputs.package-download-sha256 }} + + - name: Download provenance + uses: slsa-framework/slsa-github-generator/actions/secure-attestations-download@v1.6.0 + with: + name: ${{ needs.provenance.outputs.provenance-download-name }} + path: "${{ steps.temp-dir.outputs.path }}" + sha256: ${{ needs.provenance.outputs.provenance-download-sha256 }} + + - name: Verify downloaded artifacts + run: | + set -euo pipefail - - name: Get outputs - run: | - echo "package_name=${{ needs.provenance.outputs.package-name }}" >> $GITHUB_OUTPUT - echo "package_download_name=${{ needs.provenance.outputs.package-download-name }}" >> $GITHUB_OUTPUT - echo "package_download_sha256: ${{ needs.provenance.outputs.package-download-sha256 }}" >> $GITHUB_OUTPUT - echo "provenance_name: ${{ needs.provenance.outputs.provenance-name }}" >> $GITHUB_OUTPUT - echo "provenance_download_name: ${{ needs.provenance.outputs.provenance-download-name }}" >> $GITHUB_OUTPUT - echo "provenance_download_sha256: ${{ needs.provenance.outputs.provenance-download-sha256 }}" >> $GITHUB_OUTPUT - echo $GITHUB_OUTPUT - - name: Run tests - run: yarn test + cd ${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }} + ls -al + cd packages/ diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 720ea3af..500630c5 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -10,8 +10,9 @@ concurrency: permissions: - contents: write # for checkout and tag - pull-requests: write # for comments + contents: write + actions: read + id-token: write jobs: check_author: @@ -36,7 +37,7 @@ jobs: COMMIT_DETAILS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ "https://api.github.com/repos/${{ github.repository }}/commits/$COMMIT_SHA") echo "author=$(echo $COMMIT_DETAILS | yq '.author.login')" >> $GITHUB_OUTPUT - build: + prepare: needs: check_author runs-on: ubuntu-22.04 if: ${{ needs.check_author.outputs.latest_commit_author != 'svc-gh-is-01' }} @@ -47,32 +48,26 @@ jobs: - name: Prepare pre-requisites uses: ./.github/actions/prepare - test: - name: Unit Tests - runs-on: ubuntu-22.04 - needs: build - - steps: - - name: Checkout - uses: actions/checkout@v3.5.2 - - - name: Prepare pre-requisites - uses: ./.github/actions/prepare - - - name: Run tests - run: yarn test + # Deterministic Build & tests + provenance: + needs: prepare + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 + with: + run-scripts: "install-deps, build-test" + node-version: "16.20.0" # Git tag the commit for publishing tag: name: Tag RC candidate for all packages runs-on: ubuntu-22.04 - needs: test + needs: provenance outputs: next_rc_version: ${{ steps.update_version.outputs.next_rc_version }} steps: - name: Checkout uses: actions/checkout@v3.5.2 + # For signing commits & Tags - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v5 with: diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 03e0b059..15d9da16 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -77,12 +77,27 @@ jobs: tag: ${{ needs.tag.outputs.next_stable_version }} prerelease: false + provenance: + permissions: + contents: read + id-token: write + actions: read + + # Deterministic Build & tests + needs: [tag, create-release] + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 + with: + run-scripts: "install-deps, build-test" + node-version: "16.20.0" + publish: name: Publish - needs: [tag, create-release] + needs: provenance runs-on: ubuntu-22.04 permissions: contents: write + id-token: write + actions: read steps: - name: Checkout Repo uses: actions/checkout@v3.5.2 @@ -94,6 +109,28 @@ jobs: with: node-version: 16.20.0 + - name: Create temp dir + id: temp-dir + run: | + set -euo pipefail + + temp_dir=$(mktemp -d) + echo "path=${temp_dir}" >>"${GITHUB_OUTPUT}" + + - name: Download tarball + uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@main + with: + name: ${{ needs.provenance.outputs.package-download-name }} + path: "${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }}" + sha256: ${{ needs.provenance.outputs.package-download-sha256 }} + + - name: Download provenance + uses: slsa-framework/slsa-github-generator/actions/secure-attestations-download@v1.6.0 + with: + name: ${{ needs.provenance.outputs.provenance-download-name }} + path: "${{ steps.temp-dir.outputs.path }}" + sha256: ${{ needs.provenance.outputs.provenance-download-sha256 }} + - name: Authenticate NPM run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc diff --git a/package.json b/package.json index 7e40b95f..8bc721bd 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,10 @@ }, "scripts": { "install-deps": "yarn install --frozen-lockfile", - "build": "nx run-many -t build --skip-nx-cache", + "nx-build-skip-cache": "yarn build --skip-nx-cache", + "nx-build-test-skip-cache": "yarn build-test --skip-nx-cache", + "build": "nx run-many -t build", + "build-test": "nx run-many -t style,build,test", "lint": "yarn lint:check --fix", "format:check": "prettier --check '**/*.{js,ts,tsx}'", "format": "yarn format:check --write", From 34969ebdbf23906a7943c6c9d2f595fbf1647498 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 00:20:46 -0700 Subject: [PATCH 39/46] Fix path to secure attestations --- .github/workflows/ci.yml | 2 +- .github/workflows/stable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86f2e23e..447f742e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: sha256: ${{ needs.provenance.outputs.package-download-sha256 }} - name: Download provenance - uses: slsa-framework/slsa-github-generator/actions/secure-attestations-download@v1.6.0 + uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@v1.6.0 with: name: ${{ needs.provenance.outputs.provenance-download-name }} path: "${{ steps.temp-dir.outputs.path }}" diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 15d9da16..920cf4a1 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -125,7 +125,7 @@ jobs: sha256: ${{ needs.provenance.outputs.package-download-sha256 }} - name: Download provenance - uses: slsa-framework/slsa-github-generator/actions/secure-attestations-download@v1.6.0 + uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@v1.6.0 with: name: ${{ needs.provenance.outputs.provenance-download-name }} path: "${{ steps.temp-dir.outputs.path }}" From 57e6359e86ef5f929245dc52a022366fa82a913a Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 00:26:04 -0700 Subject: [PATCH 40/46] Fix checking tags --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 447f742e..5ed33b51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,8 +45,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3.5.2 - with: - ref: refs/tags/${{ needs.tag.outputs.next_stable_version }} + # with: + # ref: refs/tags/${{ needs.tag.outputs.next_stable_version }} - name: Use node@16 uses: actions/setup-node@v3 From bfd76658054f3f72454d40986611d364fbcc9ade Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 00:32:41 -0700 Subject: [PATCH 41/46] unzip & verify --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ed33b51..6fc85d08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,6 @@ jobs: run: | set -euo pipefail - cd ${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }} + cd ${{ steps.temp-dir.outputs.path }}; tar -xzvf ${{ needs.provenance.outputs.package-name }} ls -al - cd packages/ + cd openzeppelin-defender-client-1.44.0 From b5a3080cd75bf3d92b87b06694897be8f02ac476 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 00:45:53 -0700 Subject: [PATCH 42/46] Fix publish & adhoc release workflow --- .github/workflows/ci.yml | 49 ----------------------------------- .github/workflows/publish.yml | 49 +++++++++++++++++++++++++++++++++-- .github/workflows/stable.yml | 8 ++++-- 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fc85d08..e8eec9e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,52 +33,3 @@ jobs: with: run-scripts: "install-deps, build-test" node-version: "16.20.0" - - publish: - name: Publish - needs: provenance - runs-on: ubuntu-22.04 - permissions: - contents: write - id-token: write - actions: read - steps: - - name: Checkout Repo - uses: actions/checkout@v3.5.2 - # with: - # ref: refs/tags/${{ needs.tag.outputs.next_stable_version }} - - - name: Use node@16 - uses: actions/setup-node@v3 - with: - node-version: 16.20.0 - - - name: Create temp dir - id: temp-dir - run: | - set -euo pipefail - - temp_dir=$(mktemp -d) - echo "path=${temp_dir}" >>"${GITHUB_OUTPUT}" - - - name: Download tarball - uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@main - with: - name: ${{ needs.provenance.outputs.package-download-name }} - path: "${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }}" - sha256: ${{ needs.provenance.outputs.package-download-sha256 }} - - - name: Download provenance - uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@v1.6.0 - with: - name: ${{ needs.provenance.outputs.provenance-download-name }} - path: "${{ steps.temp-dir.outputs.path }}" - sha256: ${{ needs.provenance.outputs.provenance-download-sha256 }} - - - name: Verify downloaded artifacts - run: | - set -euo pipefail - - cd ${{ steps.temp-dir.outputs.path }}; tar -xzvf ${{ needs.provenance.outputs.package-name }} - ls -al - cd openzeppelin-defender-client-1.44.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2e8cee40..f919ebc2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,20 @@ on: - 'v*' jobs: + + provenance: + permissions: + contents: read + id-token: write + actions: read + + # Deterministic Build & tests + uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 + with: + run-scripts: "install-deps, build-test" + node-version: "16.20.0" + + publish: runs-on: ubuntu-22.04 permissions: @@ -20,11 +34,42 @@ jobs: with: ref: ${{ github.ref }} + - name: Use node@16 + uses: actions/setup-node@v3 + with: + node-version: 16.20.0 + + - name: Create temp dir + id: temp-dir + run: | + set -euo pipefail + + temp_dir=$(mktemp -d) + echo "path=${temp_dir}" >>"${GITHUB_OUTPUT}" + + - name: Download tarball + uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@main + with: + name: ${{ needs.provenance.outputs.package-download-name }} + path: "${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }}" + sha256: ${{ needs.provenance.outputs.package-download-sha256 }} + + - name: Download provenance + uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@v1.6.0 + with: + name: ${{ needs.provenance.outputs.provenance-download-name }} + path: "${{ steps.temp-dir.outputs.path }}" + sha256: ${{ needs.provenance.outputs.provenance-download-sha256 }} + - name: Authenticate NPM run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Publish + - name: Unpack the zipped artifact run: | - yarn publish + set -euo pipefail + + cd "${{ steps.temp-dir.outputs.path }}" + tar -xzvf "${{ needs.provenance.outputs.package-name }}" + cd package/; yarn publish env: NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 920cf4a1..4a8c7042 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -134,8 +134,12 @@ jobs: - name: Authenticate NPM run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Publish + - name: Unpack the zipped artifact run: | - yarn publish + set -euo pipefail + + cd "${{ steps.temp-dir.outputs.path }}" + tar -xzvf "${{ needs.provenance.outputs.package-name }}" + cd package/; yarn publish env: NPM_CONFIG_PROVENANCE: true From 8f6fdb7b6ed84fac86f25d678283c562cd0964f4 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 13:13:59 -0700 Subject: [PATCH 43/46] Add badges --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/rc.yml | 2 +- .github/workflows/stable.yml | 2 +- README.md | 15 ++++++++++++++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8eec9e1..21250bff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,5 +31,5 @@ jobs: needs: prepare uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: - run-scripts: "install-deps, build-test" + run-scripts: "install-deps, nx-build-test-skip-cache" node-version: "16.20.0" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f919ebc2..675207a0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,7 +17,7 @@ jobs: # Deterministic Build & tests uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: - run-scripts: "install-deps, build-test" + run-scripts: "install-deps, nx-build-test-skip-cache" node-version: "16.20.0" diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 500630c5..73038708 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -53,7 +53,7 @@ jobs: needs: prepare uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: - run-scripts: "install-deps, build-test" + run-scripts: "install-deps, nx-build-test-skip-cache" node-version: "16.20.0" # Git tag the commit for publishing diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 4a8c7042..b4719ad6 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -87,7 +87,7 @@ jobs: needs: [tag, create-release] uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@v1.6.0 with: - run-scripts: "install-deps, build-test" + run-scripts: "install-deps, nx-build-test-skip-cache" node-version: "16.20.0" publish: diff --git a/README.md b/README.md index df4975ac..c6814998 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -# Defender Clients +# Defender Client Packages + +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/defender-client/badge)](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/defender-client) +[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7395/badge)](https://bestpractices.coreinfrastructure.org/projects/7395) +[![Stable Git Release](https://github.com/OpenZeppelin/defender/actions/workflows/stable.yml/badge.svg)](https://github.com/OpenZeppelin/defender/actions/workflows/stable.yml) +[![RC Git Release](https://github.com/OpenZeppelin/defender/actions/workflows/rc.yml/badge.svg)](https://github.com/OpenZeppelin/defender/actions/workflows/rc.yml) +[![CI](https://github.com/OpenZeppelin/defender-client/actions/workflows/ci.yml/badge.svg)](https://github.com/OpenZeppelin/defender-client/actions/workflows/ci.yml) Monorepo that contains Defender typescript clients. Check out the individual packages for more info: @@ -81,4 +87,11 @@ DEFENDER_SENTINEL_POOL_CLIENT_ID= - `ci.yml` - runs on every push to any branch --> runs tests. - `rc.yml` - runs on every push to master --> creates a rc tag --> creates a pre-release draft. - `stable.yml` - Manual trigger workflow --> creates a stable tag --> creates a latest release --> publishes to npm. + - `release.yml` - Manual trigger workflow --> create a git release for a given tag. - `publish.yml` - Manual trigger workflow ( for any given tag ) --> publishes to npm. + +--- + +### Determinstic Builds & Secure Publishes + +- We use [slsa framework](https://slsa.dev/) _pronounced "salsa"_ for reproducible builds & secure pushes. Verification is done using [provenance](https://slsa.dev/provenance/v1) From 814cd2b4ebd9650549a284079bdedd0c7d573f3a Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 13:15:31 -0700 Subject: [PATCH 44/46] Remove static codeQL file --- .github/workflows/codeql.yml | 76 ------------------------------------ 1 file changed, 76 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 6ad6ec91..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,76 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "master" ] - schedule: - - cron: '29 0 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" From e3d8245cd15c1115dbeb1c7aeac2425e87a244d9 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 14:06:32 -0700 Subject: [PATCH 45/46] Use beta tags for rc --- .github/workflows/publish.yml | 8 +++++++- examples/create-sentinel/index.js | 1 + examples/update-notification-category/index.js | 1 + package.json | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 675207a0..c41ba6e8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -70,6 +70,12 @@ jobs: cd "${{ steps.temp-dir.outputs.path }}" tar -xzvf "${{ needs.provenance.outputs.package-name }}" - cd package/; yarn publish + cd package/ + if [[ ${GITHUB_REF#refs/tags/}" != *rc* ]]; then + yarn publish + else + yarn publish-rc + fi + env: NPM_CONFIG_PROVENANCE: true diff --git a/examples/create-sentinel/index.js b/examples/create-sentinel/index.js index 37d14f7b..13e1adfe 100644 --- a/examples/create-sentinel/index.js +++ b/examples/create-sentinel/index.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ require('dotenv').config(); const abi = require('./abis/erc721.json'); diff --git a/examples/update-notification-category/index.js b/examples/update-notification-category/index.js index da3d0c3f..2712b5d0 100644 --- a/examples/update-notification-category/index.js +++ b/examples/update-notification-category/index.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ require('dotenv').config(); const { SentinelClient } = require('defender-sentinel-client'); diff --git a/package.json b/package.json index 8bc721bd..0011b8c3 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "versionup-deploy:stableminor": "cd packages/deploy && lerna version minor --conventional-commits --yes --exact --no-changelog", "versionup:stablemajor": "lerna version major --conventional-commits --yes --exact --no-changelog", "versionup-deploy:stablemajor": "cd packages/deploy && lerna version major --conventional-commits --yes --exact --no-changelog", + "publish-rc": "yarn publish --dist-tag beta", "publish": "lerna publish from-git --yes --exact --no-changelog --force-publish" }, "repository": { From 6fe6cf67a88cc495758c296103a254ea6f7aad78 Mon Sep 17 00:00:00 2001 From: Sai Chaitanya Tirumerla Date: Tue, 23 May 2023 14:31:27 -0700 Subject: [PATCH 46/46] USE secure workflow files for gh actions --- .github/workflows/ci.yml | 7 ++++++- .github/workflows/publish.yml | 14 +++++++++----- .github/workflows/rc.yml | 23 +++++++++++++++++++---- .github/workflows/release-drafter.yml | 7 ++++++- .github/workflows/release.yml | 9 +++++++-- .github/workflows/stable.yml | 24 +++++++++++++++++------- 6 files changed, 64 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21250bff..3add4cf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,13 @@ jobs: name: Prepare pre-requisites runs-on: ubuntu-22.04 steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Prepare pre-requisites uses: ./.github/actions/prepare diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c41ba6e8..e42b41af 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,13 +29,18 @@ jobs: id-token: write # For signing actions: read steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout Repo - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: ${{ github.ref }} - name: Use node@16 - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: 16.20.0 @@ -48,14 +53,14 @@ jobs: echo "path=${temp_dir}" >>"${GITHUB_OUTPUT}" - name: Download tarball - uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@main + uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@934435652996c02a6317092984312602dfaf2a21 # main with: name: ${{ needs.provenance.outputs.package-download-name }} path: "${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }}" sha256: ${{ needs.provenance.outputs.package-download-sha256 }} - name: Download provenance - uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@v1.6.0 + uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@0779f7bec68e2bf54a7b0a32bf4763f25ab29702 # v1.6.0 with: name: ${{ needs.provenance.outputs.provenance-download-name }} path: "${{ steps.temp-dir.outputs.path }}" @@ -76,6 +81,5 @@ jobs: else yarn publish-rc fi - env: NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 73038708..2f652c1f 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -20,8 +20,13 @@ jobs: outputs: latest_commit_author: ${{ steps.commit.outputs.author }} steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout Repo - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Install yq run: | @@ -42,8 +47,13 @@ jobs: runs-on: ubuntu-22.04 if: ${{ needs.check_author.outputs.latest_commit_author != 'svc-gh-is-01' }} steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout Repo - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Prepare pre-requisites uses: ./.github/actions/prepare @@ -64,12 +74,17 @@ jobs: outputs: next_rc_version: ${{ steps.update_version.outputs.next_rc_version }} steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 # For signing commits & Tags - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v5 + uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.0 with: gpg_private_key: ${{ secrets.SVC_GPG_KEY }} passphrase: ${{ secrets.SVC_GPG_PASSPHRASE }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 4c96d50a..4fdb5e2d 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -9,6 +9,11 @@ jobs: update_release_draft: runs-on: ubuntu-22.04 steps: - - uses: release-drafter/release-drafter@v5 + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + + - uses: release-drafter/release-drafter@569eb7ee3a85817ab916c8f8ff03a5bd96c9c83e # v5.23.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d97df26..9884ee1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,12 +26,17 @@ jobs: permissions: contents: write steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout Repo - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: refs/tags/${{ inputs.tag }} - name: Create release - uses: ncipollo/release-action@v1 + uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 with: tag: ${{ inputs.tag }} skipIfReleaseExists: true diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index b4719ad6..b1b83e9a 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -13,18 +13,23 @@ jobs: outputs: next_stable_version: ${{ steps.update_version.outputs.next_stable_version }} steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout Repo - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: master - name: Use node@16 - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: 16.20.0 - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v5 + uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.0 with: gpg_private_key: ${{ secrets.SVC_GPG_KEY }} passphrase: ${{ secrets.SVC_GPG_PASSPHRASE }} @@ -99,13 +104,18 @@ jobs: id-token: write actions: read steps: + - name: Harden Runner + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + with: + egress-policy: audit + - name: Checkout Repo - uses: actions/checkout@v3.5.2 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: refs/tags/${{ needs.tag.outputs.next_stable_version }} - name: Use node@16 - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: 16.20.0 @@ -118,14 +128,14 @@ jobs: echo "path=${temp_dir}" >>"${GITHUB_OUTPUT}" - name: Download tarball - uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@main + uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@934435652996c02a6317092984312602dfaf2a21 # main with: name: ${{ needs.provenance.outputs.package-download-name }} path: "${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }}" sha256: ${{ needs.provenance.outputs.package-download-sha256 }} - name: Download provenance - uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@v1.6.0 + uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@0779f7bec68e2bf54a7b0a32bf4763f25ab29702 # v1.6.0 with: name: ${{ needs.provenance.outputs.provenance-download-name }} path: "${{ steps.temp-dir.outputs.path }}"