From a21133d2afd59e16cb36bb94648bcf69f62273fb Mon Sep 17 00:00:00 2001 From: "Baruch Odem (Rothkoff)" Date: Sun, 19 Mar 2023 08:49:23 +0200 Subject: [PATCH] revert: remove the npmjs.com handle (#30) This injection to npmjs.com was only a POC, and we are not maintaining it. Now it starts to break my code, so I'm removing it from the code. I think when we will re-implement it, we will do that with Vue, so this code is useless. --- gulpfile.js | 10 ---------- src/content.npm.js | 17 ----------------- src/manifest.chrome.json | 4 ---- src/manifest.firefox.json | 4 ---- 4 files changed, 35 deletions(-) delete mode 100644 src/content.npm.js diff --git a/gulpfile.js b/gulpfile.js index c627f2c..dde1637 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -108,16 +108,6 @@ async function buildBrowserExtension(browserType, version, fileExtension) { format: 'iife', }); - // -------------- - // content.npm.js - bundle = await rollup({ - input: path.join(srcDirPath, 'content.npm.js'), - }); - await bundle.write({ - file: path.join(outputDirPath, 'content.npm.js'), - format: 'iife', - }); - // -------------- // background.js bundle = await rollup({ diff --git a/src/content.npm.js b/src/content.npm.js deleted file mode 100644 index 2be19ef..0000000 --- a/src/content.npm.js +++ /dev/null @@ -1,17 +0,0 @@ -import { mountContentScript } from './content'; -import { getPackageInfo } from './content/bridge'; -import { urlParser } from './content/registry/npm'; - -mountContentScript(async () => { - const { registry, packageName, packageVersion } = urlParser(window.location); - const { id, depsDev, totalScore } = await getPackageInfo({ type: registry, name: packageName, version: packageVersion }); - - const div = document.createElement('div'); - div.innerHTML = ` -

overlay

-

${id.name}: ${depsDev.licenses[0]} Stars: ${depsDev.stars} Scorecard: ${depsDev.scorecard} Total Score: ${totalScore}

- `; - - const cubic = document.getElementById('repository')?.parentElement; - cubic?.parentElement?.insertBefore(div, cubic.nextSibling); -}); diff --git a/src/manifest.chrome.json b/src/manifest.chrome.json index 8f418a8..42b9283 100644 --- a/src/manifest.chrome.json +++ b/src/manifest.chrome.json @@ -16,10 +16,6 @@ { "matches": ["*://stackoverflow.com/*"], "js": ["content.stackoverflow.js"] - }, - { - "matches": ["*://www.npmjs.com/package/*"], - "js": ["content.npm.js"] } ], "background": { diff --git a/src/manifest.firefox.json b/src/manifest.firefox.json index b99e705..ea7e5e8 100644 --- a/src/manifest.firefox.json +++ b/src/manifest.firefox.json @@ -10,10 +10,6 @@ { "matches": ["*://stackoverflow.com/*"], "js": ["content.stackoverflow.js"] - }, - { - "matches": ["*://www.npmjs.com/package/*"], - "js": ["content.npm.js"] } ], "background": {