From 068ec3a895933ce17bb2c09e08832aaf14f39a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Thu, 7 Nov 2024 14:06:36 +0800 Subject: [PATCH] feat(babel-plugin-canyon): add intervalTime option --- plugins/babel-plugin-canyon/package.json | 2 +- plugins/babel-plugin-canyon/src/index.js | 1 + plugins/babel-plugin-canyon/templates/canyon.template.js | 1 + tools/canyon-extension/public/interceptor.js | 2 +- tools/canyon-extension/public/manifest.json | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/babel-plugin-canyon/package.json b/plugins/babel-plugin-canyon/package.json index b3ae79aa..da253cf5 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.82", + "version": "1.8.83", "description": "A Babel plugin cooperates with istanbul to report the coverage", "author": "Allen Zhang ", "license": "MIT", diff --git a/plugins/babel-plugin-canyon/src/index.js b/plugins/babel-plugin-canyon/src/index.js index a57cf395..4c3b3511 100644 --- a/plugins/babel-plugin-canyon/src/index.js +++ b/plugins/babel-plugin-canyon/src/index.js @@ -58,6 +58,7 @@ export default declare((api,config) => { BRANCH: config.branch || '-', REPORT_ID: config.reportID || '-', COMPARE_TARGET: config.compareTarget || '-', + INTERVAL_TIME: config.intervalTime || '0', VERSION: packageJson.version || '-' } diff --git a/plugins/babel-plugin-canyon/templates/canyon.template.js b/plugins/babel-plugin-canyon/templates/canyon.template.js index 8a3bda53..10b488b7 100644 --- a/plugins/babel-plugin-canyon/templates/canyon.template.js +++ b/plugins/babel-plugin-canyon/templates/canyon.template.js @@ -27,6 +27,7 @@ compareTarget: 'COMPARE_TARGET', branch: 'BRANCH', version: 'VERSION', + intervalTime: 'INTERVAL_TIME' } diff --git a/tools/canyon-extension/public/interceptor.js b/tools/canyon-extension/public/interceptor.js index 8bbdd37b..2709c35e 100644 --- a/tools/canyon-extension/public/interceptor.js +++ b/tools/canyon-extension/public/interceptor.js @@ -17,7 +17,7 @@ window.addEventListener('message', function (e) { canyon: { ...window.__canyon__, reportID: localStorage.getItem('__canyon__report__id__') || undefined, - intervalTime: localStorage.getItem('__canyon__interval__time__') || undefined, + intervalTime: localStorage.getItem('__canyon__interval__time__') || window.__canyon__.intervalTime, reporter: localStorage.getItem('__canyon__reporter__') || window.__canyon__.reporter, }, coverage: window.__coverage__, diff --git a/tools/canyon-extension/public/manifest.json b/tools/canyon-extension/public/manifest.json index 74b8b1e7..9e39a57b 100644 --- a/tools/canyon-extension/public/manifest.json +++ b/tools/canyon-extension/public/manifest.json @@ -1,6 +1,6 @@ { "name": "Canyon Extension", - "version": "1.0.7", + "version": "1.0.8", "manifest_version": 3, "description": "Canyon manual report plugin", "icons": {