From eefc96315ec7fe963d1dfd8bddc634f9ed29afd1 Mon Sep 17 00:00:00 2001 From: Ivan Starkov Date: Thu, 9 Nov 2023 23:05:22 +0200 Subject: [PATCH] fix: Fix cli types (#2592) ## Description 1. What is this PR about (link the issue and add a short description) ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 5de6) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env.example` and the `builder/env-check.js` if mandatory --- fixtures/webstudio-custom-template/app/extension.ts | 1 + fixtures/webstudio-custom-template/app/routes/_index.tsx | 2 +- .../webstudio-remix-netlify-edge-functions/app/extension.ts | 1 + .../app/routes/_index.tsx | 2 +- fixtures/webstudio-remix-netlify-functions/app/extension.ts | 1 + .../webstudio-remix-netlify-functions/app/routes/_index.tsx | 2 +- fixtures/webstudio-remix-vercel/app/extension.ts | 1 + .../app/routes/[_route_with_symbols_]._index.tsx | 2 +- fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx | 2 +- .../app/routes/[heading-with-id]._index.tsx | 2 +- fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx | 2 +- fixtures/webstudio-remix-vercel/app/routes/_index.tsx | 2 +- packages/cli/templates/defaults/app/extension.ts | 1 + packages/cli/templates/route-template.tsx | 2 +- 14 files changed, 14 insertions(+), 9 deletions(-) diff --git a/fixtures/webstudio-custom-template/app/extension.ts b/fixtures/webstudio-custom-template/app/extension.ts index c42becab9a..934b0437c1 100644 --- a/fixtures/webstudio-custom-template/app/extension.ts +++ b/fixtures/webstudio-custom-template/app/extension.ts @@ -5,5 +5,6 @@ import { AppLoadContext } from "@remix-run/server-runtime"; declare module "@remix-run/server-runtime" { interface AppLoadContext { EXCLUDE_FROM_SEARCH: boolean; + N8N_FORM_EMAIL_HOOK: string; } } diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsx index 464d4729ba..89f25e2896 100644 --- a/fixtures/webstudio-custom-template/app/routes/_index.tsx +++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/extension.ts b/fixtures/webstudio-remix-netlify-edge-functions/app/extension.ts index c42becab9a..934b0437c1 100644 --- a/fixtures/webstudio-remix-netlify-edge-functions/app/extension.ts +++ b/fixtures/webstudio-remix-netlify-edge-functions/app/extension.ts @@ -5,5 +5,6 @@ import { AppLoadContext } from "@remix-run/server-runtime"; declare module "@remix-run/server-runtime" { interface AppLoadContext { EXCLUDE_FROM_SEARCH: boolean; + N8N_FORM_EMAIL_HOOK: string; } } diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx index 464d4729ba..89f25e2896 100644 --- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx +++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/fixtures/webstudio-remix-netlify-functions/app/extension.ts b/fixtures/webstudio-remix-netlify-functions/app/extension.ts index c42becab9a..934b0437c1 100644 --- a/fixtures/webstudio-remix-netlify-functions/app/extension.ts +++ b/fixtures/webstudio-remix-netlify-functions/app/extension.ts @@ -5,5 +5,6 @@ import { AppLoadContext } from "@remix-run/server-runtime"; declare module "@remix-run/server-runtime" { interface AppLoadContext { EXCLUDE_FROM_SEARCH: boolean; + N8N_FORM_EMAIL_HOOK: string; } } diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx index 464d4729ba..89f25e2896 100644 --- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx +++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/fixtures/webstudio-remix-vercel/app/extension.ts b/fixtures/webstudio-remix-vercel/app/extension.ts index c42becab9a..934b0437c1 100644 --- a/fixtures/webstudio-remix-vercel/app/extension.ts +++ b/fixtures/webstudio-remix-vercel/app/extension.ts @@ -5,5 +5,6 @@ import { AppLoadContext } from "@remix-run/server-runtime"; declare module "@remix-run/server-runtime" { interface AppLoadContext { EXCLUDE_FROM_SEARCH: boolean; + N8N_FORM_EMAIL_HOOK: string; } } diff --git a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx index 16324c16ba..825a849dae 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx index 075776c874..7cdc7dad8b 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx index cc83d6e036..6b6d04e955 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx index d5a1ab0b8f..e621c44302 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx index 464d4729ba..89f25e2896 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result; diff --git a/packages/cli/templates/defaults/app/extension.ts b/packages/cli/templates/defaults/app/extension.ts index c42becab9a..934b0437c1 100644 --- a/packages/cli/templates/defaults/app/extension.ts +++ b/packages/cli/templates/defaults/app/extension.ts @@ -5,5 +5,6 @@ import { AppLoadContext } from "@remix-run/server-runtime"; declare module "@remix-run/server-runtime" { interface AppLoadContext { EXCLUDE_FROM_SEARCH: boolean; + N8N_FORM_EMAIL_HOOK: string; } } diff --git a/packages/cli/templates/route-template.tsx b/packages/cli/templates/route-template.tsx index ae71c7b02f..3fe8eea60c 100644 --- a/packages/cli/templates/route-template.tsx +++ b/packages/cli/templates/route-template.tsx @@ -276,7 +276,7 @@ export const action = async ({ request, context }: ActionArgs) => { const result = await n8nHandler({ formInfo, - hookUrl: context.N8N_FORM_EMAIL_HOOK as string, + hookUrl: context.N8N_FORM_EMAIL_HOOK, }); return result;