Skip to content

Commit

Permalink
Merge branch 'lib-classifier_survey-task-design-changes' into lib-cla…
Browse files Browse the repository at this point in the history
…ssifier_chooser-styling-updates
  • Loading branch information
mcbouslog authored Dec 17, 2024
2 parents af889d3 + 7b55019 commit 56afb38
Show file tree
Hide file tree
Showing 162 changed files with 2,740 additions and 3,469 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 15
labels:
- "dependencies"
groups:
nextjs:
patterns:
- "@next*"
- "next"
- "eslint-config-next"
sentry:
patterns:
- "@sentry*"
Expand All @@ -27,6 +30,13 @@ updates:
visx:
patterns:
- "@visx*"
react-testing-library:
patterns:
- "@testing-library*"
babel:
patterns:
- "@babel*"
- "babel-*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:

- run: yarn install --production=false --frozen-lockfile
- run: yarn workspace @zooniverse/react-components build:es6
- run: yarn workspace @zooniverse/subject-viewers build:es6
- name: Deploy to GH Pages
run: yarn deploy-storybook -- --ci
env:
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ WORKDIR /usr/src/

ADD package.json /usr/src/

ADD yarn.lock /usr/src/

COPY .yarn /usr/src/.yarn

ADD .yarnrc /usr/src/
Expand All @@ -40,6 +38,8 @@ ADD lerna.json /usr/src/

COPY ./packages /usr/src/packages

ADD yarn.lock /usr/src/

RUN chown -R node:node .

USER node
Expand All @@ -64,16 +64,16 @@ RUN mkdir -p /usr/src

WORKDIR /usr/src/

ADD package.json /usr/src/

ADD yarn.lock /usr/src/
COPY --from=builder /usr/src/package.json /usr/src/package.json

COPY .yarn /usr/src/.yarn
COPY --from=builder /usr/src/.yarn /usr/src/.yarn

ADD .yarnrc /usr/src/
COPY --from=builder /usr/src/.yarnrc /usr/src/.yarnrc

COPY --from=builder /usr/src/packages ./packages

COPY --from=builder /usr/src/yarn.lock /usr/src/yarn.lock

RUN --mount=type=cache,id=fem-runner-yarn,uid=1000,gid=1000,target=/home/node/.yarn YARN_CACHE_FOLDER=/home/node/.yarn yarn install --production --frozen-lockfile --ignore-scripts --prefer-offline

RUN rm -rf /usr/src/packages/lib-react-components/src
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ docker compose build
docker compose up -d
# shut down the running containers when you're finished
docker compose down
# run this if you need a shell inside the running container
docker compose run --rm shell
# run this if you need a shell inside the dev container
docker compose run --rm dev-shell
# run this for a shell inside the production container
docker compose run --rm prod-shell
```

You can supply a service name (from `docker-compose.yml`) to `docker compose` if you only want to run a single service eg.
Expand All @@ -90,14 +92,16 @@ docker compose build fe-project
docker compose up -d fe-project
```

Development environments for individual packages can be run from the package directories. For example:
Development environments for individual packages can be run from the package directories. See the READMEs in individual packages for detailed instructions. For example:

```sh
cd packages/app-project
docker-compose up
docker compose build
docker compose up -d
docker compose down
```

to run a development server for the project app. See the READMEs for individual packages for detailed instructions.
Tip: If you're an occasional Docker Desktop user, remember to `docker image prune`.

### With Node and yarn

Expand Down
25 changes: 21 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
services:
shell:
prod-shell:
image: front-end-monorepo_prod:latest
volumes:
- node_modules-prod:/usr/src/node_modules
build:
context: ./
args:
- NODE_ENV=production
- PANOPTES_ENV=production
- NEXT_TELEMETRY_DISABLED=1
- APP_ENV=development
command:
- "/bin/sh"
dev-shell:
image: front-end-monorepo_dev:latest
volumes:
- node_modules:/usr/src/node_modules
- node_modules-dev:/usr/src/node_modules
build:
context: ./
target: builder
Expand All @@ -12,6 +25,8 @@ services:
- "/bin/sh"
fe-project:
image: front-end-monorepo_prod:latest
volumes:
- node_modules-prod:/usr/src/node_modules
build:
context: ./
args:
Expand All @@ -30,6 +45,8 @@ services:
- "3002:3000"
fe-root:
image: front-end-monorepo_prod:latest
volumes:
- node_modules-prod:/usr/src/node_modules
build:
context: ./
args:
Expand All @@ -46,6 +63,6 @@ services:
- PORT=3000
ports:
- "3003:3000"

volumes:
node_modules:
node_modules-dev:
node_modules-prod:
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"test:ci": "nyc --silent lerna run --parallel test:ci"
},
"engines": {
"node": ">=16.18"
"node": ">=20.5"
},
"nyc": {
"exclude": [
Expand Down
1 change: 1 addition & 0 deletions packages/app-project/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"env": {
"test": {
"plugins": [
"babel-plugin-styled-components",
[ "babel-plugin-webpack-alias", { "config": "./webpack.config.test.js" } ]
],
"presets": ["next/babel"]
Expand Down
4 changes: 4 additions & 0 deletions packages/app-project/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
- ./pages:/usr/src/packages/app-project/pages
- ./src:/usr/src/packages/app-project/src
- ./stores:/usr/src/packages/app-project/stores
- node_modules-dev:/usr/src/node_modules
storybook:
image: front-end-monorepo_dev:latest
entrypoint:
Expand All @@ -34,3 +35,6 @@ services:
- ./pages:/usr/src/packages/app-project/pages
- ./src:/usr/src/packages/app-project/src
- ./stores:/usr/src/packages/app-project/stores
- node_modules-dev:/usr/src/node_modules
volumes:
node_modules-dev:
32 changes: 12 additions & 20 deletions packages/app-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,37 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@sentry/nextjs": "~8.38.0",
"@sentry/nextjs": "~8.43.0",
"@sindresorhus/string-hash": "~1.2.0",
"@visx/axis": "~3.12.0",
"@visx/group": "~3.12.0",
"@visx/scale": "~3.12.0",
"@visx/shape": "~3.12.0",
"@visx/text": "~3.12.0",
"@zooniverse/async-states": "~0.0.1",
"@zooniverse/classifier": "^0.0.1",
"@zooniverse/grommet-theme": "~3.2.0",
"@zooniverse/panoptes-js": "~0.5.0",
"@zooniverse/react-components": "~1.13.0",
"cookie": "~0.7.0",
"cookie": "~1.0.2",
"d3": "~6.7.0",
"engine.io-client": "~6.6.0",
"express": "^4.17.1",
"graphql": "~16.9.0",
"graphql-request": "~6.1.0",
"grommet": "~2.41.0",
"grommet-icons": "~4.12.0",
"i18next": "~23.16.5",
"i18next": "~24.1.0",
"lodash": "~4.17.11",
"million": "~3.1.11",
"mobx": "~6.12.0",
"mobx-devtools-mst": "~0.9.21",
"mobx-react": "~9.1.0",
"mobx": "~6.13.5",
"mobx-react": "~9.2.0",
"mobx-state-tree": "~5.4.0",
"morgan": "^1.10.0",
"newrelic": "~12.3.1",
"newrelic": "~12.8.1",
"next": "~14.2.7",
"next-i18next": "~15.3.1",
"next-i18next": "~15.4.0",
"panoptes-client": "~5.6.0",
"path-match": "~1.2.4",
"polished": "~4.3.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-i18next": "~14.1.3",
"react-resize-detector": "~9.1.0",
"styled-components": "~5.3.3",
"styled-components": "~6.1.13",
"swr": "~2.2.0",
"validator": "~13.12.0"
},
Expand All @@ -69,21 +61,21 @@
"@testing-library/react": "~14.2.0",
"@testing-library/user-event": "~14.5.0",
"@wojtekmaj/enzyme-adapter-react-17": "~0.8.0",
"babel-loader": "~9.1.0",
"babel-loader": "~9.2.1",
"babel-plugin-webpack-alias": "~2.1.2",
"chai": "~4.5.0",
"chai-dom": "~1.12.0",
"dirty-chai": "~2.0.1",
"enzyme": "~3.11.0",
"eslint-config-next": "~14.2.7",
"eslint-plugin-jsx-a11y": "~6.10.1",
"jsdom": "~24.0.0",
"jsdom": "~25.0.1",
"mocha": "~10.8.2",
"msw": "~2.5.1",
"msw": "~2.6.9",
"msw-storybook-addon": "~2.0.3",
"nock": "~13.5.1",
"selfsigned": "~2.4.1",
"sinon": "~17.0.0",
"sinon": "~19.0.2",
"sinon-chai": "~3.7.0",
"storybook": "~7.6.11",
"storybook-react-i18next": "~2.0.1"
Expand Down
2 changes: 0 additions & 2 deletions packages/app-project/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import makeInspectable from 'mobx-devtools-mst'
import { enableStaticRendering, Provider } from 'mobx-react'
import Error from 'next/error'
import { useEffect, useMemo } from 'react'
Expand Down Expand Up @@ -50,7 +49,6 @@ function MyApp({ Component, pageProps }) {
/* Initialize the mobx store */
const { initialState } = pageProps
const store = useStore(initialState)
makeInspectable(store)

useEffect(
function onMount() {
Expand Down
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/cs/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dismiss": "Tyto zprávy již nezobrazovat."
},
"YourStats": {
"title": "Statistiky projektu {{projectName}}"
"title": "Statistiky"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/de/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"content": "Glückwunsch! Du hast den nächsten Workflow freigeschalten. Wenn Du lieber in diesem Workflow bleiben möchtest, kannst Du auswählen hier zu bleiben."
},
"YourStats": {
"title": "{{projectName}} Statistik"
"title": "Statistik"
}
}
}
}
22 changes: 4 additions & 18 deletions packages/app-project/public/locales/en/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,7 @@
"title": "There was an error in the classifier :("
}
},
"FinishedForTheDay": {
"buttons": {
"stats": "See the stats"
},
"text": "Your answers are saved for the research team while you're working. See the project stats and return to the {{projectName}} home page.",
"title": "Finished for the day?",
"ProjectImage": {
"alt": "Image for {{projectName}}"
}
},
"RecentSubjects": {
"text": "Discuss a subject on Talk, or add it to your Favourites or a collection.",
"title": "Your recent classifications"
},
"WorkflowAssignmentModal": {
Expand All @@ -77,13 +66,10 @@
"title": "New Workflow Available"
},
"YourStats": {
"todaysCount": "Classifications today",
"totalCount": "Classifications total",
"text": "Keep up the great work!",
"title": "Your {{projectName}} statistics",
"DailyClassificationsChart": {
"title": "{{projectName}} daily classification counts"
}
"allTime": "All Time",
"lastSeven": "Last 7 Days",
"link": "See more",
"title": "Your Stats"
}
}
}
19 changes: 1 addition & 18 deletions packages/app-project/public/locales/es/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,7 @@
"title": "Se ha producido un error en el clasificador :("
}
},
"FinishedForTheDay": {
"ProjectImage": {
"alt": "Imagen para {{projectName}}"
},
"buttons": {
"stats": "Ver las estadísticas"
},
"text": "Mientras estás trabajando, tus respuestas se guardan para el equipo de investigación. Mira las estadísticas del proyecto y vuelve a la página de inicio de {{projectName}}.",
"title": "¿Has terminado por hoy?"
},
"RecentSubjects": {
"text": "Comenta un objeto en Hablemos o añádelo a tus Favoritos o a una colección.",
"title": "Tus clasificaciones recientes"
},
"WorkflowAssignmentModal": {
Expand All @@ -52,13 +41,7 @@
"title": "Nuevo flujo de trabajo disponible"
},
"YourStats": {
"DailyClassificationsChart": {
"title": "Recuentos diarios de la clasificación de {{projectName}}"
},
"text": "¡Sigue con ese gran trabajo!",
"title": "Estadística de {{projectName}}",
"todaysCount": "Las clasificaciones de hoy",
"totalCount": "Total de clasificaciones"
"title": "Estadística"
}
},
"Home": {
Expand Down
Loading

0 comments on commit 56afb38

Please sign in to comment.