Skip to content

Commit 64be259

Browse files
committed
Start implementing basic CLI codegen tooling
1 parent d9f981c commit 64be259

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1821
-1075
lines changed

bin/print-module-types.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
import { main } from '../output/Bin.PrintModuleTypes/index.js';
4+
5+
main();

flake.lock

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
4+
flakeUtils.url = "github:gytis-ivaskevicius/flake-utils-plus";
5+
easyPSSrc = {
6+
flake = false;
7+
url = "github:justinwoo/easy-purescript-nix";
8+
};
9+
};
10+
outputs = { self, nixpkgs, flakeUtils, easyPSSrc }:
11+
flakeUtils.lib.eachSystem ["x86_64-linux"] (system:
12+
let
13+
pkgs = nixpkgs.legacyPackages.${system};
14+
easyPS = pkgs.callPackage easyPSSrc { inherit pkgs; };
15+
nodejs-16 = pkgs.writeShellScriptBin "nodejs-16" ''
16+
${ pkgs.nodejs-16_x.out}/bin/node $@
17+
'';
18+
in {
19+
devShell = pkgs.mkShell {
20+
buildInputs = [
21+
22+
# Please update spago and purescript in `package.json` `scripts` section
23+
easyPS."purs-0_15_7"
24+
easyPS.purescript-language-server
25+
easyPS.pscid
26+
easyPS.purs-tidy
27+
easyPS.pulp
28+
easyPS.spago
29+
30+
pkgs.jq
31+
pkgs.docker
32+
pkgs.nodePackages.bower
33+
pkgs.nodePackages.jshint
34+
# pkgs.nodePackages.yarn
35+
# pkgs.nodePackages.nodemon
36+
# pkgs.nodePackages.webpack
37+
# pkgs.nodePackages.webpack-cli
38+
# pkgs.nodePackages.webpack-dev-server
39+
pkgs.dhall
40+
pkgs.nodejs-18_x
41+
nodejs-16
42+
pkgs.pkgconfig
43+
pkgs.postgresql
44+
pkgs.python27
45+
pkgs.python37
46+
pkgs.unzip
47+
pkgs.nixpacks
48+
];
49+
shellHook = ''
50+
npm install
51+
NODE_OPTIONS=--experimental-fetch --trace-warnings
52+
export PATH=$PATH:./node_modules/.bin/:./bin
53+
export PS1="\n\[\033[1;32m\][nix develop:\w]\$\[\033[0m\] ";
54+
'';
55+
};
56+
}
57+
);
58+
}

package.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",
6+
"type": "module",
67
"directories": {
78
"test": "test"
89
},
10+
"bin": {
11+
"print-module-types": "bin/print-module-types.js"
12+
},
913
"scripts": {
1014
"build": "tsc && spago build",
1115
"format": "purs-tidy format-in-place src test",
@@ -23,10 +27,19 @@
2327
},
2428
"homepage": "https://github.com/lambdaterms/purescript-read-dts#readme",
2529
"dependencies": {
26-
"@types/node": "^17.0.15",
27-
"typescript": "^4.5.2"
30+
"@react-three/drei": "^9.68.3",
31+
"@react-three/fiber": "^8.13.0",
32+
"@types/react": "^18.2.6",
33+
"@types/react-dom": "^18.2.4",
34+
"@types/three": "^0.150.2",
35+
"esbuild": "^0.17.19",
36+
"react-bootstrap": "^2.7.0",
37+
"ts-node": "^10.9.1",
38+
"typescript-compiler": "^1.4.1-2",
39+
"typescript-language-server": "^2.2.0"
2840
},
2941
"devDependencies": {
30-
"purs-tidy": "^0.6.3"
42+
"@types/node": "^18.11.17",
43+
"typescript": "^4.9.4"
3144
}
3245
}

packages.dhall

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@ let mkPackage =
33
sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57
44

55
let upstream =
6-
https://github.com/purescript/package-sets/releases/download/psc-0.14.4-20211030/packages.dhall
7-
sha256:5cd7c5696feea3d3f84505d311348b9e90a76c4ce3684930a0ff29606d2d816c
6+
https://github.com/purescript/package-sets/releases/download/psc-0.15.4-20221201/packages.dhall
7+
sha256:d1a68fa15709eaa686515eb5b9950d82c743f7bf73e3d87a4abe9e1be6fda571
88

99
in upstream
10+
with errors = ../purescript-errors/spago.dhall as Location
11+
-- mkPackage
12+
-- [ "prelude", "either", "maybe", "transformers", "control", "effect" ]
13+
-- "https://github.com/passy/purescript-errors.git"
14+
-- "v4.1.0"
1015
with dodo-printer =
1116
mkPackage
1217
[ "ansi", "foldable-traversable", "lists", "maybe", "strings" ]
1318
"https://github.com/natefaubion/purescript-dodo-printer.git"
1419
"v2.1.0"
20+
with js-object = ../js-object/spago.dhall as Location
1521
with js-unsafe-stringify =
1622
mkPackage
1723
([] : List Text)
1824
"https://github.com/paluh/purescript-js-unsafe-stringify"
19-
"master"
25+
"v0.2.1"
2026
with language-cst-parser =
2127
mkPackage
2228
[ "arrays"
@@ -40,7 +46,7 @@ in upstream
4046
mkPackage
4147
[ "fixed-points", "free", "prelude", "profunctor", "transformers" ]
4248
"https://github.com/slamdata/purescript-matryoshka.git"
43-
"v0.4.0"
49+
"v1.0.0"
4450
with pprint =
4551
mkPackage
4652
[ "arrays", "strings", "unfoldable" ]

spago.dhall

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ You can edit this file as you like.
1414
, "either"
1515
, "errors"
1616
, "exceptions"
17+
, "filterable"
1718
, "fixed-points"
1819
, "foldable-traversable"
20+
, "foreign"
1921
, "foreign-object"
2022
, "free"
2123
, "functions"
2224
, "identity"
2325
, "integers"
26+
, "js-object"
2427
, "language-cst-parser"
2528
, "lists"
2629
, "matryoshka"
@@ -31,6 +34,7 @@ You can edit this file as you like.
3134
, "node-fs"
3235
, "node-path"
3336
, "nullable"
37+
, "optparse"
3438
, "ordered-collections"
3539
, "partial"
3640
, "pprint"
@@ -40,6 +44,7 @@ You can edit this file as you like.
4044
, "profunctor-lenses"
4145
, "psci-support"
4246
, "record"
47+
, "refs"
4348
, "safe-coerce"
4449
, "strings"
4550
, "strings-extra"

0 commit comments

Comments
 (0)