From df052a1688934a9a9502ff69cf21cc6029997c3d Mon Sep 17 00:00:00 2001 From: Leszek Stachowski Date: Fri, 10 Jan 2025 14:46:02 +0100 Subject: [PATCH] Telemetry (#465) --- .github/workflows/ci.yml | 3 - docs/command-line-interface/config.md | 7 + package.json | 2 +- packages/cli/src/base-l2.test.ts | 187 +++++++++++++++++++ packages/cli/src/base.ts | 3 + packages/cli/src/commands/config/get.test.ts | 5 +- packages/cli/src/commands/config/set.test.ts | 73 +++++++- packages/cli/src/commands/config/set.ts | 10 + packages/cli/src/scripts/postinstall.ts | 3 + packages/cli/src/test-utils/setup.ts | 2 + packages/cli/src/utils/config.test.ts | 28 ++- packages/cli/src/utils/config.ts | 3 + packages/cli/src/utils/telemetry.test.ts | 33 ++++ packages/cli/src/utils/telemetry.ts | 126 +++++++++++++ 14 files changed, 473 insertions(+), 12 deletions(-) create mode 100644 packages/cli/src/scripts/postinstall.ts create mode 100644 packages/cli/src/utils/telemetry.test.ts create mode 100644 packages/cli/src/utils/telemetry.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92c3adfee..cd6863bc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,9 +78,6 @@ jobs: - name: Install yarn dependencies run: git config --global url."https://".insteadOf ssh:// && yarn install if: steps.cache_node.outputs.cache-hit != 'true' - - name: Run yarn postinstall if cache hitted - run: yarn run postinstall - if: steps.cache_node.outputs.cache-hit == 'true' - name: Build packages run: yarn build - name: Check licenses diff --git a/docs/command-line-interface/config.md b/docs/command-line-interface/config.md index d074a79f9..9ea26cce8 100644 --- a/docs/command-line-interface/config.md +++ b/docs/command-line-interface/config.md @@ -41,6 +41,7 @@ Configure running node information for propagating transactions to network ``` USAGE $ celocli config:set [-n ] [--globalHelp] [--derivationPath ] + [--telemetry 1|0] FLAGS -n, --node= URL of the node to run commands against or an alias @@ -48,6 +49,8 @@ FLAGS when using --useLedger flag. Options: 'eth', 'celoLegacy', or a custom derivation path --globalHelp View all available global flags + --telemetry=