Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: leafwatch worker #2963

Merged
merged 3 commits into from
May 28, 2023
Merged

feat: leafwatch worker #2963

merged 3 commits into from
May 28, 2023

Conversation

bigint
Copy link
Member

@bigint bigint commented May 28, 2023

What does this PR do?

🤖 Generated by Copilot at 63285c1

This pull request adds a new package for the leafwatch worker, which is a Cloudflare Worker that interacts with a PostgreSQL database. The package contains the TypeScript code, configuration files, and documentation for the worker. The worker has two handlers: one for creating the database table for events, and one for ingesting events from the web application. The worker uses the pg, itty-router, and @cloudflare/workers-types modules, and the wrangler tool. The pull request also updates the pnpm-lock.yaml file with the new dependencies.

Related issues

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking small changes to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Explanation of the changes

🤖 Generated by Copilot at 63285c1

  • Add a leafwatch worker package that handles requests to ingest events from the web application and create tables in the PostgreSQL database (link-link)
  • Create a package.json file that specifies the package metadata and dependencies (link)
  • Create a wrangler.toml file that configures the wrangler tool for deploying and developing the worker (link)
  • Create a .eslintrc.js file that configures the linting rules for the TypeScript code (link)
  • Create a tsconfig.json file that configures the TypeScript compiler for the worker (link)
  • Create a README.md file that provides a brief title for the package (link)
  • Create a .dev.vars.example file that stores the database URL and the secret key for the worker (link)
  • Create a src folder that contains the source code for the worker (link-link)
    • Create an index.ts file that exports the main fetch function that handles the incoming requests to the worker (link)
    • Create a types.ts file that exports the interface for the environment variables for the worker (link)
    • Create a handlers folder that contains the handlers for the different routes of the worker (link-link)
      • Create a createTables.ts file that exports the handler for the /createTables route that initializes the database schema (link)
      • Create an ingest.ts file that exports the handler for the /ingest route that inserts events into the database (link)
    • Create a helpers folder that contains the helper function for validating the request body (link)
      • Create a keysValidator.ts file that exports the function that checks the required keys in the request body (link)
  • Update the pnpm-lock.yaml file to lock the dependency tree for the monorepo and add the dependencies for the leafwatch worker package (link,link,link,link,link,link,link)
    • Add a section for the leafwatch worker package that lists its dependencies and devDependencies (link)
    • Add sections for the @types/pg, buffer-writer, obuf, packet-reader, pg-cloudflare, postgres-array, postgres-bytea, postgres-date, postgres-interval, and postgres-range packages that list their resolutions, dependencies, and flags (link,link,link,link,link,link)

Emoji

🚀🌿🗄️

@vercel
Copy link

vercel bot commented May 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
prerender ✅ Ready (Inspect) Visit Preview May 28, 2023 8:43am
1 Ignored Deployment
Name Status Preview Updated (UTC)
web ⬜️ Ignored (Inspect) Visit Preview May 28, 2023 8:43am

@vercel vercel bot temporarily deployed to Preview – prerender May 28, 2023 08:43 Inactive
@bigint bigint merged commit 21d9ef7 into main May 28, 2023
@bigint bigint deleted the leafwatch branch May 28, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant