@danhachuel/jobfinder 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ All notable changes to JobFinder are documented in this file.
6
6
 
7
7
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
8
8
 
9
+ ## [0.1.18] — 2026-11-25
10
+
11
+ ### Fixed
12
+
13
+ - **UI não servida no modo daemon (`{"error":{"code":"internal_error","message":"Not Found"}}` na raiz)**: o fallback SPA usava `res.sendFile(caminhoAbsoluto)` — no **Express 5** um caminho absoluto sem a opção `root` falha com 404 "Not Found", que chegava ao handler central e era devolvido como JSON. Os assets (servidos pelo `express.static`) funcionavam, o que mascara o diagnóstico. Agora o fallback usa a forma canônica `res.sendFile('index.html', { root: UI_DIST })` — `/`, `/login`, `/configuracoes` e qualquer rota do React Router voltaram a servir o `index.html` (HTTP 200, `text/html`).
14
+ - `src/ui/dist/` já estava no `files` do `package.json` e o `setupRuntime()` já copiava o dist para `~/.jobfinder/runtime/src/ui/dist` — a cópia não era a causa; o bug era exclusivamente do `sendFile` no Express 5.
15
+
9
16
  ## [0.1.17] — 2026-11-23
10
17
 
11
18
  ### Added
package/README.md CHANGED
@@ -109,6 +109,12 @@ npx --yes @danhachuel/jobfinder@0.1.17 --port 4050 # porta customizada
109
109
  npx --yes @danhachuel/jobfinder@0.1.17 stop # encerra
110
110
  ```
111
111
 
112
+ > **Dica (Windows/npx):** se você já rodou uma versão antiga antes, use
113
+ > `npx --yes --prefer-online @danhachuel/jobfinder@latest`. Sem o
114
+ > `--prefer-online` o npx pode reaproveitar um bucket de cache antigo (com uma
115
+ > versão defasada do CLI) em vez de baixar a latest. Instalação global
116
+ > (`npm install -g @danhachuel/jobfinder@latest`) não tem esse problema.
117
+
112
118
  Saída típica:
113
119
 
114
120
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/jobfinder",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "JobFinder — LinkedIn automation platform (posts, connections/DMs, job matching) with a React + Vite UI. Intelligent workflows, JSON storage.",
5
5
  "keywords": [
6
6
  "linkedin",
@@ -52,9 +52,12 @@ export function createApp({ store, logger, config, rateLimiter, dataDir }) {
52
52
  if (fs.existsSync(UI_DIST)) {
53
53
  app.use(express.static(UI_DIST, { index: false, maxAge: '1h' }));
54
54
  // SPA fallback: any other GET serves index.html.
55
+ // Express 5 EXIGE a opção `root`: um caminho absoluto "puro" falha com
56
+ // 404 "Not Found" — foi a regressão que devolvia JSON na raiz da URL
57
+ // enquanto os assets (servidos pelo static) funcionavam.
55
58
  app.use((req, res, next) => {
56
59
  if (req.method !== 'GET') return next();
57
- res.sendFile(`${UI_DIST}/index.html`);
60
+ res.sendFile('index.html', { root: UI_DIST });
58
61
  });
59
62
  } else {
60
63
  app.get('/', (req, res) => {