This repository has been archived by the owner on Jul 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 362
Add Browsersync for mobile development testing #712
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Default to using local IP address instead of localhost
- Loading branch information
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* eslint-disable */ | ||
const chalk = require('chalk'); | ||
const ip = require('ip'); | ||
const inquirer = require('inquirer'); | ||
const slateEnv = require('@shopify/slate-env'); | ||
const {event} = require('@shopify/slate-analytics'); | ||
const {fetchMainThemeId} = require('@shopify/slate-sync'); | ||
const figures = require('figures'); | ||
const {argv} = require('yargs'); | ||
|
||
const question = { | ||
type: 'confirm', | ||
name: 'disableExternalTesting', | ||
message: ' Continue with external device testing disabled?', | ||
default: true, | ||
}; | ||
|
||
module.exports = async function promptDisableExternalTesting() { | ||
let address = ip.address(); | ||
|
||
if (!ip.isPrivate(address)) { | ||
console.log( | ||
`\n${chalk.yellow( | ||
figures.warning | ||
)} It looks like you are connected to the internet with the IP address, | ||
'${chalk.green(address)}', which is publically accessible. This could result | ||
in security vulnerabilities to your development machine if you want to test | ||
your dev store from an external device, e.g. your phone. We recommend you | ||
proceed with external testing disabled until you are connected to the internet | ||
with a private IP address, e.g. connected to a router which assigns your | ||
device a private IP.\n` | ||
); | ||
|
||
const answer = await inquirer.prompt([question]); | ||
|
||
address = answer.disableExternalTesting ? 'localhost' : address; | ||
} | ||
|
||
return address; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,9 +57,10 @@ | |
"jest": "22.4.2", | ||
"minimatch": "^3.0.4", | ||
"minimist": "1.2.0", | ||
"node-ip": "^0.1.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is meant to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! Got mixed up there. Thanks. |
||
"node-sass": "^4.7.2", | ||
"ora": "^2.0.0", | ||
"portfinder": "^1.0.17", | ||
"portscanner": "^2.2.0", | ||
"postcss-loader": "2.1.1", | ||
"postcss-reporter": "^5.0.0", | ||
"prettier": "^1.10.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo on this file (confim =>
confirm
)