From 467754d92e094402421d2cf5a7885763c6d16869 Mon Sep 17 00:00:00 2001 From: Corey Butler Date: Wed, 6 May 2020 21:35:10 -0500 Subject: [PATCH] Fix discoverability feature (devtooling). --- package-lock.json | 2 +- package.json | 2 +- src/shell.js | 2 +- test/unit/01-sanity/01-sanity.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 520e7ae..b2d95e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@author.io/shell", - "version": "1.5.11", + "version": "1.5.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cc68102..094d045 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@author.io/shell", - "version": "1.5.11", + "version": "1.5.12", "description": "A micro-framework for creating CLI-like experiences. This supports Node.js and browsers.", "main": "src/index.js", "scripts": { diff --git a/src/shell.js b/src/shell.js index 0c584b3..7fa3bf2 100644 --- a/src/shell.js +++ b/src/shell.js @@ -40,7 +40,7 @@ export default class Shell extends Base { this.#tabWidth = cfg.hasOwnProperty('tabWidth') ? cfg.tabWidth : 4 // This sets a global symbol that dev tools can find. - Object.defineProperty(globalThis, Symbol('SHELL_INTEGRATIONS'), { enumerable: false, get () { return this }}) + globalThis[Symbol('SHELL_INTEGRATIONS')] = this } get data () { diff --git a/test/unit/01-sanity/01-sanity.js b/test/unit/01-sanity/01-sanity.js index d6c61eb..7dcc7f6 100644 --- a/test/unit/01-sanity/01-sanity.js +++ b/test/unit/01-sanity/01-sanity.js @@ -10,7 +10,7 @@ test('Sanity Check - Shell', t => { }) t.ok(shell instanceof Shell, 'Basic shell instantiates correctly.') - + t.ok(Object.getOwnPropertySymbols(globalThis).filter(s => globalThis[s] instanceof Shell).length === 1, 'The shell is discoverable.') t.end() })