Skip to content

Commit

Permalink
Update to parcel 2
Browse files Browse the repository at this point in the history
  • Loading branch information
190n committed Apr 23, 2023
1 parent 942d949 commit 50b73dc
Show file tree
Hide file tree
Showing 8 changed files with 1,675 additions and 250 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.vscode
dist
node_modules
.parcel-cache
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ WORKDIR /app
COPY . .
WORKDIR /app/packages/werewolf-frontend
RUN yarn
RUN yarn global add parcel-bundler
RUN rm -fr dist .env .env.production
RUN rm -fr dist .env .env.production .parcel-cache
ENV NODE_ENV=production

ARG backendBaseUrl=''
ARG frontendBaseUrl=''
ARG backendBaseSocketUrl='ws://localhost:5000'

ENV BACKEND_BASE_URL=${backendBaseUrl}
ENV FRONTEND_BASE_URL=${frontendBaseUrl}
ENV BACKEND_BASE_SOCKET_URL=${backendBaseSocketUrl}
RUN yarn build
WORKDIR /app/packages/werewolf-backend
RUN rm -fr dist
Expand Down
4 changes: 3 additions & 1 deletion packages/werewolf-backend/src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,12 @@ export interface ActionGroup {

export function makeActionGroups(assignedCards: CardAssignments, center: Center): ActionGroup[] {
const cardsSelected = Object.values(assignedCards).concat(center),
players = Object.keys(assignedCards),
groups: ActionGroup[] = [];

if (cardsSelected.includes('doppelganger')) {

const doppelganger = players.find(p => assignedCards[p] == 'doppelganger')!;
groups.push({ allowed: [doppelganger], required: [doppelganger] });
}

return groups;
Expand Down
6 changes: 6 additions & 0 deletions packages/werewolf-frontend/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties"]
]
}
5 changes: 5 additions & 0 deletions packages/werewolf-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
},
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.21.0",
"@babel/plugin-transform-runtime": "^7.8.3",
"cssnano": "^5.0.0-rc.2",
"parcel": "2",
"postcss": "8",
"process": "^0.11.10",
"sass": "^1.26.3",
"typescript": "^3.8.3"
},
Expand Down
7 changes: 4 additions & 3 deletions packages/werewolf-frontend/src/SettingsOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import styled from 'styled-components';
import { MdVolumeOff, MdVolumeUp, MdOpenInNew, MdBrightness3, MdBrightness7 } from 'react-icons/md';

import { ExternalLink, IconButton } from './ui';
import opusFile from './music/fantasy-ukulele.opus';
import cafFile from './music/fantasy-ukulele.caf';
import m4aFile from './music/fantasy-ukulele.m4a';
import { useColorMode, ColorMode, ColorModePreference } from './color-mode';

const opusFile = new URL('music/fantasy-ukulele.opus', import.meta.url);
const cafFile = new URL('music/fantasy-ukulele.caf', import.meta.url);
const m4aFile = new URL('music/fantasy-ukulele.m4a', import.meta.url);

const FloatingContainerLeft = styled.div`
position: fixed;
left: 0.5rem;
Expand Down
2 changes: 1 addition & 1 deletion packages/werewolf-frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
}
</script>
<main id="app"></main>
<script src="index.tsx"></script>
<script src="index.tsx" type="module"></script>
</body>
</html>
1,889 changes: 1,646 additions & 243 deletions packages/werewolf-frontend/yarn.lock

Large diffs are not rendered by default.

0 comments on commit 50b73dc

Please sign in to comment.