Skip to content

tech: enable watch mode & esbuild server in dev mode#674

Draft
ErwanRaulo wants to merge 1 commit intoNodeSecure:masterfrom
ErwanRaulo:watch-mode
Draft

tech: enable watch mode & esbuild server in dev mode#674
ErwanRaulo wants to merge 1 commit intoNodeSecure:masterfrom
ErwanRaulo:watch-mode

Conversation

@ErwanRaulo
Copy link
Contributor

@ErwanRaulo ErwanRaulo commented Mar 10, 2026

what it does

esbuild config to watch and serve fle for auto reload on served files changes.

features

  • build, watch, serve and opens web app using an nsecure result existing file.
    or
  • build, watch, serve and opens web app but nsecure command should be ran to open the esbuild server with generated result file.

commands tested : nsecure auto

to validate:

  • 2 esbuild config VS 1 file with process arg (-dev) ? Or use base config ?

to fix:

  • [ x] searchbar not visible when opening the server ip address after payload extraction.

@socket-security
Copy link

socket-security bot commented Mar 10, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​server-destroy@​1.0.4921006680100
Added@​types/​ws@​8.18.11001007481100
Addedchokidar@​5.0.010010010081100
Updatedmarkdown-it@​13.0.2 ⏵ 14.1.186 -11100 +2100 +183100
Addedhighlight.js@​11.11.19610010084100
Addedvis-data@​8.0.3931008587100
Addedvis-network@​10.0.210010010088100
Addedfind-my-way@​9.4.09910010088100

View full report

@clemgbld clemgbld requested review from PierreDemailly and fraxken and removed request for fraxken March 11, 2026 09:22
@fraxken
Copy link
Member

fraxken commented Mar 11, 2026

Not a big fan of duplicating code (http etc)

Comment on lines -66 to +57
httpServer.listen(httpPort, async() => {
const link = `http://localhost:${httpServer.address().port}`;
console.log(kleur.magenta().bold(await i18n.getToken("cli.http_server_started")), kleur.cyan().bold(link));

open(link);
});
if (enableDeveloperMode) {
// todo: ping/warn if dev server is not up & running
open("http://127.0.0.1:8080");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm there is something wrong with how the code is modified here. Before we had a clean open but now only one simple open when enabledDeveloperMode is true?

Copy link
Contributor Author

@ErwanRaulo ErwanRaulo Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, not really what i wanted to do, it miss the translation for dev mode, keeping the clean open in place.

watch esbuild config file now it opens the link like this with current nsecure result.
so maybe we should tell something in scenarios like:

  • "dev server not running ?"
  • " dev server listening on ...."

@ErwanRaulo
Copy link
Contributor Author

Not a big fan of duplicating code (http etc)

i ended up removing duplication.

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.

2 participants