funoteka 0.1.3 → 0.1.4
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 +15 -0
- package/DEPLOY.md +2 -2
- package/dist/api/envelope.js +1 -1
- package/dist/cli/daemon.js +4 -2
- package/dist/cli/entry.js +26 -5
- package/dist/cli.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,21 @@ The version lives in exactly one place — `package.json`.
|
|
|
9
9
|
|
|
10
10
|
_(nothing yet)_
|
|
11
11
|
|
|
12
|
+
## [0.1.4] — 2026-09-17
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **The scan started from the server starts again.** `src/cli.ts` called
|
|
17
|
+
`entryPoint('./cli')` and the helper's default base was `import.meta.url`
|
|
18
|
+
evaluated *inside the helper* — so `./cli` resolved against `src/cli/`, not the
|
|
19
|
+
caller, and the scan child died with `Cannot find module '.../src/cli/cli.ts'`.
|
|
20
|
+
That killed every server-side entry to a scan: `POST /scan`, the MCP
|
|
21
|
+
`funoteka_scan_start` tool, the interval timer and the reader-change trigger.
|
|
22
|
+
The CLI scan kept working, which is why a broken published build read as a
|
|
23
|
+
deployment problem. The base is now a **required** argument to `entryPoint`
|
|
24
|
+
(forgetting it is a `TS2554`, and a path that does not exist throws), both call
|
|
25
|
+
sites name it, and the seam has tests over the exact pair the call sites use.
|
|
26
|
+
|
|
12
27
|
## [0.1.3] — 2026-09-17
|
|
13
28
|
|
|
14
29
|
### Changed
|
package/DEPLOY.md
CHANGED
|
@@ -61,7 +61,7 @@ node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"
|
|
|
61
61
|
## 3. Path A — Docker (main path)
|
|
62
62
|
|
|
63
63
|
Works the same on a laptop, a NAS and a VDS. There is a **published image** —
|
|
64
|
-
`ghcr.io/kzntsv-dev/funoteka:0.1.
|
|
64
|
+
`ghcr.io/kzntsv-dev/funoteka:0.1.4`, `linux/amd64` and `linux/arm64` in one
|
|
65
65
|
manifest — and `build: .` still builds on the machine that runs it (that is the
|
|
66
66
|
path where a published image is not wanted or not reachable).
|
|
67
67
|
|
|
@@ -75,7 +75,7 @@ docker run -d --name funoteka -p 4533:4533 -p 4534:4534 \
|
|
|
75
75
|
-e FUNOTEKA_ADMIN_TOKEN=PASTE_THE_TOKEN_YOU_GENERATED \
|
|
76
76
|
-e FUNOTEKA_SUPERVISED=1 -e FUNOTEKA_LOG_FILE=/data/funoteka.log \
|
|
77
77
|
-v "$MUSIC":/music:ro -v funoteka-data:/data \
|
|
78
|
-
--restart unless-stopped ghcr.io/kzntsv-dev/funoteka:0.1.
|
|
78
|
+
--restart unless-stopped ghcr.io/kzntsv-dev/funoteka:0.1.4
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
(The token above is a placeholder with no angle brackets in it, on purpose: a
|
package/dist/api/envelope.js
CHANGED
|
@@ -30,7 +30,7 @@ export const API_VERSION = '1.16.1';
|
|
|
30
30
|
* module every route depends on.
|
|
31
31
|
*/
|
|
32
32
|
export const SERVER_TYPE = 'funoteka';
|
|
33
|
-
export const SERVER_VERSION = '0.1.
|
|
33
|
+
export const SERVER_VERSION = '0.1.4';
|
|
34
34
|
/**
|
|
35
35
|
* The fields every answer carries, whatever the answer is.
|
|
36
36
|
*
|
package/dist/cli/daemon.js
CHANGED
|
@@ -101,8 +101,10 @@ export async function start(dbPath, argv, timeoutMs = 15_000) {
|
|
|
101
101
|
const log = openSync(logPath(dbPath), 'a');
|
|
102
102
|
const child = spawn(process.execPath,
|
|
103
103
|
// The entry point as *this* build spells it — `.ts` beside the sources, `.js`
|
|
104
|
-
// in the compiled build the npm package ships (see `cli/entry.ts`).
|
|
105
|
-
|
|
104
|
+
// in the compiled build the npm package ships (see `cli/entry.ts`). The base
|
|
105
|
+
// is this module's own URL, because the relative name is counted from the
|
|
106
|
+
// file that spawns (`issue:91`).
|
|
107
|
+
[entryPoint('../cli', import.meta.url), 'serve', ...argv], {
|
|
106
108
|
detached: true,
|
|
107
109
|
// Nothing on stdin: a daemon that could read a terminal would be waiting
|
|
108
110
|
// on a prompt nobody is there to answer.
|
package/dist/cli/entry.js
CHANGED
|
@@ -13,13 +13,34 @@ import { fileURLToPath } from 'node:url';
|
|
|
13
13
|
*
|
|
14
14
|
* Asking the filesystem instead of inferring the answer from the caller's own
|
|
15
15
|
* extension makes it checkable rather than assumed: the emitted file is preferred
|
|
16
|
-
* because a tree that has one is a built tree, the source is the fallback
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* because a tree that has one is a built tree, the source is the fallback.
|
|
17
|
+
*
|
|
18
|
+
* ## The base is the caller's, and it is a parameter rather than a default
|
|
19
|
+
*
|
|
20
|
+
* `from` has **no default on purpose.** It had one — `import.meta.url`, which
|
|
21
|
+
* reads as "here" and is evaluated *in this file*: so a caller writing
|
|
22
|
+
* `entryPoint('./cli')` from `src/cli.ts` was asking for a sibling of
|
|
23
|
+
* `src/cli/entry.ts`, and got `src/cli/cli.ts`, which does not exist. The server
|
|
24
|
+
* answered `202` to `POST /scan`, the child died on `MODULE_NOT_FOUND`, and the
|
|
25
|
+
* only trace was in the child's stderr — `issue:91`, and it reached a released
|
|
26
|
+
* image because nothing in the suite ran the command the scanner builds. A
|
|
27
|
+
* required parameter turns that from a silent wrong path into a compile error at
|
|
28
|
+
* the next call site, which is the version of this that cannot happen again.
|
|
29
|
+
*
|
|
30
|
+
* ## And a path that is not there is a throw, not a guess
|
|
31
|
+
*
|
|
32
|
+
* The first version returned the `.ts` spelling whether or not it existed, so a
|
|
33
|
+
* wrong base travelled out of here as a plausible-looking string and failed
|
|
34
|
+
* somewhere else entirely. Now the search either finds a file or says so.
|
|
19
35
|
*/
|
|
20
|
-
export function entryPoint(relative, from
|
|
36
|
+
export function entryPoint(relative, from) {
|
|
21
37
|
const emitted = fileURLToPath(new URL(`${relative}.js`, from));
|
|
22
38
|
if (existsSync(emitted))
|
|
23
39
|
return emitted;
|
|
24
|
-
|
|
40
|
+
const source = fileURLToPath(new URL(`${relative}.ts`, from));
|
|
41
|
+
if (existsSync(source))
|
|
42
|
+
return source;
|
|
43
|
+
throw new Error(`no entry point beside ${fileURLToPath(from)}: neither ${emitted} nor ${source} exists. ` +
|
|
44
|
+
`A relative name is resolved against the base the caller passes, so a base that is not ` +
|
|
45
|
+
`the calling module's own URL looks in the wrong directory.`);
|
|
25
46
|
}
|
package/dist/cli.js
CHANGED
|
@@ -494,7 +494,10 @@ function listen(db, config, admin, scan, stopLog) {
|
|
|
494
494
|
args: [
|
|
495
495
|
// The entry point as *this* build spells it — `.ts` beside the sources,
|
|
496
496
|
// `.js` in the compiled build the npm package ships (see `cli/entry.ts`).
|
|
497
|
-
|
|
497
|
+
// `import.meta.url` is this module's, and it has to be passed: the name is
|
|
498
|
+
// relative to the file that *spawns*, not to the helper that resolves it
|
|
499
|
+
// (`issue:91`).
|
|
500
|
+
entryPoint('./cli', import.meta.url),
|
|
498
501
|
'scan',
|
|
499
502
|
...listRoots(db).map((one) => one.path),
|
|
500
503
|
'--db',
|