From a0187272721ae7d00a8888f99588a1f12f1793ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Thu, 24 Oct 2024 15:45:39 +0800 Subject: [PATCH] feat: update --- packages/canyon-backend/nest-cli.json | 3 ++- packages/canyon-backend/package.json | 2 ++ plugins/babel-plugin-canyon/package.json | 2 +- .../templates/inject-in-page-popup.js | 10 +++++----- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/canyon-backend/nest-cli.json b/packages/canyon-backend/nest-cli.json index f9aa683b..c9ff8240 100755 --- a/packages/canyon-backend/nest-cli.json +++ b/packages/canyon-backend/nest-cli.json @@ -3,6 +3,7 @@ "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { - "deleteOutDir": true + "deleteOutDir": true, + "builder": "swc" } } diff --git a/packages/canyon-backend/package.json b/packages/canyon-backend/package.json index d93bd2d9..aa65aed0 100755 --- a/packages/canyon-backend/package.json +++ b/packages/canyon-backend/package.json @@ -53,6 +53,8 @@ "devDependencies": { "@nestjs/cli": "^10.4.5", "@nestjs/schematics": "^10.2.2", + "@swc/cli": "0.4.1-nightly.20240914", + "@swc/core": "^1.7.39", "@types/express": "^5.0.0", "@types/istanbul-lib-coverage": "^2.0.6", "@types/istanbul-lib-source-maps": "^4.0.4", diff --git a/plugins/babel-plugin-canyon/package.json b/plugins/babel-plugin-canyon/package.json index 81e85f9c..5aa449e7 100644 --- a/plugins/babel-plugin-canyon/package.json +++ b/plugins/babel-plugin-canyon/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-canyon", - "version": "1.8.78-beta.17", + "version": "1.8.78-beta.18", "description": "A Babel plugin cooperates with istanbul to report the coverage", "author": "Allen Zhang ", "license": "MIT", diff --git a/plugins/babel-plugin-canyon/templates/inject-in-page-popup.js b/plugins/babel-plugin-canyon/templates/inject-in-page-popup.js index 33edd41b..70129c0c 100644 --- a/plugins/babel-plugin-canyon/templates/inject-in-page-popup.js +++ b/plugins/babel-plugin-canyon/templates/inject-in-page-popup.js @@ -17,7 +17,7 @@ if (globalObj.ssssssssssssss) { } else { - if (window.__canyon__ && window.__coverage__) { + if (globalObj.__canyon__ && globalObj.__coverage__) { globalObj.ssssssssssssss = true if (globalObj.document && globalObj.document.addEventListener) { @@ -152,8 +152,8 @@ // 逻辑开始 // - const canyon = window.__canyon__ - const coverage = window.__coverage__ + const canyon = globalObj.__canyon__ + const coverage = globalObj.__coverage__ // 步骤一:连点5次打开弹窗+检查页面变量合法性 let clickCount = 0 @@ -175,7 +175,7 @@ clickCount = 0 // 重置计数 // 检查参数 - if (window.__canyon__ && window.__coverage__) { + if (globalObj.__canyon__ && globalObj.__coverage__) { document.querySelector('.__canyon__modal').style.display = 'block' } else { alert('window.__canyon__ or window.__coverage__ is not defined') @@ -206,7 +206,7 @@ method: 'post', body: JSON.stringify({ ...canyon, - coverage: window.__coverage__ + coverage: globalObj.__coverage__ }), headers: { 'Content-Type': 'application/json',