fix: use never for empty params #318
Annotations
4 errors and 2 warnings
packages/remix-routes/src/__tests__/build.test.ts#L21
Error: Snapshot `build v1 routes 1` mismatched
- Expected
+ Received
"declare module "remix-routes" {
- type URLSearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams;
- // symbol won't be a key of SearchParams
- type IsSearchParams<T> = symbol extends keyof T ? false : true;
-
+ type URLSearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams;
+ // symbol won't be a key of SearchParams
+ type IsSearchParams<T> = symbol extends keyof T ? false : true;
+
type ExportedQuery<T> = IsSearchParams<T> extends true ? T : URLSearchParamsInit;
+
+ export interface Routes {
+
+ "/": {
+ params: never,
+ query: ExportedQuery<import('../app/root').SearchParams>,
+ };
+
+ "/:lang?/about": {
+ params: {
+ lang?: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/($lang)/about').SearchParams>,
+ };
+
+ "/admin": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/admin/index').SearchParams>,
+ };
+
+ "/admin/episodes": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/admin/episodes/index').SearchParams>,
+ };
+
+ "/admin/episodes/:id": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/admin/episodes/$id').SearchParams>,
+ };
+
+ "/admin/episodes/:id/comments": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/admin/episodes/$id/comments/index').SearchParams>,
+ };
+
+ "/admin/episodes/new": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/admin/episodes/new').SearchParams>,
+ };
+
+ "/auth": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/auth/__auth').SearchParams>,
+ };
+
+ "/auth/login": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/auth/__auth/login').SearchParams>,
+ };
+
+ "/blog/rss.xml": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/blog.rss[.]xml').SearchParams>,
+ };
+
+ "/chats/:season/:episode": {
+ params: {
+ season: string | number;episode: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/chats.$season.$episode').SearchParams>,
+ };
+
+ "/chats/:season/:episode/:slug": {
+ params: {
+ season: string | number;episode: string | number;slug: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/chats.$season.$episode.$slug').SearchParams>,
+ };
+
+ "/credits": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/credits').SearchParams>,
+ };
+
+ "/home": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/(static)/home').SearchParams>,
+ };
+
+ "/jokes": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/jokes/index').SearchParams>,
+ };
+
+ "/jokes/:jokeId": {
+ params: {
+ jokeId: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/jokes/$jokeId').SearchParams>,
+ };
+
+ "/people/:personId": {
+ params: {
+ personId: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/people/$personId').SearchParams>,
+ };
+
+ "/people/:personId/:planId/remove-plan": {
+ params: {
+ personId: string | number;planId: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/people/$personId/$planId/remove-plan').SearchParams>,
+ };
+
+ "/posts": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/posts/index').SearchParams>,
+ };
+
+ "/posts/:id": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/posts/$id').SearchParams>,
+ };
+
+ "/posts/*":
|
packages/remix-routes/src/__tests__/build.test.ts#L32
Error: Snapshot `build v2 routes 1` mismatched
- Expected
+ Received
"declare module "remix-routes" {
- type URLSearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams;
- // symbol won't be a key of SearchParams
- type IsSearchParams<T> = symbol extends keyof T ? false : true;
-
+ type URLSearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams;
+ // symbol won't be a key of SearchParams
+ type IsSearchParams<T> = symbol extends keyof T ? false : true;
+
type ExportedQuery<T> = IsSearchParams<T> extends true ? T : URLSearchParamsInit;
+
+ export interface Routes {
+
+ "/": {
+ params: never,
+ query: ExportedQuery<import('../app/root').SearchParams>,
+ };
+
+ "/:lang?/about": {
+ params: {
+ lang?: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/($lang).about').SearchParams>,
+ };
+
+ "/admin": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/admin._index').SearchParams>,
+ };
+
+ "/admin/episodes": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/admin.episodes._index').SearchParams>,
+ };
+
+ "/admin/episodes/:id": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/admin.episodes.$id._index').SearchParams>,
+ };
+
+ "/admin/episodes/:id/comments": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/admin.episodes.$id.comments').SearchParams>,
+ };
+
+ "/admin/episodes/new": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/admin.episodes.new').SearchParams>,
+ };
+
+ "/api/:id.json": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/api.$id[.]json').SearchParams>,
+ };
+
+ "/auth": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/auth._auth').SearchParams>,
+ };
+
+ "/auth/login": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/auth._auth.login').SearchParams>,
+ };
+
+ "/blog/rss.xml": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/blog.rss[.]xml').SearchParams>,
+ };
+
+ "/chats/:season/:episode": {
+ params: {
+ season: string | number;episode: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/chats_.$season.$episode').SearchParams>,
+ };
+
+ "/chats/:season/:episode/:slug": {
+ params: {
+ season: string | number;episode: string | number;slug: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/chats_.$season.$episode.$slug').SearchParams>,
+ };
+
+ "/credits": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/credits').SearchParams>,
+ };
+
+ "/home": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/(static).home').SearchParams>,
+ };
+
+ "/jokes": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/jokes._index').SearchParams>,
+ };
+
+ "/jokes/:jokeId": {
+ params: {
+ jokeId: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/jokes.$jokeId').SearchParams>,
+ };
+
+ "/people/:personId": {
+ params: {
+ personId: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/people.$personId').SearchParams>,
+ };
+
+ "/people/:personId/:planId/remove-plan": {
+ params: {
+ personId: string | number;planId: string | number;
+ } ,
+ query: ExportedQuery<import('../app/routes/people.$personId.$planId.remove-plan').SearchParams>,
+ };
+
+ "/posts": {
+ params: never,
+ query: ExportedQuery<import('../app/routes/posts._index').SearchParams>,
+ };
+
+
|
packages/remix-routes/src/__tests__/build.test.ts#L43
Error: Snapshot `build customPaths routes 1` mismatched
- Expected
+ Received
"declare module "remix-routes" {
- type URLSearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams;
- // symbol won't be a key of SearchParams
- type IsSearchParams<T> = symbol extends keyof T ? false : true;
-
+ type URLSearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams;
+ // symbol won't be a key of SearchParams
+ type IsSearchParams<T> = symbol extends keyof T ? false : true;
+
type ExportedQuery<T> = IsSearchParams<T> extends true ? T : URLSearchParamsInit;
+
+ export interface Routes {
+
+ "/": {
+ params: never,
+ query: ExportedQuery<import('../../src/root').SearchParams>,
+ };
+
+ "/:lang?/about": {
+ params: {
+ lang?: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/($lang).about').SearchParams>,
+ };
+
+ "/admin": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/admin._index').SearchParams>,
+ };
+
+ "/admin/episodes": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/admin.episodes._index').SearchParams>,
+ };
+
+ "/admin/episodes/:id": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/admin.episodes.$id._index').SearchParams>,
+ };
+
+ "/admin/episodes/:id/comments": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/admin.episodes.$id.comments').SearchParams>,
+ };
+
+ "/admin/episodes/new": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/admin.episodes.new').SearchParams>,
+ };
+
+ "/auth": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/auth._auth').SearchParams>,
+ };
+
+ "/auth/login": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/auth._auth.login').SearchParams>,
+ };
+
+ "/blog/rss.xml": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/blog.rss[.]xml').SearchParams>,
+ };
+
+ "/chats/:season/:episode": {
+ params: {
+ season: string | number;episode: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/chats_.$season.$episode').SearchParams>,
+ };
+
+ "/chats/:season/:episode/:slug": {
+ params: {
+ season: string | number;episode: string | number;slug: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/chats_.$season.$episode.$slug').SearchParams>,
+ };
+
+ "/credits": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/credits').SearchParams>,
+ };
+
+ "/home": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/(static).home').SearchParams>,
+ };
+
+ "/jokes": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/jokes._index').SearchParams>,
+ };
+
+ "/jokes/:jokeId": {
+ params: {
+ jokeId: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/jokes.$jokeId').SearchParams>,
+ };
+
+ "/people/:personId": {
+ params: {
+ personId: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/people.$personId').SearchParams>,
+ };
+
+ "/people/:personId/:planId/remove-plan": {
+ params: {
+ personId: string | number;planId: string | number;
+ } ,
+ query: ExportedQuery<import('../../src/routes/people.$personId.$planId.remove-plan').SearchParams>,
+ };
+
+ "/posts": {
+ params: never,
+ query: ExportedQuery<import('../../src/routes/posts._index').SearchParams>,
+ };
+
+ "/posts/:id": {
+ params: {
+ id: string | number;
+ } ,
+ query: ExportedQuery<import('..
|
|
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, pnpm/[email protected], actions/setup-node@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
This job failed
Loading