Skip to content

Commit b2990f1

Browse files
committed
Make 'npm run build-public' windows-friendly
1 parent eb5db62 commit b2990f1

File tree

8 files changed

+8
-27
lines changed

8 files changed

+8
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/lib
2+
/public/schema.js
23
/node_modules
34
/npm-debug.log
45
/coverage

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"coveralls": "babel-node node_modules/.bin/isparta cover --root src --report lcovonly node_modules/.bin/_mocha -- $npm_package_options_mocha && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
4848
"build": "babel src --optional runtime --ignore __tests__,public --out-dir lib/",
4949
"download": "babel-node scripts/download.js cache/data.json",
50-
"build-public": "scripts/build-public",
50+
"build-public": "browserify --standalone Schema -t babelify --outfile public/schema.js src/schema-proxy.js",
5151
"serve-public": "babel-node scripts/serve-public",
5252
"deploy": "scripts/build-public && scripts/deploy-public",
5353
"prettier": "prettier --write 'src/**/*.js'",
File renamed without changes.
File renamed without changes.

scripts/build-public

Lines changed: 0 additions & 20 deletions
This file was deleted.

scripts/deploy-public

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ PARENT=`git rev-parse gh-pages 2> /dev/null` || {
2121
}
2222

2323
echo "Preparing index based on:"
24-
ls lib/public/*
25-
git update-index --add lib/public/*
24+
ls public/*
25+
git update-index --add public/*
2626

27-
TREE=`git write-tree --prefix=lib/public`
27+
TREE=`git write-tree --prefix=public`
2828
echo "Wrote tree object: $TREE"
2929

3030
echo "Reseting index to former state."
31-
git reset lib/public
31+
git reset public
3232

3333
COMMIT=`git commit-tree $TREE -p $PARENT -m "Build gh-pages from $HEAD"`
3434
echo "Wrote commit object: $COMMIT"

scripts/serve-public.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import express from 'express';
1111

1212
const app = express();
13-
app.use(express.static('./lib/public'))
13+
app.use(express.static('./public'))
1414

1515
// Listen for incoming HTTP requests
1616
const listener = app.listen(() => {

src/public/schema-proxy.js renamed to src/schema-proxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import { graphql } from 'graphql';
10-
import schema from '../schema';
10+
import schema from './schema';
1111

1212
export function execute(query, variables, operationName) {
1313
return graphql(schema, query, null, null, variables, operationName);

0 commit comments

Comments
 (0)