From 5878c117f20b6a5abb8f624defa6500aaadbb5e8 Mon Sep 17 00:00:00 2001 From: Arjun Devarajan Date: Wed, 19 Jul 2023 17:00:45 -0400 Subject: [PATCH] feat: use Scarf Gateway for Superset npm downloads (#24433) Co-authored-by: Arjun Devarajan Co-authored-by: Evan Rusackas Co-authored-by: Evan Rusackas --- CONTRIBUTING.md | 12 ++++++++++++ superset-frontend/package-lock.json | 12 ++++++++++++ superset-frontend/package.json | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c5d60f236829..91f224bc03cf7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -577,6 +577,18 @@ cd superset-frontend npm ci ``` +Note that Superset uses [Scarf](https://docs.scarf.sh) to capture telemetry/analytics about versions being installed, including the `scarf-js` npm package. As noted elsewhere in this documentation, Scarf gathers aggregated stats for the sake of security/release strategy, and does not capture/retain PII. [You can read here](https://docs.scarf.sh/package-analytics/) about the package, and various means to opt out of it, but one easy way to opt out is to add this setting in `superset-frontent/package.json`: +```json +// your-package/package.json +{ + // ... + "scarfSettings": { + "enabled": false + } + // ... +} +``` + #### Build assets There are three types of assets you can build: diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 82bb7c360785d..1e9eca6f27f09 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -21,6 +21,7 @@ "@emotion/styled": "^11.3.0", "@fontsource/inter": "^4.0.0", "@reduxjs/toolkit": "^1.9.3", + "@scarf/scarf": "^1.1.1", "@superset-ui/chart-controls": "file:./packages/superset-ui-chart-controls", "@superset-ui/core": "file:./packages/superset-ui-core", "@superset-ui/legacy-plugin-chart-calendar": "file:./plugins/legacy-plugin-chart-calendar", @@ -12317,6 +12318,12 @@ } } }, + "node_modules/@scarf/scarf": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.1.1.tgz", + "integrity": "sha512-VGbKDbk1RFIaSmdVb0cNjjWJoRWRI/Weo23AjRCC2nryO0iAS8pzsToJfPVPtVs74WHw4L1UTADNdIYRLkirZQ==", + "hasInstallScript": true + }, "node_modules/@sigstore/protobuf-specs": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.1.0.tgz", @@ -72722,6 +72729,11 @@ "any-observable": "^0.3.0" } }, + "@scarf/scarf": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.1.1.tgz", + "integrity": "sha512-VGbKDbk1RFIaSmdVb0cNjjWJoRWRI/Weo23AjRCC2nryO0iAS8pzsToJfPVPtVs74WHw4L1UTADNdIYRLkirZQ==" + }, "@sigstore/protobuf-specs": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.1.0.tgz", diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 5104ad87db2a1..1a6b202e4be12 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -86,6 +86,7 @@ "@emotion/styled": "^11.3.0", "@fontsource/inter": "^4.0.0", "@reduxjs/toolkit": "^1.9.3", + "@scarf/scarf": "^1.1.1", "@superset-ui/chart-controls": "file:./packages/superset-ui-chart-controls", "@superset-ui/core": "file:./packages/superset-ui-core", "@superset-ui/legacy-plugin-chart-calendar": "file:./plugins/legacy-plugin-chart-calendar", @@ -357,5 +358,8 @@ } }, "readme": "ERROR: No README data found!", + "scarfSettings": { + "allowTopLevel": true + }, "_id": "superset@0.0.0-dev" }