Skip to content

Commit

Permalink
Update deco.cx
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgr committed Oct 17, 2024
1 parent 3d3ed32 commit ff519e2
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 44 deletions.
1 change: 0 additions & 1 deletion components/ui/ImpactCalculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default function ImpactCalculator({
};

const handleSubmit = (e: JSX.TargetedEvent<HTMLFormElement>) => {
// @ts-expect-error: preventDefault is not a function
e.preventDefault();
loading.value = true;

Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@std/testing": "jsr:@std/testing@^1.0.0",
"@supabase/supabase-js": "jsr:@supabase/supabase-js@^2.45.4",
"@zaubrik/djwt": "jsr:@zaubrik/djwt@^3.0.2",
"apps/": "https://denopkg.com/deco-cx/[email protected].5/",
"apps/": "https://denopkg.com/deco-cx/[email protected].9/",
"daisyui": "npm:[email protected]",
"deco-sites/std/": "https://denopkg.com/deco-sites/[email protected]/",
"deco/": "https://denopkg.com/deco-cx/[email protected]/",
Expand Down
37 changes: 1 addition & 36 deletions docs/self-host/envs/pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,4 @@ description: Arquitetura Self-host
since: 2.0
---

## Deployando seu site (Docker)

```dockerfile
FROM denoland/deno:alpine

# The port that your application listens to.
EXPOSE 8000

WORKDIR /app

RUN mkdir -p /home/deno && chown -R deno:deno /home/deno && mkdir /app/deno && chown -R deno:deno /app && mkdir -p /deno-dir && chown -R deno:deno /deno-dir

# Prefer not to run as root.
USER deno

# These steps will be re-run upon each file change in your working directory:
COPY --chown=deno:deno . deco

WORKDIR /app/deco

RUN echo -e 'import "$fresh/src/build/deps.ts";\nimport "$fresh/src/runtime/entrypoints/main.ts";\nimport "$fresh/src/runtime/entrypoints/deserializer.ts";\nimport "$fresh/src/runtime/entrypoints/signals.ts";' >> _docker_deps.ts

RUN deno cache --allow-import --frozen main.ts dev.ts _docker_deps.ts

ARG GIT_REVISION=1

ENV DECO_SITE_NAME=selfhostmgr

ENV DENO_DEPLOYMENT_ID=$GIT_REVISION

CMD ["run", "--cached-only", "-A", "--unstable-kv", "main.ts"]
```

Para deployar no fly.io...

`flyctl lauch`
## TODO (WIP)
6 changes: 4 additions & 2 deletions docs/self-host/site/pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: Arquitetura Self-host
since: 2.0
---

## TODO (WIP)

## Deployando seu site (Docker)

```dockerfile
Expand All @@ -29,7 +31,7 @@ RUN deno cache --allow-import --frozen main.ts dev.ts _docker_deps.ts

ARG GIT_REVISION=1

ENV DECO_SITE_NAME=selfhostmgr
ENV DECO_SITE_NAME=yoursitename

ENV DENO_DEPLOYMENT_ID=$GIT_REVISION

Expand All @@ -38,4 +40,4 @@ CMD ["run", "--cached-only", "-A", "--unstable-kv", "main.ts"]

Para deployar no fly.io...

`flyctl lauch`
`flyctl launch`
3 changes: 2 additions & 1 deletion islands/tuju/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export default function Form({
alert("Erro ao enviar. Por favor, envie o fomulário novamente");
}
} catch (error) {
console.log(error.message);
const errorObj = error as { message?: string };
console.log(errorObj.message ? errorObj.message : error);
alert("Erro inesperado. Por favor, envie o fomulário novamente");
}

Expand Down
3 changes: 1 addition & 2 deletions routes/api/calc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export const handler: Handlers<null, DecoState> = {
POST: async (req) => {
const formData = Object.fromEntries((await req.formData()).entries());
const recaptchaToken = formData["g-recaptcha-response"];
const isCaptchaValid = !!recaptchaToken ??
(await verifyCaptcha(recaptchaToken.toString()));
const isCaptchaValid = await verifyCaptcha(recaptchaToken.toString());
if (!ZAPIER_WEBHOOK || !isCaptchaValid) {
return new Response(null, {
headers: {
Expand Down
1 change: 0 additions & 1 deletion sections/Live Projects/LiveProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ function TemplatesGrid(props: Props) {
className="p-2 cursor-pointer w-full bg-[#000D0D] rounded-lg lg:hidden"
value={categoriaSelecionada}
onChange={(e) => {
// @ts-expect-error: e.target does not exists
const selectedValue = (e.target as HTMLSelectElement).value;
handleChangeCategoria(selectedValue);
}}
Expand Down

0 comments on commit ff519e2

Please sign in to comment.