Skip to content

Commit 55aa4de

Browse files
committed
feat: introduce types
1 parent cc519cc commit 55aa4de

File tree

10 files changed

+1668
-156
lines changed

10 files changed

+1668
-156
lines changed

Diff for: .gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/bower_components/
2+
/node_modules/
3+
/.pulp-cache/
4+
/output/
5+
/generated-docs/
6+
/.psc-package/
7+
/.psc*
8+
/.purs*
9+
/.psa*
10+
/.spago
11+
/.spago2nix/
12+
result

Diff for: flake.lock

+131
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: flake.nix

+2-53
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
description = "purescript-cardano-types";
2+
description = "purescript-cardano-plutus-data-schema";
33

44
# Allow IFD in `nix flake check`.
55
nixConfig.allow-import-from-derivation = "true";
66

77
nixConfig = {
88
extra-substituters = [ "https://plutonomicon.cachix.org" ];
99
extra-trusted-public-keys = [ "plutonomicon.cachix.org-1:evUxtNULjCjOipxwAnYhNFeF/lyYU1FeNGaVAnm+QQw=" ];
10-
bash-prompt = "\\[\\e[0m\\][\\[\\e[0;2m\\]nix-develop \\[\\e[0;1m\\]ps-cardano-types@\\[\\033[33m\\]$(git rev-parse --abbrev-ref HEAD) \\[\\e[0;32m\\]\\w\\[\\e[0m\\]]\\[\\e[0m\\]$ \\[\\e[0m\\]";
10+
bash-prompt = "\\[\\e[0m\\][\\[\\e[0;2m\\]nix-develop \\[\\e[0;1m\\]ps-cpds@\\[\\033[33m\\]$(git rev-parse --abbrev-ref HEAD) \\[\\e[0;32m\\]\\w\\[\\e[0m\\]]\\[\\e[0m\\]$ \\[\\e[0m\\]";
1111
};
1212

1313
inputs = {
@@ -81,40 +81,6 @@
8181
'';
8282
};
8383

84-
nodejs = pkgs.nodejs-18_x;
85-
86-
src = ./.;
87-
88-
mkNodeEnv = { withDevDeps ? true }: import
89-
(pkgs.runCommand "node-packages"
90-
{
91-
buildInputs = [ pkgs.nodePackages.node2nix ];
92-
} ''
93-
mkdir $out
94-
cd $out
95-
cp ${src}/package-lock.json ./package-lock.json
96-
cp ${src}/package.json ./package.json
97-
node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \
98-
--lock ./package-lock.json -i ./package.json
99-
'')
100-
{ inherit pkgs nodejs system; };
101-
102-
mkNodeModules = { withDevDeps ? true }:
103-
let
104-
nodeEnv = mkNodeEnv { inherit withDevDeps; };
105-
modules = pkgs.callPackage
106-
(_:
107-
nodeEnv // {
108-
shell = nodeEnv.shell.override {
109-
# see https://github.com/svanderburg/node2nix/issues/198
110-
buildInputs = [ pkgs.nodePackages.node-gyp-build ];
111-
};
112-
});
113-
in
114-
(modules { }).shell.nodeDependencies;
115-
116-
nodeModules = mkNodeModules { };
117-
11884
# Compiles your Purescript project and copies the `output` directory into the
11985
# Nix store. Also copies the local sources to be made available later as `purs`
12086
# does not include any external files to its `output` (if we attempted to refer
@@ -145,12 +111,6 @@
145111
];
146112
unpackPhase = ''
147113
export HOME="$TMP"
148-
149-
# handle NodeJS deps
150-
export NODE_PATH="${nodeModules}/lib/node_modules"
151-
ln -sfn $NODE_PATH node_modules
152-
export PATH="${nodeModules}/bin:$PATH"
153-
154114
# copy the dependency build artifacts and sources
155115
# preserve the modification date so that we don't rebuild them
156116
mkdir -p output .spago
@@ -206,11 +166,6 @@
206166
# Copy the purescript project files
207167
cp -r ${builtProject}/* .
208168
209-
# Handle nodejs dependencies
210-
export NODE_PATH="${nodeModules}/lib/node_modules"
211-
ln -sfn $NODE_PATH node_modules
212-
export PATH="${nodeModules}/bin:$PATH"
213-
214169
# The tests may depend on sources
215170
cp -r $src/* .
216171
@@ -225,12 +180,6 @@
225180
{
226181
devShells = {
227182
default = pkgs.mkShell {
228-
shellHook = ''
229-
export NODE_PATH="${nodeModules}/lib/node_modules"
230-
ln -sfn $NODE_PATH node_modules
231-
export PATH="${nodeModules}/bin:$PATH"
232-
export NPM_CONFIG_PACKAGE_LOCK_ONLY=true
233-
'';
234183
buildInputs = with pkgs; [
235184
nixpkgs-fmt
236185
easy-ps.purs

0 commit comments

Comments
 (0)