Skip to content

Commit

Permalink
fix:setup modified for running dingus locally on windows, fixes accor…
Browse files Browse the repository at this point in the history
…dproject#375

Signed-off-by: Nishi Agrawal <[email protected]>
  • Loading branch information
nishihere19 committed Apr 4, 2021
1 parent bdf05d5 commit 5579aaf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/dingus/lib/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ html
pre.hljs.result-debug.full-height
code.result-debug-content.full-height
pre.hljs.result-ast.full-height
code.result-ast-content.full-height
code.result-ast-content.full-height
7 changes: 3 additions & 4 deletions packages/dingus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
},
"license": "Apache-2.0",
"scripts": {
"dingus": "node scripts/build_dingus.js"
"dingus": "node ./scripts/build_dingus.js"
},
"files": [],
"dependencies": {},
"devDependencies": {
"@accordproject/markdown-cicero": "0.12.12",
"@accordproject/markdown-common": "0.12.12",
"@accordproject/markdown-it-cicero": "0.12.12",
"@accordproject/markdown-it-template": "0.12.12",
"@accordproject/markdown-cicero": "0.12.12",
"@accordproject/markdown-template": "0.12.12",
"autoprefixer-stylus": "^0.14.0",
"browserify": "^16.3.0",
Expand All @@ -38,4 +37,4 @@
"mocha": {
"inline-diffs": true
}
}
}
32 changes: 21 additions & 11 deletions packages/dingus/scripts/build_dingus.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,29 @@ const shell = require('shelljs');
shell.rm('-rf', 'demo');
shell.mkdir('demo');

shell.exec('scripts/demodata.js > lib/sample.json');
var path = require('path');
var demo = path.resolve('./demo');

shell.exec('node_modules/.bin/pug lib/index.pug --pretty \
--obj lib/sample.json \
--out demo');
var demodata = path.resolve('./scripts/demodata.js');

shell.exec('node_modules/.bin/stylus -u autoprefixer-stylus \
< lib/index.styl \
> demo/index.css');
shell.exec(`node ${demodata} > lib/sample.json`);
var pug = path.resolve('./node_modules/pug-cli/index.js');
var index=path.resolve('./lib/index.pug');
shell.exec(`node ${pug} lib/index.pug --obj lib/sample.json --out ${demo}`);

shell.cp('lib/templatemark.css', 'demo/templatemark.css');
var stylus=path.resolve('./node_modules/stylus/bin/stylus');
var index_styl= path.resolve('./lib/index.styl');

shell.rm('-rf', 'lib/sample.json');
shell.exec(`node ${stylus} -u autoprefixer-stylus \
< ${index_styl} \
> ./demo/index.css`);

shell.exec('node_modules/.bin/browserify lib/index.js \
> demo/index.js');
var templateMarkCSS_lib=path.resolve('./lib/templatemark.css');
var templateMarkCSS_demo=path.resolve('./demo/templatemark.css');
shell.cp(templateMarkCSS_lib, templateMarkCSS_demo);

shell.rm('-rf', "lib/sample.json");
index=path.resolve('./node_modules/browserify/bin/cmd.js');

shell.exec(`${index} lib/index.js \
> demo/index.js --standalone demo/index.html`);

0 comments on commit 5579aaf

Please sign in to comment.