feat: Add Sentry sourcemap uploading for editor-ui (no-changelog) (#5870)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Alex Grozav 2023-04-05 18:14:41 +03:00 committed by GitHub
parent 9e600d0f90
commit dba5be37ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 153 additions and 23 deletions

View file

@ -31,6 +31,9 @@ jobs:
cache: 'pnpm' cache: 'pnpm'
- run: pnpm install --frozen-lockfile - run: pnpm install --frozen-lockfile
- name: Set release version in env
run: echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_ENV
- name: Build - name: Build
run: pnpm build run: pnpm build
@ -38,7 +41,6 @@ jobs:
run: | run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc
echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_ENV
- name: Create Release - name: Create Release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1

View file

@ -58,8 +58,8 @@
"supertest": "^6.3.3", "supertest": "^6.3.3",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
"tsc-watch": "^6.0.0", "tsc-watch": "^6.0.0",
"typescript": "*", "turbo": "1.8.8",
"turbo": "1.8.8" "typescript": "*"
}, },
"pnpm": { "pnpm": {
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
@ -84,7 +84,8 @@
}, },
"patchedDependencies": { "patchedDependencies": {
"element-ui@2.15.12": "patches/element-ui@2.15.12.patch", "element-ui@2.15.12": "patches/element-ui@2.15.12.patch",
"typedi@0.10.0": "patches/typedi@0.10.0.patch" "typedi@0.10.0": "patches/typedi@0.10.0.patch",
"@sentry/cli@2.17.0": "patches/@sentry__cli@2.17.0.patch"
} }
} }
} }

View file

@ -85,6 +85,7 @@
"devDependencies": { "devDependencies": {
"@faker-js/faker": "^7.6.0", "@faker-js/faker": "^7.6.0",
"@pinia/testing": "^0.0.14", "@pinia/testing": "^0.0.14",
"@sentry/vite-plugin": "^0.4.0",
"@testing-library/jest-dom": "^5.16.5", "@testing-library/jest-dom": "^5.16.5",
"@testing-library/user-event": "^14.4.3", "@testing-library/user-event": "^14.4.3",
"@testing-library/vue": "^5.8.3", "@testing-library/vue": "^5.8.3",
@ -99,9 +100,9 @@
"@types/lodash.set": "^4.3.6", "@types/lodash.set": "^4.3.6",
"@types/luxon": "^3.2.0", "@types/luxon": "^3.2.0",
"@types/uuid": "^8.3.2", "@types/uuid": "^8.3.2",
"@vitest/coverage-c8": "^0.28.5",
"@vitejs/plugin-legacy": "^3.0.1", "@vitejs/plugin-legacy": "^3.0.1",
"@vitejs/plugin-vue2": "^2.2.0", "@vitejs/plugin-vue2": "^2.2.0",
"@vitest/coverage-c8": "^0.28.5",
"c8": "^7.12.0", "c8": "^7.12.0",
"jshint": "^2.9.7", "jshint": "^2.9.7",
"miragejs": "^0.1.47", "miragejs": "^0.1.47",

View file

@ -4,6 +4,7 @@ import monacoEditorPlugin from 'vite-plugin-monaco-editor';
import path, { resolve } from 'path'; import path, { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite'; import { defineConfig, mergeConfig } from 'vite';
import { defineConfig as defineVitestConfig } from 'vitest/config'; import { defineConfig as defineVitestConfig } from 'vitest/config';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import packageJSON from './package.json'; import packageJSON from './package.json';
@ -80,6 +81,35 @@ if (NODE_ENV === 'test') {
}); });
} }
const plugins = [
vue(),
legacy({
targets: ['defaults', 'not IE 11'],
}),
monacoEditorPlugin({
publicPath: 'assets/monaco-editor',
customDistPath: (root: string, buildOutDir: string, base: string) =>
`${root}/${buildOutDir}/assets/monaco-editor`,
}),
];
const { SENTRY_AUTH_TOKEN: authToken, RELEASE: release } = process.env;
if (release && authToken) {
plugins.push(
sentryVitePlugin({
org: 'n8nio',
project: 'instance-frontend',
// Specify the directory containing build artifacts
include: './dist',
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
// and needs the `project:releases` and `org:read` scopes
authToken,
telemetry: false,
release,
}),
);
}
export default mergeConfig( export default mergeConfig(
defineConfig({ defineConfig({
define: { define: {
@ -88,17 +118,7 @@ export default mergeConfig(
...(NODE_ENV === 'development' ? { process: { env: {} } } : {}), ...(NODE_ENV === 'development' ? { process: { env: {} } } : {}),
BASE_PATH: `'${publicPath}'`, BASE_PATH: `'${publicPath}'`,
}, },
plugins: [ plugins,
vue(),
legacy({
targets: ['defaults', 'not IE 11'],
}),
monacoEditorPlugin({
publicPath: 'assets/monaco-editor',
customDistPath: (root: string, buildOutDir: string, base: string) =>
`${root}/${buildOutDir}/assets/monaco-editor`,
}),
],
resolve: { alias }, resolve: { alias },
base: publicPath, base: publicPath,
envPrefix: 'VUE_APP', envPrefix: 'VUE_APP',
@ -111,8 +131,10 @@ export default mergeConfig(
}, },
build: { build: {
assetsInlineLimit: 0, assetsInlineLimit: 0,
sourcemap: false, minify: !!release,
sourcemap: !!release,
rollupOptions: { rollupOptions: {
treeshake: !!release,
output: { output: {
manualChunks: { manualChunks: {
vendor: vendorChunks, vendor: vendorChunks,

View file

@ -0,0 +1,12 @@
diff --git a/js/helper.js b/js/helper.js
index a4a7a61f0e226d7cb45f8d5db34c35cc9e62cf96..38fd3ec2214970b1c5dd22fdff902ff3b5eeddde 100644
--- a/js/helper.js
+++ b/js/helper.js
@@ -15,6 +15,7 @@ function getBinaryPath() {
const parts = [];
parts.push(__dirname);
parts.push('..');
+ parts.push('bin');
parts.push(`sentry-cli${process.platform === 'win32' ? '.exe' : ''}`);
return path.resolve(...parts);
}

View file

@ -21,6 +21,9 @@ overrides:
qqjs>globby: ^11.1.0 qqjs>globby: ^11.1.0
patchedDependencies: patchedDependencies:
'@sentry/cli@2.17.0':
hash: nchnoezkq6p37qaiku3vrpwraq
path: patches/@sentry__cli@2.17.0.patch
element-ui@2.15.12: element-ui@2.15.12:
hash: prckukfdop5sl2her6de25cod4 hash: prckukfdop5sl2her6de25cod4
path: patches/element-ui@2.15.12.patch path: patches/element-ui@2.15.12.patch
@ -985,6 +988,9 @@ importers:
'@pinia/testing': '@pinia/testing':
specifier: ^0.0.14 specifier: ^0.0.14
version: 0.0.14(pinia@2.0.23)(vue@2.7.14) version: 0.0.14(pinia@2.0.23)(vue@2.7.14)
'@sentry/vite-plugin':
specifier: ^0.4.0
version: 0.4.0
'@testing-library/jest-dom': '@testing-library/jest-dom':
specifier: ^5.16.5 specifier: ^5.16.5
version: 5.16.5 version: 5.16.5
@ -4573,6 +4579,46 @@ packages:
selderee: 0.6.0 selderee: 0.6.0
dev: false dev: false
/@sentry-internal/tracing@7.47.0:
resolution: {integrity: sha512-udpHnCzF8DQsWf0gQwd0XFGp6Y8MOiwnl8vGt2ohqZGS3m1+IxoRLXsSkD8qmvN6KKDnwbaAvYnK0z0L+AW95g==}
engines: {node: '>=8'}
dependencies:
'@sentry/core': 7.47.0
'@sentry/types': 7.47.0
'@sentry/utils': 7.47.0
tslib: 2.5.0
dev: true
/@sentry/bundler-plugin-core@0.4.0:
resolution: {integrity: sha512-Xi+dqaSOoxbdmxegX7f66FVOxm2dVJLmrMXUpoNyuV6ASoccRWzouGaFekP059SUTTD05ytk1mHqwgVuBCA0Dw==}
engines: {node: '>= 10'}
dependencies:
'@sentry/cli': 2.17.0(patch_hash=nchnoezkq6p37qaiku3vrpwraq)
'@sentry/node': 7.28.1
'@sentry/tracing': 7.47.0
magic-string: 0.27.0
unplugin: 1.0.1
transitivePeerDependencies:
- encoding
- supports-color
dev: true
/@sentry/cli@2.17.0(patch_hash=nchnoezkq6p37qaiku3vrpwraq):
resolution: {integrity: sha512-CHIMEg8+YNCpEBDgUctu+DvG3S8+g8Zn9jTE5MMGINNmGkQTMG179LuDE04B/inaCYixLVNpFPTe6Iow3tXjnQ==}
engines: {node: '>= 10'}
hasBin: true
dependencies:
https-proxy-agent: 5.0.1
node-fetch: 2.6.8
progress: 2.0.3
proxy-from-env: 1.1.0
which: 2.0.2
transitivePeerDependencies:
- encoding
- supports-color
dev: true
patched: true
/@sentry/core@7.28.1: /@sentry/core@7.28.1:
resolution: {integrity: sha512-7wvnuvn/mrAfcugWoCG/3pqDIrUgH5t+HisMJMGw0h9Tc33KqrmqMDCQVvjlrr2pWrw/vuUCFdm8CbUHJ832oQ==} resolution: {integrity: sha512-7wvnuvn/mrAfcugWoCG/3pqDIrUgH5t+HisMJMGw0h9Tc33KqrmqMDCQVvjlrr2pWrw/vuUCFdm8CbUHJ832oQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
@ -4580,7 +4626,15 @@ packages:
'@sentry/types': 7.28.1 '@sentry/types': 7.28.1
'@sentry/utils': 7.28.1 '@sentry/utils': 7.28.1
tslib: 2.5.0 tslib: 2.5.0
dev: false
/@sentry/core@7.47.0:
resolution: {integrity: sha512-EFhZhKdMu7wKmWYZwbgTi8FNZ7Fq+HdlXiZWNz51Bqe3pHmfAkdHtAEs0Buo0v623MKA0CA4EjXIazGUM34XTg==}
engines: {node: '>=8'}
dependencies:
'@sentry/types': 7.47.0
'@sentry/utils': 7.47.0
tslib: 2.5.0
dev: true
/@sentry/integrations@7.28.1: /@sentry/integrations@7.28.1:
resolution: {integrity: sha512-opeXVR1L9mZmZcpAs9kX+4JPY7pXhVupy17Sbz+43zd5CshYTveIcttGNPp+EPT3j7mMU+1TMAYZspKqJXtEBQ==} resolution: {integrity: sha512-opeXVR1L9mZmZcpAs9kX+4JPY7pXhVupy17Sbz+43zd5CshYTveIcttGNPp+EPT3j7mMU+1TMAYZspKqJXtEBQ==}
@ -4605,12 +4659,22 @@ packages:
tslib: 2.5.0 tslib: 2.5.0
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
dev: false
/@sentry/tracing@7.47.0:
resolution: {integrity: sha512-hJCpKdekwaFNbCVXxfCz5IxfSEJIKnkPmRSVHITOm5VhKwq2e5kmy4Rn6bzSETwJFSDE8LGbR/3eSfGTqw37XA==}
engines: {node: '>=8'}
dependencies:
'@sentry-internal/tracing': 7.47.0
dev: true
/@sentry/types@7.28.1: /@sentry/types@7.28.1:
resolution: {integrity: sha512-DvSplMVrVEmOzR2M161V5+B8Up3vR71xMqJOpWTzE9TqtFJRGPtqT/5OBsNJJw1+/j2ssMcnKwbEo9Q2EGeS6g==} resolution: {integrity: sha512-DvSplMVrVEmOzR2M161V5+B8Up3vR71xMqJOpWTzE9TqtFJRGPtqT/5OBsNJJw1+/j2ssMcnKwbEo9Q2EGeS6g==}
engines: {node: '>=8'} engines: {node: '>=8'}
dev: false
/@sentry/types@7.47.0:
resolution: {integrity: sha512-GxXocplN0j1+uczovHrfkykl9wvkamDtWxlPUQgyGlbLGZn+UH1Y79D4D58COaFWGEZdSNKr62gZAjfEYu9nQA==}
engines: {node: '>=8'}
dev: true
/@sentry/utils@7.28.1: /@sentry/utils@7.28.1:
resolution: {integrity: sha512-75/jzLUO9HH09iC9TslNimGbxOP3jgn89P+q7uR+rp2fJfRExHVeKJZQdK0Ij4/SmE7TJ3Uh2r154N0INZEx1g==} resolution: {integrity: sha512-75/jzLUO9HH09iC9TslNimGbxOP3jgn89P+q7uR+rp2fJfRExHVeKJZQdK0Ij4/SmE7TJ3Uh2r154N0INZEx1g==}
@ -4618,7 +4682,24 @@ packages:
dependencies: dependencies:
'@sentry/types': 7.28.1 '@sentry/types': 7.28.1
tslib: 2.5.0 tslib: 2.5.0
dev: false
/@sentry/utils@7.47.0:
resolution: {integrity: sha512-A89SaOLp6XeZfByeYo2C8Ecye/YAtk/gENuyOUhQEdMulI6mZdjqtHAp7pTMVgkBc/YNARVuoa+kR/IdRrTPkQ==}
engines: {node: '>=8'}
dependencies:
'@sentry/types': 7.47.0
tslib: 2.5.0
dev: true
/@sentry/vite-plugin@0.4.0:
resolution: {integrity: sha512-dBxM00MCLzO/idzAqj33ZfbIBKZxP+FzpxtS2WaV0yzad9yLBAFZ/VGDIGHQJC0Qo3fsFi/CZpmN39wJkJoWFA==}
engines: {node: '>= 10'}
dependencies:
'@sentry/bundler-plugin-core': 0.4.0
transitivePeerDependencies:
- encoding
- supports-color
dev: true
/@servie/events@1.0.0: /@servie/events@1.0.0:
resolution: {integrity: sha512-sBSO19KzdrJCM3gdx6eIxV8M9Gxfgg6iDQmH5TIAGaUu+X9VDdsINXJOnoiZ1Kx3TrHdH4bt5UVglkjsEGBcvw==} resolution: {integrity: sha512-sBSO19KzdrJCM3gdx6eIxV8M9Gxfgg6iDQmH5TIAGaUu+X9VDdsINXJOnoiZ1Kx3TrHdH4bt5UVglkjsEGBcvw==}
@ -9718,7 +9799,6 @@ packages:
/cookie@0.4.2: /cookie@0.4.2:
resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==}
engines: {node: '>= 0.6'} engines: {node: '>= 0.6'}
dev: false
/cookie@0.5.0: /cookie@0.5.0:
resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==}
@ -15345,7 +15425,6 @@ packages:
/lru_map@0.3.3: /lru_map@0.3.3:
resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==} resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==}
dev: false
/luxon@3.3.0: /luxon@3.3.0:
resolution: {integrity: sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==} resolution: {integrity: sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==}
@ -20840,6 +20919,15 @@ packages:
webpack-virtual-modules: 0.4.6 webpack-virtual-modules: 0.4.6
dev: true dev: true
/unplugin@1.0.1:
resolution: {integrity: sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==}
dependencies:
acorn: 8.8.1
chokidar: 3.5.2
webpack-sources: 3.2.3
webpack-virtual-modules: 0.5.0
dev: true
/unset-value@1.0.0: /unset-value@1.0.0:
resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -21714,6 +21802,10 @@ packages:
resolution: {integrity: sha512-5tyDlKLqPfMqjT3Q9TAqf2YqjwmnUleZwzJi1A5qXnlBCdj2AtOJ6wAWdglTIDOPgOiOrXeBeFcsQ8+aGQ6QbA==} resolution: {integrity: sha512-5tyDlKLqPfMqjT3Q9TAqf2YqjwmnUleZwzJi1A5qXnlBCdj2AtOJ6wAWdglTIDOPgOiOrXeBeFcsQ8+aGQ6QbA==}
dev: true dev: true
/webpack-virtual-modules@0.5.0:
resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==}
dev: true
/webpack@5.75.0(esbuild@0.16.17): /webpack@5.75.0(esbuild@0.16.17):
resolution: {integrity: sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==} resolution: {integrity: sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==}
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}