Skip to content

Commit

Permalink
Merge pull request #70 from ptwales/npm-package
Browse files Browse the repository at this point in the history
Prepare the package.json to be used with npm
  • Loading branch information
ptwales authored Jan 29, 2020
2 parents 6b5dc9d + b292d73 commit 358ab56
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions editors/ccap-temple-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ COMPILER-LOC the directory containing the compiler executable.
TARGET-PACKAGE package or module to place the generated module.
LANGUAGE either 'scala' or 'purs'.
OUT-DIR directory to place the generated code file."
(let ((compile-command (concat compiler-loc "/compile"))
(let ((compile-command (concat compiler-loc "/codgen.js"))
(module-argument (concat "-p " target-package))
(lang-argument (concat "-m " language))
(output-argument (concat "-o " out-dir))
Expand Down Expand Up @@ -338,7 +338,7 @@ OUT-DIR directory to place the generated code file."
;; Flycheck
(add-to-list 'flycheck-checkers 'ccap-temple)
(flycheck-add-mode 'ccap-temple 'ccap-temple-mode)
(setq flycheck-ccap-temple-executable (concat ccap-temple-mode-codegen-repo "/compile"))
(setq flycheck-ccap-temple-executable (concat ccap-temple-mode-codegen-repo "/codegen.js"))

;; Syntax highlighting.
(setq font-lock-defaults '((ccap-temple-font-lock-keywords))))
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "purescript-ccap-codegen",
"private": true,
"version": "0.0.5",
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "spago build --purs-args '--censor-lib --strict'",
Expand All @@ -10,10 +12,10 @@
"dependencies": {
"decimal.js": "10.2.0",
"pg": "^7.11.0",
"spago": "^0.13.0",
"yargs": "^8.0.2"
},
"devDependencies": {
"spago": "^0.13.0",
"dotenv-cli": "^3.0.0",
"purescript": "^0.13.5",
"purescript-language-server": "^0.12.7",
Expand Down
14 changes: 7 additions & 7 deletions runtests
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ spago build
case $1 in
ccap)
DB=dev15-db.wicourts.gov:5612:cc:viewer
./get-schema --config $DB -d > samples/Domains.tmpl
./get-schema --config $DB -t Case > samples/Case.tmpl
./get-schema.js --config $DB -d > samples/Domains.tmpl
./get-schema.js --config $DB -t Case > samples/Case.tmpl
;;
esac

Expand All @@ -17,23 +17,23 @@ for i in samples/*.tmpl; do
# not parsed correctly. NOTE: this passing does NOT guarantee a
# working purescript or scala file on generation; for example, if
# a type is undefined, no error checking catches this.
./compile.js -m test -p unused $i
./codegen.js -m test -p unused $i

# Pretty-print county.tmpl to the console. Removes comments and
# puts the template in a readable format.
./compile.js -m pretty -p unused $i
./codegen.js -m pretty -p unused $i

# Generate the purescript file from the given template
./compile.js -p Ccap.Cc.Test -m purs $i
./codegen.js -p Ccap.Cc.Test -m purs $i

# Generate the scala file from the given template
./compile.js -p gov.wicourts.cc -m scala $i
./codegen.js -p gov.wicourts.cc -m scala $i

# TODO: Test compilation of generated output.
done

# We can at least test compile this one for now

./compile.js -p Test.Generated -m purs -o test/generated samples/SelfContained.tmpl
./codegen.js -p Test.Generated -m purs -o test/generated samples/SelfContained.tmpl

spago test

0 comments on commit 358ab56

Please sign in to comment.