Skip to content

Commit

Permalink
Convert from parsec to Vite.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisl8 committed Dec 28, 2024
1 parent 08c198d commit 74acba8
Show file tree
Hide file tree
Showing 277 changed files with 269 additions and 6,507 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
cache: 'npm'
cache-dependency-path: ./package-lock.json
- run: ./scripts/versionNumberUpdate.sh
- run: pnpm i
- run: pnpm run build
- run: npm i
- run: npm run build
10 changes: 2 additions & 8 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: pnpm i
run: npm i
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Set Version Number
run: ./scripts/versionNumberUpdate.sh
- name: Run Server in background
run: node server/server.js &
- name: Run Client web server in background
run: npm run client-no-browser < /dev/null &
run: npm run client < /dev/null &
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
cache: 'npm'
cache-dependency-path: ./package-lock.json
- run: ./scripts/versionNumberUpdate.sh
- run: pnpm i
- run: npm i
- run: node server/server.js
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Thumbs.db
node_modules/

# Build
stage/
dist/
web-dist/
/npm-debug.log
Expand All @@ -30,3 +29,4 @@ server/utilities/version.js
/test-results/
/playwright-report/
/playwright/.cache/
/package-lock.json
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,23 @@ This is entirely a hobby project for me, with no desire to monetize it, so there

## How to Run a Local Copy for DEVELOPMENT!

1. Clone the repository.
2. Run `./scripts/devSetup.sh`
You need to have Node.js installed. I use `nvm` to manage my Node.js versions, but you can use whatever you like.

That should get you going and provide some guidance if you are missing anything, along with how to run it.
For development open two terminals windows:
In the first run:
npm run server

This will start the server, and restart it when file changes are made.
It is the same as running 'node server.js', except that it will
auto restart when you update your code.

In the second run:
npm run client

This will build the client as well as rebuild and cause a browser refresh
when file changes are made.
It should also automatically open your web browser to the page,
but if not, go to http://localhost:3001

## Phaser Documentation

Expand Down
2 changes: 1 addition & 1 deletion client/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
sizes="16x16"
href="./src/favicon/favicon-16x16.png"
/>
<link rel="manifest" href="./manifest.json"/>
<link rel="manifest" href="manifest.json"/>
<meta name="theme-color" content="#ffffff"/>
<!-- End Favicons -->
<!-- Fonts -->
Expand Down
File renamed without changes.
29 changes: 8 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,19 @@
"version": "0.0.1",
"description": "Witchazzan Game",
"type": "module",
"source": [
"client/index.html",
"client/sign-in.html"
],
"targets": {
"default": {
"distDir": "./stage"
}
},
"scripts": {
"client": "rm -rf .parcel-cache;parcel --port 3001 --open",
"client-no-browser": "rm -rf .parcel-cache;parcel --port 3001",
"prebuild": "rm -rf stage;rm -rf .parcel-cache",
"build": "parcel build && rm -rf web-dist && mv stage web-dist",
"client": "vite --config vite/config.dev.mjs",
"prebuild": "rm -rf dist",
"build": "vite build --config vite/config.prod.mjs",
"server": "pm2-dev scripts/pm2DevConfig.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/chrisl8/Witchazzan.git"
},
"author": "Christen Lofland <christen@lofland.net> (https://www.ekpyroticfrood.net)",
"license": "AGPL-3.0-or-later",
"licenseUrl": "https://opensource.org/licenses/AGPL-3.0",
"license": "MIT",
"licenseUrl": "https://raw.githubusercontent.com/chrisl8/Witchazzan/refs/heads/main/LICENSE",
"bugs": {
"url": "https://github.com/chrisl8/Witchazzan/issues"
},
Expand All @@ -53,14 +43,11 @@
"querystring-es3": "^0.2.1",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"terser": "^5.37.0",
"url": "^0.11.4",
"util": "^0.12.5"
"util": "^0.12.5",
"vite": "^5.3.1"
},
"browserslist": [
"> 0.5%",
"last 2 versions",
"not dead"
],
"dependencies": {
"bcrypt": "^5.1.1",
"cors": "^2.8.5",
Expand Down
Loading

0 comments on commit 74acba8

Please sign in to comment.