Skip to content

Commit

Permalink
Fix discoverability feature (devtooling).
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed May 7, 2020
1 parent 44777f2 commit 467754d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/01-sanity/01-sanity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

Expand Down

0 comments on commit 467754d

Please sign in to comment.