mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-25 10:03:07 +03:00
Bumps react-router-dom
to v6 (#2256)
This commit is contained in:
parent
b755293f7b
commit
d1f0c79d89
220
examples/hackathon-submissions/package-lock.json
generated
220
examples/hackathon-submissions/package-lock.json
generated
@ -21,12 +21,10 @@
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@prisma/client": "5.18.0",
|
||||
"@prisma/client": "5.19.1",
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"axios": "^1.4.0",
|
||||
@ -36,33 +34,18 @@
|
||||
"mitt": "3.0.0",
|
||||
"msw": "^1.1.0",
|
||||
"postcss": "^8.4.21",
|
||||
"prisma": "5.18.0",
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"tailwindcss": "^3.2.7",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
}
|
||||
},
|
||||
".wasp/out/sdk/wasp/node_modules/prisma": {
|
||||
"version": "5.18.0",
|
||||
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.18.0.tgz",
|
||||
"integrity": "sha512-+TrSIxZsh64OPOmaSgVPH7ALL9dfU0jceYaMJXsNrTkFHO7/3RANi5K2ZiPB1De9+KDxCWn7jvRq8y8pvk+o9g==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@prisma/engines": "5.18.0"
|
||||
},
|
||||
"bin": {
|
||||
"prisma": "build/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@adobe/css-tools": {
|
||||
@ -858,10 +841,11 @@
|
||||
"integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ=="
|
||||
},
|
||||
"node_modules/@prisma/client": {
|
||||
"version": "5.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.18.0.tgz",
|
||||
"integrity": "sha512-BWivkLh+af1kqC89zCJYkHsRcyWsM8/JHpsDMM76DjP3ZdEquJhXa4IeX+HkWPnwJ5FanxEJFZZDTWiDs/Kvyw==",
|
||||
"version": "5.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.19.1.tgz",
|
||||
"integrity": "sha512-x30GFguInsgt+4z5I4WbkZP2CGpotJMUXy+Gl/aaUjHn2o1DnLYNTA+q9XdYmAQZM8fIIkvUiA2NpgosM3fneg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=16.13"
|
||||
},
|
||||
@ -874,49 +858,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@prisma/debug": {
|
||||
"version": "5.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.18.0.tgz",
|
||||
"integrity": "sha512-f+ZvpTLidSo3LMJxQPVgAxdAjzv5OpzAo/eF8qZqbwvgi2F5cTOI9XCpdRzJYA0iGfajjwjOKKrVq64vkxEfUw==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/@prisma/engines": {
|
||||
"version": "5.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.18.0.tgz",
|
||||
"integrity": "sha512-ofmpGLeJ2q2P0wa/XaEgTnX/IsLnvSp/gZts0zjgLNdBhfuj2lowOOPmDcfKljLQUXMvAek3lw5T01kHmCG8rg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@prisma/debug": "5.18.0",
|
||||
"@prisma/engines-version": "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169",
|
||||
"@prisma/fetch-engine": "5.18.0",
|
||||
"@prisma/get-platform": "5.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@prisma/engines-version": {
|
||||
"version": "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169.tgz",
|
||||
"integrity": "sha512-a/+LpJj8vYU3nmtkg+N3X51ddbt35yYrRe8wqHTJtYQt7l1f8kjIBcCs6sHJvodW/EK5XGvboOiwm47fmNrbgg==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/@prisma/fetch-engine": {
|
||||
"version": "5.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.18.0.tgz",
|
||||
"integrity": "sha512-I/3u0x2n31rGaAuBRx2YK4eB7R/1zCuayo2DGwSpGyrJWsZesrV7QVw7ND0/Suxeo/vLkJ5OwuBqHoCxvTHpOg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@prisma/debug": "5.18.0",
|
||||
"@prisma/engines-version": "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169",
|
||||
"@prisma/get-platform": "5.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@prisma/get-platform": {
|
||||
"version": "5.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.18.0.tgz",
|
||||
"integrity": "sha512-Tk+m7+uhqcKDgnMnFN0lRiH7Ewea0OEsZZs9pqXa7i3+7svS3FSCqDBCaM9x5fmhhkufiG0BtunJVDka+46DlA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@prisma/debug": "5.18.0"
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
@ -1263,6 +1210,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -1270,11 +1218,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -1283,7 +1226,8 @@
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -1306,12 +1250,14 @@
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.60",
|
||||
@ -1331,25 +1277,6 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -1359,6 +1286,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -3107,27 +3035,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -4655,7 +4562,6 @@
|
||||
"version": "5.19.1",
|
||||
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.19.1.tgz",
|
||||
"integrity": "sha512-c5K9MiDaa+VAAyh1OiYk76PXOme9s3E992D7kvvIOhCrNsBQfy2mP2QAQtX0WNj140IgG++12kwZpYB9iIydNQ==",
|
||||
"devOptional": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@ -4675,14 +4581,12 @@
|
||||
"version": "5.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.19.1.tgz",
|
||||
"integrity": "sha512-lAG6A6QnG2AskAukIEucYJZxxcSqKsMK74ZFVfCTOM/7UiyJQi48v6TQ47d6qKG3LbMslqOvnTX25dj/qvclGg==",
|
||||
"devOptional": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/prisma/node_modules/@prisma/engines": {
|
||||
"version": "5.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.19.1.tgz",
|
||||
"integrity": "sha512-kR/PoxZDrfUmbbXqqb8SlBBgCjvGaJYMCOe189PEYzq9rKqitQ2fvT/VJ8PDSe8tTNxhc2KzsCfCAL+Iwm/7Cg==",
|
||||
"devOptional": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@ -4696,14 +4600,12 @@
|
||||
"version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3.tgz",
|
||||
"integrity": "sha512-xR6rt+z5LnNqTP5BBc+8+ySgf4WNMimOKXRn6xfNRDSpHvbOEmd7+qAOmzCrddEc4Cp8nFC0txU14dstjH7FXA==",
|
||||
"devOptional": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/prisma/node_modules/@prisma/fetch-engine": {
|
||||
"version": "5.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.19.1.tgz",
|
||||
"integrity": "sha512-pCq74rtlOVJfn4pLmdJj+eI4P7w2dugOnnTXpRilP/6n5b2aZiA4ulJlE0ddCbTPkfHmOL9BfaRgA8o+1rfdHw==",
|
||||
"devOptional": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@prisma/debug": "5.19.1",
|
||||
@ -4715,7 +4617,6 @@
|
||||
"version": "5.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.19.1.tgz",
|
||||
"integrity": "sha512-sCeoJ+7yt0UjnR+AXZL7vXlg5eNxaFOwC23h0KvW1YIXUoa7+W2ZcAUhoEQBmJTW4GrFqCuZ8YSP0mkDa4k3Zg==",
|
||||
"devOptional": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@prisma/debug": "5.19.1"
|
||||
@ -4877,52 +4778,33 @@
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/read-cache": {
|
||||
@ -5020,11 +4902,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -5567,16 +5444,6 @@
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -5824,11 +5691,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
179
examples/streaming/package-lock.json
generated
179
examples/streaming/package-lock.json
generated
@ -24,8 +24,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -36,13 +34,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@adobe/css-tools": {
|
||||
@ -708,6 +707,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz",
|
||||
@ -1052,6 +1059,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -1059,11 +1067,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -1072,7 +1075,8 @@
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -1095,12 +1099,14 @@
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.55",
|
||||
@ -1120,25 +1126,6 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -1148,6 +1135,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -2664,32 +2652,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -3670,14 +3632,6 @@
|
||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
|
||||
"integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ=="
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
||||
@ -4001,21 +3955,6 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
@ -4151,59 +4090,35 @@
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
@ -4274,11 +4189,6 @@
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -4691,16 +4601,6 @@
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
|
||||
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -4914,11 +4814,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
156
examples/thoughts/package-lock.json
generated
156
examples/thoughts/package-lock.json
generated
@ -29,8 +29,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -43,13 +41,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
".wasp/out/sdk/wasp/node_modules/@emnapi/core": {
|
||||
@ -1526,6 +1525,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz",
|
||||
@ -1887,6 +1894,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -1902,11 +1910,6 @@
|
||||
"@types/unist": "^2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -1923,7 +1926,8 @@
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -1946,12 +1950,14 @@
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.57",
|
||||
@ -1971,25 +1977,6 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -1999,6 +1986,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -3683,32 +3671,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -5882,59 +5844,35 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
@ -6030,11 +5968,6 @@
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -6488,16 +6421,6 @@
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
|
||||
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -6831,11 +6754,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { createThought } from "wasp/client/operations";
|
||||
import { routes } from "wasp/client/router";
|
||||
import React, { useState, useRef } from 'react'
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import Tag from './Tag'
|
||||
import './Main.css'
|
||||
@ -35,7 +36,7 @@ const MainPage = ({ user }) => {
|
||||
)
|
||||
}
|
||||
|
||||
const Thought = (props) => {
|
||||
const Thought = () => {
|
||||
const defaultTextMd = ''
|
||||
const defaultNewTagName = ''
|
||||
const defaultTagNames = []
|
||||
@ -44,7 +45,7 @@ const Thought = (props) => {
|
||||
const [tagNames, setTagNames] = useState(defaultTagNames)
|
||||
const [newTagName, setNewTagName] = useState(defaultNewTagName)
|
||||
const [inPreviewMode, setInPreviewMode] = useState(defaultInPreviewMode)
|
||||
const history = useHistory()
|
||||
const navigate = useNavigate()
|
||||
const formRef = useRef(null) // TODO: Why do I have this ref? I don't seem to use it anywhere?
|
||||
|
||||
const setNewTagNameIfValid = (tagName) => {
|
||||
@ -61,7 +62,7 @@ const Thought = (props) => {
|
||||
}
|
||||
try {
|
||||
await createThought({ textMarkdown: textMd.trim(), tagNames })
|
||||
history.push('/thoughts') // TODO: Would be cool if this was type checked somehow or if string was coming from the Wasp API.
|
||||
navigate(routes.ThoughtsRoute.build())
|
||||
} catch (err) {
|
||||
return window.alert('Error: ' + err.message)
|
||||
}
|
||||
|
179
examples/todo-typescript/package-lock.json
generated
179
examples/todo-typescript/package-lock.json
generated
@ -27,8 +27,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -41,13 +39,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime": {
|
||||
@ -2037,6 +2036,14 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz",
|
||||
@ -2398,6 +2405,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -2405,11 +2413,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -2418,7 +2421,8 @@
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -2441,12 +2445,14 @@
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.55",
|
||||
@ -2466,25 +2472,6 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -2494,6 +2481,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -4016,32 +4004,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -5051,14 +5013,6 @@
|
||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
|
||||
"integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ=="
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
||||
@ -5346,21 +5300,6 @@
|
||||
"fsevents": "2.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
@ -5496,59 +5435,35 @@
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
@ -5619,11 +5534,6 @@
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -6036,16 +5946,6 @@
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
|
||||
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -6259,11 +6159,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
190
examples/tutorials/TodoApp/package-lock.json
generated
190
examples/tutorials/TodoApp/package-lock.json
generated
@ -27,8 +27,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -41,13 +39,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.1",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
".wasp/out/sdk/wasp/node_modules/@node-rs/argon2": {
|
||||
@ -1576,6 +1575,15 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz",
|
||||
"integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz",
|
||||
@ -2006,6 +2014,7 @@
|
||||
"version": "4.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz",
|
||||
"integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
@ -2014,12 +2023,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -2030,6 +2033,7 @@
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
@ -2057,12 +2061,14 @@
|
||||
"version": "6.9.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz",
|
||||
"integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
@ -2084,31 +2090,11 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/send": {
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
@ -3798,35 +3784,6 @@
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -4945,15 +4902,6 @@
|
||||
"integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
|
||||
@ -5296,23 +5244,6 @@
|
||||
"integrity": "sha512-xR6rt+z5LnNqTP5BBc+8+ySgf4WNMimOKXRn6xfNRDSpHvbOEmd7+qAOmzCrddEc4Cp8nFC0txU14dstjH7FXA==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
@ -5461,64 +5392,37 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz",
|
||||
"integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz",
|
||||
"integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.1",
|
||||
"react-router": "6.26.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
@ -5597,12 +5501,6 @@
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -6063,18 +5961,6 @@
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz",
|
||||
@ -6312,12 +6198,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
190
examples/tutorials/TodoAppTs/package-lock.json
generated
190
examples/tutorials/TodoAppTs/package-lock.json
generated
@ -27,8 +27,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -41,13 +39,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.1",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
".wasp/out/sdk/wasp/node_modules/@node-rs/argon2": {
|
||||
@ -1569,6 +1568,15 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz",
|
||||
"integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz",
|
||||
@ -1999,6 +2007,7 @@
|
||||
"version": "4.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz",
|
||||
"integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
@ -2007,12 +2016,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -2023,6 +2026,7 @@
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
@ -2050,12 +2054,14 @@
|
||||
"version": "6.9.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz",
|
||||
"integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
@ -2077,31 +2083,11 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/send": {
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
@ -3791,35 +3777,6 @@
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -4938,15 +4895,6 @@
|
||||
"integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
|
||||
@ -5270,23 +5218,6 @@
|
||||
"fsevents": "2.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
@ -5435,64 +5366,37 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz",
|
||||
"integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz",
|
||||
"integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.1",
|
||||
"react-router": "6.26.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
@ -5571,12 +5475,6 @@
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -6037,18 +5935,6 @@
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz",
|
||||
@ -6286,12 +6172,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
133
examples/waspello/package-lock.json
generated
133
examples/waspello/package-lock.json
generated
@ -31,8 +31,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"arctic": "^1.2.1",
|
||||
"autoprefixer": "^10.4.13",
|
||||
@ -48,14 +46,15 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"tailwindcss": "^3.2.7",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
".wasp/out/sdk/wasp/node_modules/@emnapi/core": {
|
||||
@ -1711,6 +1710,14 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz",
|
||||
@ -2072,6 +2079,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -2079,11 +2087,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"node_modules/@types/hoist-non-react-statics": {
|
||||
"version": "3.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz",
|
||||
@ -2101,7 +2104,8 @@
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -2124,12 +2128,14 @@
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.60",
|
||||
@ -2160,25 +2166,6 @@
|
||||
"redux": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -2188,6 +2175,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -3964,19 +3952,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
@ -6260,52 +6235,33 @@
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-tiny-popover": {
|
||||
@ -6420,11 +6376,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -6972,11 +6923,6 @@
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -7232,11 +7178,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react'
|
||||
|
||||
import { Link, useHistory } from 'react-router-dom'
|
||||
import { Link, useNavigate } from 'react-router-dom'
|
||||
|
||||
import EmailAndPassForm from './components/EmailAndPassForm'
|
||||
import GoogleAuthButton from './components/GoogleAuthButton'
|
||||
@ -11,7 +11,7 @@ import './Signup.css'
|
||||
import { login } from "wasp/client/auth";
|
||||
|
||||
const LoginPage = (props) => {
|
||||
const history = useHistory()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const [usernameFieldVal, setUsernameFieldVal] = useState('')
|
||||
const [passwordFieldVal, setPasswordFieldVal] = useState('')
|
||||
@ -24,7 +24,7 @@ const LoginPage = (props) => {
|
||||
setUsernameFieldVal('')
|
||||
setPasswordFieldVal('')
|
||||
|
||||
history.push('/')
|
||||
navigate('/')
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
window.alert(err)
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react'
|
||||
import { Link, useHistory } from 'react-router-dom'
|
||||
import { Link, useNavigate } from 'react-router-dom'
|
||||
|
||||
import EmailAndPassForm from './components/EmailAndPassForm'
|
||||
import GoogleAuthButton from './components/GoogleAuthButton'
|
||||
@ -12,7 +12,7 @@ import { login, signup } from "wasp/client/auth";
|
||||
|
||||
const SignupPage = (props) => {
|
||||
|
||||
const history = useHistory()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const [usernameFieldVal, setUsernameFieldVal] = useState('')
|
||||
const [passwordFieldVal, setPasswordFieldVal] = useState('')
|
||||
@ -26,7 +26,7 @@ const SignupPage = (props) => {
|
||||
setUsernameFieldVal('')
|
||||
setPasswordFieldVal('')
|
||||
|
||||
history.push('/')
|
||||
navigate('/')
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
window.alert(err)
|
||||
|
179
examples/waspleau/package-lock.json
generated
179
examples/waspleau/package-lock.json
generated
@ -25,8 +25,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -38,13 +36,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@adobe/css-tools": {
|
||||
@ -755,6 +754,14 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz",
|
||||
@ -1099,6 +1106,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -1106,11 +1114,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -1119,7 +1122,8 @@
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -1142,12 +1146,14 @@
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.60",
|
||||
@ -1167,25 +1173,6 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -1195,6 +1182,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -2778,32 +2766,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -3800,14 +3762,6 @@
|
||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
|
||||
"integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ=="
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
||||
@ -4248,21 +4202,6 @@
|
||||
"fsevents": "2.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
@ -4398,59 +4337,35 @@
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
@ -4522,11 +4437,6 @@
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -4978,16 +4888,6 @@
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -5201,11 +5101,6 @@
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
330
examples/websockets-realtime-voting/package-lock.json
generated
330
examples/websockets-realtime-voting/package-lock.json
generated
@ -30,8 +30,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"axios": "^1.4.0",
|
||||
@ -46,7 +44,7 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"socket.io": "^4.6.1",
|
||||
"socket.io-client": "^4.6.1",
|
||||
"superjson": "^1.12.2",
|
||||
@ -54,7 +52,8 @@
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
}
|
||||
},
|
||||
".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime": {
|
||||
@ -2175,6 +2174,14 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.11.0.tgz",
|
||||
@ -2563,6 +2570,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -2570,11 +2578,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"node_modules/@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -2583,7 +2586,8 @@
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -2606,12 +2610,14 @@
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.2.55",
|
||||
@ -2631,25 +2637,6 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"dependencies": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -2659,6 +2646,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -4682,32 +4670,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"node_modules/history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"dependencies": {
|
||||
"react-is": "^16.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hoist-non-react-statics/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -6413,21 +6375,6 @@
|
||||
"fsevents": "2.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
@ -6589,59 +6536,35 @@
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/react-router/node_modules/path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"dependencies": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/read-cache": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
|
||||
@ -6737,11 +6660,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"node_modules/restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -7474,16 +7392,6 @@
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
|
||||
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -7719,11 +7627,6 @@
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
@ -9980,6 +9883,11 @@
|
||||
"@prisma/debug": "5.19.1"
|
||||
}
|
||||
},
|
||||
"@remix-run/router": {
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA=="
|
||||
},
|
||||
"@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.11.0.tgz",
|
||||
@ -10215,6 +10123,7 @@
|
||||
"version": "4.17.43",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
|
||||
"integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
@ -10222,11 +10131,6 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"@types/history": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz",
|
||||
"integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="
|
||||
},
|
||||
"@types/js-levenshtein": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz",
|
||||
@ -10235,7 +10139,8 @@
|
||||
"@types/mime": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="
|
||||
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/ms": {
|
||||
"version": "0.7.34",
|
||||
@ -10258,12 +10163,14 @@
|
||||
"@types/qs": {
|
||||
"version": "6.9.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz",
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ=="
|
||||
"integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/range-parser": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="
|
||||
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/react": {
|
||||
"version": "18.2.55",
|
||||
@ -10283,25 +10190,6 @@
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"@types/react-router": {
|
||||
"version": "5.1.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz",
|
||||
"integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==",
|
||||
"requires": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*"
|
||||
}
|
||||
},
|
||||
"@types/react-router-dom": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz",
|
||||
"integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==",
|
||||
"requires": {
|
||||
"@types/history": "^4.7.11",
|
||||
"@types/react": "*",
|
||||
"@types/react-router": "*"
|
||||
}
|
||||
},
|
||||
"@types/scheduler": {
|
||||
"version": "0.16.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz",
|
||||
@ -10311,6 +10199,7 @@
|
||||
"version": "0.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/mime": "^1",
|
||||
"@types/node": "*"
|
||||
@ -11707,34 +11596,6 @@
|
||||
"resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.2.5.tgz",
|
||||
"integrity": "sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA=="
|
||||
},
|
||||
"history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
"integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
|
||||
"requires": {
|
||||
"react-is": "^16.7.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"html-encoding-sniffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz",
|
||||
@ -12868,23 +12729,6 @@
|
||||
"fsevents": "2.3.3"
|
||||
}
|
||||
},
|
||||
"prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
@ -12989,53 +12833,20 @@
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
|
||||
},
|
||||
"react-router": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"requires": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
},
|
||||
"react-is": {
|
||||
"version": "16.13.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
}
|
||||
"@remix-run/router": "1.19.2"
|
||||
}
|
||||
},
|
||||
"react-router-dom": {
|
||||
"version": "5.3.4",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
||||
"version": "6.26.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.3.4",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
"@remix-run/router": "1.19.2",
|
||||
"react-router": "6.26.2"
|
||||
}
|
||||
},
|
||||
"read-cache": {
|
||||
@ -13109,11 +12920,6 @@
|
||||
"supports-preserve-symlinks-flag": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
@ -13648,16 +13454,6 @@
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"tiny-invariant": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
|
||||
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
|
||||
},
|
||||
"tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"tinybench": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz",
|
||||
@ -13819,11 +13615,6 @@
|
||||
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
|
||||
},
|
||||
"value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
@ -14322,7 +14113,6 @@
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"axios": "^1.4.0",
|
||||
@ -14337,7 +14127,7 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"socket.io": "^4.6.1",
|
||||
"socket.io-client": "^4.6.1",
|
||||
"superjson": "^1.12.2",
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { ReactNode } from "react";
|
||||
import { Outlet } from "react-router-dom";
|
||||
import { logout, useAuth } from "wasp/client/auth";
|
||||
// @ts-check
|
||||
import "./Main.css";
|
||||
|
||||
import { Flowbite, Dropdown, Navbar, Avatar } from "flowbite-react";
|
||||
@ -14,7 +13,7 @@ const customTheme = {
|
||||
},
|
||||
};
|
||||
|
||||
export const Layout = ({ children }: { children: ReactNode }) => {
|
||||
export const Layout = () => {
|
||||
const { data: user } = useAuth();
|
||||
|
||||
return (
|
||||
@ -40,7 +39,9 @@ export const Layout = ({ children }: { children: ReactNode }) => {
|
||||
}
|
||||
>
|
||||
<Dropdown.Header>
|
||||
<span className="block text-sm">{user.getFirstProviderUserId()}</span>
|
||||
<span className="block text-sm">
|
||||
{user.getFirstProviderUserId()}
|
||||
</span>
|
||||
</Dropdown.Header>
|
||||
<Dropdown.Item>Dashboard</Dropdown.Item>
|
||||
<Dropdown.Item>Settings</Dropdown.Item>
|
||||
@ -61,7 +62,9 @@ export const Layout = ({ children }: { children: ReactNode }) => {
|
||||
<Navbar.Link href="#">Contact</Navbar.Link>
|
||||
</Navbar.Collapse> */}
|
||||
</Navbar>
|
||||
<div className="grid place-items-center mt-8">{children}</div>
|
||||
<div className="grid place-items-center mt-8">
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
</Flowbite>
|
||||
);
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{={= =}=}}
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { type AxiosResponse } from "axios";
|
||||
import { Redirect, useLocation } from 'react-router-dom'
|
||||
import { Navigate, useLocation } from 'react-router-dom'
|
||||
import { useAuth } from 'wasp/client/auth'
|
||||
import { api } from 'wasp/client/api'
|
||||
import { initSession } from 'wasp/auth/helpers/user'
|
||||
@ -14,7 +14,7 @@ export function OAuthCallbackPage() {
|
||||
const { error, user } = useOAuthCallbackHandler();
|
||||
|
||||
if (user !== undefined && user !== null) {
|
||||
return <Redirect to="{= onAuthSucceededRedirectTo =}" />;
|
||||
return <Navigate to="{= onAuthSucceededRedirectTo =}" replace />;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{={= =}=}}
|
||||
import React from 'react'
|
||||
|
||||
import { Redirect } from 'react-router-dom'
|
||||
import { Navigate } from 'react-router-dom'
|
||||
import { useAuth } from 'wasp/client/auth'
|
||||
|
||||
import { Loader } from '../../components/Loader'
|
||||
@ -17,7 +17,7 @@ const createAuthRequiredPage = (Page) => {
|
||||
if (user) {
|
||||
return <Page {...props} user={user} />
|
||||
} else {
|
||||
return <Redirect to="{= onAuthFailedRedirectTo =}" />
|
||||
return <Navigate to="{= onAuthFailedRedirectTo =}" replace />
|
||||
}
|
||||
case 'loading':
|
||||
return (
|
||||
|
@ -0,0 +1,13 @@
|
||||
import { useRouteError } from 'react-router-dom'
|
||||
|
||||
import { FullPageWrapper } from './FullPageWrapper'
|
||||
|
||||
export function DefaultRootErrorBoundary() {
|
||||
const error = useRouteError()
|
||||
console.error(error)
|
||||
return (
|
||||
<FullPageWrapper>
|
||||
<div>There was an error rendering this page. Check the browser console for more information.</div>
|
||||
</FullPageWrapper>
|
||||
)
|
||||
}
|
@ -3,7 +3,7 @@ import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
import router from './router'
|
||||
import { router } from './router'
|
||||
import {
|
||||
initializeQueryClient,
|
||||
queryClientInitialized,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{{={= =}=}}
|
||||
import React from 'react'
|
||||
import { Route, Switch, BrowserRouter as Router } from 'react-router-dom'
|
||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
||||
{=# rootComponent.isDefined =}
|
||||
{=& rootComponent.importStatement =}
|
||||
{=/ rootComponent.isDefined =}
|
||||
@ -17,6 +17,8 @@ import createAuthRequiredPage from "./auth/pages/createAuthRequiredPage"
|
||||
import { OAuthCallbackPage } from "./auth/pages/OAuthCallback"
|
||||
{=/ isExternalAuthEnabled =}
|
||||
|
||||
import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary'
|
||||
|
||||
import { routes } from 'wasp/client/router'
|
||||
|
||||
export const routeNameToRouteComponent = {
|
||||
@ -25,35 +27,31 @@ export const routeNameToRouteComponent = {
|
||||
{=/ routes =}
|
||||
} as const;
|
||||
|
||||
const router = (
|
||||
<Router basename="{= baseDir =}">
|
||||
{=# rootComponent.isDefined =}
|
||||
<{= rootComponent.importIdentifier =}>
|
||||
{=/ rootComponent.isDefined =}
|
||||
<Switch>
|
||||
const waspDefinedRoutes = [
|
||||
{=# isExternalAuthEnabled =}
|
||||
{/*
|
||||
Wasp specific routes *must* go first to prevent user
|
||||
defined routes from overriding them.
|
||||
Details in https://github.com/wasp-lang/wasp/issues/2029
|
||||
*/}
|
||||
<Route exact path="{= oAuthCallbackPath =}">
|
||||
<OAuthCallbackPage />
|
||||
</Route>
|
||||
{
|
||||
path: "{= oAuthCallbackPath =}",
|
||||
Component: OAuthCallbackPage,
|
||||
},
|
||||
{=/ isExternalAuthEnabled =}
|
||||
{Object.entries(routes).map(([routeKey, route]) => (
|
||||
<Route
|
||||
exact
|
||||
key={routeKey}
|
||||
path={route.to}
|
||||
component={routeNameToRouteComponent[routeKey]}
|
||||
/>
|
||||
))}
|
||||
</Switch>
|
||||
{=# rootComponent.isDefined =}
|
||||
</{= rootComponent.importIdentifier =}>
|
||||
{=/ rootComponent.isDefined =}
|
||||
</Router>
|
||||
)
|
||||
]
|
||||
const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => {
|
||||
return {
|
||||
path: route.to,
|
||||
Component: routeNameToRouteComponent[routeKey],
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
const browserRouter = createBrowserRouter([{
|
||||
path: '/',
|
||||
{=# rootComponent.isDefined =}
|
||||
element: <{= rootComponent.importIdentifier =} />,
|
||||
{=/ rootComponent.isDefined =}
|
||||
ErrorBoundary: DefaultRootErrorBoundary,
|
||||
children: [
|
||||
...waspDefinedRoutes,
|
||||
...userDefinedRoutes,
|
||||
],
|
||||
}])
|
||||
|
||||
export const router = <RouterProvider router={browserRouter} />
|
||||
|
@ -25,7 +25,7 @@ import * as SocialIcons from '../social/SocialIcons'
|
||||
import { SocialButton } from '../social/SocialButton'
|
||||
{=/ isSocialAuthEnabled =}
|
||||
{=# isAnyPasswordBasedAuthEnabled =}
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
{=/ isAnyPasswordBasedAuthEnabled =}
|
||||
{=# enabledProviders.isUsernameAndPasswordAuthEnabled =}
|
||||
import { useUsernameAndPassword } from '../usernameAndPassword/useUsernameAndPassword'
|
||||
@ -147,7 +147,7 @@ export const LoginSignupForm = ({
|
||||
const isLogin = state === 'login'
|
||||
const cta = isLogin ? 'Log in' : 'Sign up';
|
||||
{=# isAnyPasswordBasedAuthEnabled =}
|
||||
const history = useHistory();
|
||||
const navigate = useNavigate();
|
||||
const onErrorHandler = (error) => {
|
||||
setErrorMessage({ title: error.message, description: error.data?.data?.message })
|
||||
};
|
||||
@ -159,7 +159,7 @@ export const LoginSignupForm = ({
|
||||
isLogin,
|
||||
onError: onErrorHandler,
|
||||
onSuccess() {
|
||||
history.push('{= onAuthSucceededRedirectTo =}')
|
||||
navigate('{= onAuthSucceededRedirectTo =}')
|
||||
},
|
||||
});
|
||||
{=/ enabledProviders.isUsernameAndPasswordAuthEnabled =}
|
||||
@ -172,7 +172,7 @@ export const LoginSignupForm = ({
|
||||
setSuccessMessage(`You've signed up successfully! Check your email for the confirmation link.`)
|
||||
},
|
||||
onLoginSuccess() {
|
||||
history.push('{= onAuthSucceededRedirectTo =}')
|
||||
navigate('{= onAuthSucceededRedirectTo =}')
|
||||
},
|
||||
});
|
||||
{=/ enabledProviders.isEmailAuthEnabled =}
|
||||
|
@ -4,6 +4,7 @@ import type {
|
||||
RouteDefinitionsToRoutes,
|
||||
OptionalRouteOptions,
|
||||
ParamValue,
|
||||
ExpandRouteOnOptionalStaticSegments,
|
||||
} from './types'
|
||||
|
||||
// PUBLIC API
|
||||
@ -13,15 +14,33 @@ export const routes = {
|
||||
to: "{= urlPath =}",
|
||||
{=# hasUrlParams =}
|
||||
build: (
|
||||
options: {
|
||||
params: {{=# urlParams =}{= name =}{=# isOptional =}?{=/ isOptional =}: ParamValue;{=/ urlParams =}}
|
||||
} & OptionalRouteOptions,
|
||||
) => interpolatePath("{= urlPath =}", options.params, options?.search, options?.hash),
|
||||
options: OptionalRouteOptions
|
||||
& { params: {{=# urlParams =}"{= name =}"{=# isOptional =}?{=/ isOptional =}: ParamValue;{=/ urlParams =}}}
|
||||
{=# hasOptionalStaticSegments =}
|
||||
& { path: ExpandRouteOnOptionalStaticSegments<"{= urlPath =}"> }
|
||||
{=/ hasOptionalStaticSegments =}
|
||||
) => interpolatePath(
|
||||
{=# hasOptionalStaticSegments =}options.path,{=/ hasOptionalStaticSegments =}
|
||||
{=^ hasOptionalStaticSegments =}"{= urlPath =}",{=/ hasOptionalStaticSegments =}
|
||||
options.params,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
{=/ hasUrlParams =}
|
||||
{=^ hasUrlParams =}
|
||||
build: (
|
||||
options?: OptionalRouteOptions,
|
||||
) => interpolatePath("{= urlPath =}", undefined, options?.search, options?.hash),
|
||||
options?:
|
||||
OptionalRouteOptions
|
||||
{=# hasOptionalStaticSegments =}
|
||||
& { path: ExpandRouteOnOptionalStaticSegments<"{= urlPath =}"> }
|
||||
{=/ hasOptionalStaticSegments =}
|
||||
) => interpolatePath(
|
||||
{=# hasOptionalStaticSegments =}options.path,{=/ hasOptionalStaticSegments =}
|
||||
{=^ hasOptionalStaticSegments =}"{= urlPath =}",{=/ hasOptionalStaticSegments =}
|
||||
undefined,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
{=/ hasUrlParams =}
|
||||
},
|
||||
{=/ routes =}
|
||||
|
@ -17,6 +17,9 @@ export function interpolatePath(
|
||||
|
||||
function interpolatePathParams(path: string, params: Params) {
|
||||
function mapPathPart(part: string) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -2,7 +2,7 @@
|
||||
export type RouteDefinitionsToRoutes<Routes extends RoutesDefinition> =
|
||||
RouteDefinitionsToRoutesObj<Routes>[keyof RouteDefinitionsToRoutesObj<Routes>]
|
||||
|
||||
// PRIVATE API
|
||||
// PRIVATE API
|
||||
export type OptionalRouteOptions = {
|
||||
search?: Search
|
||||
hash?: string
|
||||
@ -21,7 +21,7 @@ export type Search =
|
||||
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to']
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>
|
||||
}
|
||||
|
||||
@ -39,3 +39,60 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
}
|
||||
? { params: Params }
|
||||
: { params?: never }
|
||||
|
||||
// PRIVATE API (sdk)
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<
|
||||
ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>
|
||||
>;
|
||||
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail]
|
||||
? [_ParseSegment<Head>, ...ParseSegments<Tail>]
|
||||
: T;
|
||||
|
||||
type _ParseSegment<T> = T extends `:${infer P}`
|
||||
? // Param segment
|
||||
{ segment: T }
|
||||
: T extends `${infer S}?`
|
||||
? // Optional segment
|
||||
{ optionalSegment: S }
|
||||
: // Regular segment
|
||||
{ segment: T };
|
||||
|
||||
type Segment = { segment: string };
|
||||
type OptionalSegment = { optionalSegment: string };
|
||||
|
||||
type Elem = Segment | OptionalSegment;
|
||||
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends []
|
||||
? []
|
||||
: T extends [infer First extends Elem, ...infer Rest extends Elem[]]
|
||||
? First extends Segment
|
||||
? [First["segment"], ...ExpandOptionalSegments<Rest>]
|
||||
: First extends OptionalSegment
|
||||
? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest>
|
||||
: []
|
||||
: [];
|
||||
|
||||
type SplitPath<S extends string> = S extends "/"
|
||||
? [""]
|
||||
: S extends `${infer T}/${infer U}`
|
||||
? [T, ...SplitPath<U>]
|
||||
: [S];
|
||||
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string]
|
||||
? Only extends ""
|
||||
? "/"
|
||||
: Only
|
||||
: T extends [infer First extends string, ...infer Rest extends string[]]
|
||||
? `${First}/${JoinPath<Rest>}`
|
||||
: never;
|
||||
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
|
@ -219,6 +219,7 @@ waspBuild/.wasp/build/web-app/public/.gitkeep
|
||||
waspBuild/.wasp/build/web-app/public/favicon.ico
|
||||
waspBuild/.wasp/build/web-app/public/manifest.json
|
||||
waspBuild/.wasp/build/web-app/scripts/validate-env.mjs
|
||||
waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx
|
||||
waspBuild/.wasp/build/web-app/src/components/FullPageWrapper.tsx
|
||||
waspBuild/.wasp/build/web-app/src/components/Loader.module.css
|
||||
waspBuild/.wasp/build/web-app/src/components/Loader.tsx
|
||||
|
@ -116,21 +116,21 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/index.ts"
|
||||
],
|
||||
"6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0"
|
||||
"ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/linkHelpers.ts"
|
||||
],
|
||||
"62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e"
|
||||
"3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/types.ts"
|
||||
],
|
||||
"9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f"
|
||||
"ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -200,7 +200,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/package.json"
|
||||
],
|
||||
"866e8d016c5972a35983615a9ac0bc4b3c1b25f4155ed09b60300be71af975c7"
|
||||
"c5dc0e880b6924c30799671f3204f15687c1e50e338144ba82e62916dba80c9d"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -536,7 +536,7 @@
|
||||
"file",
|
||||
"web-app/package.json"
|
||||
],
|
||||
"c9ec6110684c2e6c76392fc93458756ca636fa30f2b6c23db1507c0cc910e8b8"
|
||||
"b1d6de065bb861e6631ecc504632ebdf69c2e34bd7e5091f8f1879befcb90a68"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -566,6 +566,13 @@
|
||||
],
|
||||
"a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"web-app/src/components/DefaultRootErrorBoundary.tsx"
|
||||
],
|
||||
"4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
@ -599,7 +606,7 @@
|
||||
"file",
|
||||
"web-app/src/index.tsx"
|
||||
],
|
||||
"ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2"
|
||||
"61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -613,7 +620,7 @@
|
||||
"file",
|
||||
"web-app/src/router.tsx"
|
||||
],
|
||||
"5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e"
|
||||
"72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752"
|
||||
],
|
||||
[
|
||||
[
|
||||
|
@ -1 +1 @@
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
@ -3,6 +3,7 @@ import type {
|
||||
RouteDefinitionsToRoutes,
|
||||
OptionalRouteOptions,
|
||||
ParamValue,
|
||||
ExpandRouteOnOptionalStaticSegments,
|
||||
} from './types'
|
||||
|
||||
// PUBLIC API
|
||||
@ -10,8 +11,15 @@ export const routes = {
|
||||
RootRoute: {
|
||||
to: "/",
|
||||
build: (
|
||||
options?: OptionalRouteOptions,
|
||||
) => interpolatePath("/", undefined, options?.search, options?.hash),
|
||||
options?:
|
||||
OptionalRouteOptions
|
||||
) => interpolatePath(
|
||||
|
||||
"/",
|
||||
undefined,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
@ -17,6 +17,9 @@ export function interpolatePath(
|
||||
|
||||
function interpolatePathParams(path: string, params: Params) {
|
||||
function mapPathPart(part: string) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -2,7 +2,7 @@
|
||||
export type RouteDefinitionsToRoutes<Routes extends RoutesDefinition> =
|
||||
RouteDefinitionsToRoutesObj<Routes>[keyof RouteDefinitionsToRoutesObj<Routes>]
|
||||
|
||||
// PRIVATE API
|
||||
// PRIVATE API
|
||||
export type OptionalRouteOptions = {
|
||||
search?: Search
|
||||
hash?: string
|
||||
@ -21,7 +21,7 @@ export type Search =
|
||||
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to']
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>
|
||||
}
|
||||
|
||||
@ -39,3 +39,60 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
}
|
||||
? { params: Params }
|
||||
: { params?: never }
|
||||
|
||||
// PRIVATE API (sdk)
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<
|
||||
ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>
|
||||
>;
|
||||
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail]
|
||||
? [_ParseSegment<Head>, ...ParseSegments<Tail>]
|
||||
: T;
|
||||
|
||||
type _ParseSegment<T> = T extends `:${infer P}`
|
||||
? // Param segment
|
||||
{ segment: T }
|
||||
: T extends `${infer S}?`
|
||||
? // Optional segment
|
||||
{ optionalSegment: S }
|
||||
: // Regular segment
|
||||
{ segment: T };
|
||||
|
||||
type Segment = { segment: string };
|
||||
type OptionalSegment = { optionalSegment: string };
|
||||
|
||||
type Elem = Segment | OptionalSegment;
|
||||
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends []
|
||||
? []
|
||||
: T extends [infer First extends Elem, ...infer Rest extends Elem[]]
|
||||
? First extends Segment
|
||||
? [First["segment"], ...ExpandOptionalSegments<Rest>]
|
||||
: First extends OptionalSegment
|
||||
? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest>
|
||||
: []
|
||||
: [];
|
||||
|
||||
type SplitPath<S extends string> = S extends "/"
|
||||
? [""]
|
||||
: S extends `${infer T}/${infer U}`
|
||||
? [T, ...SplitPath<U>]
|
||||
: [S];
|
||||
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string]
|
||||
? Only extends ""
|
||||
? "/"
|
||||
: Only
|
||||
: T extends [infer First extends string, ...infer Rest extends string[]]
|
||||
? `${First}/${JoinPath<Rest>}`
|
||||
: never;
|
||||
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) {
|
||||
}
|
||||
function interpolatePathParams(path, params) {
|
||||
function mapPathPart(part) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
@ -10,7 +10,7 @@ export type Params = {
|
||||
export type Search = string[][] | Record<string, string> | string | URLSearchParams;
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to'];
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>;
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>;
|
||||
};
|
||||
type RoutesDefinition = {
|
||||
@ -27,4 +27,32 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
} : {
|
||||
params?: never;
|
||||
};
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>>;
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail] ? [_ParseSegment<Head>, ...ParseSegments<Tail>] : T;
|
||||
type _ParseSegment<T> = T extends `:${infer P}` ? {
|
||||
segment: T;
|
||||
} : T extends `${infer S}?` ? {
|
||||
optionalSegment: S;
|
||||
} : {
|
||||
segment: T;
|
||||
};
|
||||
type Segment = {
|
||||
segment: string;
|
||||
};
|
||||
type OptionalSegment = {
|
||||
optionalSegment: string;
|
||||
};
|
||||
type Elem = Segment | OptionalSegment;
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments<Rest>] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest> : [] : [];
|
||||
type SplitPath<S extends string> = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath<U>] : [S];
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath<Rest>}` : never;
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
export {};
|
||||
|
@ -4,8 +4,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -16,13 +14,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
},
|
||||
"exports": {
|
||||
"./api/events": "./dist/api/events.js",
|
||||
|
@ -17,13 +17,12 @@
|
||||
"mitt": "3.0.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/vite-react": "^2.0.0",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"dotenv": "^16.0.3"
|
||||
},
|
||||
|
@ -0,0 +1,13 @@
|
||||
import { useRouteError } from 'react-router-dom'
|
||||
|
||||
import { FullPageWrapper } from './FullPageWrapper'
|
||||
|
||||
export function DefaultRootErrorBoundary() {
|
||||
const error = useRouteError()
|
||||
console.error(error)
|
||||
return (
|
||||
<FullPageWrapper>
|
||||
<div>There was an error rendering this page. Check the browser console for more information.</div>
|
||||
</FullPageWrapper>
|
||||
)
|
||||
}
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
import router from './router'
|
||||
import { router } from './router'
|
||||
import {
|
||||
initializeQueryClient,
|
||||
queryClientInitialized,
|
||||
|
@ -1,29 +1,34 @@
|
||||
import React from 'react'
|
||||
import { Route, Switch, BrowserRouter as Router } from 'react-router-dom'
|
||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
||||
|
||||
|
||||
import { MainPage } from '../../../../src/MainPage'
|
||||
|
||||
|
||||
import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary'
|
||||
|
||||
import { routes } from 'wasp/client/router'
|
||||
|
||||
export const routeNameToRouteComponent = {
|
||||
RootRoute: MainPage,
|
||||
} as const;
|
||||
|
||||
const router = (
|
||||
<Router basename="/">
|
||||
<Switch>
|
||||
{Object.entries(routes).map(([routeKey, route]) => (
|
||||
<Route
|
||||
exact
|
||||
key={routeKey}
|
||||
path={route.to}
|
||||
component={routeNameToRouteComponent[routeKey]}
|
||||
/>
|
||||
))}
|
||||
</Switch>
|
||||
</Router>
|
||||
)
|
||||
const waspDefinedRoutes = [
|
||||
]
|
||||
const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => {
|
||||
return {
|
||||
path: route.to,
|
||||
Component: routeNameToRouteComponent[routeKey],
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
const browserRouter = createBrowserRouter([{
|
||||
path: '/',
|
||||
ErrorBoundary: DefaultRootErrorBoundary,
|
||||
children: [
|
||||
...waspDefinedRoutes,
|
||||
...userDefinedRoutes,
|
||||
],
|
||||
}])
|
||||
|
||||
export const router = <RouterProvider router={browserRouter} />
|
||||
|
@ -3,6 +3,7 @@ import type {
|
||||
RouteDefinitionsToRoutes,
|
||||
OptionalRouteOptions,
|
||||
ParamValue,
|
||||
ExpandRouteOnOptionalStaticSegments,
|
||||
} from './types'
|
||||
|
||||
// PUBLIC API
|
||||
@ -10,8 +11,15 @@ export const routes = {
|
||||
RootRoute: {
|
||||
to: "/",
|
||||
build: (
|
||||
options?: OptionalRouteOptions,
|
||||
) => interpolatePath("/", undefined, options?.search, options?.hash),
|
||||
options?:
|
||||
OptionalRouteOptions
|
||||
) => interpolatePath(
|
||||
|
||||
"/",
|
||||
undefined,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
@ -17,6 +17,9 @@ export function interpolatePath(
|
||||
|
||||
function interpolatePathParams(path: string, params: Params) {
|
||||
function mapPathPart(part: string) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -2,7 +2,7 @@
|
||||
export type RouteDefinitionsToRoutes<Routes extends RoutesDefinition> =
|
||||
RouteDefinitionsToRoutesObj<Routes>[keyof RouteDefinitionsToRoutesObj<Routes>]
|
||||
|
||||
// PRIVATE API
|
||||
// PRIVATE API
|
||||
export type OptionalRouteOptions = {
|
||||
search?: Search
|
||||
hash?: string
|
||||
@ -21,7 +21,7 @@ export type Search =
|
||||
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to']
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>
|
||||
}
|
||||
|
||||
@ -39,3 +39,60 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
}
|
||||
? { params: Params }
|
||||
: { params?: never }
|
||||
|
||||
// PRIVATE API (sdk)
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<
|
||||
ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>
|
||||
>;
|
||||
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail]
|
||||
? [_ParseSegment<Head>, ...ParseSegments<Tail>]
|
||||
: T;
|
||||
|
||||
type _ParseSegment<T> = T extends `:${infer P}`
|
||||
? // Param segment
|
||||
{ segment: T }
|
||||
: T extends `${infer S}?`
|
||||
? // Optional segment
|
||||
{ optionalSegment: S }
|
||||
: // Regular segment
|
||||
{ segment: T };
|
||||
|
||||
type Segment = { segment: string };
|
||||
type OptionalSegment = { optionalSegment: string };
|
||||
|
||||
type Elem = Segment | OptionalSegment;
|
||||
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends []
|
||||
? []
|
||||
: T extends [infer First extends Elem, ...infer Rest extends Elem[]]
|
||||
? First extends Segment
|
||||
? [First["segment"], ...ExpandOptionalSegments<Rest>]
|
||||
: First extends OptionalSegment
|
||||
? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest>
|
||||
: []
|
||||
: [];
|
||||
|
||||
type SplitPath<S extends string> = S extends "/"
|
||||
? [""]
|
||||
: S extends `${infer T}/${infer U}`
|
||||
? [T, ...SplitPath<U>]
|
||||
: [S];
|
||||
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string]
|
||||
? Only extends ""
|
||||
? "/"
|
||||
: Only
|
||||
: T extends [infer First extends string, ...infer Rest extends string[]]
|
||||
? `${First}/${JoinPath<Rest>}`
|
||||
: never;
|
||||
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) {
|
||||
}
|
||||
function interpolatePathParams(path, params) {
|
||||
function mapPathPart(part) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
@ -10,7 +10,7 @@ export type Params = {
|
||||
export type Search = string[][] | Record<string, string> | string | URLSearchParams;
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to'];
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>;
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>;
|
||||
};
|
||||
type RoutesDefinition = {
|
||||
@ -27,4 +27,32 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
} : {
|
||||
params?: never;
|
||||
};
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>>;
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail] ? [_ParseSegment<Head>, ...ParseSegments<Tail>] : T;
|
||||
type _ParseSegment<T> = T extends `:${infer P}` ? {
|
||||
segment: T;
|
||||
} : T extends `${infer S}?` ? {
|
||||
optionalSegment: S;
|
||||
} : {
|
||||
segment: T;
|
||||
};
|
||||
type Segment = {
|
||||
segment: string;
|
||||
};
|
||||
type OptionalSegment = {
|
||||
optionalSegment: string;
|
||||
};
|
||||
type Elem = Segment | OptionalSegment;
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments<Rest>] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest> : [] : [];
|
||||
type SplitPath<S extends string> = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath<U>] : [S];
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath<Rest>}` : never;
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
export {};
|
||||
|
@ -4,8 +4,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -16,13 +14,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
},
|
||||
"exports": {
|
||||
"./api/events": "./dist/api/events.js",
|
||||
|
@ -216,6 +216,7 @@ waspCompile/.wasp/out/web-app/public/.gitkeep
|
||||
waspCompile/.wasp/out/web-app/public/favicon.ico
|
||||
waspCompile/.wasp/out/web-app/public/manifest.json
|
||||
waspCompile/.wasp/out/web-app/scripts/validate-env.mjs
|
||||
waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx
|
||||
waspCompile/.wasp/out/web-app/src/components/FullPageWrapper.tsx
|
||||
waspCompile/.wasp/out/web-app/src/components/Loader.module.css
|
||||
waspCompile/.wasp/out/web-app/src/components/Loader.tsx
|
||||
|
@ -116,21 +116,21 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/index.ts"
|
||||
],
|
||||
"6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0"
|
||||
"ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/linkHelpers.ts"
|
||||
],
|
||||
"62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e"
|
||||
"3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/types.ts"
|
||||
],
|
||||
"9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f"
|
||||
"ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -200,7 +200,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/package.json"
|
||||
],
|
||||
"866e8d016c5972a35983615a9ac0bc4b3c1b25f4155ed09b60300be71af975c7"
|
||||
"c5dc0e880b6924c30799671f3204f15687c1e50e338144ba82e62916dba80c9d"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -550,7 +550,7 @@
|
||||
"file",
|
||||
"web-app/package.json"
|
||||
],
|
||||
"58b50932dadb8d0eadd20132f39dc1871eb9dfc026978fe7db217be58eb73a51"
|
||||
"8dabb1f0aa1f517bc272a7b6c9a13f8de348dbd064002dbcf0614c8d342f18e6"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -580,6 +580,13 @@
|
||||
],
|
||||
"a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"web-app/src/components/DefaultRootErrorBoundary.tsx"
|
||||
],
|
||||
"4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
@ -613,7 +620,7 @@
|
||||
"file",
|
||||
"web-app/src/index.tsx"
|
||||
],
|
||||
"ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2"
|
||||
"61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -627,7 +634,7 @@
|
||||
"file",
|
||||
"web-app/src/router.tsx"
|
||||
],
|
||||
"5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e"
|
||||
"72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752"
|
||||
],
|
||||
[
|
||||
[
|
||||
|
@ -1 +1 @@
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
@ -3,6 +3,7 @@ import type {
|
||||
RouteDefinitionsToRoutes,
|
||||
OptionalRouteOptions,
|
||||
ParamValue,
|
||||
ExpandRouteOnOptionalStaticSegments,
|
||||
} from './types'
|
||||
|
||||
// PUBLIC API
|
||||
@ -10,8 +11,15 @@ export const routes = {
|
||||
RootRoute: {
|
||||
to: "/",
|
||||
build: (
|
||||
options?: OptionalRouteOptions,
|
||||
) => interpolatePath("/", undefined, options?.search, options?.hash),
|
||||
options?:
|
||||
OptionalRouteOptions
|
||||
) => interpolatePath(
|
||||
|
||||
"/",
|
||||
undefined,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
@ -17,6 +17,9 @@ export function interpolatePath(
|
||||
|
||||
function interpolatePathParams(path: string, params: Params) {
|
||||
function mapPathPart(part: string) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -2,7 +2,7 @@
|
||||
export type RouteDefinitionsToRoutes<Routes extends RoutesDefinition> =
|
||||
RouteDefinitionsToRoutesObj<Routes>[keyof RouteDefinitionsToRoutesObj<Routes>]
|
||||
|
||||
// PRIVATE API
|
||||
// PRIVATE API
|
||||
export type OptionalRouteOptions = {
|
||||
search?: Search
|
||||
hash?: string
|
||||
@ -21,7 +21,7 @@ export type Search =
|
||||
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to']
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>
|
||||
}
|
||||
|
||||
@ -39,3 +39,60 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
}
|
||||
? { params: Params }
|
||||
: { params?: never }
|
||||
|
||||
// PRIVATE API (sdk)
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<
|
||||
ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>
|
||||
>;
|
||||
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail]
|
||||
? [_ParseSegment<Head>, ...ParseSegments<Tail>]
|
||||
: T;
|
||||
|
||||
type _ParseSegment<T> = T extends `:${infer P}`
|
||||
? // Param segment
|
||||
{ segment: T }
|
||||
: T extends `${infer S}?`
|
||||
? // Optional segment
|
||||
{ optionalSegment: S }
|
||||
: // Regular segment
|
||||
{ segment: T };
|
||||
|
||||
type Segment = { segment: string };
|
||||
type OptionalSegment = { optionalSegment: string };
|
||||
|
||||
type Elem = Segment | OptionalSegment;
|
||||
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends []
|
||||
? []
|
||||
: T extends [infer First extends Elem, ...infer Rest extends Elem[]]
|
||||
? First extends Segment
|
||||
? [First["segment"], ...ExpandOptionalSegments<Rest>]
|
||||
: First extends OptionalSegment
|
||||
? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest>
|
||||
: []
|
||||
: [];
|
||||
|
||||
type SplitPath<S extends string> = S extends "/"
|
||||
? [""]
|
||||
: S extends `${infer T}/${infer U}`
|
||||
? [T, ...SplitPath<U>]
|
||||
: [S];
|
||||
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string]
|
||||
? Only extends ""
|
||||
? "/"
|
||||
: Only
|
||||
: T extends [infer First extends string, ...infer Rest extends string[]]
|
||||
? `${First}/${JoinPath<Rest>}`
|
||||
: never;
|
||||
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) {
|
||||
}
|
||||
function interpolatePathParams(path, params) {
|
||||
function mapPathPart(part) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
@ -10,7 +10,7 @@ export type Params = {
|
||||
export type Search = string[][] | Record<string, string> | string | URLSearchParams;
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to'];
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>;
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>;
|
||||
};
|
||||
type RoutesDefinition = {
|
||||
@ -27,4 +27,32 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
} : {
|
||||
params?: never;
|
||||
};
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>>;
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail] ? [_ParseSegment<Head>, ...ParseSegments<Tail>] : T;
|
||||
type _ParseSegment<T> = T extends `:${infer P}` ? {
|
||||
segment: T;
|
||||
} : T extends `${infer S}?` ? {
|
||||
optionalSegment: S;
|
||||
} : {
|
||||
segment: T;
|
||||
};
|
||||
type Segment = {
|
||||
segment: string;
|
||||
};
|
||||
type OptionalSegment = {
|
||||
optionalSegment: string;
|
||||
};
|
||||
type Elem = Segment | OptionalSegment;
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments<Rest>] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest> : [] : [];
|
||||
type SplitPath<S extends string> = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath<U>] : [S];
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath<Rest>}` : never;
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
export {};
|
||||
|
@ -4,8 +4,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -16,13 +14,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
},
|
||||
"exports": {
|
||||
"./api/events": "./dist/api/events.js",
|
||||
|
@ -17,13 +17,12 @@
|
||||
"mitt": "3.0.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/vite-react": "^2.0.0",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"dotenv": "^16.0.3"
|
||||
},
|
||||
|
@ -0,0 +1,13 @@
|
||||
import { useRouteError } from 'react-router-dom'
|
||||
|
||||
import { FullPageWrapper } from './FullPageWrapper'
|
||||
|
||||
export function DefaultRootErrorBoundary() {
|
||||
const error = useRouteError()
|
||||
console.error(error)
|
||||
return (
|
||||
<FullPageWrapper>
|
||||
<div>There was an error rendering this page. Check the browser console for more information.</div>
|
||||
</FullPageWrapper>
|
||||
)
|
||||
}
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
import router from './router'
|
||||
import { router } from './router'
|
||||
import {
|
||||
initializeQueryClient,
|
||||
queryClientInitialized,
|
||||
|
@ -1,29 +1,34 @@
|
||||
import React from 'react'
|
||||
import { Route, Switch, BrowserRouter as Router } from 'react-router-dom'
|
||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
||||
|
||||
|
||||
import { MainPage } from '../../../../src/MainPage'
|
||||
|
||||
|
||||
import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary'
|
||||
|
||||
import { routes } from 'wasp/client/router'
|
||||
|
||||
export const routeNameToRouteComponent = {
|
||||
RootRoute: MainPage,
|
||||
} as const;
|
||||
|
||||
const router = (
|
||||
<Router basename="/">
|
||||
<Switch>
|
||||
{Object.entries(routes).map(([routeKey, route]) => (
|
||||
<Route
|
||||
exact
|
||||
key={routeKey}
|
||||
path={route.to}
|
||||
component={routeNameToRouteComponent[routeKey]}
|
||||
/>
|
||||
))}
|
||||
</Switch>
|
||||
</Router>
|
||||
)
|
||||
const waspDefinedRoutes = [
|
||||
]
|
||||
const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => {
|
||||
return {
|
||||
path: route.to,
|
||||
Component: routeNameToRouteComponent[routeKey],
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
const browserRouter = createBrowserRouter([{
|
||||
path: '/',
|
||||
ErrorBoundary: DefaultRootErrorBoundary,
|
||||
children: [
|
||||
...waspDefinedRoutes,
|
||||
...userDefinedRoutes,
|
||||
],
|
||||
}])
|
||||
|
||||
export const router = <RouterProvider router={browserRouter} />
|
||||
|
@ -508,6 +508,7 @@ waspComplexTest/.wasp/out/web-app/public/manifest.json
|
||||
waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs
|
||||
waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCallback.tsx
|
||||
waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx
|
||||
waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx
|
||||
waspComplexTest/.wasp/out/web-app/src/components/FullPageWrapper.tsx
|
||||
waspComplexTest/.wasp/out/web-app/src/components/Loader.module.css
|
||||
waspComplexTest/.wasp/out/web-app/src/components/Loader.tsx
|
||||
|
@ -319,21 +319,21 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/index.ts"
|
||||
],
|
||||
"6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0"
|
||||
"ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/linkHelpers.ts"
|
||||
],
|
||||
"62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e"
|
||||
"3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/types.ts"
|
||||
],
|
||||
"9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f"
|
||||
"ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -487,7 +487,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/package.json"
|
||||
],
|
||||
"a333b7881848511a13daf4220c5c96f447319660fad15d22f7e5272865dc2641"
|
||||
"d018a4695d02879c54e6ed75d27e63acc6cc7b33386f1feeb853c5e10248b4f1"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -1180,7 +1180,7 @@
|
||||
"file",
|
||||
"web-app/package.json"
|
||||
],
|
||||
"1b0855b401aae4ceb6eca959600a1fde84e9f7590beb8362a7d2fad40bcb6fef"
|
||||
"b602a1d989b4e0950cf30fa1490d10bd5956aa4a5339acdd7358f44d00b534d0"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -1215,14 +1215,21 @@
|
||||
"file",
|
||||
"web-app/src/auth/pages/OAuthCallback.tsx"
|
||||
],
|
||||
"f5f1214036b335cd000d49e89908d35bdffd1878887d15877b699a78154c7852"
|
||||
"6414299e9cb46702b8daca23563991a46e70ef8e9ea985bc5d4fe48d2c646132"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"web-app/src/auth/pages/createAuthRequiredPage.jsx"
|
||||
],
|
||||
"011b5851a168fc4280b68a57a6ac2379fdbfb50d81f1fe0917be218ff9dba420"
|
||||
"be2f872a6465690dec32a0d2a0c3b15d941846cc0059a9ec13d09650daccda7f"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"web-app/src/components/DefaultRootErrorBoundary.tsx"
|
||||
],
|
||||
"4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -1257,7 +1264,7 @@
|
||||
"file",
|
||||
"web-app/src/index.tsx"
|
||||
],
|
||||
"46b4cde819de4048b82feb249ae662fb60de2297c6a740f49da239011848458d"
|
||||
"27e9b6e82ad360f481cc4883b4321e18871b7c6d9be5abbaa4613c0a6faebbcd"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -1271,7 +1278,7 @@
|
||||
"file",
|
||||
"web-app/src/router.tsx"
|
||||
],
|
||||
"8dc5955b5a640cbae8836cc227e6ade562b8e7ba9eda5ce076436955807fe0fe"
|
||||
"8160ffecec82dde31d889825cf0a2d605e2b729be555c650b8accca2252ed613"
|
||||
],
|
||||
[
|
||||
[
|
||||
|
@ -1 +1 @@
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"@node-rs/argon2","version":"^1.8.3"},{"name":"arctic","version":"^1.2.1"},{"name":"lucia","version":"^3.0.1"},{"name":"oslo","version":"^1.1.2"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"@node-rs/argon2","version":"^1.8.3"},{"name":"arctic","version":"^1.2.1"},{"name":"lucia","version":"^3.0.1"},{"name":"oslo","version":"^1.1.2"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
@ -3,6 +3,7 @@ import type {
|
||||
RouteDefinitionsToRoutes,
|
||||
OptionalRouteOptions,
|
||||
ParamValue,
|
||||
ExpandRouteOnOptionalStaticSegments,
|
||||
} from './types'
|
||||
|
||||
// PUBLIC API
|
||||
@ -10,8 +11,15 @@ export const routes = {
|
||||
RootRoute: {
|
||||
to: "/",
|
||||
build: (
|
||||
options?: OptionalRouteOptions,
|
||||
) => interpolatePath("/", undefined, options?.search, options?.hash),
|
||||
options?:
|
||||
OptionalRouteOptions
|
||||
) => interpolatePath(
|
||||
|
||||
"/",
|
||||
undefined,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
@ -17,6 +17,9 @@ export function interpolatePath(
|
||||
|
||||
function interpolatePathParams(path: string, params: Params) {
|
||||
function mapPathPart(part: string) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -2,7 +2,7 @@
|
||||
export type RouteDefinitionsToRoutes<Routes extends RoutesDefinition> =
|
||||
RouteDefinitionsToRoutesObj<Routes>[keyof RouteDefinitionsToRoutesObj<Routes>]
|
||||
|
||||
// PRIVATE API
|
||||
// PRIVATE API
|
||||
export type OptionalRouteOptions = {
|
||||
search?: Search
|
||||
hash?: string
|
||||
@ -21,7 +21,7 @@ export type Search =
|
||||
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to']
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>
|
||||
}
|
||||
|
||||
@ -39,3 +39,60 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
}
|
||||
? { params: Params }
|
||||
: { params?: never }
|
||||
|
||||
// PRIVATE API (sdk)
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<
|
||||
ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>
|
||||
>;
|
||||
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail]
|
||||
? [_ParseSegment<Head>, ...ParseSegments<Tail>]
|
||||
: T;
|
||||
|
||||
type _ParseSegment<T> = T extends `:${infer P}`
|
||||
? // Param segment
|
||||
{ segment: T }
|
||||
: T extends `${infer S}?`
|
||||
? // Optional segment
|
||||
{ optionalSegment: S }
|
||||
: // Regular segment
|
||||
{ segment: T };
|
||||
|
||||
type Segment = { segment: string };
|
||||
type OptionalSegment = { optionalSegment: string };
|
||||
|
||||
type Elem = Segment | OptionalSegment;
|
||||
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends []
|
||||
? []
|
||||
: T extends [infer First extends Elem, ...infer Rest extends Elem[]]
|
||||
? First extends Segment
|
||||
? [First["segment"], ...ExpandOptionalSegments<Rest>]
|
||||
: First extends OptionalSegment
|
||||
? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest>
|
||||
: []
|
||||
: [];
|
||||
|
||||
type SplitPath<S extends string> = S extends "/"
|
||||
? [""]
|
||||
: S extends `${infer T}/${infer U}`
|
||||
? [T, ...SplitPath<U>]
|
||||
: [S];
|
||||
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string]
|
||||
? Only extends ""
|
||||
? "/"
|
||||
: Only
|
||||
: T extends [infer First extends string, ...infer Rest extends string[]]
|
||||
? `${First}/${JoinPath<Rest>}`
|
||||
: never;
|
||||
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) {
|
||||
}
|
||||
function interpolatePathParams(path, params) {
|
||||
function mapPathPart(part) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
@ -10,7 +10,7 @@ export type Params = {
|
||||
export type Search = string[][] | Record<string, string> | string | URLSearchParams;
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to'];
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>;
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>;
|
||||
};
|
||||
type RoutesDefinition = {
|
||||
@ -27,4 +27,32 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
} : {
|
||||
params?: never;
|
||||
};
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>>;
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail] ? [_ParseSegment<Head>, ...ParseSegments<Tail>] : T;
|
||||
type _ParseSegment<T> = T extends `:${infer P}` ? {
|
||||
segment: T;
|
||||
} : T extends `${infer S}?` ? {
|
||||
optionalSegment: S;
|
||||
} : {
|
||||
segment: T;
|
||||
};
|
||||
type Segment = {
|
||||
segment: string;
|
||||
};
|
||||
type OptionalSegment = {
|
||||
optionalSegment: string;
|
||||
};
|
||||
type Elem = Segment | OptionalSegment;
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments<Rest>] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest> : [] : [];
|
||||
type SplitPath<S extends string> = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath<U>] : [S];
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath<Rest>}` : never;
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
export {};
|
||||
|
@ -8,8 +8,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"arctic": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
@ -24,13 +22,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
},
|
||||
"exports": {
|
||||
"./api/events": "./dist/api/events.js",
|
||||
|
@ -17,13 +17,12 @@
|
||||
"mitt": "3.0.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/vite-react": "^2.0.0",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"dotenv": "^16.0.3"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { type AxiosResponse } from "axios";
|
||||
import { Redirect, useLocation } from 'react-router-dom'
|
||||
import { Navigate, useLocation } from 'react-router-dom'
|
||||
import { useAuth } from 'wasp/client/auth'
|
||||
import { api } from 'wasp/client/api'
|
||||
import { initSession } from 'wasp/auth/helpers/user'
|
||||
@ -13,7 +13,7 @@ export function OAuthCallbackPage() {
|
||||
const { error, user } = useOAuthCallbackHandler();
|
||||
|
||||
if (user !== undefined && user !== null) {
|
||||
return <Redirect to="/" />;
|
||||
return <Navigate to="/" replace />;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
|
||||
import { Redirect } from 'react-router-dom'
|
||||
import { Navigate } from 'react-router-dom'
|
||||
import { useAuth } from 'wasp/client/auth'
|
||||
|
||||
import { Loader } from '../../components/Loader'
|
||||
@ -16,7 +16,7 @@ const createAuthRequiredPage = (Page) => {
|
||||
if (user) {
|
||||
return <Page {...props} user={user} />
|
||||
} else {
|
||||
return <Redirect to="/login" />
|
||||
return <Navigate to="/login" replace />
|
||||
}
|
||||
case 'loading':
|
||||
return (
|
||||
|
@ -0,0 +1,13 @@
|
||||
import { useRouteError } from 'react-router-dom'
|
||||
|
||||
import { FullPageWrapper } from './FullPageWrapper'
|
||||
|
||||
export function DefaultRootErrorBoundary() {
|
||||
const error = useRouteError()
|
||||
console.error(error)
|
||||
return (
|
||||
<FullPageWrapper>
|
||||
<div>There was an error rendering this page. Check the browser console for more information.</div>
|
||||
</FullPageWrapper>
|
||||
)
|
||||
}
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
import router from './router'
|
||||
import { router } from './router'
|
||||
import {
|
||||
initializeQueryClient,
|
||||
queryClientInitialized,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { Route, Switch, BrowserRouter as Router } from 'react-router-dom'
|
||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
||||
import App from '../../../../src/client/App.jsx'
|
||||
|
||||
import createAuthRequiredPage from "./auth/pages/createAuthRequiredPage"
|
||||
@ -8,35 +8,35 @@ import { MainPage } from '../../../../src/MainPage'
|
||||
|
||||
import { OAuthCallbackPage } from "./auth/pages/OAuthCallback"
|
||||
|
||||
import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary'
|
||||
|
||||
import { routes } from 'wasp/client/router'
|
||||
|
||||
export const routeNameToRouteComponent = {
|
||||
RootRoute: MainPage,
|
||||
} as const;
|
||||
|
||||
const router = (
|
||||
<Router basename="/">
|
||||
<App>
|
||||
<Switch>
|
||||
{/*
|
||||
Wasp specific routes *must* go first to prevent user
|
||||
defined routes from overriding them.
|
||||
Details in https://github.com/wasp-lang/wasp/issues/2029
|
||||
*/}
|
||||
<Route exact path="/oauth/callback">
|
||||
<OAuthCallbackPage />
|
||||
</Route>
|
||||
{Object.entries(routes).map(([routeKey, route]) => (
|
||||
<Route
|
||||
exact
|
||||
key={routeKey}
|
||||
path={route.to}
|
||||
component={routeNameToRouteComponent[routeKey]}
|
||||
/>
|
||||
))}
|
||||
</Switch>
|
||||
</App>
|
||||
</Router>
|
||||
)
|
||||
const waspDefinedRoutes = [
|
||||
{
|
||||
path: "/oauth/callback",
|
||||
Component: OAuthCallbackPage,
|
||||
},
|
||||
]
|
||||
const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => {
|
||||
return {
|
||||
path: route.to,
|
||||
Component: routeNameToRouteComponent[routeKey],
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
const browserRouter = createBrowserRouter([{
|
||||
path: '/',
|
||||
element: <App />,
|
||||
ErrorBoundary: DefaultRootErrorBoundary,
|
||||
children: [
|
||||
...waspDefinedRoutes,
|
||||
...userDefinedRoutes,
|
||||
],
|
||||
}])
|
||||
|
||||
export const router = <RouterProvider router={browserRouter} />
|
||||
|
@ -251,6 +251,7 @@ waspJob/.wasp/out/web-app/public/.gitkeep
|
||||
waspJob/.wasp/out/web-app/public/favicon.ico
|
||||
waspJob/.wasp/out/web-app/public/manifest.json
|
||||
waspJob/.wasp/out/web-app/scripts/validate-env.mjs
|
||||
waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx
|
||||
waspJob/.wasp/out/web-app/src/components/FullPageWrapper.tsx
|
||||
waspJob/.wasp/out/web-app/src/components/Loader.module.css
|
||||
waspJob/.wasp/out/web-app/src/components/Loader.tsx
|
||||
|
@ -116,21 +116,21 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/index.ts"
|
||||
],
|
||||
"6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0"
|
||||
"ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/linkHelpers.ts"
|
||||
],
|
||||
"62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e"
|
||||
"3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/types.ts"
|
||||
],
|
||||
"9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f"
|
||||
"ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -207,7 +207,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/package.json"
|
||||
],
|
||||
"ac367dc5e1f727e5ee31fe9f9097392a09bfd7303b9fe35280a3cd60cb9fc50b"
|
||||
"ea409ee729f8b19739d4d06aee14dae9fb1b3b745ea155a235d13f6c4aedda3c"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -620,7 +620,7 @@
|
||||
"file",
|
||||
"web-app/package.json"
|
||||
],
|
||||
"018f64a891479362d528211d2e52a038fa8948d392dd61fb9532712202d2340b"
|
||||
"224c574b8eea2c414fb618e7ec833d87c98b962288cdd8e0f65377dfe684bd8d"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -650,6 +650,13 @@
|
||||
],
|
||||
"a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"web-app/src/components/DefaultRootErrorBoundary.tsx"
|
||||
],
|
||||
"4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
@ -683,7 +690,7 @@
|
||||
"file",
|
||||
"web-app/src/index.tsx"
|
||||
],
|
||||
"ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2"
|
||||
"61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -697,7 +704,7 @@
|
||||
"file",
|
||||
"web-app/src/router.tsx"
|
||||
],
|
||||
"5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e"
|
||||
"72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752"
|
||||
],
|
||||
[
|
||||
[
|
||||
|
@ -1 +1 @@
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
@ -3,6 +3,7 @@ import type {
|
||||
RouteDefinitionsToRoutes,
|
||||
OptionalRouteOptions,
|
||||
ParamValue,
|
||||
ExpandRouteOnOptionalStaticSegments,
|
||||
} from './types'
|
||||
|
||||
// PUBLIC API
|
||||
@ -10,8 +11,15 @@ export const routes = {
|
||||
RootRoute: {
|
||||
to: "/",
|
||||
build: (
|
||||
options?: OptionalRouteOptions,
|
||||
) => interpolatePath("/", undefined, options?.search, options?.hash),
|
||||
options?:
|
||||
OptionalRouteOptions
|
||||
) => interpolatePath(
|
||||
|
||||
"/",
|
||||
undefined,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
@ -17,6 +17,9 @@ export function interpolatePath(
|
||||
|
||||
function interpolatePathParams(path: string, params: Params) {
|
||||
function mapPathPart(part: string) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -2,7 +2,7 @@
|
||||
export type RouteDefinitionsToRoutes<Routes extends RoutesDefinition> =
|
||||
RouteDefinitionsToRoutesObj<Routes>[keyof RouteDefinitionsToRoutesObj<Routes>]
|
||||
|
||||
// PRIVATE API
|
||||
// PRIVATE API
|
||||
export type OptionalRouteOptions = {
|
||||
search?: Search
|
||||
hash?: string
|
||||
@ -21,7 +21,7 @@ export type Search =
|
||||
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to']
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>
|
||||
}
|
||||
|
||||
@ -39,3 +39,60 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
}
|
||||
? { params: Params }
|
||||
: { params?: never }
|
||||
|
||||
// PRIVATE API (sdk)
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<
|
||||
ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>
|
||||
>;
|
||||
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail]
|
||||
? [_ParseSegment<Head>, ...ParseSegments<Tail>]
|
||||
: T;
|
||||
|
||||
type _ParseSegment<T> = T extends `:${infer P}`
|
||||
? // Param segment
|
||||
{ segment: T }
|
||||
: T extends `${infer S}?`
|
||||
? // Optional segment
|
||||
{ optionalSegment: S }
|
||||
: // Regular segment
|
||||
{ segment: T };
|
||||
|
||||
type Segment = { segment: string };
|
||||
type OptionalSegment = { optionalSegment: string };
|
||||
|
||||
type Elem = Segment | OptionalSegment;
|
||||
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends []
|
||||
? []
|
||||
: T extends [infer First extends Elem, ...infer Rest extends Elem[]]
|
||||
? First extends Segment
|
||||
? [First["segment"], ...ExpandOptionalSegments<Rest>]
|
||||
: First extends OptionalSegment
|
||||
? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest>
|
||||
: []
|
||||
: [];
|
||||
|
||||
type SplitPath<S extends string> = S extends "/"
|
||||
? [""]
|
||||
: S extends `${infer T}/${infer U}`
|
||||
? [T, ...SplitPath<U>]
|
||||
: [S];
|
||||
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string]
|
||||
? Only extends ""
|
||||
? "/"
|
||||
: Only
|
||||
: T extends [infer First extends string, ...infer Rest extends string[]]
|
||||
? `${First}/${JoinPath<Rest>}`
|
||||
: never;
|
||||
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
@ -9,6 +9,9 @@ export function interpolatePath(path, params, search, hash) {
|
||||
}
|
||||
function interpolatePathParams(path, params) {
|
||||
function mapPathPart(part) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
||||
{"version":3,"file":"linkHelpers.js","sourceRoot":"","sources":["../../../client/router/linkHelpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAe,EACf,MAAe,EACf,IAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,MAAM,kBAAkB,GAAG,MAAM;QAC/B,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAA;IACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/C,OAAO,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;IACzD,SAAS,WAAW,CAAC,IAAY;QAC/B,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,WAAW,CAAC;SAChB,MAAM,CAAC,eAAe,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
@ -10,7 +10,7 @@ export type Params = {
|
||||
export type Search = string[][] | Record<string, string> | string | URLSearchParams;
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to'];
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>;
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>;
|
||||
};
|
||||
type RoutesDefinition = {
|
||||
@ -27,4 +27,32 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
} : {
|
||||
params?: never;
|
||||
};
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>>;
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail] ? [_ParseSegment<Head>, ...ParseSegments<Tail>] : T;
|
||||
type _ParseSegment<T> = T extends `:${infer P}` ? {
|
||||
segment: T;
|
||||
} : T extends `${infer S}?` ? {
|
||||
optionalSegment: S;
|
||||
} : {
|
||||
segment: T;
|
||||
};
|
||||
type Segment = {
|
||||
segment: string;
|
||||
};
|
||||
type OptionalSegment = {
|
||||
optionalSegment: string;
|
||||
};
|
||||
type Elem = Segment | OptionalSegment;
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends [] ? [] : T extends [infer First extends Elem, ...infer Rest extends Elem[]] ? First extends Segment ? [First["segment"], ...ExpandOptionalSegments<Rest>] : First extends OptionalSegment ? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest> : [] : [];
|
||||
type SplitPath<S extends string> = S extends "/" ? [""] : S extends `${infer T}/${infer U}` ? [T, ...SplitPath<U>] : [S];
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string] ? Only extends "" ? "/" : Only : T extends [infer First extends string, ...infer Rest extends string[]] ? `${First}/${JoinPath<Rest>}` : never;
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
export {};
|
||||
|
@ -16,7 +16,7 @@ export declare const mySpecialJob: {
|
||||
readonly pgBoss: {
|
||||
readonly cancel: () => ReturnType<import("pg-boss")["cancel"]>;
|
||||
readonly resume: () => ReturnType<import("pg-boss")["resume"]>;
|
||||
readonly details: () => Promise<Omit<import("pg-boss").JobWithMetadata<JSONObject>, "output" | "state"> & ({
|
||||
readonly details: () => Promise<Omit<import("pg-boss").JobWithMetadata<JSONObject>, "state" | "output"> & ({
|
||||
data: JSONObject;
|
||||
} & ({
|
||||
state: "failed";
|
||||
|
@ -4,8 +4,6 @@
|
||||
"@tanstack/react-query": "^4.29.0",
|
||||
"@testing-library/jest-dom": "^6.3.0",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@types/express-serve-static-core": "^4.17.13",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitest/ui": "^1.2.1",
|
||||
"axios": "^1.4.0",
|
||||
"express": "~4.18.1",
|
||||
@ -17,13 +15,14 @@
|
||||
"prisma": "5.19.1",
|
||||
"react": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2",
|
||||
"uuid": "^9.0.0",
|
||||
"vitest": "^1.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "latest"
|
||||
"@tsconfig/node18": "latest",
|
||||
"@types/express-serve-static-core": "^4.17.13"
|
||||
},
|
||||
"exports": {
|
||||
"./api/events": "./dist/api/events.js",
|
||||
|
@ -17,13 +17,12 @@
|
||||
"mitt": "3.0.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.45.4",
|
||||
"react-router-dom": "^5.3.3",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"superjson": "^1.12.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/vite-react": "^2.0.0",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"dotenv": "^16.0.3"
|
||||
},
|
||||
|
@ -0,0 +1,13 @@
|
||||
import { useRouteError } from 'react-router-dom'
|
||||
|
||||
import { FullPageWrapper } from './FullPageWrapper'
|
||||
|
||||
export function DefaultRootErrorBoundary() {
|
||||
const error = useRouteError()
|
||||
console.error(error)
|
||||
return (
|
||||
<FullPageWrapper>
|
||||
<div>There was an error rendering this page. Check the browser console for more information.</div>
|
||||
</FullPageWrapper>
|
||||
)
|
||||
}
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
|
||||
import router from './router'
|
||||
import { router } from './router'
|
||||
import {
|
||||
initializeQueryClient,
|
||||
queryClientInitialized,
|
||||
|
@ -1,29 +1,34 @@
|
||||
import React from 'react'
|
||||
import { Route, Switch, BrowserRouter as Router } from 'react-router-dom'
|
||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
||||
|
||||
|
||||
import { MainPage } from '../../../../src/MainPage'
|
||||
|
||||
|
||||
import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary'
|
||||
|
||||
import { routes } from 'wasp/client/router'
|
||||
|
||||
export const routeNameToRouteComponent = {
|
||||
RootRoute: MainPage,
|
||||
} as const;
|
||||
|
||||
const router = (
|
||||
<Router basename="/">
|
||||
<Switch>
|
||||
{Object.entries(routes).map(([routeKey, route]) => (
|
||||
<Route
|
||||
exact
|
||||
key={routeKey}
|
||||
path={route.to}
|
||||
component={routeNameToRouteComponent[routeKey]}
|
||||
/>
|
||||
))}
|
||||
</Switch>
|
||||
</Router>
|
||||
)
|
||||
const waspDefinedRoutes = [
|
||||
]
|
||||
const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => {
|
||||
return {
|
||||
path: route.to,
|
||||
Component: routeNameToRouteComponent[routeKey],
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
const browserRouter = createBrowserRouter([{
|
||||
path: '/',
|
||||
ErrorBoundary: DefaultRootErrorBoundary,
|
||||
children: [
|
||||
...waspDefinedRoutes,
|
||||
...userDefinedRoutes,
|
||||
],
|
||||
}])
|
||||
|
||||
export const router = <RouterProvider router={browserRouter} />
|
||||
|
@ -220,6 +220,7 @@ waspMigrate/.wasp/out/web-app/public/.gitkeep
|
||||
waspMigrate/.wasp/out/web-app/public/favicon.ico
|
||||
waspMigrate/.wasp/out/web-app/public/manifest.json
|
||||
waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs
|
||||
waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx
|
||||
waspMigrate/.wasp/out/web-app/src/components/FullPageWrapper.tsx
|
||||
waspMigrate/.wasp/out/web-app/src/components/Loader.module.css
|
||||
waspMigrate/.wasp/out/web-app/src/components/Loader.tsx
|
||||
|
@ -116,21 +116,21 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/index.ts"
|
||||
],
|
||||
"6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0"
|
||||
"ad12dae94c1c68a4f31f660dd942fc0b43d713b4ed37145faeb2f65d3e5bc392"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/linkHelpers.ts"
|
||||
],
|
||||
"62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e"
|
||||
"3b523ed6020fe18d71a108551de0a71cbfa23bdc4e3245b3491c5224251faa20"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/types.ts"
|
||||
],
|
||||
"9bfaabe92126b641e6b939c26bac121dbbe1bb495392a5d40474ef4981432b5f"
|
||||
"ffbce0f351b849dfe04f00421a31844836cbd5a80ab97445f6ed8859e6b94928"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -200,7 +200,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/package.json"
|
||||
],
|
||||
"866e8d016c5972a35983615a9ac0bc4b3c1b25f4155ed09b60300be71af975c7"
|
||||
"c5dc0e880b6924c30799671f3204f15687c1e50e338144ba82e62916dba80c9d"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -550,7 +550,7 @@
|
||||
"file",
|
||||
"web-app/package.json"
|
||||
],
|
||||
"19a5d3854b7614748db2af7b574afc66951d5b6eff128ca3eab36445b331686f"
|
||||
"880c852ac4fc2f2b319f5e53c5743e6b1f99f149cb212844d32804bebc27ecfc"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -580,6 +580,13 @@
|
||||
],
|
||||
"a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"web-app/src/components/DefaultRootErrorBoundary.tsx"
|
||||
],
|
||||
"4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
@ -613,7 +620,7 @@
|
||||
"file",
|
||||
"web-app/src/index.tsx"
|
||||
],
|
||||
"ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2"
|
||||
"61265d54c480ce94df81fdd0c65fa2e3c154e7d9fb9621c87a2d81e32ecd2adf"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -627,7 +634,7 @@
|
||||
"file",
|
||||
"web-app/src/router.tsx"
|
||||
],
|
||||
"5641aec64e4771fde7aaedb217fbb726103c9859de65f2b6bdc51fbb2e970a3e"
|
||||
"72f880dba47672ec9fb112a8b88cc8d831458cccddcc891b853a6dc9809a5752"
|
||||
],
|
||||
[
|
||||
[
|
||||
|
@ -1 +1 @@
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
||||
{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^1.12.2"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}}
|
@ -3,6 +3,7 @@ import type {
|
||||
RouteDefinitionsToRoutes,
|
||||
OptionalRouteOptions,
|
||||
ParamValue,
|
||||
ExpandRouteOnOptionalStaticSegments,
|
||||
} from './types'
|
||||
|
||||
// PUBLIC API
|
||||
@ -10,8 +11,15 @@ export const routes = {
|
||||
RootRoute: {
|
||||
to: "/",
|
||||
build: (
|
||||
options?: OptionalRouteOptions,
|
||||
) => interpolatePath("/", undefined, options?.search, options?.hash),
|
||||
options?:
|
||||
OptionalRouteOptions
|
||||
) => interpolatePath(
|
||||
|
||||
"/",
|
||||
undefined,
|
||||
options?.search,
|
||||
options?.hash
|
||||
),
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
@ -17,6 +17,9 @@ export function interpolatePath(
|
||||
|
||||
function interpolatePathParams(path: string, params: Params) {
|
||||
function mapPathPart(part: string) {
|
||||
if (part === '*') {
|
||||
return params['*'];
|
||||
}
|
||||
if (part.startsWith(":")) {
|
||||
const paramName = extractParamNameFromPathPart(part);
|
||||
return params[paramName];
|
||||
|
@ -2,7 +2,7 @@
|
||||
export type RouteDefinitionsToRoutes<Routes extends RoutesDefinition> =
|
||||
RouteDefinitionsToRoutesObj<Routes>[keyof RouteDefinitionsToRoutesObj<Routes>]
|
||||
|
||||
// PRIVATE API
|
||||
// PRIVATE API
|
||||
export type OptionalRouteOptions = {
|
||||
search?: Search
|
||||
hash?: string
|
||||
@ -21,7 +21,7 @@ export type Search =
|
||||
|
||||
type RouteDefinitionsToRoutesObj<Routes extends RoutesDefinition> = {
|
||||
[K in keyof Routes]: {
|
||||
to: Routes[K]['to']
|
||||
to: ExpandRouteOnOptionalStaticSegments<Routes[K]['to']>
|
||||
} & ParamsFromBuildFn<Routes[K]['build']>
|
||||
}
|
||||
|
||||
@ -39,3 +39,60 @@ type ParamsFromBuildFn<BF extends BuildFn> = Parameters<BF>[0] extends {
|
||||
}
|
||||
? { params: Params }
|
||||
: { params?: never }
|
||||
|
||||
// PRIVATE API (sdk)
|
||||
/**
|
||||
* Optional static segments handling: expands routes with optional segments
|
||||
* into multiple routes, one for each possible combination of optional segments.
|
||||
*
|
||||
* For example: /users/tasks?/:id? will be expanded into two routes:
|
||||
* - /users/:id?
|
||||
* - /users/tasks/:id?
|
||||
*/
|
||||
export type ExpandRouteOnOptionalStaticSegments<Route extends string> = JoinPath<
|
||||
ExpandOptionalSegments<ParseSegments<SplitPath<NonEmptyString<Route>>>>
|
||||
>;
|
||||
|
||||
type ParseSegments<T> = T extends [infer Head, ...infer Tail]
|
||||
? [_ParseSegment<Head>, ...ParseSegments<Tail>]
|
||||
: T;
|
||||
|
||||
type _ParseSegment<T> = T extends `:${infer P}`
|
||||
? // Param segment
|
||||
{ segment: T }
|
||||
: T extends `${infer S}?`
|
||||
? // Optional segment
|
||||
{ optionalSegment: S }
|
||||
: // Regular segment
|
||||
{ segment: T };
|
||||
|
||||
type Segment = { segment: string };
|
||||
type OptionalSegment = { optionalSegment: string };
|
||||
|
||||
type Elem = Segment | OptionalSegment;
|
||||
|
||||
type ExpandOptionalSegments<T extends Elem[]> = T extends []
|
||||
? []
|
||||
: T extends [infer First extends Elem, ...infer Rest extends Elem[]]
|
||||
? First extends Segment
|
||||
? [First["segment"], ...ExpandOptionalSegments<Rest>]
|
||||
: First extends OptionalSegment
|
||||
? [First["optionalSegment"], ...ExpandOptionalSegments<Rest>] | ExpandOptionalSegments<Rest>
|
||||
: []
|
||||
: [];
|
||||
|
||||
type SplitPath<S extends string> = S extends "/"
|
||||
? [""]
|
||||
: S extends `${infer T}/${infer U}`
|
||||
? [T, ...SplitPath<U>]
|
||||
: [S];
|
||||
|
||||
type JoinPath<T extends string[]> = T extends [infer Only extends string]
|
||||
? Only extends ""
|
||||
? "/"
|
||||
: Only
|
||||
: T extends [infer First extends string, ...infer Rest extends string[]]
|
||||
? `${First}/${JoinPath<Rest>}`
|
||||
: never;
|
||||
|
||||
type NonEmptyString<S extends string> = S extends "" ? never : S;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAO/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OAA8B,EAC9B,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;KACrE;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,CACL,OACoB,EACpB,EAAE,CAAC,eAAe,CAEhB,GAAG,EACH,SAAS,EACT,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EACf,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CACd;KACJ;CACO,CAAC;AAKX,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user