Skip to content

Commit

Permalink
[chore] add stylus-sample to CI (#884)
Browse files Browse the repository at this point in the history
* [chore] add stylus-sample to CI

* fix xenv default as function
  • Loading branch information
jchip authored Jul 31, 2018
1 parent ef1515c commit fdd2914
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const webpackConfigSpec = {
reporterSocketPort: { env: "WEBPACK_REPORTER_SOCKET_PORT", default: 5000 },
https: { env: "WEBPACK_DEV_HTTPS", default: false },
devMiddleware: { env: "WEBPACK_DEV_MIDDLEWARE", default: false },
cssModuleSupport: { env: "CSS_MODULE_SUPPORT", type: "boolean", default: detectCSSModule() },
cssModuleSupport: { env: "CSS_MODULE_SUPPORT", type: "truthy", default: detectCSSModule },
cssModuleStylusSupport: { env: "CSS_MODULE_STYLUS_SUPPORT", default: false },
enableBabelPolyfill: { env: "ENABLE_BABEL_POLYFILL", default: false },
enableNodeSourcePlugin: { env: "ENABLE_NODESOURCE_PLUGIN", default: false },
Expand Down
2 changes: 1 addition & 1 deletion packages/electrode-archetype-react-app-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"webpack-stats-plugin": "^0.1.1",
"winston": "^2.3.1",
"xclap": "^0.2.0",
"xenv-config": "^1.0.0",
"xenv-config": "^1.2.2",
"xsh": "^0.4.2"
},
"optionalDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions samples/stylus-sample/src/client/styles/index.styl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import "normalize.styl"
@import "custom.styl"
@import "raleway.styl"
@import "normalize.styl";
@import "custom.styl";
@import "raleway.styl";
23 changes: 18 additions & 5 deletions xclap.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ const runAppTest = (dir, forceLocal) => {
};

const localClap = Path.join("node_modules", ".bin", "clap");
return exec({ cwd: dir }, `fyn --pg simple -q v i && ${localClap} ?fix-generator-eslint`).then(
() => exec({ cwd: dir }, `npm test`)
);
return exec({ cwd: dir }, `fyn --pg simple -q v i && ${localClap} ?fix-generator-eslint`)
.then(() => exec({ cwd: dir }, `npm test`))
.then(() => exec({ cwd: dir }, `${localClap} build`));
};

const testGenerator = (testDir, name, clean, runTest, prompts) => {
Expand Down Expand Up @@ -138,14 +138,15 @@ xclap.load({
`~$cd samples/demo-component && fyn --pg none install && npm test`
],
"test-boilerplate": [".fyn-setup", ".test-boilerplate"],
"test-stylus-sample": [".fyn-setup", ".test-stylus-sample"],
"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: () => {
process.env.BUILD_TEST = "true";
process.env.NODE_PRESERVE_SYMLINKS = "1";
const tasks = ["test-boilerplate"];
const tasks = ["test-boilerplate", "test-stylus-sample"];
let updated;
return exec("lerna updated")
.then(output => {
Expand Down Expand Up @@ -179,10 +180,22 @@ xclap.load({
}
},

".test-stylus-sample": {
desc: "Run tests for the boilerplage app stylus-sample",
task: () => {
return runAppTest(Path.join(__dirname, "samples/stylus-sample"));
}
},

"samples-local": {
desc: "modify all samples to pull electrode packages from local",
task: () => {
["electrode-demo-index", "universal-material-ui", "universal-react-node"].forEach(a => {
[
"electrode-demo-index",
"stylus-sample",
"universal-material-ui",
"universal-react-node"
].forEach(a => {
pullLocalPackages(Path.join(__dirname, "samples", a));
});
}
Expand Down

0 comments on commit fdd2914

Please sign in to comment.