Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gardening #1164

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
dfb7dbb
feat: begin migration
ob6160 Jun 26, 2021
abc64e2
feat: typescript
ob6160 Jun 27, 2021
5cc2085
feat: typescript
ob6160 Jun 27, 2021
d668669
feat: typescript
ob6160 Jun 27, 2021
6444f07
feat: typescript
ob6160 Jun 27, 2021
53fafc9
feat: typescript
ob6160 Jun 27, 2021
dd091bb
feat: typescript
ob6160 Jun 27, 2021
0c2084e
feat: typescript
ob6160 Jun 27, 2021
04a7cb3
feat: typescript
ob6160 Jun 27, 2021
a0a0481
feat: typescript
ob6160 Jun 27, 2021
4631451
fix: types for emotion
ob6160 Jun 27, 2021
1fd8662
fix: start upgrade to emotion 11
ob6160 Jun 27, 2021
34912dc
fix: emotion css prop
ob6160 Jun 27, 2021
999b08f
feat: do some auth typing
ob6160 Jun 27, 2021
806bfe7
chore: typing
ob6160 Jun 27, 2021
d7daf2c
feat: IT RENDERS
ob6160 Jun 27, 2021
be38f8b
wip
ob6160 Jun 27, 2021
06febda
chore: codemode anon
ob6160 Jun 27, 2021
cb0e267
feat: render images better
ob6160 Jun 27, 2021
5d37b55
feat: render loo map without markers
ob6160 Jun 27, 2021
c08b760
fix: edit loo page
ob6160 Jun 27, 2021
e41cb44
feat: onwards
Jul 10, 2021
5fbd03c
feat: graphql webpack loader
Jul 10, 2021
d96276b
fix: typefest
Jul 10, 2021
8c56ce4
feat: switch to esbuild
ob6160 Jul 23, 2021
50f7661
u turn on esbuild for now
ob6160 Jul 23, 2021
3e932f3
add next config for proxying api reqs
ob6160 Jul 26, 2021
e26bf4e
fix routing for shallow loading of individual loo pages
ob6160 Jul 26, 2021
4a32ca0
edit page working I think maybe perhaps
ob6160 Jul 26, 2021
d61cb49
remove page
ob6160 Jul 26, 2021
3e7a67f
get the other pages to route correctly, still a few more to fix
ob6160 Jul 26, 2021
f2ab022
conflict resolution
ob6160 Jul 28, 2021
0bba49a
install gql apollo codegen
ob6160 Jul 28, 2021
91898ee
codegen on graphql
ob6160 Jul 31, 2021
f1efc12
disable gql wp loader, break ALL the things
ob6160 Jul 31, 2021
f810a2d
ship nearby loos query out to its own file for codegen
ob6160 Jul 31, 2021
3b430d7
prove out new codegen is working for loos by proximity on the index p…
ob6160 Jul 31, 2021
71fe013
get gen client hook to work properly
ob6160 Jul 31, 2021
2a19b38
tidyup
ob6160 Jul 31, 2021
0bc946a
improve codegen command so it spins up api for code generation to work
ob6160 Jul 31, 2021
69ca739
Merge branch 'main' of github.com:neontribe/gbptm into feature/nextjs…
ob6160 Aug 1, 2021
58bf0ad
fix dynamic loading of toilets so that they load successfully on init…
ob6160 Aug 1, 2021
ecddc47
fix info panels for individual toilets
ob6160 Aug 1, 2021
4b19112
messing around getting the build to pass, skipping type checking and …
ob6160 Aug 2, 2021
e5e024c
no idea how this workflow works haha
ob6160 Aug 2, 2021
669bdd4
undo
ob6160 Aug 2, 2021
e7789f7
put names back for package json
ob6160 Aug 2, 2021
55975bc
change build out dir
ob6160 Aug 2, 2021
47bca8e
remove index from public
ob6160 Aug 2, 2021
d8de1b4
put build output back
ob6160 Aug 2, 2021
34940cf
messing with build dir
ob6160 Aug 2, 2021
df64c19
put back, wait on vercel config check
ob6160 Aug 2, 2021
048687f
sketch a plan
ob6160 Aug 2, 2021
8825fa6
api gardening (#1147)
Aug 3, 2021
1ac2d79
fix chicken and egg problem with codegen for nextjs client depending …
ob6160 Aug 3, 2021
a2af6c3
fix so we use one typedef file for both api impls
ob6160 Aug 3, 2021
607115d
feat: auth with nextjs-auth0 (#1150)
Aug 28, 2021
c66d8b6
chore: update codegen tools et al
Sep 6, 2021
f56bb84
fix: update to latest apollo and graphql
Sep 6, 2021
a22554c
chore: fix lint-staged
Sep 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"env": {
"production": {
"plugins": ["emotion"]
},
"development": {
"plugins": [["emotion", { "sourceMap": true }]]
}
}
}
"presets": [
[
"next/babel",
{
"preset-react": {
"runtime": "automatic",
"importSource": "@emotion/react"
}
}
]
],
"plugins": [
"@emotion/babel-plugin"
]
}
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
node: true,
jest: true,
},
extends: ['eslint:recommended', 'react-app'],
extends: ['eslint:recommended'/*, 'react-app'*/],
parserOptions: {
ecmaVersion: 2017,
ecmaFeatures: {
Expand Down
22 changes: 16 additions & 6 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ MONGODB_URI=mongodb://127.0.0.1:27017/toiletmap
# Use this database in migration scripts
DATABASE_NAME=toiletmap

# UI
# If you wish to avoid running a local API you can proxy to a remote
# PROXY=https://some.remote.api

# Connect to GA in prod
REACT_APP_GOOGLE_MAPS_API_KEY=
# A long, secret value used to encrypt the session cookie
AUTH0_SECRET='A REALLY LONG STRING'
# The base url of your application
AUTH0_BASE_URL='http://localhost:3000'
# The url of your Auth0 tenant domain
AUTH0_ISSUER_BASE_URL='https://gbptm.eu.auth0.com'
# Your Auth0 application's Client ID
AUTH0_CLIENT_ID='ASK FOR THIS'
# Your Auth0 application's Client Secret
AUTH0_CLIENT_SECRET='ASK FOR THIS'
# Our API's audience setting
AUTH0_AUDIENCE='https://www.toiletmap.org.uk/graphql'
# The key in the session or token where we keep user permissions
AUTH0_PERMISSIONS_KEY='https://toiletmap.org.uk/permissions'
#The key in the session or token where we keep profile info
AUTH0_PROFILE_KEY='https://toiletmap.org.uk/profile'
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Tests

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Yarn install (with caching)
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ build
.idea

.vercel

# nextjs
.next
7 changes: 0 additions & 7 deletions api/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions api/index.js

This file was deleted.

34 changes: 34 additions & 0 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
overwrite: true
schema: "http://localhost:3000/api"
documents: "src/**/*.graphql"
generates:
src/generated/graphql.tsx:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
config:
reactApolloVersion: 3
withHooks: false
withHOC: false
withComponent: false
exportFragmentSpreadSubTypes: true
documentMode: graphQLTag
src/generated/page.tsx:
config:
documentMode: external
importDocumentNodeExternallyFrom: ./graphql
reactApolloVersion: 3
withHooks: true
# withHOC: false
# excludePatterns: 'getComments'
# excludePatternsOptions: 'i'
# customDataIdFromObjectName: 'test'
# customDataIdFromObjectImport: 'abc'
apolloClientInstanceImport: '../components/withApollo'
# apolloStateKey: '__APOLLO_STATE__'
preset: import-types
presetConfig:
typesPath: ./graphql
plugins:
- graphql-codegen-apollo-next-ssr # replace by - graphql-codegen-apollo-next-ssr
24 changes: 0 additions & 24 deletions config-overrides.js

This file was deleted.

6 changes: 6 additions & 0 deletions graphql.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module '*.graphql' {
import { DocumentNode } from 'graphql';
const Schema: DocumentNode;

export = Schema;
}
13 changes: 0 additions & 13 deletions jsconfig.json

This file was deleted.

5 changes: 5 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
'*.{js,ts,tsx}': ['prettier --write', 'eslint --max-warnings=0'],
'**/*.ts?(x)': () => 'tsc -p tsconfig.json --noEmit',
'*.{json,md,yml}': ['prettier --write'],
};
6 changes: 6 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
14 changes: 14 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
eslint: {
// Warning: Dangerously allow production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
};
97 changes: 44 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
"version": "2.0.0",
"description": "",
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"build": "react-app-rewired build",
"dev": "react-app-rewired start",
"api": "node -r dotenv/config ./api/index.js",
"build": "next build",
"dev": "next dev",
"start": "next start",
"lint": "eslint . && stylelint \"src/**/*.css\"",
"format": "prettier --write \"./**/*.{js,json}\"",
"test": "jest",
"build:testable": "CI= REACT_APP_MOCKS=true yarn build",
"migrate": "migrate-mongo up",
"generate": "node -r dotenv/config ./src/api/db/manage/generate/index.js --confirm",
"areas": "node -r dotenv/config ./src/api/db/manage/areaToDatabase/index.js",
"styleguide": "styleguidist server",
"prepare": "husky install"
"prepare": "husky install",
"gql:codegen": "start-server-and-test dev http-get://localhost:3000/api 'graphql-codegen --config codegen.yml'"
},
"repository": {
"type": "git",
Expand All @@ -27,62 +25,57 @@
"bugs": {
"url": "https://github.com/neontribe/gbptm/issues"
},
"lint-staged": {
"*.js": [
"eslint --max-warnings 0",
"prettier --write"
],
"*.css": "stylelint"
},
"dependencies": {
"@apollo/client": "3.4.10",
"@artsy/fresnel": "1.5.0",
"@emotion/babel-preset-css-prop": "10.2.1",
"@emotion/core": "10.1.1",
"@auth0/nextjs-auth0": "1.5.0",
"@emotion/babel-plugin": "11.3.0",
"@emotion/is-prop-valid": "0.8.8",
"@emotion/styled": "10.0.27",
"@emotion/react": "11.4.0",
"@emotion/styled": "11.3.0",
"@fortawesome/fontawesome-svg-core": "1.2.35",
"@fortawesome/free-brands-svg-icons": "5.15.3",
"@fortawesome/free-regular-svg-icons": "5.15.3",
"@fortawesome/free-solid-svg-icons": "5.15.3",
"@fortawesome/react-fontawesome": "0.1.14",
"@graphql-tools/schema": "8.2.0",
"@graphql-tools/utils": "8.2.2",
"@material-ui/core": "4.11.4",
"@material-ui/icons": "4.11.2",
"@rehooks/component-size": "1.0.3",
"@styled-system/prop-types": "5.1.5",
"apollo-server": "2.24.1",
"auth0-js": "9.16.2",
"apollo-server-core": "3.3.0",
"apollo-server-micro": "3.3.0",
"chart.js": "2.9.4",
"d3-scale": "3.3.0",
"date-fns": "2.22.1",
"downshift": "6.1.3",
"emotion-theming": "10.0.27",
"focus-visible": "5.2.0",
"framer-motion": "2.9.5",
"graphql": "15.5.3",
"graphql-iso-date": "3.6.1",
"graphql-request": "3.4.0",
"graphql-request": "3.5.0",
"graphql-voyager": "1.0.0-rc.31",
"graphql.macro": "1.4.2",
"hasha": "5.2.2",
"jsonwebtoken": "8.5.1",
"jwks-rsa": "2.0.4",
"leaflet": "1.7.1",
"lodash": "4.17.21",
"micro": "9.3.4",
"mongoose": "5.12.14",
"mongoose-paginate": "5.0.3",
"next": "11.1.2",
"node-fetch": "2.6.1",
"prop-types": "15.7.2",
"query-string": "7.0.1",
"react": "17.0.2",
"react-animated-number": "0.4.4",
"react-app-polyfill": "2.0.0",
"react-chartjs-2": "2.11.2",
"react-dom": "17.0.2",
"react-helmet": "6.1.0",
"react-hook-form": "6.15.8",
"react-leaflet": "2.8.0",
"react-leaflet-control": "2.1.2",
"react-router-dom": "5.2.0",
"react-router-hash-link": "2.4.3",
"react-simple-maps": "2.3.0",
"react-tooltip": "4.2.21",
"resize-observer-polyfill": "1.5.1",
Expand All @@ -91,55 +84,53 @@
"timeago-react": "3.0.3"
},
"devDependencies": {
"@commitlint/cli": "12.1.4",
"@commitlint/config-conventional": "12.1.4",
"@commitlint/cli": "13.1.0",
"@commitlint/config-conventional": "13.1.0",
"@graphql-codegen/cli": "2.1.1",
"@graphql-codegen/import-types-preset": "2.1.3",
"@graphql-codegen/typescript": "2.2.0",
"@graphql-codegen/typescript-operations": "2.1.3",
"@graphql-codegen/typescript-react-apollo": "3.1.3",
"@lola-tech/graphql-kimera": "1.0.1",
"@mapbox/geojson-area": "0.2.2",
"@mapbox/geojson-rewind": "0.5.1",
"@shelf/jest-mongodb": "1.3.4",
"@types/jest": "26.0.24",
"@types/node": "16.7.10",
"@types/puppeteer": "5.4.4",
"apollo-server-testing": "2.24.1",
"@types/react": "17.0.20",
"@types/react-dom": "17.0.9",
"@types/react-leaflet": "2.8.1",
"@types/styled-system": "5.1.11",
"apollo-server-testing": "2.25.2",
"cli-progress": "3.9.0",
"customize-cra": "1.0.0",
"dotenv": "10.0.0",
"eslint": "7.32.0",
"eslint-config-next": "11.1.2",
"geojson-precision": "1.0.0",
"http-proxy-middleware": "2.0.1",
"husky": "6.0.0",
"graphql-codegen-apollo-next-ssr": "1.7.0",
"husky": "7.0.2",
"jest-puppeteer": "5.0.3",
"lint-staged": "11.1.1",
"lint-staged": "11.1.2",
"migrate-mongo": "8.2.3",
"msw": "0.33.0",
"nodemon": "2.0.12",
"prettier": "2.3.2",
"puppeteer": "10.1.0",
"react-app-rewired": "2.1.8",
"react-scripts": "3.4.4",
"react-styleguidist": "11.1.7",
"serve": "12.0.0",
"source-map-explorer": "2.5.2",
"start-server-and-test": "1.14.0",
"stylelint": "13.13.1",
"stylelint-config-standard": "22.0.0",
"topojson-server": "3.0.1",
"topojson-simplify": "3.0.3",
"typescript": "4.4.2",
"uuid": "8.3.2"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"ie 11"
]
},
"resolutions": {
"graphql": "14.7.0"
},
"msw": {
"workerDirectory": "public"
},
"browser": {
"fs": false,
"path": false,
"os": false
}
}
File renamed without changes
File renamed without changes
File renamed without changes
Loading