Skip to content

Commit

Permalink
Move CLI parsing code to new project "Oclis"
Browse files Browse the repository at this point in the history
The included code is now automatically generated by the `oclis` binary
  • Loading branch information
ad-si committed Feb 17, 2024
1 parent 3966f03 commit 13b9729
Show file tree
Hide file tree
Showing 16 changed files with 666 additions and 813 deletions.
154 changes: 0 additions & 154 deletions cli-contract.ncl

This file was deleted.

15 changes: 9 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
config = { };
overlays = builtins.attrValues self.overlays;
# TODO: PureScript deps are currently still installed via npm
# overlays = builtins.attrValues self.overlays;
});
in {
overlays = {
purescript = inputs.purescript-overlay.overlays.default;
};
# TODO: PureScript deps are currently still installed via npm
# overlays = {
# purescript = inputs.purescript-overlay.overlays.default;
# };

packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in {
Expand All @@ -51,12 +53,13 @@
let pkgs = nixpkgsFor.${system}; in {
default = pkgs.mkShell {
name = "transity";
inputsFrom = builtins.attrValues self.packages.${system};
# TODO: This somehow makes it use nodejs_18
# inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = with pkgs; [
nodejs_20
watchexec

# TODO: Currently still installed via npm
# TODO: PureScript deps are currently still installed via npm
# purs
# purs-backend-es
# purs-tidy-bin.purs-tidy-0_10_1
Expand Down
28 changes: 5 additions & 23 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all: changelog.md readme.md index.js docs output


.PHONY: build
build: src/CliSpec/JsonEmbed.purs | node_modules
build: | node_modules
npx spago build


Expand All @@ -22,7 +22,7 @@ changelog.md: .git | node_modules


srcFiles := $(shell find src -type f -name "*.purs")
index.js: $(srcFiles) src/CliSpec/JsonEmbed.purs spago.yaml | node_modules
index.js: $(srcFiles) spago.yaml | node_modules
npx spago bundle \
--platform node \
--minify
Expand All @@ -48,26 +48,8 @@ docs-dev: output index.js | node_modules
--target $@


define JsonEmbedStart
module CliSpec.JsonEmbed where

fileContent :: String
fileContent = """
endef
export JsonEmbedStart

src/CliSpec/JsonEmbed.purs: cli-contract.ncl cli-spec.ncl
echo "$$JsonEmbedStart" > $@

echo \
'(import "cli-contract.ncl") & (import "cli-spec.ncl")' \
| nickel --color=always export --format json \
>> $@

echo '"""' >> $@


output: src src/CliSpec/JsonEmbed.purs spago.yaml | node_modules
output: src spago.yaml | node_modules
npx spago build


Expand All @@ -89,14 +71,14 @@ lint-js: | node_modules
scripts

.PHONY: test-spago
test-spago: src/CliSpec/JsonEmbed.purs | node_modules
test-spago: | node_modules
npx spago test

.PHONY: test
test: lint-js test-spago

.PHONY: test-watch
test-watch: src/CliSpec/JsonEmbed.purs | node_modules
test-watch: | node_modules
watchexec \
--exts purs \
'npx spago test'
Expand Down
Loading

0 comments on commit 13b9729

Please sign in to comment.