deployctl icon indicating copy to clipboard operation
deployctl copied to clipboard

feat(action): auto-discovery of deno.json and auto-populate defaults

Open lowlighter opened this issue 11 months ago • 1 comments

Closes #350

PS: the diff is not that huge, most of the changed files are due to the addition of a jsonc parser package in the node_module directory

Features:

  • Add a new option deno-config
    • Auto-discovery of deno.json/deno.jsonc from the root file
  • If the deno config file exists, then
    • project defaults to "deploy.project"
    • entrypoint defaults to "deploy.entrypoint"
    • exclude defaults to "deploy.exclude"
    • include defaults to "deploy.include"
    • import-map defaults to "importMap"
      • If it contains a "import" field, it is saved as JSON to import-map-autogen-temp, allowing use of JSONC deno config file since using them directly in import-map would cause parsing issues if there is comments

Changes:

  • Added jsonc as dependency
  • Modified the workflow to have the test project as variable so it's easier for contributor to test their code
  • Updated docs about the new deno-config feature
  • Added a new test case to cover this new feature

Side note: since the deno config is discovered it allows for a really clean workflow, and also if user test their deployment from the CLI version (which populates the "deploy" section of deno config) then they'll have the same "experience" on the GA version.

It may or may not be considered a breaking change, since the config file was totally ignored before, so it could change they way if work if inputs were explicit

    steps:
      - name: Clone repository
        uses: actions/checkout@v4
      # ...
      - name: Deploy to Deno Deploy
        uses: denoland/deployctl@v1

lowlighter avatar Dec 19 '24 01:12 lowlighter

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 19 '24 01:12 CLAassistant