Skip to content

Commit

Permalink
Make sure that the project build with npm workspaces and bun
Browse files Browse the repository at this point in the history
  • Loading branch information
adamczykm committed May 7, 2024
1 parent f2e71b4 commit b1998b4
Show file tree
Hide file tree
Showing 21 changed files with 90 additions and 63,388 deletions.
Binary file added bun.lockb
Binary file not shown.
36 changes: 36 additions & 0 deletions devops/mkenvrc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Check if direnv is installed
if ! command -v direnv &> /dev/null; then
echo "Error: 'direnv' is not installed. Please install it and try again."
exit 1
fi

# Check if the path to the .envrc file is provided
if [ -z "$1" ]; then
echo "Please provide the path to the .envrc file as an argument."
exit 1
fi

# Resolve the absolute path of the given .envrc file
DIRPATH=$(realpath "$1")
ENVRCPATH=$DIRPATH/.envrc

# Construct the export command using the current working directory
NODE_MODULES_PATH=$DIRPATH/node_modules
EXPORT_COMMAND="export NODE_MODULES=${NODE_MODULES_PATH}"

# Check if the .envrc file exists, if not, create it
if [ ! -f "$ENVRCPATH" ]; then
touch "$ENVRCPATH"
fi

# Check if the export command is already present in the .envrc file
if grep -Fxq "$EXPORT_COMMAND" "$ENVRCPATH"; then
echo "NODE_MODULES is already set in ${ENVRCPATH}"
else
# Append the export command to the file
echo "$EXPORT_COMMAND" >> "$ENVRCPATH"
echo "Successfully added NODE_MODULES to ${ENVRCPATH}"
fi

2 changes: 1 addition & 1 deletion minauth-demo/minauth-demo-client/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const nextConfig = {
webpack(config) {
config.resolve.alias = {
...config.resolve.alias,
o1js: require('path').resolve('node_modules/o1js')
o1js: `${process.env.NODE_MODULES}/o1js`
};
config.experiments = { ...config.experiments, topLevelAwait: true };
return config;
Expand Down
Loading

0 comments on commit b1998b4

Please sign in to comment.