hasura / ndc-typescript-deno

Instant Hasura Native Data Connector by writing Typescript Functions
https://hasura.io
Apache License 2.0
22 stars 3 forks source link

Test Deno Deploy with `deployctl` #16

Open sordina opened 11 months ago

sordina commented 11 months ago

It would be very cool to be able to use Deno hosting to deploy connectors.

WARNING: This could lead to mutable connectors which connector create avoids.

https://docs.deno.com/deploy/manual

https://github.com/denoland/deployctl#deployctl

This may require a seperate entrypoint that uses a convention for the config, or some other trick:

> deno_deployctl deploy --help
deployctl deploy
Deploy a script with static files to Deno Deploy.

To deploy a local script:
  deployctl deploy --project=helloworld main.ts

To deploy a remote script:
  deployctl deploy --project=helloworld https://deno.com/examples/hello.js

To deploy a remote script without static files:
  deployctl deploy --project=helloworld --no-static https://deno.com/examples/hello.js

To ignore the node_modules directory while deploying:
  deployctl deploy --project=helloworld --exclude=node_modules main.tsx

USAGE:
    deployctl deploy [OPTIONS] <ENTRYPOINT>

OPTIONS:
        --exclude=<PATTERNS>  Exclude files that match this pattern
        --include=<PATTERNS>  Only upload files that match this pattern
        --import-map=<FILE>   Use import map file
    -h, --help                Prints help information
        --no-static           Don't include the files in the CWD as static files
        --prod                Create a production deployment (default is preview deployment)
    -p, --project=NAME        The project to deploy to
        --token=TOKEN         The API token to use (defaults to DENO_DEPLOY_TOKEN env var)
        --dry-run             Dry run the deployment process.
sordina commented 11 months ago

@BenoitRanque what do you think about this?

sordina commented 11 months ago

The functions should be able to be pulled in as static assets with the correct --include/--exclude flags.

My concern is that there's no config or env settings so ideally the user would configure with a wrapper script but our start method doesn't facilitate this. Maybe we can touch base about the recent SDK changes and how that could work with this workflow.