Skip to content

Commit

Permalink
prettier and linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkySharks committed Feb 7, 2019
1 parent 5a9aeea commit d04e0d5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 50 deletions.
1 change: 1 addition & 0 deletions packages/pwa-buildpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"debug": "~4.1.1",
"debug-error-middleware": "~1.3.0",
"devcert": "~1.0.0",
"dotenv": "~6.2.0",
"execa": "~1.0.0",
"express": "~4.16.4",
"graphql-playground-middleware-express": "~1.7.8",
Expand Down
98 changes: 49 additions & 49 deletions packages/pwa-buildpack/src/WebpackTools/PWADevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,62 +20,62 @@ const secureHostWarning = chalk.redBright(
` To enable all PWA features and avoid ServiceWorker collisions, PWA Studio
highly recommends using the ${chalk.whiteBright(
'"provideSecureHost"'
)} configuration
)} configuration
option of PWADevServer. `
);
const helpText = `To autogenerate a unique host based on project name
);

const helpText = `To autogenerate a unique host based on project name
and location on disk, simply add:
${chalk.whiteBright('provideSecureHost: true')}
to PWADevServer configuration options.
More options for this feature are described in documentation.
`;
const PWADevServer = {
validateConfig: optionsValidator('PWADevServer', {
publicPath: 'string',
env: 'object'
}),
async configure(config) {
debug('configure() invoked', config);
PWADevServer.validateConfig('.configure(config)', config);
const devServerConfig = {
contentBase: false, // UpwardPlugin serves static files
compress: true,
hot: true,
host: config.host || '0.0.0.0',
port: config.port || (await portscanner.findAPortNotInUse(10000)),
stats: {
all: !process.env.NODE_DEBUG ? false : undefined,
builtAt: true,
colors: true,
errors: true,
errorDetails: true,
moduleTrace: true,
timings: true,
version: true,
warnings: true
},
after(app, server) {
app.use(debugErrorMiddleware());
require('dotenv').config();
let publicPath = process.env.DOCKER_CONFIG
? 'https://' + process.env.PWA_STUDIO_PUBLIC_PATH
: devServerConfig.publicPath;
let readyNotice = chalk.green(
`PWADevServer ready at ${chalk.greenBright.underline(
publicPath
)}`
);
if (config.graphqlPlayground) {
readyNotice +=
'\n' +
chalk.blueBright(
`GraphQL Playground ready at ${chalk.blueBright.underline(
new url.URL('/graphiql', publicPath)
)}`
);

const PWADevServer = {
validateConfig: optionsValidator('PWADevServer', {
publicPath: 'string',
env: 'object'
}),
async configure(config) {
debug('configure() invoked', config);
PWADevServer.validateConfig('.configure(config)', config);
const devServerConfig = {
contentBase: false, // UpwardPlugin serves static files
compress: true,
hot: true,
host: config.host || '0.0.0.0',
port: config.port || (await portscanner.findAPortNotInUse(10000)),
stats: {
all: !process.env.NODE_DEBUG ? false : undefined,
builtAt: true,
colors: true,
errors: true,
errorDetails: true,
moduleTrace: true,
timings: true,
version: true,
warnings: true
},
after(app, server) {
app.use(debugErrorMiddleware());
require('dotenv').config();
let publicPath = process.env.DOCKER_CONFIG
? 'https://' + process.env.PWA_STUDIO_PUBLIC_PATH
: devServerConfig.publicPath;
let readyNotice = chalk.green(
`PWADevServer ready at ${chalk.greenBright.underline(
publicPath
)}`
);
if (config.graphqlPlayground) {
readyNotice +=
'\n' +
chalk.blueBright(
`GraphQL Playground ready at ${chalk.blueBright.underline(
new url.URL('/graphiql', publicPath)
)}`
);
}
server.middleware.waitUntilValid(() =>
console.log(
Expand Down
3 changes: 2 additions & 1 deletion packages/venia-concept/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ module.exports = async function(env) {
config.devtool = 'eval-source-map';
const devServerConfig = {
env: validEnv,
publicPath: validEnv.PWA_STUDIO_PUBLIC_PATH || config.output.publicPath,
publicPath:
validEnv.PWA_STUDIO_PUBLIC_PATH || config.output.publicPath,
graphqlPlayground: {
queryDirs: [path.resolve(themePaths.src, 'queries')]
},
Expand Down

0 comments on commit d04e0d5

Please sign in to comment.