w3c / aria-at-automation-driver

A WebSocket server which allows clients to observe the text enunciated by a screen reader and to simulate user input
Other
10 stars 6 forks source link

Add install and uninstall subcommands #42

Closed mzgoddard closed 6 months ago

mzgoddard commented 7 months ago

Add subcommands for installing text to speech extensions and other support software.

mzgoddard commented 7 months ago

@jugglinmike I think we will need to move in this direction of having install as a separate step from npm install in some way. If a user of the package has two copies of the package installed in two locations, trying to install two copies of the voice will cause issues, at least for macos. On macos having two copies of the speech synthesizer extension will not work. One will be selected over the other by the operating system. If we haven't different versions of the extension will further complicate it, where we probably can't set which version will run. What do you think?

To a lesser point, I think this change will help with getting the package working in CI sooner for us like with https://github.com/w3c/aria-at-automation-driver/pull/34.

jugglinmike commented 7 months ago

Here's how I understand the installation process as implemented on the "main" branch today:

  1. User executes npm install
  2. npm installs Node.js packages
  3. npm invokes an installation script

And here's how I understand it will look if we merge this patch:

  1. User executes npm install
  2. npm installs Node.js packages
  3. User invokes an installation script

Is that accurate? If so, how will changing the actor in step 3 allow us to support multiple simultaneous installations?

mzgoddard commented 7 months ago

This doesn't properly support multiple copies. At minimum I think we'd need to be able to check the version of any installed extension. And a step past that, migrate between versions.

But with this PR you could have, for example for developers on the package, a development copy and a globally installed copy. npm install on both would succeed and not make modifications to operating systems. You can then uninstall operating system changes in one and install the other.

My darwin draft has an isInstalled check that install and uninstall use. I'd like to add that to this for windows too but wasn't immediately sure how to make that check.


I guess part of this is, to me, how npm install is kind of a misnomer. It doesn't install things into the system, it downloads a cache of dependencies described by package.json. I don't think its a good practice for us to use npm install the way we currently do for installing the windows extension.

jugglinmike commented 6 months ago

(This patch is in service of gh-29)