Skip to content

Commit

Permalink
2.3.0: minor updates on mk_dist.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
acaldero committed Jun 16, 2023
1 parent cd61751 commit 93ded2a
Show file tree
Hide file tree
Showing 10 changed files with 487 additions and 19 deletions.
62 changes: 55 additions & 7 deletions devel/mk_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,67 @@ echo ""
echo " WepSIM packer"
echo " ---------------"
echo ""
if [ $# -gt 0 ]; then
set -x
fi

# install dependencies
echo " Requirements:"
echo " * terser jq jshint"

# arguments
while getopts 'vdh' opt; do
case "$opt" in
v)
echo " getopts: processing verbose..."
echo ""
set -x
;;

d)
echo " Please install first:"
echo " sudo apt-get install jq"
echo ""
echo " npm i terser jshint"
echo " npm i yargs clear inquirer fuzzy commander async"
echo " npm i inquirer-command-prompt inquirer-autocomplete-prompt"
echo " npm i rollup @rollup/plugin-node-resolve"
echo ""
echo " npm i codemirror @codemirror/lang-javascript"
echo " npm i codemirror @codemirror/view";
echo " npm i codemirror @codemirror/state";
echo " npm i codemirror @codemirror/gutter";
echo " npm i codemirror @codemirror/highlight";
echo ""
exit
;;

?|h)
echo " Usage: $(basename $0) [-v] [-d]"
echo ""
exit 1
;;
esac
done
shift "$(($OPTIND -1))"


# install npm dependencies
echo " Step for npm install/update:"
echo " * terser jshint"
echo " * yargs clear inquirer fuzzy commander async"
echo " * inquirer-command-prompt inquirer-autocomplete-prompt"
echo " * codemirror @codemirror/lang-javascript"
echo " * rollup @rollup/plugin-node-resolve"
npm install
echo " Done.\n"


# pre-bundle
echo " Step for rollup:"
echo " * codemirror6"
node_modules/.bin/rollup -c external/codemirror6/rollup.config.mjs
terser -o external/codemirror6/min.codemirror.js external/codemirror6/codemirror.bundle.js
rm -fr external/codemirror6/codemirror.bundle.js
echo " Done.\n"


# skeleton
echo " Packing:"
echo " Step for packing:"
echo " * ws_dist"
mkdir -p ws_dist
touch ws_dist/index.html
Expand Down
10 changes: 10 additions & 0 deletions external/codemirror6/codemirror.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import { EditorView, basicSetup } from "codemirror"

import { javascript } from "@codemirror/lang-javascript"

let editor = new EditorView({
extensions: [basicSetup, javascript()],
parent: document.body
})

Empty file added external/codemirror6/index.html
Empty file.
1 change: 1 addition & 0 deletions external/codemirror6/min.codemirror.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions external/codemirror6/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

import {nodeResolve} from "@rollup/plugin-node-resolve"
export default {
input: "external/codemirror6/codemirror.mjs",
output: {
file: "external/codemirror6/codemirror.bundle.js",
format: "iife"
},
plugins: [nodeResolve()]
}


Loading

0 comments on commit 93ded2a

Please sign in to comment.