Skip to content

Commit

Permalink
Merge branch 'dshuiski/docker' into dshuiski/commit-blueprint-tx
Browse files Browse the repository at this point in the history
  • Loading branch information
errfrom committed Apr 24, 2024
2 parents 84677d0 + 3a16834 commit 3f0a79a
Show file tree
Hide file tree
Showing 12 changed files with 399 additions and 4,219 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
spago-packages.nix linguist-generated=true
flake.lock linguist-generated=true
package-lock.json linguist-generated=true
demo/package-lock.json linguist-generated=true
spago-packages.nix linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/.direnv
/.envrc
/dist/
/demo/package-lock.json
/demo/index.js
/demo/node_modules/
/plutip-env/payment.skey
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ format:
check:
@nix build .#checks.x86_64-linux.all

build: requires-nix-shell
spago build --purs-args ${purs-args}

bundle: build requires-nix-shell
node bundle.js && tsc --emitDeclarationOnly

bundle-docker:
docker rm -f ${ha-frontend-api}
docker build -t ${ha-frontend-api} -f docker/frontend-api/Dockerfile .
docker create --name ${ha-frontend-api} ${ha-frontend-api}
docker cp ${ha-frontend-api}:/app/dist .
docker rm -f ${ha-frontend-api}

build: requires-nix-shell
spago build --purs-args ${purs-args}

bundle: build requires-nix-shell
node bundle.js && tsc --emitDeclarationOnly

serve: bundle requires-nix-shell
cd demo && npm run serve
serve:
cd demo && npm install --package-lock-only=false && npm run serve

repl: requires-nix-shell
spago repl
Expand Down
6 changes: 1 addition & 5 deletions bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ esbuild.build({
entryPoints: ["api/index.ts"],
outfile: "dist/index.js",
define: {
BROWSER_RUNTIME: "1",
"process.env.CARDANO_NETWORK": `"${process.env.CARDANO_NETWORK}"`,
"process.env.BLOCKFROST_API_KEY": `"${process.env.BLOCKFROST_API_KEY}"`,
"process.env.PLUTIP_ENV_HOST_PORT": `"${process.env.PLUTIP_ENV_HOST_PORT}"`,
"process.env.DEMO_HOST_PORT": `"${process.env.DEMO_HOST_PORT}"`
BROWSER_RUNTIME: "1"
},
loader: {
".plutus": "text"
Expand Down
23 changes: 0 additions & 23 deletions demo/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@ esbuild.build({
define: {
"process.env.BLOCKFROST_API_KEY": `"${process.env.BLOCKFROST_API_KEY}"`
},
plugins: [
{
name: "replace-hydra-auction-offchain-import",
setup(build) {
const skipResolve = "skipResolve";
build.onResolve({ filter: /^hydra-auction-offchain$/ }, async (args) => {
if (args.pluginData === skipResolve) return;
const isNixEnv = process.env.NPM_ENV !== "1";
if (isNixEnv) {
args.path = args.path.replace("hydra-auction-offchain", "../../dist");
}
const resolveOptions = {
importer: args.importer,
namespace: args.namespace,
resolveDir: args.resolveDir,
kind: args.kind,
pluginData: skipResolve
};
return build.resolve(args.path, resolveOptions);
});
}
}
],
bundle: true,
platform: "browser",
format: "esm",
Expand Down
Loading

0 comments on commit 3f0a79a

Please sign in to comment.