Skip to content

Commit

Permalink
feat: enable telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Jun 4, 2024
1 parent c8aa2e3 commit 0b8f52e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
PULL_REQUEST_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
GSA_TELEMETRY: true

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion ui/src/tool/wasm_exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
throw new Error("globalThis.TextDecoder is not available, polyfill required");
}

const encoder = new TextEncoder("utf-8");
const encoder = new TextEncoder();
const decoder = new TextDecoder("utf-8");

globalThis.Go = class {
Expand Down
18 changes: 13 additions & 5 deletions ui/vite.config-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@ import {defineConfig} from 'vite';
import {build, codecov, commonPlugin, getVersionTag} from "./common";
import {createHtmlPlugin} from "vite-plugin-html";

const tags = [getVersionTag()];
if (process.env.GSA_TELEMETRY) {
tags.push({
tag: "script",
attrs: {
defer: true,
src: "https://trail.learningman.top/script.js",
"data-website-id": "1aab8912-b4b0-4561-a683-81a730bdb944",
}
})
}

export default defineConfig({
plugins: [
...commonPlugin(),
createHtmlPlugin({
minify: true,
entry: './src/explorer_main.tsx',
inject: {
tags: [
getVersionTag(),
]
}
inject: {tags}
}),
codecov("gsa-explorer")
],
Expand Down

0 comments on commit 0b8f52e

Please sign in to comment.