FoalTS / foal

Full-featured Node.js framework, with no complexity. 🚀 Simple and easy to use, TypeScript-based and well-documented.
https://foalts.org/
MIT License
1.88k stars 137 forks source link

Include `@foal/cli` as dev dependency in the generated `package.json` #1097

Closed LoicPoullain closed 1 year ago

LoicPoullain commented 2 years ago

Issue

When deploying an application to a Cloud provider, the build often fails with the error foal not found because the CLI dependency is not found. When developing the app in local, it is installed as global dependency with npm install -g @foal/cli.

Solution

Include the CLI as project dev dependency when creating the app.

Files to update:

scho-to commented 1 year ago

Hi @LoicPoullain,

i would like to take this as my first ever github issue. In my Job i use gitlab and jira as ticket management.

I would like to improve my knowledge by taking this task.

However, I am not sure how to test this afterwards, as I dont have any cloud providers privately. I try to reproduce the issue in a local docker Container.

I also have some question: The issue says, that it "often fails". When does it not fail? So it should not fail, If the cli is installed either locally or globally.

LoicPoullain commented 1 year ago

Hi @scho-to 👋

Thank you for taking care of this issue.

You don't need to have a Cloud provider account or to set up a Docker container for this issue.

The only thing that you have to do is to update the package.json templates that are used to create a new application (i.e. when running the command foal createapp). These templates must include @foal/cli as devDependency.

For this, you need to:

To give more details on the issue, here's the problem that we often face:

scho-to commented 1 year ago

Hey @LoicPoullain ,

could you create a new branch for this issue? I have it fixed and tested on my local branch, I need a branch to commit the changes to :)

LoicPoullain commented 1 year ago

@scho-to did you create a fork of the repository? You will need it to be able to submit a PR. The branch will be created on your side in the fork.

https://docs.github.com/en/get-started/quickstart/fork-a-repo

scho-to commented 1 year ago

Hey @LoicPoullain ,

i created a pull request for this issue: https://github.com/FoalTS/foal/pull/1109

LoicPoullain commented 1 year ago

Feature added in v2.10.0. Thank you 👍