Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize repo from module template #69

Closed
wants to merge 5 commits into from

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Jan 17, 2023

  • Update Yarn to v3
  • Bring over updated GitHub workflows from module template, including those for automated publishing
  • Bump ESLint config packages to 11.x and apply any fixes necessary to satisfy new changes, including addition of any missing JSDocs
  • Add Prettier to lint pipeline, applying any fixes necessary
  • Bump TypeScript to 4.8.x
  • Add TypeDoc
  • Add standard sections to README, including Contributing

@mcmire mcmire requested a review from a team as a code owner January 17, 2023 21:28
@socket-security
Copy link

socket-security bot commented Jan 17, 2023

New dependency changes detected. Learn more about Socket for GitHub ↗︎


🚨 Potential security issues found in this pull request. To accept the risk, merge this PR and you will not be notified again.

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore es5-ext@0.10.62
📜 Install scripts

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Package Script field Source
es5-ext@0.10.62 (upgraded) postinstall package.json via tinyify@3.1.0
Pull request alert summary
Issue Status
Install scripts ⚠️ 1 issue
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
@metamask/eslint-config-browser@11.1.0 None +109 metamaskbot
@metamask/eslint-config-typescript@11.1.0 None +110 metamaskbot
@metamask/eslint-config-nodejs@11.1.0 None +110 metamaskbot
prettier-plugin-packagejson@2.4.3 None +18 matzkoh
ts-node@10.9.1 filesystem, shell, environment +15 cspotcode
eslint-plugin-prettier@4.2.1 None +44 jounqin
eslint-config-prettier@8.8.0 None +42 lydell
eslint-plugin-jsdoc@39.9.1 None +48 gajus
@types/node@17.0.45 None +0 types
typedoc@0.23.28 network, filesystem, shell, environment +10 typedoc-bot
⬆️ Updated Package Version Diff Added Capability Access +/- Transitive Count Publisher
@lavamoat/allow-scripts@2.3.0 2.0.3...2.3.0 None +15/-15 kumavis
tape@5.6.3 5.0.0...5.6.3 environment +58/-32 ljharb
browserify@16.5.2 16.5.1...16.5.2 None +25/-27 goto-bus-stop
typescript@4.8.4 4.0.3...4.8.4 None +0/-0 typescript-bot
tinyify@3.1.0 3.0.0...3.1.0 None +38/-37 substack
@metamask/eslint-config@11.1.0 4.1.0...11.1.0 None +108/-83 metamaskbot
eslint-plugin-import@2.27.5 2.22.1...2.27.5 None +96/-82 ljharb
sinon@9.2.4 9.0.2...9.2.4 environment +6/-6 mrgnrdrck
eslint@8.38.0 7.11.0...8.38.0 environment +41/-59 eslintbot

🚮 Removed packages: @typescript-eslint/eslint-plugin@4.5.0, @typescript-eslint/parser@4.5.0, eslint-plugin-json@2.1.1

types: [closed]
workflow_call:
secrets:
NPM_TOKEN:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we will need to add an NPM_TOKEN in order to merge this pull request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been setup

@@ -1,61 +1,64 @@
{
"name": "@metamask/detect-provider",
"version": "2.0.0",
"description": "A tiny utility for detecting the MetaMask Ethereum provider, or any EIP 1193-compliant provider.",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no functional changes to this file. The Node version should be the same as well as the set of published files. I did change typings to types but that should work the same.

window.addEventListener = sinon.fake()
window.removeEventListener = sinon.fake()
console.error = sinon.fake()
global.addEventListener = sinon.fake();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint was complaining that window was unavailable in Node tests. We do set it at the top of this file, but since it's global, I opted to change all instances of window to global in this file.

"strict": true,
"target": "ES2015"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to keep the ES target the same, although I think we could upgrade this in a future PR.

"bugs": {
"url": "https://github.com/MetaMask/detect-provider/issues"
"scripts": {
"build": "./build.sh",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to keep the build script the same, but in a future PR, I think we could just use tsc in a future PR like we do in the module template. That would raise the question on how to use this library in a Node context, but I really wonder whether that makes sense.

@mcmire
Copy link
Contributor Author

mcmire commented Jan 17, 2023

With regard to the Socket report above, es5-ext's postinstall script has some extraneous code in it for protest purposes, but this appears to be innocuous. We may be able to remove this dependency by upgrading either browserify or tinyify (or removing those dependencies altogether).

@mcmire
Copy link
Contributor Author

mcmire commented Jan 17, 2023

Here are the differences for dist/index.js before this PR and after:

--- /tmp/detect-provider-before.js	2023-01-17 14:42:34
+++ /tmp/detect-provider-after.js	2023-01-17 14:41:50
@@ -1,4 +1,13 @@
 "use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
 /**
  * Returns a Promise that resolves to the value of window.ethereum if it is
  * set within the given timeout, or null.
@@ -6,58 +15,71 @@
  * are provided.
  *
  * @param options - Options bag.
- * @param options.mustBeMetaMask - Whether to only look for MetaMask providers.
- * Default: false
+ * @param options.mustBeMetaMask - Whether to only look for MetaMask providers
+ * (default: false).
  * @param options.silent - Whether to silence console errors. Does not affect
- * thrown errors. Default: false
+ * thrown errors (default: false).
  * @param options.timeout - Milliseconds to wait for 'ethereum#initialized' to
- * be dispatched. Default: 3000
+ * be dispatched (default: 3000).
  * @returns A Promise that resolves with the Provider if it is detected within
  * given timeout, otherwise null.
  */
 function detectEthereumProvider({ mustBeMetaMask = false, silent = false, timeout = 3000, } = {}) {
-    _validateInputs();
-    let handled = false;
-    return new Promise((resolve) => {
-        if (window.ethereum) {
-            handleEthereum();
-        }
-        else {
-            window.addEventListener('ethereum#initialized', handleEthereum, { once: true });
-            setTimeout(() => {
+    return __awaiter(this, void 0, void 0, function* () {
+        _validateInputs();
+        let handled = false;
+        return new Promise((resolve) => {
+            if (window.ethereum) {
                 handleEthereum();
-            }, timeout);
-        }
-        function handleEthereum() {
-            if (handled) {
-                return;
             }
-            handled = true;
-            window.removeEventListener('ethereum#initialized', handleEthereum);
-            const { ethereum } = window;
-            if (ethereum && (!mustBeMetaMask || ethereum.isMetaMask)) {
-                resolve(ethereum);
-            }
             else {
-                const message = mustBeMetaMask && ethereum
-                    ? 'Non-MetaMask window.ethereum detected.'
-                    : 'Unable to detect window.ethereum.';
-                !silent && console.error('@metamask/detect-provider:', message);
-                resolve(null);
+                window.addEventListener('ethereum#initialized', handleEthereum, {
+                    once: true,
+                });
+                setTimeout(() => {
+                    handleEthereum();
+                }, timeout);
             }
+            /**
+             * Reads `window.ethereum`, resolving the promise with the value if it is is
+             * present and matches the requirement of being a MetaMask provider or if no
+             * such requirement has been specified; or otherwise rejects the promise
+             * with an error.
+             */
+            function handleEthereum() {
+                if (handled) {
+                    return;
+                }
+                handled = true;
+                window.removeEventListener('ethereum#initialized', handleEthereum);
+                const { ethereum } = window;
+                if (ethereum && (!mustBeMetaMask || ethereum.isMetaMask)) {
+                    resolve(ethereum);
+                }
+                else {
+                    const message = mustBeMetaMask && ethereum
+                        ? 'Non-MetaMask window.ethereum detected.'
+                        : 'Unable to detect window.ethereum.';
+                    !silent && console.error('@metamask/detect-provider:', message);
+                    resolve(null);
+                }
+            }
+        });
+        /**
+         * Ensures that the options to `detectEthereumProvider` are correct.
+         */
+        function _validateInputs() {
+            if (typeof mustBeMetaMask !== 'boolean') {
+                throw new Error(`@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.`);
+            }
+            if (typeof silent !== 'boolean') {
+                throw new Error(`@metamask/detect-provider: Expected option 'silent' to be a boolean.`);
+            }
+            if (typeof timeout !== 'number') {
+                throw new Error(`@metamask/detect-provider: Expected option 'timeout' to be a number.`);
+            }
         }
     });
-    function _validateInputs() {
-        if (typeof mustBeMetaMask !== 'boolean') {
-            throw new Error(`@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.`);
-        }
-        if (typeof silent !== 'boolean') {
-            throw new Error(`@metamask/detect-provider: Expected option 'silent' to be a boolean.`);
-        }
-        if (typeof timeout !== 'number') {
-            throw new Error(`@metamask/detect-provider: Expected option 'timeout' to be a number.`);
-        }
-    }
 }
 module.exports = detectEthereumProvider;
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQWdCQTs7Ozs7Ozs7Ozs7Ozs7O0dBZUc7QUFDSCxTQUFTLHNCQUFzQixDQUErQixFQUM1RCxjQUFjLEdBQUcsS0FBSyxFQUN0QixNQUFNLEdBQUcsS0FBSyxFQUNkLE9BQU8sR0FBRyxJQUFJLEdBQ2YsR0FBRyxFQUFFO0lBRUosZUFBZSxFQUFFLENBQUM7SUFFbEIsSUFBSSxPQUFPLEdBQUcsS0FBSyxDQUFDO0lBRXBCLE9BQU8sSU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cgRXJyb3IoYEBtZXRhbWFzay9kZXRlY3QtcHJvdmlkZXI6IEV4cGVjdGVkIG9wdGlvbiAndGltZW91dCcgdG8gYmUgYSBudW1iZXIuYCk7XG4gICAgfVxuICB9XG59XG4iXX0=
+//# sourceMappingURL=index.js.map
\ No newline at end of file

* Update Yarn to v3
* Bring over updated GitHub workflows from module template, including
  those for automated publishing
* Bump ESLint config packages to 11.x and apply any fixes necessary to
  satisfy new changes, including addition of any missing JSDocs
* Add Prettier to lint pipeline, applying any fixes necessary
* Bump TypeScript to 4.8.x
* Add TypeDoc
* Add standard sections to README, including Contributing
required: true
type: string
secrets:
PUBLISH_DOCS_TOKEN:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will also need a PUBLISH_DOCS_TOKEN in order to merge this pull request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been setup

@mcmire
Copy link
Contributor Author

mcmire commented Apr 19, 2023

@legobeat Thanks for trying to get these tests to pass. I opted to merge the build job into the lint job and that seemed to fix the issue. Do you think your change is needed any longer?

@legobeat
Copy link
Contributor

Cheers @mcmire and yes, if build-before-lint is fine then the .gitkeep file doesn't seem necessary 👍

@@ -1,4139 +1,6750 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that the yarn upgrade rewrites the entire lockfile and the rest of the changes are quite wide, is it possible to do the yarn upgrade and lockfile regeneration separately from the rest?

@MetaMask MetaMask deleted a comment from metamaskbot Apr 20, 2023
@MetaMask MetaMask deleted a comment from metamaskbot Apr 20, 2023
@legobeat
Copy link
Contributor

legobeat commented Apr 20, 2023

The upgrade of es5-ext from 0.10.50 to 0.10.62 actually introduces a nagware postinstall script which reads the local system timezone and changes behavior (displaying a message) based on the result. Are we OK with depending on it considering that?

OP thread: medikoo/es5-ext#116

The postinstall script is present from 0.10.54.

@Gudahtt
Copy link
Member

Gudahtt commented Apr 20, 2023

I'm not seeing a reference to es5-ext@0.10.62 in the lockfile - the only reference appears to be to v0.10.53 (both before and after this PR)

@legobeat
Copy link
Contributor

legobeat commented Apr 20, 2023

I'm not seeing a reference to es5-ext@0.10.62 in the lockfile - the only reference appears to be to v0.10.53 (both before and after this PR)

You're right. I (got) caught (by) it by looking at the Socket Security bot. Curiously, it still flags for 0.10.62 despite forcing a rerun: https://github.com/MetaMask/detect-provider/pull/69/checks?check_run_id=12882624815

@mcmire mcmire marked this pull request as draft June 7, 2023 16:02
@mcmire
Copy link
Contributor Author

mcmire commented Jun 7, 2023

I've extracted the Yarn v3 upgrade to a separate PR: #82 /cc @legobeat

I may be able to extract some other things as well to break this PR up further. Putting this in draft in the meantime.

@mcmire
Copy link
Contributor Author

mcmire commented Nov 15, 2023

I'll break this up into pieces.

@mcmire mcmire closed this Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants