void 0.10.8 → 0.10.11
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/AGENT_PROMPT.md +4 -0
- package/README.md +1 -1
- package/dist/{agents-Bmr5tFFb.mjs → agents-CtgBYqld.mjs} +1 -1
- package/dist/{auth-cmd-DlgNwByu.mjs → auth-cmd-BqsdZJp5.mjs} +3 -3
- package/dist/{better-auth-shared-BvnM9px6.d.mts → better-auth-shared-DealXecJ.d.mts} +1 -1
- package/dist/{build-cmd-Br8qL0rA.mjs → build-cmd-Bujrv5q-.mjs} +3 -3
- package/dist/{cache-wH-mP8UE.mjs → cache-C11V8Fxq.mjs} +3 -3
- package/dist/{cancel-deploy-BEBOEgtu.mjs → cancel-deploy-fwFYF04b.mjs} +2 -2
- package/dist/cli/cli.mjs +175 -43
- package/dist/cli/env-schema-probe.d.mts +96 -0
- package/dist/cli/env-schema-probe.mjs +272 -0
- package/dist/{client-Cj96iiBH.mjs → client-Gb71-XkG.mjs} +20 -2
- package/dist/{config-BdUctCZD.mjs → config-CutEMNGJ.mjs} +3 -3
- package/dist/{config-1twldYCW.mjs → config-E03l1C_h.mjs} +8 -2
- package/dist/{create-project-DD9n8Ho-.mjs → create-project-DsYvl3TB.mjs} +3 -3
- package/dist/{db-DjKE2-A-.mjs → db-PZBsLSGb.mjs} +27 -27
- package/dist/{delete-D2kr3Kmk.mjs → delete-mh6p-zkQ.mjs} +3 -3
- package/dist/deploy-DT8wsPZd.mjs +6990 -0
- package/dist/{discover-BuVVSAum.mjs → discover-CJHyvYfR.mjs} +2 -2
- package/dist/dist-DaKKDf8D.mjs +41 -0
- package/dist/{domain-_luIsM_B.mjs → domain-DiaNQbrl.mjs} +2 -2
- package/dist/entry-D7yy4xVH.mjs +100 -0
- package/dist/{env-CO5XAS9t.mjs → env-AAHU02L6.mjs} +5 -5
- package/dist/env-mask-Dd47NbR6.mjs +90 -0
- package/dist/env-public-BfiLcMBk.d.mts +140 -0
- package/dist/env-raw-Cx8ElDdj.mjs +58 -0
- package/dist/{env-types-D51bnR-c.mjs → env-types-QBj-ndax.mjs} +2 -2
- package/dist/env-validation-BdDlGhbN.mjs +1069 -0
- package/dist/{gen-Cf79J4aw.mjs → gen-oup1xBN0.mjs} +8 -8
- package/dist/{github-cmd-B6OX9c7d.mjs → github-cmd-BdNaOVNa.mjs} +102 -3
- package/dist/{handler-imD0UVDT.d.mts → handler-Cjh8uM3Y.d.mts} +1 -1
- package/dist/{headers-BwvFGhkx.mjs → headers-BQknpzkn.mjs} +2 -2
- package/dist/index.d.mts +14 -2
- package/dist/index.mjs +102 -55
- package/dist/{init-KirOzVDs.mjs → init-Dl2PKuQn.mjs} +13 -14
- package/dist/{link-CUmiosyb.mjs → link-CdGHSIy-.mjs} +4 -4
- package/dist/{list-3GEw7b6m.mjs → list-CPwFDZ_c.mjs} +3 -3
- package/dist/{login-DJReaT_Q.mjs → login-BT3H8PN3.mjs} +2 -2
- package/dist/{logs-D-rQ56Lq.mjs → logs-Bt313ax7.mjs} +3 -2
- package/dist/{mcp-D7yc0dXY.mjs → mcp-DoM3_nhd.mjs} +7 -2
- package/dist/{node-yFFk626c.mjs → node-BDx8pmhq.mjs} +5 -5
- package/dist/{package-json-B0NuUWGd.mjs → package-json-Cx1osYo6.mjs} +1 -1
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/index.d.mts +1 -23
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.mjs +2 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{plugin-inference-CJxi_fWI.mjs → plugin-inference-DMeavIJ6.mjs} +4 -98
- package/dist/{prepare-C_cVurhP.mjs → prepare-DOBTY0o4.mjs} +10 -10
- package/dist/preset-BGrvB4Bl.mjs +539 -0
- package/dist/{project-cmd-DnU7u9QF.mjs → project-cmd-D_w-4w5B.mjs} +13 -9
- package/dist/{project-paths-tpdR1mJR.mjs → project-paths-BQd7OmIo.mjs} +1 -1
- package/dist/project-paths-GpziKeQQ.d.mts +25 -0
- package/dist/{project-tsconfig-D9uSVVpA.mjs → project-tsconfig-B-QtXjLQ.mjs} +2 -2
- package/dist/{protocol-6hTJ04T1.d.mts → protocol-Bnb0LFp3.d.mts} +1 -1
- package/dist/provision-BLrCEBbI.mjs +2557 -0
- package/dist/requests-B8sZxaFM.mjs +50 -0
- package/dist/{resolve-project-D2HI3TrG.mjs → resolve-project-BBMtLLV9.mjs} +1 -1
- package/dist/{rollback-Yh7bCKob.mjs → rollback-CkvTFXx5.mjs} +2 -2
- package/dist/{route-types-CfKfhbIg.mjs → route-types-COI2DsZv.mjs} +2 -2
- package/dist/{runner-h272wcPj.mjs → runner-kapo9aPs.mjs} +3 -3
- package/dist/{runner-pg-waxJOnBb.mjs → runner-pg-CHM76xuC.mjs} +1 -1
- package/dist/runtime/ai.mjs +113 -15
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/env-public.d.mts +1 -139
- package/dist/runtime/env-public.mjs +10 -93
- package/dist/runtime/env.d.mts +14 -1
- package/dist/runtime/env.mjs +24 -10
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/isr-cache.d.mts +207 -0
- package/dist/runtime/isr-cache.mjs +523 -0
- package/dist/runtime/isr.d.mts +4 -3
- package/dist/runtime/isr.mjs +44 -5
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/{scan-Dp_Gyzs3.mjs → scan-DEwlM_Xy.mjs} +2 -2
- package/dist/{scan-i7Yz54fv.mjs → scan-DYXkrasO.mjs} +4 -4
- package/dist/{secret-u7FRvg8d.mjs → secret-Dt32J6RI.mjs} +3 -3
- package/dist/{skills-DsdNDtX3.mjs → skills-CLjN0uUO.mjs} +2 -2
- package/dist/{subcommand-prompt-DtES-oP6.mjs → subcommand-prompt-BzV8iQZo.mjs} +1 -1
- package/dist/sveltekit.mjs +1 -1
- package/dist/{validate-DT7nFMlf.mjs → validate-Cw_RLeTj.mjs} +1 -1
- package/dist/{yarn-pnp-CW8LB6g_.mjs → yarn-pnp-DJn3SAHF.mjs} +1 -1
- package/getting-started-prompt.txt +3 -1
- package/package.json +6 -3
- package/schema.json +11 -0
- package/skills/void/SKILL.md +34 -33
- package/skills/void/docs/guide/auth.md +8 -0
- package/skills/void/docs/guide/deployment.md +1 -1
- package/skills/void/docs/guide/env-vars.md +14 -6
- package/skills/void/docs/guide/queues.md +4 -0
- package/skills/void/docs/integrations/cloudflare.md +171 -5
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +4 -0
- package/skills/void/docs/node_modules/void/{AGENTS.md → CLAUDE.md} +14 -0
- package/skills/void/docs/node_modules/void/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +64 -0
- package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +64 -0
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +108 -0
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +183 -0
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +34 -33
- package/skills/void/docs/node_modules/void/test/e2e/README.md +85 -0
- package/skills/void/docs/reference/cli.md +97 -14
- package/dist/deploy-C4PbkFyE.mjs +0 -3705
- package/dist/dotenv-D_UbC_vc.mjs +0 -173
- package/dist/env-raw-CoS20LHP.mjs +0 -32
- package/dist/env-validation-CeC2FL66.mjs +0 -163
- package/dist/pathe.M-eThtNZ-CQzLbt4c.mjs +0 -150
- package/dist/preset-CVvwCeIy.mjs +0 -208
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +0 -73
- package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +0 -73
package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# pathslash
|
|
2
|
+
|
|
3
|
+
> `node:path`, platform-correct, with forward-slash output.
|
|
4
|
+
|
|
5
|
+
`pathslash` is a tiny wrapper around `node:path` that always outputs forward slashes (`/`) while keeping the correct per-platform semantics. It never reimplements path logic. Every function delegates to `node:path` and only flips the separators in the result.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
- **Forward slashes everywhere.** On Windows, the `win32` functions output `/` instead of `\`, which is what bundlers, route maps, and URLs expect.
|
|
10
|
+
- **Correct semantics for free.** Drive letters, UNC paths, and case-insensitive `relative` behave exactly as in `node:path`, because they _are_ `node:path`.
|
|
11
|
+
- **POSIX-safe.** On POSIX, a backslash is a valid filename character, so it is never rewritten there.
|
|
12
|
+
- **A typed drop-in.** Same API and types as `node:path`.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm i pathslash
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
The default export and the top-level named exports follow the host platform, exactly like `node:path`:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import path, { join } from "pathslash";
|
|
26
|
+
|
|
27
|
+
join("src", "a.ts"); // 'src/a.ts'
|
|
28
|
+
path.sep; // '/'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To force a specific platform, use the `win32` and `posix` namespaces. They work on any host OS:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { win32, posix } from "pathslash";
|
|
35
|
+
|
|
36
|
+
win32.join("C:\\a", "b"); // 'C:/a/b' (forward slashes)
|
|
37
|
+
win32.normalize("C:\\a\\..\\b"); // 'C:/b'
|
|
38
|
+
win32.relative("C:/Foo/Bar", "C:/foo/baz"); // '../baz' (case-insensitive)
|
|
39
|
+
|
|
40
|
+
posix.join("a", "b\\c"); // 'a/b\\c' (backslash kept)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `toSlash(path)`
|
|
44
|
+
|
|
45
|
+
Safely normalizes separators to `/`. On Windows it converts `\` to `/`. On POSIX it returns the path unchanged, because a backslash is a valid filename character there and rewriting it would corrupt the path. Use it for paths that come from outside this package, such as `process.cwd()`:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { toSlash } from "pathslash";
|
|
49
|
+
|
|
50
|
+
toSlash("C:\\a\\b"); // 'C:/a/b' on Windows, unchanged on POSIX
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Notes
|
|
54
|
+
|
|
55
|
+
- `win32.sep` is `"/"` instead of `"\\"`, and `win32.delimiter` stays `";"`.
|
|
56
|
+
- `\\?\` (extended-length) paths stay verbatim. `toSlash` and every `win32.*` function leave them untouched, because a forward slash is a literal character there, not a separator.
|
|
57
|
+
- `toNamespacedPath` always returns a native, backslash path, since `\\?\` paths are only valid with backslashes.
|
|
58
|
+
- `matchesGlob` mirrors `node:path`. It exists only on Node versions that ship it (22.5+) and is `undefined` on older ones.
|
|
59
|
+
- The types are a drop-in too: `import type { ParsedPath, FormatInputPathObject, PlatformPath } from "pathslash"`.
|
|
60
|
+
- Everything else matches `node:path`, separators aside.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# pathslash
|
|
2
|
+
|
|
3
|
+
> `node:path`, platform-correct, with forward-slash output.
|
|
4
|
+
|
|
5
|
+
`pathslash` is a tiny wrapper around `node:path` that always outputs forward slashes (`/`) while keeping the correct per-platform semantics. It never reimplements path logic. Every function delegates to `node:path` and only flips the separators in the result.
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
- **Forward slashes everywhere.** On Windows, the `win32` functions output `/` instead of `\`, which is what bundlers, route maps, and URLs expect.
|
|
10
|
+
- **Correct semantics for free.** Drive letters, UNC paths, and case-insensitive `relative` behave exactly as in `node:path`, because they _are_ `node:path`.
|
|
11
|
+
- **POSIX-safe.** On POSIX, a backslash is a valid filename character, so it is never rewritten there.
|
|
12
|
+
- **A typed drop-in.** Same API and types as `node:path`.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm i pathslash
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
The default export and the top-level named exports follow the host platform, exactly like `node:path`:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import path, { join } from "pathslash";
|
|
26
|
+
|
|
27
|
+
join("src", "a.ts"); // 'src/a.ts'
|
|
28
|
+
path.sep; // '/'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To force a specific platform, use the `win32` and `posix` namespaces. They work on any host OS:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { win32, posix } from "pathslash";
|
|
35
|
+
|
|
36
|
+
win32.join("C:\\a", "b"); // 'C:/a/b' (forward slashes)
|
|
37
|
+
win32.normalize("C:\\a\\..\\b"); // 'C:/b'
|
|
38
|
+
win32.relative("C:/Foo/Bar", "C:/foo/baz"); // '../baz' (case-insensitive)
|
|
39
|
+
|
|
40
|
+
posix.join("a", "b\\c"); // 'a/b\\c' (backslash kept)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `toSlash(path)`
|
|
44
|
+
|
|
45
|
+
Safely normalizes separators to `/`. On Windows it converts `\` to `/`. On POSIX it returns the path unchanged, because a backslash is a valid filename character there and rewriting it would corrupt the path. Use it for paths that come from outside this package, such as `process.cwd()`:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { toSlash } from "pathslash";
|
|
49
|
+
|
|
50
|
+
toSlash("C:\\a\\b"); // 'C:/a/b' on Windows, unchanged on POSIX
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Notes
|
|
54
|
+
|
|
55
|
+
- `win32.sep` is `"/"` instead of `"\\"`, and `win32.delimiter` stays `";"`.
|
|
56
|
+
- `\\?\` (extended-length) paths stay verbatim. `toSlash` and every `win32.*` function leave them untouched, because a forward slash is a literal character there, not a separator.
|
|
57
|
+
- `toNamespacedPath` always returns a native, backslash path, since `\\?\` paths are only valid with backslashes.
|
|
58
|
+
- `matchesGlob` mirrors `node:path`. It exists only on Node versions that ship it (22.5+) and is `undefined` on older ones.
|
|
59
|
+
- The types are a drop-in too: `import type { ParsedPath, FormatInputPathObject, PlatformPath } from "pathslash"`.
|
|
60
|
+
- Everything else matches `node:path`, separators aside.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
<a name="4.1.2"></a>
|
|
6
|
+
## [4.1.2](https://github.com/moxystudio/node-proper-lockfile/compare/v4.1.1...v4.1.2) (2021-01-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix node 14 updating graceful-fs ([#102](https://github.com/moxystudio/node-proper-lockfile/issues/102)) ([b0d988e](https://github.com/moxystudio/node-proper-lockfile/commit/b0d988e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<a name="4.1.1"></a>
|
|
16
|
+
## [4.1.1](https://github.com/moxystudio/node-proper-lockfile/compare/v4.1.0...v4.1.1) (2019-04-03)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* fix mtime precision on some filesystems ([#88](https://github.com/moxystudio/node-proper-lockfile/issues/88)) ([f266158](https://github.com/moxystudio/node-proper-lockfile/commit/f266158)), closes [#82](https://github.com/moxystudio/node-proper-lockfile/issues/82) [#87](https://github.com/moxystudio/node-proper-lockfile/issues/87)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<a name="4.1.0"></a>
|
|
26
|
+
# [4.1.0](https://github.com/moxystudio/node-proper-lockfile/compare/v4.0.0...v4.1.0) (2019-03-18)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* allow second precision in mtime comparison ([#78](https://github.com/moxystudio/node-proper-lockfile/issues/78)) ([b2816a6](https://github.com/moxystudio/node-proper-lockfile/commit/b2816a6))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<a name="4.0.0"></a>
|
|
36
|
+
# [4.0.0](https://github.com/moxystudio/node-proper-lockfile/compare/v3.2.0...v4.0.0) (2019-03-12)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* fix typo in error message ([#68](https://github.com/moxystudio/node-proper-lockfile/issues/68)) ([b91cb55](https://github.com/moxystudio/node-proper-lockfile/commit/b91cb55))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* make staleness check more robust ([#74](https://github.com/moxystudio/node-proper-lockfile/issues/74)) ([9cc0973](https://github.com/moxystudio/node-proper-lockfile/commit/9cc0973)), closes [#71](https://github.com/moxystudio/node-proper-lockfile/issues/71) [/github.com/ipfs/js-ipfs-repo/issues/188#issuecomment-468682971](https://github.com//github.com/ipfs/js-ipfs-repo/issues/188/issues/issuecomment-468682971)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### BREAKING CHANGES
|
|
50
|
+
|
|
51
|
+
* We were marking the lock as compromised when system went into sleep or if the event loop was busy taking too long to run the internals timers, Now we keep track of the mtime updated by the current process, and if we lose some cycles in the update process but recover and the mtime is still ours we do not mark the lock as compromised.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<a name="3.2.0"></a>
|
|
56
|
+
# [3.2.0](https://github.com/moxystudio/node-proper-lockfile/compare/v3.1.0...v3.2.0) (2018-11-19)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
* add lock path option ([#66](https://github.com/moxystudio/node-proper-lockfile/issues/66)) ([32f1b8d](https://github.com/moxystudio/node-proper-lockfile/commit/32f1b8d))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
<a name="3.1.0"></a>
|
|
66
|
+
# [3.1.0](https://github.com/moxystudio/node-proper-lockfile/compare/v3.0.2...v3.1.0) (2018-11-15)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* **package:** update retry to version 0.12.0 ([#50](https://github.com/moxystudio/node-proper-lockfile/issues/50)) ([d400b98](https://github.com/moxystudio/node-proper-lockfile/commit/d400b98))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
* add signal exit ([#65](https://github.com/moxystudio/node-proper-lockfile/issues/65)) ([f20bc45](https://github.com/moxystudio/node-proper-lockfile/commit/f20bc45))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<a name="3.0.2"></a>
|
|
81
|
+
## [3.0.2](https://github.com/moxystudio/node-proper-lockfile/compare/v3.0.1...v3.0.2) (2018-01-30)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
<a name="3.0.1"></a>
|
|
86
|
+
## [3.0.1](https://github.com/moxystudio/node-proper-lockfile/compare/v3.0.0...v3.0.1) (2018-01-20)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Bug Fixes
|
|
90
|
+
|
|
91
|
+
* restore ability to use lockfile() directly ([0ef8fbc](https://github.com/moxystudio/node-proper-lockfile/commit/0ef8fbc))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<a name="3.0.0"></a>
|
|
96
|
+
# [3.0.0](https://github.com/moxystudio/node-proper-lockfile/compare/v2.0.1...v3.0.0) (2018-01-20)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Chores
|
|
100
|
+
|
|
101
|
+
* update project to latest node lts ([b1d43e5](https://github.com/moxystudio/node-proper-lockfile/commit/b1d43e5))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### BREAKING CHANGES
|
|
105
|
+
|
|
106
|
+
* remove callback support
|
|
107
|
+
* use of node lts language features such as object spread
|
|
108
|
+
* compromised function in lock() has been moved to an option
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# proper-lockfile
|
|
2
|
+
|
|
3
|
+
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]
|
|
4
|
+
|
|
5
|
+
[npm-url]:https://npmjs.org/package/proper-lockfile
|
|
6
|
+
[downloads-image]:https://img.shields.io/npm/dm/proper-lockfile.svg
|
|
7
|
+
[npm-image]:https://img.shields.io/npm/v/proper-lockfile.svg
|
|
8
|
+
[travis-url]:https://travis-ci.org/moxystudio/node-proper-lockfile
|
|
9
|
+
[travis-image]:https://img.shields.io/travis/moxystudio/node-proper-lockfile/master.svg
|
|
10
|
+
[codecov-url]:https://codecov.io/gh/moxystudio/node-proper-lockfile
|
|
11
|
+
[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-proper-lockfile/master.svg
|
|
12
|
+
[david-dm-url]:https://david-dm.org/moxystudio/node-proper-lockfile
|
|
13
|
+
[david-dm-image]:https://img.shields.io/david/moxystudio/node-proper-lockfile.svg
|
|
14
|
+
[david-dm-dev-url]:https://david-dm.org/moxystudio/node-proper-lockfile?type=dev
|
|
15
|
+
[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-proper-lockfile.svg
|
|
16
|
+
|
|
17
|
+
An inter-process and inter-machine lockfile utility that works on a local or network file system.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
`$ npm install proper-lockfile`
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Design
|
|
26
|
+
|
|
27
|
+
There are various ways to achieve [file locking](http://en.wikipedia.org/wiki/File_locking).
|
|
28
|
+
|
|
29
|
+
This library utilizes the `mkdir` strategy which works atomically on any kind of file system, even network based ones.
|
|
30
|
+
The lockfile path is based on the file path you are trying to lock by suffixing it with `.lock`.
|
|
31
|
+
|
|
32
|
+
When a lock is successfully acquired, the lockfile's `mtime` (modified time) is periodically updated to prevent staleness. This allows to effectively check if a lock is stale by checking its `mtime` against a stale threshold. If the update of the mtime fails several times, the lock might be compromised. The `mtime` is [supported](http://en.wikipedia.org/wiki/Comparison_of_file_systems) in almost every `filesystem`.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Comparison
|
|
36
|
+
|
|
37
|
+
This library is similar to [lockfile](https://github.com/isaacs/lockfile) but the latter has some drawbacks:
|
|
38
|
+
|
|
39
|
+
- It relies on `open` with `O_EXCL` flag which has problems in network file systems. `proper-lockfile` uses `mkdir` which doesn't have this issue.
|
|
40
|
+
|
|
41
|
+
> O_EXCL is broken on NFS file systems; programs which rely on it for performing locking tasks will contain a race condition.
|
|
42
|
+
|
|
43
|
+
- The lockfile staleness check is done via `ctime` (creation time) which is unsuitable for long running processes. `proper-lockfile` constantly updates lockfiles `mtime` to do proper staleness check.
|
|
44
|
+
|
|
45
|
+
- It does not check if the lockfile was compromised which can lead to undesirable situations. `proper-lockfile` checks the lockfile when updating the `mtime`.
|
|
46
|
+
|
|
47
|
+
- It has a default value of `0` for the stale option which isn't good because any crash or process kill that the package can't handle gracefully will leave the lock active forever.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Compromised
|
|
51
|
+
|
|
52
|
+
`proper-lockfile` does not detect cases in which:
|
|
53
|
+
|
|
54
|
+
- A `lockfile` is manually removed and someone else acquires the lock right after
|
|
55
|
+
- Different `stale`/`update` values are being used for the same file, possibly causing two locks to be acquired on the same file
|
|
56
|
+
|
|
57
|
+
`proper-lockfile` detects cases in which:
|
|
58
|
+
|
|
59
|
+
- Updates to the `lockfile` fail
|
|
60
|
+
- Updates take longer than expected, possibly causing the lock to become stale for a certain amount of time
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
As you see, the first two are a consequence of bad usage. Technically, it was possible to detect the first two but it would introduce complexity and eventual race conditions.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
### .lock(file, [options])
|
|
69
|
+
|
|
70
|
+
Tries to acquire a lock on `file` or rejects the promise on error.
|
|
71
|
+
|
|
72
|
+
If the lock succeeds, a `release` function is provided that should be called when you want to release the lock. The `release` function also rejects the promise on error (e.g. when the lock was already compromised).
|
|
73
|
+
|
|
74
|
+
Available options:
|
|
75
|
+
|
|
76
|
+
- `stale`: Duration in milliseconds in which the lock is considered stale, defaults to `10000` (minimum value is `5000`)
|
|
77
|
+
- `update`: The interval in milliseconds in which the lockfile's `mtime` will be updated, defaults to `stale/2` (minimum value is `1000`, maximum value is `stale/2`)
|
|
78
|
+
- `retries`: The number of retries or a [retry](https://www.npmjs.org/package/retry) options object, defaults to `0`
|
|
79
|
+
- `realpath`: Resolve symlinks using realpath, defaults to `true` (note that if `true`, the `file` must exist previously)
|
|
80
|
+
- `fs`: A custom fs to use, defaults to `graceful-fs`
|
|
81
|
+
- `onCompromised`: Called if the lock gets compromised, defaults to a function that simply throws the error which will probably cause the process to die
|
|
82
|
+
- `lockfilePath`: Custom lockfile path. e.g.: If you want to lock a directory and create the lock file inside it, you can pass `file` as `<dir path>` and `options.lockfilePath` as `<dir path>/dir.lock`
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const lockfile = require('proper-lockfile');
|
|
87
|
+
|
|
88
|
+
lockfile.lock('some/file')
|
|
89
|
+
.then((release) => {
|
|
90
|
+
// Do something while the file is locked
|
|
91
|
+
|
|
92
|
+
// Call the provided release function when you're done,
|
|
93
|
+
// which will also return a promise
|
|
94
|
+
return release();
|
|
95
|
+
})
|
|
96
|
+
.catch((e) => {
|
|
97
|
+
// either lock could not be acquired
|
|
98
|
+
// or releasing it failed
|
|
99
|
+
console.error(e)
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Alternatively, you may use lockfile('some/file') directly.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### .unlock(file, [options])
|
|
107
|
+
|
|
108
|
+
Releases a previously acquired lock on `file` or rejects the promise on error.
|
|
109
|
+
|
|
110
|
+
Whenever possible you should use the `release` function instead (as exemplified above). Still there are cases in which it's hard to keep a reference to it around code. In those cases `unlock()` might be handy.
|
|
111
|
+
|
|
112
|
+
Available options:
|
|
113
|
+
|
|
114
|
+
- `realpath`: Resolve symlinks using realpath, defaults to `true` (note that if `true`, the `file` must exist previously)
|
|
115
|
+
- `fs`: A custom fs to use, defaults to `graceful-fs`
|
|
116
|
+
- `lockfilePath`: Custom lockfile path. e.g.: If you want to lock a directory and create the lock file inside it, you can pass `file` as `<dir path>` and `options.lockfilePath` as `<dir path>/dir.lock`
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
const lockfile = require('proper-lockfile');
|
|
121
|
+
|
|
122
|
+
lockfile.lock('some/file')
|
|
123
|
+
.then(() => {
|
|
124
|
+
// Do something while the file is locked
|
|
125
|
+
|
|
126
|
+
// Later..
|
|
127
|
+
return lockfile.unlock('some/file');
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### .check(file, [options])
|
|
132
|
+
|
|
133
|
+
Check if the file is locked and its lockfile is not stale, rejects the promise on error.
|
|
134
|
+
|
|
135
|
+
Available options:
|
|
136
|
+
|
|
137
|
+
- `stale`: Duration in milliseconds in which the lock is considered stale, defaults to `10000` (minimum value is `5000`)
|
|
138
|
+
- `realpath`: Resolve symlinks using realpath, defaults to `true` (note that if `true`, the `file` must exist previously)
|
|
139
|
+
- `fs`: A custom fs to use, defaults to `graceful-fs`
|
|
140
|
+
- `lockfilePath`: Custom lockfile path. e.g.: If you want to lock a directory and create the lock file inside it, you can pass `file` as `<dir path>` and `options.lockfilePath` as `<dir path>/dir.lock`
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
const lockfile = require('proper-lockfile');
|
|
145
|
+
|
|
146
|
+
lockfile.check('some/file')
|
|
147
|
+
.then((isLocked) => {
|
|
148
|
+
// isLocked will be true if 'some/file' is locked, false otherwise
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### .lockSync(file, [options])
|
|
153
|
+
|
|
154
|
+
Sync version of `.lock()`.
|
|
155
|
+
Returns the `release` function or throws on error.
|
|
156
|
+
|
|
157
|
+
### .unlockSync(file, [options])
|
|
158
|
+
|
|
159
|
+
Sync version of `.unlock()`.
|
|
160
|
+
Throws on error.
|
|
161
|
+
|
|
162
|
+
### .checkSync(file, [options])
|
|
163
|
+
|
|
164
|
+
Sync version of `.check()`.
|
|
165
|
+
Returns a boolean or throws on error.
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## Graceful exit
|
|
169
|
+
|
|
170
|
+
`proper-lockfile` automatically removes locks if the process exits, except if the process is killed with SIGKILL or it crashes due to a VM fatal error (e.g.: out of memory).
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## Tests
|
|
174
|
+
|
|
175
|
+
`$ npm test`
|
|
176
|
+
`$ npm test -- --watch` during development
|
|
177
|
+
|
|
178
|
+
The test suite is very extensive. There's even a stress test to guarantee exclusiveness of locks.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php).
|
|
@@ -32,39 +32,40 @@ Then ask what to do next.
|
|
|
32
32
|
|
|
33
33
|
## Task Routing
|
|
34
34
|
|
|
35
|
-
| User intent
|
|
36
|
-
|
|
|
37
|
-
| CLI command syntax, flags, env vars
|
|
38
|
-
| Initial setup, onboarding, first app
|
|
39
|
-
| App type detection and mode behavior
|
|
40
|
-
| Server/API routing and middleware
|
|
41
|
-
| Pages mode, loader/action, forms, layouts
|
|
42
|
-
| Database and migrations
|
|
43
|
-
| Typed fetch and end-to-end typing
|
|
44
|
-
| Authentication
|
|
45
|
-
| Cloudflare runtime bindings and config
|
|
46
|
-
| AI inference (Workers AI, providers)
|
|
47
|
-
| KV / storage / queues / cron jobs
|
|
48
|
-
| SSR and caching
|
|
49
|
-
| Rewrites, redirects, fallbacks
|
|
50
|
-
| Static site generation
|
|
51
|
-
| Deployment and CI
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
35
|
+
| User intent | Docs file(s) |
|
|
36
|
+
| ------------------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
37
|
+
| CLI command syntax, flags, env vars | `docs/reference/cli.md` |
|
|
38
|
+
| Initial setup, onboarding, first app | `docs/guide/quickstart.md`, `docs/reference/cli.md` |
|
|
39
|
+
| App type detection and mode behavior | `docs/guide/app-types.md`, `docs/reference/config.md` |
|
|
40
|
+
| Server/API routing and middleware | `docs/guide/server-routing.md`, `docs/integrations/hono.md` |
|
|
41
|
+
| Pages mode, loader/action, forms, layouts | `docs/guide/pages-routing/*.md`, `docs/guide/type-safety.md` |
|
|
42
|
+
| Database and migrations | `docs/guide/database.md`, `docs/guide/type-safety.md` |
|
|
43
|
+
| Typed fetch and end-to-end typing | `docs/guide/typed-fetch.md`, `docs/guide/type-safety.md` |
|
|
44
|
+
| Authentication | `docs/guide/auth.md`, `docs/guide/env-vars.md` |
|
|
45
|
+
| Cloudflare runtime bindings and config | `docs/integrations/cloudflare.md`, `docs/reference/config.md`, `docs/guide/env-vars.md` |
|
|
46
|
+
| AI inference (Workers AI, providers) | `docs/guide/ai.md` |
|
|
47
|
+
| KV / storage / queues / cron jobs | `docs/guide/kv.md`, `docs/guide/storage.md`, `docs/guide/queues.md`, `docs/guide/jobs.md` |
|
|
48
|
+
| SSR and caching | `docs/guide/ssr.md`, `docs/guide/edge/*.md` |
|
|
49
|
+
| Rewrites, redirects, fallbacks | `docs/guide/edge/rewrites.md`, `docs/guide/edge/redirects.md`, `docs/reference/config.md` |
|
|
50
|
+
| Static site generation | `docs/guide/ssg.md` |
|
|
51
|
+
| Deployment and CI | `docs/guide/deployment.md`, `docs/reference/cli.md` |
|
|
52
|
+
| Self-host deploy to own Cloudflare account | `docs/integrations/cloudflare.md`, `docs/reference/cli.md` |
|
|
53
|
+
| Project status, deployment history | `docs/reference/cli.md` |
|
|
54
|
+
| Cache purging | `docs/reference/cli.md` |
|
|
55
|
+
| Project logs, runtime errors | `docs/reference/cli.md` |
|
|
56
|
+
| Secrets management (put/sync/delete) | `docs/reference/cli.md`, `docs/guide/env-vars.md` |
|
|
57
|
+
| Typed env vars (`defineEnv`, `env.ts`) | `docs/guide/env-vars.md` |
|
|
58
|
+
| Custom domain setup | `docs/reference/cli.md` |
|
|
59
|
+
| Database status, reset, seed, export | `docs/reference/cli.md`, `docs/guide/database.md` |
|
|
60
|
+
| Auth login/logout/whoami | `docs/reference/cli.md` |
|
|
61
|
+
| Overview / introduction | `docs/guide/index.md` |
|
|
62
|
+
| API surface details | `docs/reference/api.md` |
|
|
63
|
+
| Meta framework integration | `docs/integrations/frameworks/*.md` |
|
|
64
|
+
| Coding agent setup | `docs/integrations/agents.md` |
|
|
65
|
+
| Node.js / Bun / Deno targets | `docs/integrations/nodejs-bun-deno.md` |
|
|
66
|
+
| ORMs and external databases | `docs/integrations/orms-and-external-dbs.md` |
|
|
67
|
+
| Project structure and conventions | `docs/reference/structure.md` |
|
|
68
|
+
| Resource/binding inference | `docs/reference/resource-inference.md` |
|
|
68
69
|
|
|
69
70
|
## Working Rules
|
|
70
71
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# `packages/void/test/e2e`
|
|
2
|
+
|
|
3
|
+
Gated live-account end-to-end tests. These run REAL Cloudflare operations against a REAL account, so
|
|
4
|
+
they **skip unless credentials are present**. Locally that means exporting the env vars below; in CI
|
|
5
|
+
they run on **pushes to `main`** (see [In CI](#in-ci)).
|
|
6
|
+
|
|
7
|
+
## `cloudflare-deploy-live.test.ts`
|
|
8
|
+
|
|
9
|
+
Deploys `playground/spa` (D1 + KV + cron) to the target account via `void deploy --backend cloudflare`,
|
|
10
|
+
verifies the live worker answers HTTP 200, then deletes the worker and every resource it created.
|
|
11
|
+
|
|
12
|
+
It does **not** drive `--provision`: that path fails closed in non-interactive shells by design (a
|
|
13
|
+
spawned CLI has no TTY, and CI cannot commit back the ids a create would mint). So the test plays the
|
|
14
|
+
provisioner's role itself — it creates the id-bearing D1 + KV directly with `wrangler … create`,
|
|
15
|
+
writes their real ids into the app's root config exactly as `--provision` would, then runs the
|
|
16
|
+
CI-safe `void deploy --backend cloudflare` (no `--provision`). That exercises the real
|
|
17
|
+
build → tamper-guard → remote-migrations → `wrangler deploy` pipeline end to end.
|
|
18
|
+
|
|
19
|
+
### Prerequisites
|
|
20
|
+
|
|
21
|
+
The suite is skipped unless BOTH env vars are set:
|
|
22
|
+
|
|
23
|
+
| Env var | Purpose |
|
|
24
|
+
| ------------------------ | -------------------------------------------------------------------------- |
|
|
25
|
+
| `VOID_E2E_CF_TOKEN` | Cloudflare API token that can create + delete Workers Scripts, D1, and KV. |
|
|
26
|
+
| `VOID_E2E_CF_ACCOUNT_ID` | Cloudflare account id to deploy into. |
|
|
27
|
+
|
|
28
|
+
The token needs, on that account, **Workers Scripts: Edit**, **D1: Edit**, and **Workers KV Storage:
|
|
29
|
+
Edit** (Edit implies read, covering the ownership/teardown list calls). Cron triggers ride along with
|
|
30
|
+
the worker deploy — no extra permission.
|
|
31
|
+
|
|
32
|
+
The account must also have a **workers.dev subdomain** already registered (with its wildcard TLS cert
|
|
33
|
+
provisioned). Without one, `wrangler deploy` uploads the worker but cannot publish a public URL, and
|
|
34
|
+
the HTTP-200 assertion has nothing to hit. Opening the Workers & Pages dashboard once registers a
|
|
35
|
+
subdomain automatically; a freshly-registered subdomain takes a few minutes for its cert to go live,
|
|
36
|
+
during which the first run may see a TLS handshake failure — rerun once the cert is ready.
|
|
37
|
+
|
|
38
|
+
With no env vars the suite SKIPS cleanly (0 run, N skipped).
|
|
39
|
+
|
|
40
|
+
### Running it
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
# Ensure the CLI is built first (dist/cli/cli.mjs):
|
|
44
|
+
vp run build:core
|
|
45
|
+
|
|
46
|
+
VOID_E2E_CF_TOKEN=... VOID_E2E_CF_ACCOUNT_ID=... vp test run packages/void/test/e2e
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### In CI
|
|
50
|
+
|
|
51
|
+
`VOID_E2E_CF_TOKEN` and `VOID_E2E_CF_ACCOUNT_ID` are **environment secrets** on the `cloudflare-e2e`
|
|
52
|
+
GitHub Environment (not repo secrets), and a dedicated `live-e2e` job in `.github/workflows/ci.yml`
|
|
53
|
+
consumes them — the main `test` job carries no creds at all. Two layers keep the account token off
|
|
54
|
+
untrusted code:
|
|
55
|
+
|
|
56
|
+
- The `live-e2e` job runs only on a direct push to `main` (`github.event_name == 'push' && github.ref
|
|
57
|
+
== 'refs/heads/main'`), so `pull_request` runs, tag pushes, and `workflow_call` (release) skip it.
|
|
58
|
+
- The `cloudflare-e2e` environment's deployment branch policy allows `main` **only**, enforced by
|
|
59
|
+
GitHub server-side on the run's ref. A `pull_request` run's ref is `refs/pull/<n>/merge`, so it can
|
|
60
|
+
never reach the secret **even if a PR edits this workflow** — the expression-level gate alone would
|
|
61
|
+
be bypassable that way; the environment ref-check is the real boundary.
|
|
62
|
+
|
|
63
|
+
So the credentialed live deploy runs on every merge to `main`; everywhere else the creds are empty and
|
|
64
|
+
the suite SKIPS (the `test` job still imports the file and skips it). The `live-e2e` job itself is
|
|
65
|
+
fail-closed — a preflight step errors if either credential is empty (a missing, deleted, or
|
|
66
|
+
not-yet-rotated secret), so a misconfigured gate is loud instead of a silent green skip. Each
|
|
67
|
+
`live-e2e` run also gets `VOID_E2E_RUN_ID = <run-id>-<attempt>` for the unique per-run resource names
|
|
68
|
+
below.
|
|
69
|
+
|
|
70
|
+
### Resource naming & cleanup
|
|
71
|
+
|
|
72
|
+
Each run derives a UNIQUE resource name — `void-e2e-cf-deploy-<suffix>` — so overlapping runs never
|
|
73
|
+
collide on remote resources. The suffix is `VOID_E2E_RUN_ID` (CI: `<run-id>-<attempt>`) or, locally, a
|
|
74
|
+
timestamp + random. Derived names mirror the provisioner: `<name>-db` (D1), `<name>-kv` (KV). The
|
|
75
|
+
shared `void-e2e-cf-deploy-` prefix keeps every resource greppable, so an orphan from a hard-killed run
|
|
76
|
+
is easy to find and `wrangler delete`. A pre-run ownership gate refuses to start if the run's names
|
|
77
|
+
already exist (failing closed on any lookup it cannot confirm), so the test never adopts or deletes a
|
|
78
|
+
resource it does not own. Teardown runs even when the deploy or an assertion fails.
|
|
79
|
+
|
|
80
|
+
> **Local concurrency:** unique names isolate _remote_ resources, but a run also snapshots and
|
|
81
|
+
> overwrites the shared `playground/spa/wrangler.jsonc` and builds in place. Do **not** run two live
|
|
82
|
+
> e2e invocations against the same checkout at once — they would race that file. CI is unaffected (each
|
|
83
|
+
> runner is an isolated checkout, and only the single `main`-push `live-e2e` job deploys). The deploy
|
|
84
|
+
> test also asserts the returned host's worker label equals this run's `WORKER_NAME`, so a clobbered
|
|
85
|
+
> overlay fails loudly instead of validating another run's worker.
|