Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
minor tweaking/cleaning up
  • Loading branch information
joeycozza committed Feb 13, 2019
commit 1a6880a3c60d0bd19a5b228afc9b564cd21304ae
1 change: 1 addition & 0 deletions packages/react-scripts/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ module.exports = async function(
}
console.log();
console.log('Happy hacking!');
frontierInit.logEndingMessages(answers);
};

function isReactInstalled(appPackage) {
Expand Down
26 changes: 17 additions & 9 deletions packages/react-scripts/scripts/utils/frontierInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ module.exports = {
promptForConfig,
packageJsonWritten,
cleanupFrontierCode,
logEndingMessages,
};

function logEndingMessages(answers) {
if (answers.includes('electric-flow')) {
console.log(
'You will need to edit your blueprint.yml file before the Electric Flow build will work'
);
}
}

async function promptForConfig() {
console.log(fsCli.fsLogo('Frontier React Scripts'));
const questions = [
Expand All @@ -26,13 +35,9 @@ async function promptForConfig() {
name: 'Using a shared Polymer Component within your React App?',
value: 'polymer',
},
{
name: `Redux (Chances are high you don't need this yet)`,
value: 'redux',
},
{
name: `Configure app for Electric Flow`,
value: 'redux',
value: 'electric-flow',
},
],
},
Expand All @@ -52,8 +57,8 @@ function installFrontierDependencies(appPath, answers, useYarn, ownPath) {
if (additionalFeatures.includes('redux')) {
configureRedux(appPath, useYarn, ownPath);
}
if (additionalFeatures.includes('electic-flow')) {
configureEF(appPath);
if (additionalFeatures.includes('electric-flow')) {
configureEF(appPath, useYarn, ownPath);
}
injectPolymerCode(appPath);

Expand All @@ -63,7 +68,10 @@ function installFrontierDependencies(appPath, answers, useYarn, ownPath) {
'fs-webdev/exo',
];

const defaultDevModules = ['react-styleguidist@9.0.0-beta4', 'webpack@4.19.1'];
const defaultDevModules = [
'react-styleguidist@9.0.0-beta4',
'webpack@4.19.1',
];

installModulesSync(defaultModules, useYarn);
installModulesSync(defaultDevModules, useYarn, true);
Expand Down Expand Up @@ -153,7 +161,7 @@ function configureRedux(appPath, useYarn, ownPath) {

function configureEF(appPath, useYarn, ownPath) {
// TODO - modify package.json to make sure name is correct for blueprint
// TODO - use blueprint.yml as a template
// TODO - use blueprint.yml as a template

const templatePath = path.join(ownPath, 'template-ef');
fs.copySync(templatePath, appPath, { overwrite: true });
Expand Down
1 change: 0 additions & 1 deletion packages/react-scripts/template-ef/blueprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ deploy:
int:
{{APP_NAME}}: &APP_DEFAULTS
type: "Heroku v1_0"
stack_name: heroku-18
location: development-fh5-useast1-heroku
binding_sets:
{{BINDING_PATH}}:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash

# Get artifactory token from SAS
ICS_AF_TOKEN=ec-sas-client frontier-hub-ics-public-artifactory-db password
NPMRC_TOKEN="//code.lds.org/artifactory/api/npm/npm-fhd/:_authToken=${ICS_AF_TOKEN}"
NPMRC_ICS_REGISTRY="@fs:registry=https://code.lds.org/artifactory/api/npm/npm-fhd/"
ICS_AF_TOKEN=$(ec-sas-client frontier-hub-ics-public-artifactory-db -b fchPassword)

# Write .npmrc
echo $NPMRC_TOKEN > .npmrc
echo $NPMRC_ICS_REGISTRY >> .npmrc
echo "//code.lds.org/artifactory/api/npm/npm-fhd/:_authToken=${ICS_AF_TOKEN}" > .npmrc
echo "@fs:registry=https://code.lds.org/artifactory/api/npm/npm-fhd/" >> .npmrc
15 changes: 8 additions & 7 deletions packages/react-scripts/template-ef/src/server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var express = require("express");
var path = require("path");
var app = express();
const path = require('path');
const express = require('express');
const app = express();

// React App
app.use(express.static(__dirname + "/build"));
// Statically serve up the production built React App
app.use(express.static(`${__dirname}/build`));

const port = process.env.PORT || 3000;
app.listen(port);
console.log("Listening on port " + port)
app.listen(port, () => {
console.log(`Listening on port ${port}`);
});