Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions packages/react-scripts/scripts/utils/frontierInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ async function promptForConfig() {
value: 'polymer',
},
{
name: `Redux (Chances are high you don't need this yet)`,
value: 'redux',
name: `Configure app for Electric Flow`,
value: 'electric-flow',
},
],
},
Expand All @@ -48,6 +48,9 @@ function installFrontierDependencies(appPath, answers, useYarn, ownPath) {
if (additionalFeatures.includes('redux')) {
configureRedux(appPath, useYarn, ownPath);
}
if (additionalFeatures.includes('electric-flow')) {
configureEF(appPath, useYarn, ownPath);
}
injectPolymerCode(appPath);

const defaultModules = [
Expand All @@ -56,7 +59,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 @@ -144,6 +150,14 @@ function configureRedux(appPath, useYarn, ownPath) {
fs.copySync(templatePath, appPath, { overwrite: true });
}

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

const templatePath = path.join(ownPath, 'template-ef');
fs.copySync(templatePath, appPath, { overwrite: true });
}

function cleanupFrontierCode(appPath) {}

function installModulesSync(modules, useYarn, saveDev = false) {
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/template-ef/.buildpacks
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/heroku/heroku-buildpack-nodejs.git
1 change: 1 addition & 0 deletions packages/react-scripts/template-ef/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node src/server.js
55 changes: 55 additions & 0 deletions packages/react-scripts/template-ef/blueprint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: 1.0
name: frontier-{{APP_NAME}}

build:
- type: "Npm-Heroku v1_0"
heroku_stack: heroku-18
name: npm-build

deploy:
int:
{{APP_NAME}}: &APP_DEFAULTS
type: "Heroku v1_0"
location: development-fh5-useast1-heroku
binding_sets:
{{BINDING_PATH}}:
- type: "Service v1_0"
sites:
- integ
bindings: &BINDING_DEFAULTS
heroku:
type: "Alias v1_0"
aliases:
- www
non_ssl_action:
type: redirect_to_https
append_slash: true
beta:
{{APP_NAME}}:
<<: *APP_DEFAULTS
type: "Heroku v1_0"
location: test-fh3-useast1-heroku
binding_sets:
{{BINDING_PATH}}:
- type: "Service v1_0"
sites:
- beta
bindings:
<<: *BINDING_DEFAULTS
prod:
{{APP_NAME}}:
<<: *APP_DEFAULTS
type: "Heroku v1_0"
location: production-fh1-useast1-heroku
binding_sets:
{{BINDING_PATH}}:
- type: "Service v1_0"
sites:
- prod
bindings:
<<: *BINDING_DEFAULTS
deliver:
deploy_order:
- int
- beta
- prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Get artifactory token from SAS
ICS_AF_TOKEN=$(ec-sas-client frontier-hub-ics-public-artifactory-db -b fchPassword)

# Write .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
11 changes: 11 additions & 0 deletions packages/react-scripts/template-ef/src/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const path = require('path');
const express = require('express');
const app = express();

// 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}`);
});