caprover / caprover-cli

Command Line Interface for https://github.com/caprover/caprover
72 stars 40 forks source link

Title: Issue with Constant.ts file not reflecting environment variable override in built Constants.js #142

Closed kmikodev closed 5 days ago

kmikodev commented 3 months ago

I've encountered an inconsistency when using the latest version of the CapRover library. Upon installation, the Constant.ts file within the utils directory contains the following line:

const ADMIN_DOMAIN = process.env.CAPROVER_ADMIN_DOMAIN_OVERRIDE || 'captain';

However, after installation, when inspecting the Constants.js file in the built/utils directory, the line appears as:

const ADMIN_DOMAIN = 'captain';

I've cloned the master branch and executed the compilation command, which seems to produce the correct output. Additionally, I've published a new version (caprover-fix) on npm for further testing.

This inconsistency appears to result in the environment variable override not being reflected in the built Constants.js file. Could you please investigate this issue? Let me know if you need any further information or assistance in resolving this matter. Thank you!

githubsaturn commented 3 months ago

Feel free to open the pull request to fix if you have the fix for this.

wildyaboku commented 5 days ago

@githubsaturn FYI there doesn't seem to be a PR-able "fix" for this. It looks more like an issue with your GitHub Action workflows or something. The built files don't match the source files in 2.3.0.

githubsaturn commented 5 days ago

there doesn't seem to be a PR-able "fix" for this

I'm not sure what this means. If it's not PR-able fix, then what fix should be implemented. Even Github Action workflows are part of the source code here: https://github.com/caprover/caprover-cli/blob/master/.github/workflows/build_push_docker_release.yml

So anything should be possible.

wildyaboku commented 5 days ago

Hi @githubsaturn, I looked more into the workflows. I don't see where the npm publish command is in this repo.

In short:

And yet, the source code published to NPM does not match what is built in either case.

Did you run npm publish manually on your end? Are you certain that it was using freshly built files? Because it really doesn't look that way.

Apologies for my former brevity.

githubsaturn commented 5 days ago

Ah that makes sense!

githubsaturn commented 5 days ago

I completely missed that the actions on github are for the Docker images. https://hub.docker.com/r/caprover/cli-caprover

githubsaturn commented 5 days ago

Just published 2.3.1 - can you please confirm if it's fixed?

wildyaboku commented 5 days ago

Yes, I can confirm it is working now, and the source code of the built file matches what is expected.

Thank you @githubsaturn!

githubsaturn commented 5 days ago

Thanks! I should definitely add npm publish to GitHub action!