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(lagon): write Lagon config on build #996

Merged
merged 2 commits into from
Feb 28, 2023

Conversation

QuiiBz
Copy link
Contributor

@QuiiBz QuiiBz commented Feb 25, 2023

πŸ”— Linked issue

#966

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Since @lagon/cli@0.5.0, Lagon supports configuration files (https://github.com/lagonapp/lagon/releases/tag/%40lagon%2Fcli%400.5.0)

This PR outputs Lagon's configuration file when the build is complete. It's written inside ${output.dir}/.lagon/config.json (e.g .output/.lagon/config.json) and allows to start the dev server / deploy the function without specifying the function's entry point (server/index.mjs) and the public directory (public) manually.

Notes:

  • Fields are written in snake_case
  • All paths are relative to the parent of the .lagon folder
  • function_id & organization_id fields are empty, they are used to detect if the function has been deployed or not
  • client field is a path to a client-side JS script that can be bundled and injected into the assets, but is useless for Nitro.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Feb 25, 2023

Codecov Report

Merging #996 (0d27b76) into main (d83f2b6) will decrease coverage by 0.10%.
The diff coverage is 39.39%.

@@            Coverage Diff             @@
##             main     #996      +/-   ##
==========================================
- Coverage   67.79%   67.70%   -0.10%     
==========================================
  Files          60       60              
  Lines        6133     6162      +29     
  Branches      692      694       +2     
==========================================
+ Hits         4158     4172      +14     
- Misses       1966     1981      +15     
  Partials        9        9              
Impacted Files Coverage Ξ”
src/presets/lagon.ts 35.71% <39.39%> (+4.76%) ⬆️
src/rollup/plugins/esbuild.ts 54.41% <0.00%> (+1.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0 pi0 mentioned this pull request Feb 27, 2023
4 tasks
@pi0
Copy link
Member

pi0 commented Feb 28, 2023

Thanks for the pull request. I have added some basic types for config.

BTW even though the .lagon/config.json is generated, I get a warning like this: (CLI version 0.5.2)

image

Will try to compile CLI locally and debug later.

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

2 participants