From 5579aaf19198ba224d5bd516efeeb1aabcdbb7b8 Mon Sep 17 00:00:00 2001 From: Nishi Agrawal Date: Sun, 4 Apr 2021 23:11:01 +0530 Subject: [PATCH] fix:setup modified for running dingus locally on windows, fixes #375 Signed-off-by: Nishi Agrawal --- packages/dingus/lib/index.pug | 2 +- packages/dingus/package.json | 7 +++--- packages/dingus/scripts/build_dingus.js | 32 ++++++++++++++++--------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/packages/dingus/lib/index.pug b/packages/dingus/lib/index.pug index c7bdfb83..c1c19dc2 100644 --- a/packages/dingus/lib/index.pug +++ b/packages/dingus/lib/index.pug @@ -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 \ No newline at end of file diff --git a/packages/dingus/package.json b/packages/dingus/package.json index 94b9789e..ac7a9ae3 100644 --- a/packages/dingus/package.json +++ b/packages/dingus/package.json @@ -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", @@ -38,4 +37,4 @@ "mocha": { "inline-diffs": true } -} \ No newline at end of file +} diff --git a/packages/dingus/scripts/build_dingus.js b/packages/dingus/scripts/build_dingus.js index 471c7ee8..6903f198 100644 --- a/packages/dingus/scripts/build_dingus.js +++ b/packages/dingus/scripts/build_dingus.js @@ -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`);