fynpo-cli 3.2.3 → 3.3.1
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/README.md +19 -4
- package/docs/reference.md +48 -0
- package/package.json +7 -8
package/README.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url]
|
|
2
|
-
|
|
3
1
|
# fynpo-cli
|
|
4
2
|
|
|
3
|
+
[![License][license-image]][license-url]
|
|
4
|
+
[![build][build-image]][build-url]
|
|
5
|
+
|
|
6
|
+
[![Downloads][downloads-image]][downloads-url]
|
|
7
|
+
|
|
8
|
+
[![npm badge][npm-badge-png]][package-url]
|
|
9
|
+
|
|
10
|
+
- [Markdown reference](docs/reference.md) - the full CLI reference and runtime behavior in one file. Also ships in the package.
|
|
11
|
+
- [GitHub](https://github.com/jchip/fynjs/tree/main/packages/fynpo-cli)
|
|
12
|
+
|
|
5
13
|
The global launcher for the `fynpo` command.
|
|
6
14
|
|
|
7
15
|
Install this package globally and you get a `fynpo` binary. It carries no logic and no dependencies of its own - it finds the [fynpo] installed in the repo you're standing in and runs that, so every repo gets the fynpo version it declares rather than whichever one happens to be installed globally.
|
|
@@ -10,6 +18,8 @@ Install this package globally and you get a `fynpo` binary. It carries no logic
|
|
|
10
18
|
|
|
11
19
|
```bash
|
|
12
20
|
npm install -g fynpo-cli
|
|
21
|
+
# or
|
|
22
|
+
fyn global add fynpo-cli
|
|
13
23
|
```
|
|
14
24
|
|
|
15
25
|
Then, in a monorepo that has `fynpo` as a dev dependency:
|
|
@@ -25,7 +35,12 @@ If you'd rather not install anything globally, run the local one directly - `npx
|
|
|
25
35
|
Licensed under the [Apache License, Version 2.0](./LICENSE).
|
|
26
36
|
|
|
27
37
|
[fynpo]: https://github.com/jchip/fynjs/tree/main/packages/fynpo
|
|
28
|
-
|
|
29
|
-
[
|
|
38
|
+
|
|
39
|
+
[license-image]: https://img.shields.io/npm/l/fynpo-cli.svg
|
|
40
|
+
[license-url]: LICENSE
|
|
30
41
|
[build-image]: https://github.com/jchip/fynjs/actions/workflows/ci.yml/badge.svg
|
|
31
42
|
[build-url]: https://github.com/jchip/fynjs/actions/workflows/ci.yml
|
|
43
|
+
[downloads-image]: https://img.shields.io/npm/dm/fynpo-cli.svg
|
|
44
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=fynpo-cli
|
|
45
|
+
[npm-badge-png]: https://nodei.co/npm/fynpo-cli.png?downloads=true&stars=true
|
|
46
|
+
[package-url]: https://npmjs.com/package/fynpo-cli
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# fynpo-cli reference
|
|
2
|
+
|
|
3
|
+
fynpo-cli is a global launcher. It installs a `fynpo` command that finds the `fynpo` package installed in the current directory's monorepo and runs it in-process. It has no logic, no dependencies and no bundled copy of fynpo.
|
|
4
|
+
|
|
5
|
+
For commands, flags and config, see https://fynjs.pages.dev/ref/fynpo.md.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install -g fynpo-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- The package has no `main` or `exports`. It ships only the executable `dist/fynpo.js` (bin `fynpo`). There is no JS API.
|
|
14
|
+
- `package.json` sets `preferGlobal: true` and `dependencies: {}`.
|
|
15
|
+
- Requires Node `^22.22.2 || ^24.15.0 || >=26.0.0`. The bin uses top-level `await`, so it is ESM only.
|
|
16
|
+
- The target monorepo must have `fynpo` installed so that `fynpo/package.json` resolves from the current directory (normally a dev dependency at the repo top level).
|
|
17
|
+
|
|
18
|
+
## Relation to `fynpo`
|
|
19
|
+
|
|
20
|
+
- `fynpo` is the real tool. `fynpo-cli` only locates and starts it.
|
|
21
|
+
- Version selection: the launcher runs whichever `fynpo` version Node resolves from the current directory. The version of `fynpo-cli` does not matter. Different repos get the fynpo version they declare.
|
|
22
|
+
- There is no fallback to a global or bundled fynpo. If none resolves, it exits with an error.
|
|
23
|
+
- To skip this package, run the repo's local fynpo directly instead.
|
|
24
|
+
|
|
25
|
+
## How `fynpo` resolves and runs
|
|
26
|
+
|
|
27
|
+
1. Build a `require` rooted at `process.cwd()` (not at fynpo-cli's own location). Resolution follows normal Node lookup upward from the current directory, so it works from any subdirectory of the monorepo.
|
|
28
|
+
2. Resolve `fynpo/package.json`. If this throws for any reason, print the not-in-monorepo error and exit 1.
|
|
29
|
+
3. Read that package.json. The entry file is its `bin` field: the string if `bin` is a string, else `bin.fynpo`. If neither exists, default to `bin/fynpo.js`.
|
|
30
|
+
4. Join that path onto the directory of the resolved package.json.
|
|
31
|
+
5. Dynamic `import()` the file (as a `file://` URL). fynpo's bin runs its own main on load, so argv, stdout, stderr and the exit code are fynpo's own. The launcher has no argument handling or flags of its own, including `--help` and `--version`: they reach fynpo.
|
|
32
|
+
|
|
33
|
+
The launcher does not read fynpo's `dist/` layout. Only the `bin` field is relied on.
|
|
34
|
+
|
|
35
|
+
## Errors
|
|
36
|
+
|
|
37
|
+
Both errors go to stderr and exit with code 1.
|
|
38
|
+
|
|
39
|
+
| Condition | Message |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `fynpo/package.json` does not resolve from the current directory | `ERROR: Unable to find the fynpo module from dir <cwd>`, then guidance to be in a fynpo monorepo with fynpo installed at its top level. |
|
|
42
|
+
| Import fails with `ERR_MODULE_NOT_FOUND` and the error text contains the bin path (leading `./` removed) | The same not-in-monorepo message. |
|
|
43
|
+
| Any other import failure, including errors thrown while fynpo loads | `Fail to load fynpo for your monorepo from dir <cwd>`, then the error object. |
|
|
44
|
+
|
|
45
|
+
Notes:
|
|
46
|
+
|
|
47
|
+
- The `ERR_MODULE_NOT_FOUND` check is a substring match on the error text. A missing dependency inside fynpo normally lacks the bin path and gets the load-failure message.
|
|
48
|
+
- Errors fynpo handles itself after it starts are not the launcher's. They carry fynpo's own output and exit code.
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fynpo-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "npm install globally to provide the fynpo command",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"preferGlobal": true,
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://
|
|
10
|
+
"homepage": "https://fynjs.pages.dev/",
|
|
11
11
|
"bin": {
|
|
12
12
|
"fynpo": "dist/fynpo.js"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsc",
|
|
16
16
|
"prepublishOnly": "xrun build",
|
|
17
|
-
"docs": "typedoc --gitRevision $(git rev-list -1 HEAD src | cut -c1-8) --out docs src",
|
|
18
17
|
"ci:check": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json && vitest run",
|
|
19
18
|
"prepack": "publish-util-prepack",
|
|
20
19
|
"postpack": "publish-util-postpack",
|
|
21
20
|
"test": "vitest run"
|
|
22
21
|
},
|
|
23
22
|
"files": [
|
|
24
|
-
"dist"
|
|
23
|
+
"dist",
|
|
24
|
+
"docs/reference.md"
|
|
25
25
|
],
|
|
26
26
|
"keywords": [
|
|
27
27
|
"fyn",
|
|
@@ -42,18 +42,17 @@
|
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
45
|
-
"url": "https://github.com/jchip/fynjs.git",
|
|
45
|
+
"url": "git+https://github.com/jchip/fynjs.git",
|
|
46
46
|
"directory": "packages/fynpo-cli"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@fynjs/run": "^1.1.
|
|
50
|
+
"@fynjs/run": "^1.1.11",
|
|
51
51
|
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
|
52
52
|
"@types/node": "^26.4.1",
|
|
53
53
|
"prettier": "^3.5.3",
|
|
54
|
-
"publish-util": "^3.1.
|
|
54
|
+
"publish-util": "^3.1.8",
|
|
55
55
|
"source-map-support": "^0.5.19",
|
|
56
|
-
"typedoc": "^0.28.14",
|
|
57
56
|
"typescript": "^7.0.2",
|
|
58
57
|
"vite": "^8.2.2",
|
|
59
58
|
"vitest": "^5.0.0"
|