Conversation
| const open = url => { | ||
| const openers = { darwin: 'open', win32: 'start' } | ||
| const cmdName = openers[process.platform] || 'xdg-open' | ||
| exec(`${cmdName} ${url}`) |
There was a problem hiding this comment.
There's probably a node module for this.
There was a problem hiding this comment.
That said this looks short and sweet :P
There was a problem hiding this comment.
There is one that does this and some checking, but for our use case we don't need the extra stuff https://github.com/domenic/opener/blob/master/opener.js
There was a problem hiding this comment.
It's a pretty small module though. Ok with me
There was a problem hiding this comment.
|
An ENV to avoid this behavior might be cool? |
|
@rauchg webpack-dev-server uses |
bin/next-dev
Outdated
| const srv = new Server({ dir, dev: true }) | ||
| await srv.start(argv.port) | ||
| console.log('> Ready on http://localhost:%d', argv.port); | ||
| open(`http://localhost:${argv.port}`) |
There was a problem hiding this comment.
I think an env var is more appropriate because it's a user preference, not a project preference. It's not something you would add to the scripts commands, for example.
NEXT_OPEN_BROWSER=0 to disable it would be cool. We can check for lose equality of '0' or 'false'
bin/next-dev
Outdated
| } | ||
| } | ||
|
|
||
| if (['false', '0'].indexOf(process.env.NEXT_OPEN_BROWSER) === -1) { |
There was a problem hiding this comment.
/^(false|0)$/i.test() is probably better if you're aiming for succinctness and also handles FALSE
There was a problem hiding this comment.
and also handles FaLsE :P. I'll make the change
bin/next-dev
Outdated
| } | ||
| } | ||
|
|
||
| if (/^(false|0)$/i.test(process.env.NEXT_OPEN_BROWSER)) { |
There was a problem hiding this comment.
ups, my fault
* add base of api docs and some pages * add pages * improve style * list all apis * add api pages * scroll into view * fix for mobile * remove query-string * use the same navbar with /docs, improve the scrollIntoView behavior * animation * fix bg color of CodeMirror gutters * update prettier * hide editor on mobile * fix code color * fix endpoints * fix typos * Link from delete deployment to list them * fix overflowing width on firefox * Fix delete dns record url * fix ::selection color on black background * fix key warning * api: a single long page * remove unused files * Add examples requests * Comment wrong information * Get test token from each endopint props * fix width * handle hash urls * improve handling hash url * Remove test token * Fix base url * Change intro to don't specify Node deployments * Add internal link * Fix request body for adding a record * Add /domains/status /domains/price and /domains/buy endpoints * improve hash handling * api: adjust style * withAPI * optimize * set dayBanner * fix escape on example * Add new v2 endpoints * adjust hash change position * add oauth2 section * deprecated * fix style of deprecated * Add more content to docs * fix the deprecated endpoint * Add more info for v2 endpoints * Change section titles and, remove FAQ and add Types * Remove table margin-left * Use generic table component * Remove empty blank spaces * Improve OAuth2 docs * update url hash using IntersectionObserver API * Add note about logs and code under OSS fix #7 * Add immutable HOC should fix #4 * Add TypeCell and BoldCell composed components * Create section for old API endpoints * Use new Cell components and remove deprecated endpoint * Fix typo * Add generic errors section * Remove generic error codes from API basics and link to specific section * Add more info for deployments endpoints * Create new specific table for input, output and headers * Use HeadersTable * Use specific tables instead of the generic one * Add type ID * Add Date type * Use Id and Date types * Correct rate_limited error message * Add input/output information for domains endpoints * Add aliases input/output information * Add secrets input/output information * Fix prop name * Add certificates input/output information * Add h4 headers before tables * Fix inconsistency of type name * Improve ID description * Remove row in rate limits section * Solve typo (fix vercel#9) * Don't run `scrollIntoViewIfNeeded` in Firefox (fix vercel#8) * Remove unused link in navbar * Revert c014ce2 * Add note to create secret about the max length * Add line after each section * Add dash before each sub link in navbar * Add border left to selected navbar item * Single line titles * Example text in gray * Only select one item in the navbar and dash in gray * Reduce section title * Bring button from zeit/front * Editor + CORS Preview * Change disabled styles * Remove padding right in navbar * collapse subsections when not active * fix wrong use of styled-jsx * Add more documentation about errors * fix scrollIntoViewIfNeeded issue of sidebar on FireFox * optimize rendering performance on sidebar * adjust padding of sidebar items * highlight shell syntax code block * fix navbar style on /docs * optimize section props * fix border color * fix NOTE text color * Add domain errors * replace 'immutable' with 'pure' if props are used * immutable -> immutable-component * fix header for displaying login state * replace with real token on #introduction * fix prop type * fix NOTE on dark bg * add shadow to editor * fix 'Introduction' style for mobile * fix introduction style * fix editor border * add spaces to notes and table headings * adjust space between sections * polyfill IntersectionObserver * apply intersection-observer polyfill only on client * apply new design for table * fix changelog * fix preview on mobile * fix changelog * fix * remove subsections of deployment errors from navbar * fix navbar style * make navbar sticky on mobile * fix hash urls * fix navbar of /docs on mobile * fix table for mobile * fix navbar style on /docs on mobile * make description of input/output tables full width on mobile * fix definition column width on mobile * Add more errors * Change navbar content related to errors * Update yarn.lock * add file tree to demo * handle JSON parse error * preserve previous preview content * add lineWrapping * update yarn.lock * update index.js content * Add more errors * Add even more domain errors * Fix errors starting message * Single line JSON * fix heading level * fix navbar padding * log deployment demo errors * Split DNS endpoints to another category * Split DNS errors to another category from domain errors * Remove placeholders * Add new file upload endpoint documentation * update package-lock.json * add /v2 prefix to endpoint urls * make the api demo work * improve instant deployment api doc * Fix new deployment endpoint docs * Add teams endpoints * Add deployment instances endpoint * Add set scale config endpoint * Use new Endpoint component everywhere * Use Request component for every CURL req * Simplify HTTP request creation * Remove duplicated code * Add authentiation endpoints documentation * Document how to get deployment logs * bump react * remove content-type header from demo * align demo vertically on api * Add toggle between Docs and API Reference * Add toggle between Docs and API Reference * Minor fixes * Improve toggle layout * Fix content alignment * Fix content alignment * Fix typo * Add docs/api page toggle * Prefetch docs/api pages * Allow active styling for toggle with a sub-page of docs/api * Add missing required field while creating the deployment * Improve mobile experience
No description provided.