Skip to content

Commit

Permalink
windows compat for build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Jun 3, 2018
1 parent c3f9b0f commit fcbba50
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 8 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"description": "Electrode Platform for NodeJS/React Universal Application",
"homepage": "http://www.electrode.io",
"scripts": {
"test": "eval `fyn bash` && npm run bootstrap && NODE_PRESERVE_SYMLINKS=1 lerna run test --ignore=electrode-webpack-reporter && npm run test-reporter && clap build-test",
"test-generator": "eval `fyn bash` && NODE_PRESERVE_SYMLINKS=1 clap test-generator",
"test-boilerplate": "eval `fyn bash` && NODE_PRESERVE_SYMLINKS=1 clap test-boilerplate",
"test": "clap test",
"test-generator": "clap test-generator",
"test-boilerplate": "clap test-boilerplate",
"bootstrap": "fynpo",
"clean": "npm run nuke && npm run nuke-packages && npm run nuke-samples",
"nuke": "rm -rf node_modules tmp lerna-debug.log npm-debug.log",
"nuke-packages": "rm -rf packages/*/node_modules packages/*/coverage",
"nuke-samples": "rm -rf samples/*/node_modules samples/*/coverage samples/*/dist samples/*/.isomorphic-loader-config.json samples/*/.etmp",
"test-reporter": "eval `fyn bash` && if lerna updated | grep electrode-webpack-reporter; then cd packages/electrode-webpack-reporter && fyn --pg none install && NODE_PRESERVE_SYMLINKS=1 npm test; fi",
"update-changelog": "eval `fyn bash` && node tools/update-changelog.js",
"gitbook-serve": "eval `fyn bash` && gitbook serve --no-watch --no-live"
"test-reporter": "clap test-reporter",
"update-changelog": "clap update-changelog",
"gitbook-serve": "clap gitbook-serve"
},
"devDependencies": {
"bluebird": "^3.5.0",
Expand Down
42 changes: 40 additions & 2 deletions xclap.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,45 @@ const testGenerator = (testDir, clean, prompts) => {
});
};

let fynSetup = false;
let saveCwd = process.cwd();

xclap.load({
".fyn-setup": () => {
if (fynSetup) return undefined;
fynSetup = true;
return exec(true, "fyn json").then(r => {
process.env.NODE_PRESERVE_SYMLINKS = 1;
const fynEnv = JSON.parse(r.stdout);
if (fynEnv.error) {
console.log(".fyn-setup:", fynEnv.error);
} else {
process.env.NODE_OPTIONS = fynEnv.NODE_OPTIONS;
console.log("NODE_OPTIONS set to", fynEnv.NODE_OPTIONS);
}
});
},
".lerna.test": "~$lerna run test --ignore=electrode-webpack-reporter",
"test-reporter": [".fyn-setup", ".test-reporter"],
".test-reporter": {
task: () => {
return exec(true, "lerna updated").then(r => {
if (r.stdout.indexOf("electrode-webpack-reporter") >= 0) {
shell.cd("packages/electrode-webpack-reporter");
return [".", "~$fyn --pg none install", "~$npm test"];
}
});
},
finally: () => {
shell.cd(saveCwd);
}
},
bootstrap: "~$fynpo",
test: [".fyn-setup", "bootstrap", ".lerna.test", "test-reporter", "build-test"],
"test-generator": [".fyn-setup", ".test-generator"],
"test-boilerplate": [".fyn-setup", ".test-boilerplate"],
"update-changelog": [".fyn-setup", "~$node tools/update-changelog.js"],
"gitbook-serve": [".fyn-setup", "~$gitbook serve --no-watch --no-live"],
"build-test": {
desc: "Run CI test",
task: () => {
Expand Down Expand Up @@ -121,7 +159,7 @@ xclap.load({
}
},

"test-boilerplate": {
".test-boilerplate": {
desc: "Run tests for the boilerplage app universal-react-node",
task: () => {
return runAppTest(Path.join(__dirname, "samples/universal-react-node"));
Expand All @@ -137,7 +175,7 @@ xclap.load({
}
},

"test-generator": {
".test-generator": {
desc: "Run tests for the yeoman generators",
task: () => {
const testDir = Path.join(__dirname, "tmp");
Expand Down

0 comments on commit fcbba50

Please sign in to comment.