From 3ea3e10b1dd0c7d2f025878fc08be33cac314d12 Mon Sep 17 00:00:00 2001 From: unional Date: Mon, 28 Mar 2022 01:33:56 -0700 Subject: [PATCH] feat(commands): add activate() update command-react tests needing to do `app.states.enableMapSet()` during jest and storybook seems complicated. Need to see if it can be improved. --- .../rush/browser-approved-packages.json | 2 +- common/config/rush/pnpm-lock.yaml | 11 +- components/command-react/package.json | 3 +- .../CommandPalette/CommandPalette.stories.tsx | 23 +- .../src/CommandPalette/CommandPalette.tsx | 2 +- ...tte-command-palette-one-command-1-snap.png | Bin 8892 -> 8757 bytes ...tte-override-mac-command-in-mac-1-snap.png | Bin 0 -> 10737 bytes ...-override-mac-command-in-window-1-snap.png | Bin 0 -> 10745 bytes ...alette-command-palette-with-key-1-snap.png | Bin 0 -> 9143 bytes .../src/__snapshots__/index.spec.ts.snap | 561 ------------------ components/command-react/src/setupTests.ts | 3 + frameworks/app/package.json | 1 + frameworks/app/ts/app.ts | 3 +- frameworks/commands/.browserslistrc | 3 + frameworks/commands/babel.config.js | 17 +- frameworks/commands/package.json | 3 +- frameworks/commands/ts/activate.ts | 17 + frameworks/commands/ts/commands.spec.ts | 97 +-- frameworks/commands/ts/commands.ts | 28 +- frameworks/commands/ts/index.ts | 1 + frameworks/commands/ts/log.ts | 3 + frameworks/commands/ts/store.ts | 18 +- 22 files changed, 148 insertions(+), 648 deletions(-) create mode 100644 components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-override-mac-command-in-mac-1-snap.png create mode 100644 components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-override-mac-command-in-window-1-snap.png create mode 100644 components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-with-key-1-snap.png delete mode 100644 components/command-react/src/__snapshots__/index.spec.ts.snap create mode 100644 frameworks/commands/.browserslistrc create mode 100644 frameworks/commands/ts/activate.ts create mode 100644 frameworks/commands/ts/log.ts diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index ea2b382f1..988819434 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -48,7 +48,7 @@ }, { "name": "@just-web/app", - "allowedCategories": [ "production" ] + "allowedCategories": [ "libraries", "production" ] }, { "name": "@just-web/command", diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ddbea43c1..87da7f07f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13,6 +13,7 @@ importers: '@babel/plugin-transform-runtime': ~7.17.0 '@babel/preset-env': ~7.16.11 '@babel/preset-typescript': ~7.16.7 + '@just-web/app': workspace:* '@just-web/commands': workspace:* '@just-web/platform': workspace:* '@storybook/addon-actions': ^6.4.19 @@ -74,6 +75,7 @@ importers: typescript: ^4.6.2 webpack: ^5.70.0 dependencies: + '@just-web/app': link:../../frameworks/app '@just-web/commands': link:../../frameworks/commands '@just-web/platform': link:../../frameworks/platform react: 17.0.2 @@ -148,6 +150,7 @@ importers: '@babel/plugin-transform-runtime': ~7.17.0 '@just-web/errors': workspace:* '@just-web/routes': workspace:* + '@just-web/states': workspace:* '@just-web/testing': workspace:* '@size-limit/preset-small-lib': ^7.0.8 '@types/jest': ^27.4.1 @@ -169,6 +172,7 @@ importers: dependencies: '@just-web/errors': link:../errors '@just-web/routes': link:../routes + '@just-web/states': link:../states standard-log: 6.2.6 type-plus: 4.4.2 devDependencies: @@ -195,6 +199,7 @@ importers: specifiers: '@babel/core': ~7.17.8 '@babel/plugin-transform-runtime': ~7.17.0 + '@just-web/states': workspace:* '@just-web/testing': workspace:* '@size-limit/preset-small-lib': ^7.0.8 '@types/jest': ^27.4.1 @@ -202,7 +207,7 @@ importers: eslint: ^8.11.0 eslint-plugin-harmony: ^6.0.0 eslint-plugin-yml: ~0.14.0 - immutable: ~4.0.0 + immer: ~9.0.12 jest: ^27.5.1 jest-validate: ^27.5.1 jest-watch-suspend: ^1.1.2 @@ -215,7 +220,8 @@ importers: type-plus: ~4.4.1 typescript: ^4.6.2 dependencies: - immutable: 4.0.0 + '@just-web/states': link:../states + immer: 9.0.12 standard-log: 6.2.6 type-plus: 4.4.2 devDependencies: @@ -12107,6 +12113,7 @@ packages: /immutable/4.0.0: resolution: {integrity: sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==} + dev: true /import-fresh/3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} diff --git a/components/command-react/package.json b/components/command-react/package.json index 1a0f333de..84ba11f6f 100644 --- a/components/command-react/package.json +++ b/components/command-react/package.json @@ -18,7 +18,7 @@ "storybook": "start-storybook -p 6006 -s public", "test": "react-app-rewired test --watchAll=false", "test:visual": "cross-env VISUAL_TEST=1 react-app-rewired test --watchAll=false", - "test:watch": "react-scripts test", + "test:watch": "react-app-rewired test", "verify": "run-p build lint depcheck test", "verify:build": "run-s clean build", "verify:test": "run-s test test:visual" @@ -39,6 +39,7 @@ "react-scripts/**/eslint-config-react-app": "7.0.0" }, "dependencies": { + "@just-web/app": "workspace:*", "@just-web/commands": "workspace:*", "@just-web/platform": "workspace:*", "react": "~17.0.2", diff --git a/components/command-react/src/CommandPalette/CommandPalette.stories.tsx b/components/command-react/src/CommandPalette/CommandPalette.stories.tsx index 3d368f56c..cdc2fa42a 100644 --- a/components/command-react/src/CommandPalette/CommandPalette.stories.tsx +++ b/components/command-react/src/CommandPalette/CommandPalette.stories.tsx @@ -1,8 +1,11 @@ +import app from '@just-web/app' import { Command, KeyBinding, registerCommand } from '@just-web/commands' import { FC } from 'react' import { stub } from 'type-plus' import CommandPalette, { CommandPaletteProps } from './CommandPalette' +app.states.enableMapSet() + export default { component: CommandPalette } @@ -20,15 +23,15 @@ const simpleCmd = cmd({ id: 'core.simpleCommand', description: 'Simple command' registerCommand(simpleCmd.id, simpleCmd) const keyCmd = cmd({ - description: 'Simple command', - id: 'core.simpleCommand', + description: 'Command with key', + id: 'core.keyedCommand', key: 'ctrl+s' }) registerCommand(keyCmd.id, keyCmd) const macCmd = cmd({ - description: 'Simple command', - id: 'core.simpleCommand', + description: 'Command with mac key override', + id: 'core.macCommand', key: 'ctrl+s', mac: 'cmd+s' }) @@ -38,12 +41,12 @@ export const NoCommand = () => export const OneCommand = () => -export const WithOneKey = () => +export const WithKey = () => -export const WithOverrideKeyInMac = () => true }} /> -export const WithoutOverrideKeyInMac = () => true }} /> +export const OverrideMacCommandInWindow = () => false }} /> diff --git a/components/command-react/src/CommandPalette/CommandPalette.tsx b/components/command-react/src/CommandPalette/CommandPalette.tsx index 9fcd15dd7..d75e4f3ec 100644 --- a/components/command-react/src/CommandPalette/CommandPalette.tsx +++ b/components/command-react/src/CommandPalette/CommandPalette.tsx @@ -18,7 +18,7 @@ export interface CommandPaletteProps { function toPaletteCommands(cmds: CommandPaletteProps['commands'], ctx: CommandPaletteCtx) { const m = ctx.isMacOS() return cmds.map(c => ({ - name: c.id, + name: c.description, key: m ? c.mac ?? c.key : c.key, command: () => invokeCommand(c.id) })) diff --git a/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-one-command-1-snap.png b/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-one-command-1-snap.png index 8878f6d251f8b65a3fd38719f36061cbc2e31c01..87cddd38066540c52aa303eec814a9a0ae03fe0d 100644 GIT binary patch literal 8757 zcmeHNcTkgQw|@~=bQJ_eij*L_QU#GF(p(9mf?@$d5Tc-h(nLBW1of_juAd7CA}k;( zC4_(^)I^0ONJpeMNu-7rAcPPg_lbMw&Yk)G`F8Gi|F|>z&cNHwbKY})=RBuPVlG~= z68(Aq&kzKOo;?G<3_-$55VXZ{`!?_-J^0ama1si*Y;_7MZk3;cASLK5{8zisjM*U{ zZx;@#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!GJ zW{Ujk@2`a!eE)vWzJ2>{#9%>BH=;51d~v7(n19!!PPsj>D$v`BmW{<}s>oCyI*ZyN zT#^~R@-yrZp!AEa&Q_o~-ESH^EvXF$+?_iMyRxb3gwj$Lsfy9CZHvc-P;!7bJ$$&G z1JK`QZ~bN&)3KzbDC~_7zgT5sGhoW6w?WTpi()(cTMxmdb0Mc~9m&on3Z9JbAV;_& zK^ts^ov(+WOWlam;1`h(K!krZPv36;vx)qM!#5nh#l?S3RK5knw_x~R2gAz`L{Pzq o`U?LS;F}+PBiaA!3S$!^El>B_-f$Syo)C2I>_scwX^(sV0Zw-s3;+NC diff --git a/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-override-mac-command-in-mac-1-snap.png b/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-override-mac-command-in-mac-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..322e86c839ecf57eb0eea5097bb1afbc27756129 GIT binary patch literal 10737 zcmeHtcT`hbx9`S=iWoW41Ox@!Q2`O9L-0tkP(->^1q2Q?A_NE!Jhn&+76hdoK|quu zAT3lC2?`Q1QX(V~BE5tJ69|OluI;^djC=3*-XG__?|Xk8#$fD`z1Nz1{$`(Z?K|hJ z%*8j$ZH6F7{PZc4^ANOl7X+%~j`+hBcZt=oW?;~!9=?AN){&vS* zitV3T6+BBL6cZ-Tkdr0DKSk*I_iAZY`5Yxb&HgMF6n1jA@osUM?XrLD#GQ`WUGbWR z{G=P@;n5nuiV0dU_~jnGQ+IsPeI8@PtgkC6DDVNCLce4J;8yj1o_(7M_ zgh4Clg#P*EZHMJ6mW4EfXEZZCooJbZXRfiTBz#+n~v^SgeIq_^%>eM4u{h-G-N9skl|}rb zvRP?qscMQ6(tYY;QvKZA+(4DDb@A=jvht0`FF$X_io}bZedqMiZ?Gl^^<$z3hjXe4 zbasuP_?Y(3QmXd%l{jygkRTZ@x|TRqC`Zfe6*2o&CuS+ss4p;!vLuQx4~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d8|GTOddl{hvd} z|Jib-qI~DApF+^4T=-jn^9~L_GfQYnNoTT>$kCJy8n)3N)Pt#feT^!N@QHG+^x zsW@!(p|dj|6b}S_yy@tV9X9siHg*p7Y0;4ov?ag1Ry!I)PiaP{fT^V=p3S}@anuTo zPY({+IfCO#Fm6V%zrT-cDAJ_qMI5ur(vetQT?JYNJ=7X#8#6A-6&#L&ZX4BODr4&7 z;{%Ql2gL)jHl}J^naaRl%TwJ2Nbtg?q@-Xv2F4~E!MNH7Wm7ljU~iu$dTLmDo5axw zcwQT`UB5drv6D;nL9SXZCGVe#c_~0dW zb@C1--$RB#o%QV5vu#QcwEf)08(ReF)b0U^U0x+eeyhw?xpXRWqXZQHSx!Ov?fTnG zvY0jA3f>`K-jwd9HG&L&JG_ecU>2E{&+mQb0Ul{(A-HMMrDxL5pYL`kS7-2)FO|4AI Je)Ig}-vDx=@Pq&W literal 0 HcmV?d00001 diff --git a/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-override-mac-command-in-window-1-snap.png b/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-override-mac-command-in-window-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..26ba1f0a98dcf429e677678551283bfbdfb12d31 GIT binary patch literal 10745 zcmeHtcT`i`*6&7C&H)t>=_QCB8%Plll;%;26+}?bh(U^gbm>9}iWI3f1f?B8L8;P0 zPZTKv0w?rhh!E+75CSQXgtxZ$y)oW>cf2va^L_XJcNl}QNA_NOuGxQc&b1$1GBe#S zC@ly<(Dt)uj4neEzXAkpviW5zxbrIDfj7AD`Cc|X1r>M6&O(p^bk^v1tDtlW5gp&Z znlVG`Rulg6^`p*5g-sLC$SEn=i0q<@`HK0^cS>Eq9kZ_U|Ll38-mOgQV#CFeRKK*; zW3!dBmDFCu<0>FL4Y ze7AAVw}TpXJw0xYCo$9M4qa4qn6TwQPtVbvfV*EWD6N7^I6WHTgP^A(3J`Si=%&pO zbjBnc+;95@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LM;IgZTZEF*N+@M;!we-uv_jf9YHb$0Dw}Af_ zKYOu7S^od`@cc;T3K&TKng@Ri@W02|+AInD=Cq|9GGTi?p)8EBIty1g5W{&$BzK)1)-Dm%t;?(V`Fgc z+q^~M#?IvAWN=RCsa@y;Cb3`I91OO`V#9&frUtKAS;6DvWk>{!v)?8+8;{o_L1`ne z5Q#i#^kqmy!J*K5k4k;I$M&{~)1Z2IKJdN4y6l(t@7{ruR%e$2SpgX%B;f)OSB{#M=Js{6NmV)nNq{q0EqZbzEh;AgyZ*Aoni1O*8Moi#Qy KDn4cR;C}(5Knp1V literal 0 HcmV?d00001 diff --git a/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-with-key-1-snap.png b/components/command-react/src/__image_snapshots__/index-spec-ts-image-storyshots-command-palette-command-palette-with-key-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..6830914ecba68819b4952de9efa7eac77ee4c10d GIT binary patch literal 9143 zcmeHNc~Fztmj9F%Y*7#ugR+XPDElf~0=6P(BcLLSAfSMNYypuyEG`e(qiq8!TMGiR z#)#~YXhRYN1OWqRfC%ZZ1&9Gc!jfcex?k12s#h~ruinf*GyVOO``z4o?z!ju&YGlL zu(jH?=T@F)}4hCkoa)PYky|dh}?d z*4J)@!|CIOi9kKDFy%jXQE_qh95waS z*K>L5L;u*AyqaTGaZ+xOhsV_f9-Gyp*LPVXwiQSuTXr^fbw1@ot|6(y zp|Y#{Z{-Re$0CqlTBE~uN=n)_BI&{K{QUg>p`jBKSgDKbW;JRV;Gc-~B6VT+)6|LP z@u;ls*!9^muZ1sl*iahrW=7eqrYt7O`{)KrysfPbaN*`Y-W2Amf8s=T1Dnkzl-lHW zxjjt1Ai_)tz`c9-=o=r&WQV%Eu3_EywJgky*K`lR&0Ird!4l#n3RgbV zG+1VrGi=pyzt5|c)#4LG#UY+Od)CEB?F(*C+V!{w{}>TJJ5T~c?Si1X%hdjU)^N_o z4?45my>O})ImUyK?B1O;UP72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`+OPR?}b}O9v4*Ip8_<-R3?vRS8SGN#6!NF%N9{07#`(H9{au)Os%RpJn8~6R!WMCjE=pUn2Q09Kc`D_zN2U zPoUA&alHxrQ{aa1zX1PFuKd?E|JQ2bzud-u11`R~?+-ti%9llULf|=f#@3?d)U~_+ E0TmG50RR91 literal 0 HcmV?d00001 diff --git a/components/command-react/src/__snapshots__/index.spec.ts.snap b/components/command-react/src/__snapshots__/index.spec.ts.snap deleted file mode 100644 index 443e949c7..000000000 --- a/components/command-react/src/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,561 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Storyshots Command Palette/Command Palette No Command 1`] = ` -Array [ -

- ctrl+p to show the command palette -
, -
- -
-
-
-
-
- -
-
-
-
-
-
, -] -`; - -exports[`Storyshots Command Palette/Command Palette One Command 1`] = ` -Array [ -
- ctrl+p to show the command palette -
, -
- -
-
-
-
-
- -
-
-
-
-
-
, -] -`; - -exports[`Storyshots Command Palette/Command Palette With One Key 1`] = ` -Array [ -
- ctrl+p to show the command palette -
, -
- -
-
-
-
-
- -
-
-
-
-
-
, -] -`; - -exports[`Storyshots Command Palette/Command Palette With Override Key In Mac 1`] = ` -Array [ -
- ctrl+p to show the command palette -
, -
- -
-
-
-
-
- -
-
-
-
-
-
, -] -`; - -exports[`Storyshots Command Palette/Command Palette Without Override Key In Mac 1`] = ` -Array [ -
- ctrl+p to show the command palette -
, -
- -
-
-
-
-
- -
-
-
-
-
-
, -] -`; diff --git a/components/command-react/src/setupTests.ts b/components/command-react/src/setupTests.ts index c66260262..78eadc561 100644 --- a/components/command-react/src/setupTests.ts +++ b/components/command-react/src/setupTests.ts @@ -1,3 +1,4 @@ +import app from '@just-web/app' import initStoryshots from '@storybook/addon-storyshots' import { imageSnapshot } from '@storybook/addon-storyshots-puppeteer' // jest-dom adds custom jest matchers for asserting on DOM nodes. @@ -10,6 +11,8 @@ import ReactDOM from 'react-dom' ReactDOM.createPortal = node => node as any // jest.mock('rc-util/lib/Portal') +app.states.enableMapSet() + if (process.env.VISUAL_TEST) initStoryshots({ suite: 'Image storyshots', test: imageSnapshot() }) else initStoryshots() diff --git a/frameworks/app/package.json b/frameworks/app/package.json index a951298b8..c36707a71 100644 --- a/frameworks/app/package.json +++ b/frameworks/app/package.json @@ -17,6 +17,7 @@ }, "dependencies": { "@just-web/errors": "workspace:*", + "@just-web/states": "workspace:*", "@just-web/routes": "workspace:*", "standard-log": "~6.2.6", "type-plus": "~4.4.1" diff --git a/frameworks/app/ts/app.ts b/frameworks/app/ts/app.ts index 8a6af928f..a4e115f6d 100644 --- a/frameworks/app/ts/app.ts +++ b/frameworks/app/ts/app.ts @@ -1,9 +1,10 @@ import { registerRoute } from '@just-web/routes' import { BrowserError, JustWebError } from '@just-web/errors' import { start } from './start' - +import * as states from '@just-web/states' export const app = { errors: { BrowserError, JustWebError }, routes: { registerRoute }, + states, start } diff --git a/frameworks/commands/.browserslistrc b/frameworks/commands/.browserslistrc new file mode 100644 index 000000000..a559e6617 --- /dev/null +++ b/frameworks/commands/.browserslistrc @@ -0,0 +1,3 @@ +defaults +ie >= 11 +current node diff --git a/frameworks/commands/babel.config.js b/frameworks/commands/babel.config.js index 50eff14f6..62f5cbe97 100644 --- a/frameworks/commands/babel.config.js +++ b/frameworks/commands/babel.config.js @@ -1,21 +1,8 @@ module.exports = { presets: [ - [ - '@babel/preset-env', - { - targets: { - node: 'current', - }, - }, - ], - ['@babel/preset-typescript', { - allowNamespaces: true - }], - ], + '@babel/preset-env', + ['@babel/preset-typescript', { allowNamespaces: true }]], plugins: [ - '@babel/plugin-proposal-class-properties', - '@babel/plugin-proposal-optional-chaining', - '@babel/plugin-proposal-nullish-coalescing-operator', '@babel/plugin-transform-runtime' ], }; diff --git a/frameworks/commands/package.json b/frameworks/commands/package.json index a5ee920b1..d4facaeba 100644 --- a/frameworks/commands/package.json +++ b/frameworks/commands/package.json @@ -16,9 +16,10 @@ "verify:build": "run-s clean build" }, "dependencies": { + "@just-web/states": "workspace:*", "standard-log": "~6.2.6", "type-plus": "~4.4.1", - "immutable": "~4.0.0" + "immer": "~9.0.12" }, "devDependencies": { "@just-web/testing": "workspace:*", diff --git a/frameworks/commands/ts/activate.ts b/frameworks/commands/ts/activate.ts new file mode 100644 index 000000000..62c81dfa8 --- /dev/null +++ b/frameworks/commands/ts/activate.ts @@ -0,0 +1,17 @@ +import { createState } from '@just-web/states' +import { store } from './store' +import { Command } from './types' + +/** + * Activate function will be called by `@just-web/app` at load time. + */ +export function activate() { + // TODO: handle when user uses ES5 only and does not support `Map` + const [commands, setCommands, onChange] = createState>( + store.getCommands() + ) + + store.activate(commands, setCommands, onChange) + return { onChange } +} + diff --git a/frameworks/commands/ts/commands.spec.ts b/frameworks/commands/ts/commands.spec.ts index 01f3127d0..de3740eab 100644 --- a/frameworks/commands/ts/commands.spec.ts +++ b/frameworks/commands/ts/commands.spec.ts @@ -1,58 +1,79 @@ +import { enableMapSet } from '@just-web/states' import { assertLog } from '@just-web/testing' import { configForTest, MemoryLogReporter } from 'standard-log' -import { stub } from 'type-plus' -import { clearCommands, CommandRegistration, getCommands, invokeCommand, registerCommand } from '.' +import { compose, stub } from 'type-plus' +import { + activate, clearCommands, CommandRegistration, + getCommands, invokeCommand, registerCommand +} from '.' let reporter: MemoryLogReporter -beforeEach(() => reporter = configForTest().reporter) -describe('registerCommand()', () => { - beforeEach(clearCommands) +beforeAll(enableMapSet) - test('register a command', () => { - registerCommand('just-web.commandPalette', { - description: 'Open Command Palette', - handler() { } - }) - }) +beforeEach(compose(() => reporter = configForTest().reporter, clearCommands)) - test('log a warning if registering with existing id', () => { - registerCommand('command1', stub()) + +describe('registerCommand()', () => { + test('can register before activate()', () => { registerCommand('command1', stub()) - assertLog(reporter, `(WARN) Registering an already registered command: 'command1'`) + const cmds = getCommands() + expect(cmds.size).toBe(1) }) -}) - -describe('invokeCommand()', () => { - beforeEach(clearCommands) + describe('after activate()', () => { + beforeEach(activate) + test('register a command', () => { + registerCommand('just-web.commandPalette', { + description: 'Open Command Palette', + handler() { } + }) + }) - test('invoke not registered command emits an error', () => { - invokeCommand('not-exist') + test('log a warning if registering with existing id', () => { + registerCommand('command1', stub()) + registerCommand('command1', stub()) + assertLog(reporter, `(WARN) Registering an already registered command: 'command1'`) + }) + }) +}) - assertLog(reporter, `(ERROR) Invoking not registered command: 'not-exist'`) +describe('getCommands()', () => { + test('return empty Map before activate', () => { + const cmds = getCommands() + expect(cmds.size).toBe(0) }) + describe('after activate()', () => { + beforeEach(activate) + + test('empty at the beginning', () => { + const cmds = getCommands() + expect(cmds.size).toEqual(0) + }) - test('invoke command', () => { - let called = false - const cmd = stub({ handler: () => called = true }) - registerCommand('command1', cmd) - invokeCommand('command1') - expect(called).toBe(true) + test('get registered commands', () => { + registerCommand('cmd1', stub()) + registerCommand('cmd2', stub()) + const cmds = getCommands() + expect(Array.from(cmds.values())).toEqual([{ id: 'cmd1' }, { id: 'cmd2' }]) + }) }) }) -describe('getCommands', () => { - beforeEach(clearCommands) +describe('invokeCommand()', () => { + describe('after activate()', () => { + beforeEach(activate) + test('invoke not registered command emits an error', () => { + invokeCommand('not-exist') - test('empty at the beginning', () => { - const cmds = getCommands() - expect(cmds).toEqual([]) - }) + assertLog(reporter, `(ERROR) Invoking not registered command: 'not-exist'`) + }) - test('get registered commands', () => { - registerCommand('cmd1', stub()) - registerCommand('cmd2', stub()) - const cmds = getCommands() - expect(cmds).toEqual([{ id: 'cmd1' }, { id: 'cmd2' }]) + test('invoke command', () => { + const cmd = stub({ handler: jest.fn() }) + registerCommand('command1', cmd) + invokeCommand('command1') + expect(cmd.handler).toHaveBeenCalledTimes(1) + }) }) }) + diff --git a/frameworks/commands/ts/commands.ts b/frameworks/commands/ts/commands.ts index d21b7c3ba..c3cdc8db6 100644 --- a/frameworks/commands/ts/commands.ts +++ b/frameworks/commands/ts/commands.ts @@ -1,38 +1,36 @@ +import produce from 'immer' import { Omit } from 'type-plus' -import { Map } from 'immutable' -import { log } from './store' +import { store } from './store' +import { log } from './log' import { Command } from './types' -let commands = Map() - export type CommandRegistration = Omit +export function getCommands() { + return store.getCommands() +} + export function registerCommand(id: string, command: CommandRegistration) { log.trace('registerCommand', id) + const commands = store.getCommands() if (commands.has(id)) { log.warn(`Registering an already registered command: '${id}'`) return } const cmd = { ...command, id } - commands = commands.set(id, cmd) + store.setCommands(produce(commands, m => m.set(id, cmd))) } export function invokeCommand(id: string) { log.trace('invokeCommand', id) - const cmd = commands.get(id) + const cmd = store.getCommands().get(id) cmd ? cmd.handler() : log.error(`Invoking not registered command: '${id}'`) } -/** - * Gets commands in an array. - * ? Don't know if this is a good idea as it eliminates the benefits of immutables - */ -export function getCommands() { - return commands.toArray().map(v => v[1]) -} - export function clearCommands() { log.trace('clearCommands') - commands = commands.clear() + store.setCommands(produce( + store.getCommands(), + (m: Map) => void m.clear())) } diff --git a/frameworks/commands/ts/index.ts b/frameworks/commands/ts/index.ts index 0340398c0..b02689c8d 100644 --- a/frameworks/commands/ts/index.ts +++ b/frameworks/commands/ts/index.ts @@ -1,3 +1,4 @@ +export * from './activate' export * from './commands' export type { Command, KeyBinding } from './types' diff --git a/frameworks/commands/ts/log.ts b/frameworks/commands/ts/log.ts new file mode 100644 index 000000000..2259e3076 --- /dev/null +++ b/frameworks/commands/ts/log.ts @@ -0,0 +1,3 @@ +import { getLogger } from 'standard-log' + +export const log = getLogger('@just-web/commands') diff --git a/frameworks/commands/ts/store.ts b/frameworks/commands/ts/store.ts index 2259e3076..9a2bddc09 100644 --- a/frameworks/commands/ts/store.ts +++ b/frameworks/commands/ts/store.ts @@ -1,3 +1,17 @@ -import { getLogger } from 'standard-log' +import { OnStateChange, SetState } from '@just-web/states' +import { Command } from './types' -export const log = getLogger('@just-web/commands') +let cmds: Map = new Map() +let setCmds: SetState> = (value) => cmds = value +export const store = { + getCommands() { return cmds }, + setCommands(commands: Map) { setCmds(commands) }, + activate( + commands: Map, + setValue: SetState>, + onChange: OnStateChange>) { + cmds = commands + onChange(v => cmds = v) + setCmds = setValue + } +}