Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Add Flow step to pipeline.yml #37

Merged
merged 3 commits into from
Dec 5, 2017
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
5 changes: 5 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ steps:
build: fusion-cli
image-repository: 296822479253.dkr.ecr.us-east-2.amazonaws.com/fusionjs
- wait
- command: yarn flow
name: ':flowtype:'
plugins:
'docker-compose#v1.7.0':
run: fusion-cli
- name: ':eslint:'
command: yarn lint
plugins:
Expand Down
14 changes: 14 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[ignore]
.*/node_modules/.*[^(package)]\.json$

[include]
./src/

[libs]

[lints]

[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore

[strict]
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @flow
/* eslint-env node */
module.exports = createNamedModuleVisitor;

Expand Down
16 changes: 15 additions & 1 deletion commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,21 @@ exports.builder = {
},
};

exports.run = async function({dir = '.', production, test, cover, logLevel}) {
exports.run = async function(
{
dir = '.',
production,
test,
cover,
logLevel,
} /*: {
dir: string,
production: boolean,
test: boolean,
cover: boolean,
logLevel: string,
}*/
) {
const logger = new winston.Logger({
transports: [
new winston.transports.Console({colorize: true, level: logLevel}),
Expand Down
1 change: 0 additions & 1 deletion entries/server-entry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@flow
/* eslint-env node */
import http from 'http';
import main from '__FRAMEWORK_SHARED_ENTRY__';
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"eslint-plugin-flowtype": "^2.35.0",
"eslint-plugin-prettier": "^2.1.2",
"eslint-plugin-react": "^7.1.0",
"flow-bin": "^0.59.0",
"fusion-core": "^0.1.8",
"globby": "^6.1.0",
"prettier": "1.4.2",
Expand Down
1 change: 0 additions & 1 deletion plugins/compilation-metadata-plugin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@flow
/* eslint-env node */

/*
Expand Down
16 changes: 10 additions & 6 deletions plugins/environment-variables-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ const {SingletonPlugin} = require('fusion-core');

const rootDir = load('ROOT_DIR', '.');
const env = load('NODE_ENV', 'development');
if (!(env === 'development' || env === 'production')) {
throw new Error(`Invalid NODE_ENV loaded: ${env}.`);
}
const prefix = load('ROUTE_PREFIX', '');
const assetPath = load('FRAMEWORK_STATIC_ASSET_PATH', '/_static');
assert(!prefix.endsWith('/'), 'ROUTE_PREFIX must not end with /');

module.exports = function() {
/*::
rootDir: String
env: 'development'|'production'
prefix: String
assetPath: String
*/
return new SingletonPlugin({
Service: class EnvVarPlugin {
/*::
rootDir: string;
env: 'development' | 'production';
prefix: string;
assetPath: string;
*/

constructor() {
this.rootDir = rootDir;
this.env = env;
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,10 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

flow-bin@^0.59.0:
version "0.59.0"
resolved "https://registry.npmjs.org/flow-bin/-/flow-bin-0.59.0.tgz#8c151ee7f09f1deed9bf0b9d1f2e8ab9d470f1bb"

for-each@~0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4"
Expand Down