Skip to content

Commit

Permalink
Merge pull request #180 from yowainwright/chore-maintenance
Browse files Browse the repository at this point in the history
chore: modern bumps updates
  • Loading branch information
yowainwright authored Apr 9, 2023
2 parents a6707c5 + 3321608 commit e089bac
Show file tree
Hide file tree
Showing 10 changed files with 1,018 additions and 996 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Node.js",
"build": {
"dockerfile": "Dockerfile",
"args": { "VARIANT": "18-bullseye", "NODE_ENV": "docker-dev" }
},
"settings": {},
"extensions": [
"rvest.vs-code-prettier-eslint",
"ZixuanChen.vitest-explorer",
"wix.vscode-import-cost",
"eamodio.gitlens"
],
"postCreateCommand": "pnpm install --ignore-scripts",
"remoteUser": "node"
}
3 changes: 3 additions & 0 deletions .devcontainer/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ARG VARIANT="18-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
RUN su node -c "npm install -g pnpm"
2 changes: 2 additions & 0 deletions .env_starter
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PNPM_VERSION=8.1.1
NODE_ENV=local
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x, 16.x]

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -25,7 +25,8 @@ jobs:
- run: pnpm install --no-frozen-lockfile
- run: pnpm build
- run: pnpm test
- run: pnpm update
- run: pnpm run update
- run: pnpm install --no-frozen-lockfile
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ typings/
package-lock.json
.dccache
.husky
.pnpm-store
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ ES Check is a small utility using powerful tools that [Isaac Z. Schlueter](https

## Contributing

ES Check has 3 main dependencies: [acorn](https://github.com/ternjs/acorn/), [glob](https://www.npmjs.com/package/glob), and [caporal](https://github.com/mattallty/Caporal.js). To contribute, file an [issue](https://github.com/yowainwright/es-check/issues) or submit a pull request.
ES Check has 3 main dependencies: [acorn](https://github.com/ternjs/acorn/), [glob](https://www.npmjs.com/package/glob), and [caporal](https://github.com/mattallty/Caporal.js). To contribute, file an [issue](https://github.com/yowainwright/es-check/issues) or submit a pull request. To setup local development, run `./bin/setup.sh` or open the devcontainer in VSCode.

### Contributors

Expand Down
47 changes: 47 additions & 0 deletions bin/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/sh

if [ ! -f .env ]; then
cp .env_starter .env
echo "created .env file from .env_starter"
export $(grep -v '^#' .env | xargs)
else
export $(grep -v '^#' .env | xargs)
fi

# Get .env variables
[ ! -f .env ] || export $(grep -v '^#' .env | xargs)

# Check to see if Homebrew, Go, and Pre-commit are installed, and install it if it is not
HAS_NVM=$(command -v nvm >/dev/null)
HAS_PNPM=$(command -v pnpm >/dev/null)


if $HAS_NVM; then
. ~/.nvm/nvm.sh install
else
echo "Please install NVM or ensure your version matches the .nvmrc file"
exit 1
fi

PNPM_MSG="Please install PNPM or ensure your version matches the pnpm version within the .env file"

# load pnpm
if $HAS_PNPM; then
PNPM_LOADED_VERSION=$(command pnpm --version)
if [ "$PNPM_LOADED_VERSION" != "$PNPM_VERSION" ]; then
read -r -p "pnpm versions are out of snyc. Run 'npm install -g pnpm@${PNPM_VERSION}'? [Y/n]" response
response=$(echo "$response" | tr '[:upper:]' '[:lower:]')
if [ $response = "y" ] || [ -z $response ]; then
npm install -g pnpm@$PNPM_VERSION
echo 'pnpm version updated globally'
else
echo $PNPM_MSG
exit 1
fi;
else
echo "pnpm version is up-to-date"
fi
else
echo $PNPM_MSG
exit 1
fi
Loading

0 comments on commit e089bac

Please sign in to comment.