fyn 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 +70 -31
- package/dist/fs-worker.mjs +5477 -0
- package/dist/fyn.mjs +1745 -502
- package/docs/reference.md +680 -0
- package/package.json +11 -8
package/README.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# fyn
|
|
2
2
|
|
|
3
|
-
[![
|
|
4
|
-
[![
|
|
5
|
-
|
|
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/fyn)
|
|
6
12
|
|
|
7
13
|
**fyn** is a fast package manager for Node.js. It treats your disk as a registry, so you can develop and test packages using local copies. It uses hardlinks and a shared store to save disk space and speed up installs. It can link live source folders between packages, so changes show up right away. It reads your existing `.npmrc` and lockfiles, and it powers [fynpo], a zero-setup monorepo tool.
|
|
8
14
|
|
|
@@ -16,6 +22,12 @@ cd <your-project>
|
|
|
16
22
|
fyn
|
|
17
23
|
```
|
|
18
24
|
|
|
25
|
+
Once fyn is installed, it can manage its own global install:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
fyn global add fyn
|
|
29
|
+
```
|
|
30
|
+
|
|
19
31
|
On an existing install, fyn checks file modification times before reinstalling. This scan
|
|
20
32
|
prunes directories and files matched by repository and nested `.gitignore` rules, alongside
|
|
21
33
|
its built-in exclusions. The rules apply even to tracked source files; manifests, lockfiles,
|
|
@@ -45,6 +57,16 @@ fyn outdated lodash --json
|
|
|
45
57
|
and the registry's `latest` tag. Local, Git, and URL dependencies are not compared. Pass
|
|
46
58
|
`--refresh-meta` to bypass fresh registry metadata caches.
|
|
47
59
|
|
|
60
|
+
To move locked versions to the newest their declared ranges allow:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
fyn update
|
|
64
|
+
fyn update lodash
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
With no names, `update` ignores every lock pin. With names, it updates those packages and their
|
|
68
|
+
dependencies and keeps the rest pinned. It never edits `package.json`.
|
|
69
|
+
|
|
48
70
|
- It can read and use some settings from your `.npmrc`.
|
|
49
71
|
- It can use `npm-shrinkwrap.json` or `package-lock.json` files.
|
|
50
72
|
|
|
@@ -56,29 +78,23 @@ fyn options can be listed in help:
|
|
|
56
78
|
fyn --help
|
|
57
79
|
```
|
|
58
80
|
|
|
59
|
-
fyn loads config from
|
|
81
|
+
fyn loads config from up to 9 rc files. Later files override earlier ones, so this list goes from lowest to highest priority:
|
|
60
82
|
|
|
61
|
-
|
|
83
|
+
1. `$NPM_CONFIG_GLOBALCONFIG`
|
|
84
|
+
2. `$PREFIX/etc/npmrc`
|
|
85
|
+
3. `$NPM_CONFIG_USERCONFIG`
|
|
86
|
+
4. `~/.npmrc`
|
|
87
|
+
5. `~/.fynrc`
|
|
88
|
+
6. `<fynpo dir>/.npmrc` (in a fynpo monorepo, when CWD is not the fynpo dir)
|
|
89
|
+
7. `<fynpo dir>/.fynrc` (same as above)
|
|
90
|
+
8. `CWD/.npmrc`
|
|
91
|
+
9. `CWD/.fynrc`
|
|
62
92
|
|
|
63
|
-
|
|
93
|
+
fyn merges every key from every rc file into its options, including `.npmrc` files.
|
|
64
94
|
|
|
65
|
-
|
|
95
|
+
Every rc file is parsed as [ini]. YAML is not supported.
|
|
66
96
|
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
registry: https://registry.npmjs.org
|
|
70
|
-
"@scope:registry": https://registry.custom.com
|
|
71
|
-
offline: false
|
|
72
|
-
forceCache: false
|
|
73
|
-
lockOnly: false
|
|
74
|
-
progress: normal
|
|
75
|
-
logLevel: info
|
|
76
|
-
production: false
|
|
77
|
-
centralStore: false
|
|
78
|
-
hardlink: true
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Or as an ini:
|
|
97
|
+
Below is an ini example, with the options set to their default values:
|
|
82
98
|
|
|
83
99
|
```ini
|
|
84
100
|
registry=https://registry.npmjs.org
|
|
@@ -89,10 +105,29 @@ lockOnly=false
|
|
|
89
105
|
progress=normal
|
|
90
106
|
logLevel=info
|
|
91
107
|
production=false
|
|
92
|
-
centralStore=false
|
|
93
108
|
hardlink=true
|
|
94
109
|
```
|
|
95
110
|
|
|
111
|
+
`centralStore` has no fixed default. When it is unset in a non-fynpo project, fyn turns it on for macOS when @fynjs/reflink can clone dirs, and for Linux when it can hardlink or clone. It stays off on other platforms. A fynpo monorepo uses its own central store. Set `centralStore=false` to keep it off in a non-fynpo project.
|
|
112
|
+
|
|
113
|
+
### `.fynrc` sections
|
|
114
|
+
|
|
115
|
+
A `.fynrc` file can have sections that apply only in some environments. Top level keys are the defaults, and a matching section overrides them.
|
|
116
|
+
|
|
117
|
+
- `[IS_CI]` matches when the `CI` or `BUILD_ENV` env var is set.
|
|
118
|
+
- `[CI:value]` matches when `CI` equals `value`. If `CI` is unset, `BUILD_ENV` is checked instead.
|
|
119
|
+
- `[VAR:value]` matches when env var `VAR` equals `value`.
|
|
120
|
+
- `[A|B:value]` matches when `A` or `B` equals `value`.
|
|
121
|
+
|
|
122
|
+
When several sections match, `[CI:value]` wins over `[IS_CI]`, and `[IS_CI]` wins over `[VAR:value]`.
|
|
123
|
+
|
|
124
|
+
```ini
|
|
125
|
+
progress=normal
|
|
126
|
+
|
|
127
|
+
[IS_CI]
|
|
128
|
+
progress=none
|
|
129
|
+
```
|
|
130
|
+
|
|
96
131
|
### Local source exports (`fyn.localExports`)
|
|
97
132
|
|
|
98
133
|
A package can expose local development directories by declaring them in its
|
|
@@ -464,8 +499,9 @@ or per-invocation on the command line:
|
|
|
464
499
|
fyn install --no-enforce-registry-deps
|
|
465
500
|
```
|
|
466
501
|
|
|
467
|
-
|
|
468
|
-
|
|
502
|
+
Any explicitly set option takes precedence over the `package.json` setting. That
|
|
503
|
+
covers the CLI flag, an `enforceRegistryDeps` key in an rc file, and fynpo's
|
|
504
|
+
`fyn.options`. The `package.json` setting takes precedence over the default (on).
|
|
469
505
|
|
|
470
506
|
This is independent of the lifecycle-script controls above: `allowScripts` /
|
|
471
507
|
`allowTopLevelScripts` decide whether *scripts run*, while `enforceRegistryDeps`
|
|
@@ -498,12 +534,6 @@ Licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses
|
|
|
498
534
|
[ini]: https://www.npmjs.com/package/ini
|
|
499
535
|
[node_preserve_symlinks]: https://nodejs.org/docs/latest-v8.x/api/cli.html#cli_node_preserve_symlinks_1
|
|
500
536
|
[require-at]: https://www.npmjs.com/package/require-at
|
|
501
|
-
[build-image]: https://github.com/jchip/fynjs/actions/workflows/ci.yml/badge.svg
|
|
502
|
-
[build-url]: https://github.com/jchip/fynjs/actions/workflows/ci.yml
|
|
503
|
-
[npm-image]: https://badge.fury.io/js/fyn.svg
|
|
504
|
-
[npm-url]: https://npmjs.org/package/fyn
|
|
505
|
-
[apache-2.0-blue-image]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
|
|
506
|
-
[apache-2.0-url]: https://www.apache.org/licenses/LICENSE-2.0
|
|
507
537
|
[npm scripts]: https://docs.npmjs.com/misc/scripts
|
|
508
538
|
[node-tar]: https://www.npmjs.com/package/tar
|
|
509
539
|
[semver]: https://www.npmjs.com/package/semver
|
|
@@ -517,3 +547,12 @@ Licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses
|
|
|
517
547
|
[npm link]: https://docs.npmjs.com/cli/link.html
|
|
518
548
|
[@npmcli/run-script]: https://www.npmjs.com/package/@npmcli/run-script
|
|
519
549
|
[npmlog]: https://www.npmjs.com/package/npmlog
|
|
550
|
+
|
|
551
|
+
[license-image]: https://img.shields.io/npm/l/fyn.svg
|
|
552
|
+
[license-url]: LICENSE
|
|
553
|
+
[build-image]: https://github.com/jchip/fynjs/actions/workflows/ci.yml/badge.svg
|
|
554
|
+
[build-url]: https://github.com/jchip/fynjs/actions/workflows/ci.yml
|
|
555
|
+
[downloads-image]: https://img.shields.io/npm/dm/fyn.svg
|
|
556
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=fyn
|
|
557
|
+
[npm-badge-png]: https://nodei.co/npm/fyn.png?downloads=true&stars=true
|
|
558
|
+
[package-url]: https://npmjs.com/package/fyn
|