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

package.json: Add chrome-open script #247

Merged
merged 1 commit into from
Jan 11, 2017

Conversation

josephfrazier
Copy link
Member

@josephfrazier josephfrazier commented Jan 10, 2017

Like the firefox-open script, this builds and loads the extension into
an isolated instance of Chrome, using chrome-launch. This has a couple
of benefits:

  1. New developers can get up-and-running faster
  2. It's easier to test Chrome without any other user settings

One caveat so far is that Chrome opens in the background rather than the
foreground, but this is alleviated by printing a message out informing
the developer.

EDIT: Disregard the AppVeyor failure. It's flakiness we've seen before: #115 (comment)

Like the `firefox-open` script, this builds and loads the extension into
an isolated instance of Chrome, using [chrome-launch]. This has a couple
of benefits:

1. New developers can get up-and-running faster
2. It's easier to test Chrome without any other user settings

One caveat so far is that Chrome opens in the background rather than the
foreground, but this is alleviated by printing a message out informing
the developer.

[chrome-launch]: https://github.com/hughsk/chrome-launch
@@ -48,6 +49,7 @@
"babel-loader": "6.2.10",
"babel-plugin-transform-object-rest-spread": "6.20.2",
"babel-preset-es2015": "6.18.0",
"chrome-launch": "1.1.4",
Copy link
Member

Choose a reason for hiding this comment

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

What about declaring chrome-launch as an optionalDependencies along with web-ext?

Copy link
Member Author

@josephfrazier josephfrazier Jan 10, 2017

Choose a reason for hiding this comment

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

Hmm, I'm not sure if this is a good idea. I tried two different ways of doing it:

  1. Move those packages from devDependencies to optionalDependencies. However, due to the shrinkwrap, this results in those packages not getting installed at all. Here's a commit where I tried it, with more details in the message: josephfrazier@8e18566
    EDIT: This also breaks the build: https://travis-ci.org/josephfrazier/browser-extension/builds/190786758#L516

  2. Just add those packages to optionalDependencies, while keeping them in devDependencies and npm-shrinkwrap.json. I'm not sure if this accomplishes anything or even makes sense, given Optional devDependencies? npm/npm#3870. It doesn't seem to break the install/chrome-open workflow, for what it's worth. Here's the test commit: josephfrazier@95b6e66

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Ahhh I wasn't aware of the issue with the shrinkwrap. Declaring the dependencies twice doesn't sound right either. Let's continue with the good old way 😉

Copy link
Member Author

Choose a reason for hiding this comment

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

Awesome, thanks for merging!

Copy link
Member

@stefanbuck stefanbuck left a comment

Choose a reason for hiding this comment

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

Just one tiny suggestion other than that looks good.

@stefanbuck stefanbuck merged commit 4c78d4a into OctoLinker:master Jan 11, 2017
@josephfrazier josephfrazier deleted the npm-run-chrome-open branch January 11, 2017 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants