@earendil-works/chord 1.4.0 → 1.5.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/CHANGELOG.md +92 -0
- package/README.md +115 -90
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/contracts/accepts.d.ts +81 -0
- package/dist/contracts/accepts.d.ts.map +1 -0
- package/dist/contracts/accepts.js +123 -0
- package/dist/contracts/accepts.js.map +1 -0
- package/dist/contracts/contract.d.ts +121 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js +50 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/declare.d.ts +107 -0
- package/dist/contracts/declare.d.ts.map +1 -0
- package/dist/contracts/declare.js +136 -0
- package/dist/contracts/declare.js.map +1 -0
- package/dist/contracts/evolve.d.ts +92 -0
- package/dist/contracts/evolve.d.ts.map +1 -0
- package/dist/contracts/evolve.js +179 -0
- package/dist/contracts/evolve.js.map +1 -0
- package/dist/contracts/fingerprint.d.ts +16 -0
- package/dist/contracts/fingerprint.d.ts.map +1 -0
- package/dist/contracts/fingerprint.js +50 -0
- package/dist/contracts/fingerprint.js.map +1 -0
- package/dist/contracts/history.d.ts +71 -0
- package/dist/contracts/history.d.ts.map +1 -0
- package/dist/contracts/history.js +3 -0
- package/dist/contracts/history.js.map +1 -0
- package/dist/contracts/host-kind.d.ts +40 -0
- package/dist/contracts/host-kind.d.ts.map +1 -0
- package/dist/contracts/host-kind.js +37 -0
- package/dist/contracts/host-kind.js.map +1 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/internal.d.ts +10 -0
- package/dist/contracts/internal.d.ts.map +1 -0
- package/dist/contracts/internal.js +9 -0
- package/dist/contracts/internal.js.map +1 -0
- package/dist/contracts/names.d.ts +3 -0
- package/dist/contracts/names.d.ts.map +1 -0
- package/dist/contracts/names.js +13 -0
- package/dist/contracts/names.js.map +1 -0
- package/dist/contracts/params.d.ts +28 -0
- package/dist/contracts/params.d.ts.map +1 -0
- package/dist/contracts/params.js +50 -0
- package/dist/contracts/params.js.map +1 -0
- package/dist/contracts/schema.d.ts +102 -0
- package/dist/contracts/schema.d.ts.map +1 -0
- package/dist/contracts/schema.js +103 -0
- package/dist/contracts/schema.js.map +1 -0
- package/dist/contracts/snapshot.d.ts +16 -0
- package/dist/contracts/snapshot.d.ts.map +1 -0
- package/dist/contracts/snapshot.js +167 -0
- package/dist/contracts/snapshot.js.map +1 -0
- package/dist/data/args.d.ts +50 -0
- package/dist/data/args.d.ts.map +1 -0
- package/dist/data/args.js +83 -0
- package/dist/data/args.js.map +1 -0
- package/dist/data/errors.d.ts +80 -0
- package/dist/data/errors.d.ts.map +1 -0
- package/dist/data/errors.js +116 -0
- package/dist/data/errors.js.map +1 -0
- package/dist/data/failure.d.ts +26 -0
- package/dist/data/failure.d.ts.map +1 -0
- package/dist/data/failure.js +77 -0
- package/dist/data/failure.js.map +1 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +5 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/internal.d.ts +7 -0
- package/dist/data/internal.d.ts.map +1 -0
- package/dist/data/internal.js +8 -0
- package/dist/data/internal.js.map +1 -0
- package/dist/data/params.d.ts +20 -0
- package/dist/data/params.d.ts.map +1 -0
- package/dist/data/params.js +31 -0
- package/dist/data/params.js.map +1 -0
- package/dist/data/principal.d.ts +22 -0
- package/dist/data/principal.d.ts.map +1 -0
- package/dist/data/principal.js +49 -0
- package/dist/data/principal.js.map +1 -0
- package/dist/data/validator.d.ts +12 -0
- package/dist/data/validator.d.ts.map +1 -0
- package/dist/data/validator.js +35 -0
- package/dist/data/validator.js.map +1 -0
- package/dist/delta/apply-immutable-trusted.js +3 -4
- package/dist/delta/apply-immutable-trusted.js.map +1 -1
- package/dist/delta/diff.d.ts.map +1 -1
- package/dist/delta/diff.js +5 -3
- package/dist/delta/diff.js.map +1 -1
- package/dist/delta/index.d.ts +9 -1
- package/dist/delta/index.d.ts.map +1 -1
- package/dist/delta/index.js +15 -11
- package/dist/delta/index.js.map +1 -1
- package/dist/delta/pending.d.ts +36 -0
- package/dist/delta/pending.d.ts.map +1 -0
- package/dist/delta/pending.js +143 -0
- package/dist/delta/pending.js.map +1 -0
- package/dist/delta/tracker.d.ts +12 -0
- package/dist/delta/tracker.d.ts.map +1 -1
- package/dist/delta/tracker.js +109 -39
- package/dist/delta/tracker.js.map +1 -1
- package/dist/documents/address-source.d.ts +20 -0
- package/dist/documents/address-source.d.ts.map +1 -0
- package/dist/documents/address-source.js +44 -0
- package/dist/documents/address-source.js.map +1 -0
- package/dist/documents/definition.d.ts +84 -0
- package/dist/documents/definition.d.ts.map +1 -0
- package/dist/documents/definition.js +74 -0
- package/dist/documents/definition.js.map +1 -0
- package/dist/documents/documents.d.ts +126 -0
- package/dist/documents/documents.d.ts.map +1 -0
- package/dist/documents/documents.js +248 -0
- package/dist/documents/documents.js.map +1 -0
- package/dist/documents/fence.d.ts +9 -0
- package/dist/documents/fence.d.ts.map +1 -0
- package/dist/documents/fence.js +15 -0
- package/dist/documents/fence.js.map +1 -0
- package/dist/documents/handles.d.ts +76 -0
- package/dist/documents/handles.d.ts.map +1 -0
- package/dist/documents/handles.js +66 -0
- package/dist/documents/handles.js.map +1 -0
- package/dist/documents/index.d.ts +4 -0
- package/dist/documents/index.d.ts.map +1 -0
- package/dist/documents/index.js +3 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/internal.d.ts +9 -0
- package/dist/documents/internal.d.ts.map +1 -0
- package/dist/documents/internal.js +9 -0
- package/dist/documents/internal.js.map +1 -0
- package/dist/documents/keyed-slot.d.ts +103 -0
- package/dist/documents/keyed-slot.d.ts.map +1 -0
- package/dist/documents/keyed-slot.js +395 -0
- package/dist/documents/keyed-slot.js.map +1 -0
- package/dist/documents/line.d.ts +7 -0
- package/dist/documents/line.d.ts.map +1 -0
- package/dist/documents/line.js +14 -0
- package/dist/documents/line.js.map +1 -0
- package/dist/documents/persistence.d.ts +104 -0
- package/dist/documents/persistence.d.ts.map +1 -0
- package/dist/documents/persistence.js +129 -0
- package/dist/documents/persistence.js.map +1 -0
- package/dist/documents/residency.d.ts +31 -0
- package/dist/documents/residency.d.ts.map +1 -0
- package/dist/documents/residency.js +93 -0
- package/dist/documents/residency.js.map +1 -0
- package/dist/documents/slot.d.ts +109 -0
- package/dist/documents/slot.d.ts.map +1 -0
- package/dist/documents/slot.js +181 -0
- package/dist/documents/slot.js.map +1 -0
- package/dist/documents/transaction.d.ts +143 -0
- package/dist/documents/transaction.d.ts.map +1 -0
- package/dist/documents/transaction.js +442 -0
- package/dist/documents/transaction.js.map +1 -0
- package/dist/host/activity.d.ts +31 -0
- package/dist/host/activity.d.ts.map +1 -0
- package/dist/host/activity.js +40 -0
- package/dist/host/activity.js.map +1 -0
- package/dist/host/adapted.d.ts +49 -0
- package/dist/host/adapted.d.ts.map +1 -0
- package/dist/host/adapted.js +214 -0
- package/dist/host/adapted.js.map +1 -0
- package/dist/host/attempt.d.ts +308 -0
- package/dist/host/attempt.d.ts.map +1 -0
- package/dist/host/attempt.js +1199 -0
- package/dist/host/attempt.js.map +1 -0
- package/dist/host/backoff.d.ts +29 -0
- package/dist/host/backoff.d.ts.map +1 -0
- package/dist/host/backoff.js +69 -0
- package/dist/host/backoff.js.map +1 -0
- package/dist/host/ctx.d.ts +94 -0
- package/dist/host/ctx.d.ts.map +1 -0
- package/dist/host/ctx.js +200 -0
- package/dist/host/ctx.js.map +1 -0
- package/dist/host/deadline.d.ts +12 -0
- package/dist/host/deadline.d.ts.map +1 -0
- package/dist/host/deadline.js +40 -0
- package/dist/host/deadline.js.map +1 -0
- package/dist/host/dependencies.d.ts +65 -0
- package/dist/host/dependencies.d.ts.map +1 -0
- package/dist/host/dependencies.js +115 -0
- package/dist/host/dependencies.js.map +1 -0
- package/dist/host/destination.d.ts +48 -0
- package/dist/host/destination.d.ts.map +1 -0
- package/dist/host/destination.js +101 -0
- package/dist/host/destination.js.map +1 -0
- package/dist/host/facet.d.ts +84 -0
- package/dist/host/facet.d.ts.map +1 -0
- package/dist/host/facet.js +55 -0
- package/dist/host/facet.js.map +1 -0
- package/dist/host/follow.d.ts +52 -0
- package/dist/host/follow.d.ts.map +1 -0
- package/dist/host/follow.js +207 -0
- package/dist/host/follow.js.map +1 -0
- package/dist/host/host.d.ts +571 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.js +1318 -0
- package/dist/host/host.js.map +1 -0
- package/dist/host/index.d.ts +17 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +6 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/internal.d.ts +11 -0
- package/dist/host/internal.d.ts.map +1 -0
- package/dist/host/internal.js +9 -0
- package/dist/host/internal.js.map +1 -0
- package/dist/host/members.d.ts +50 -0
- package/dist/host/members.d.ts.map +1 -0
- package/dist/host/members.js +107 -0
- package/dist/host/members.js.map +1 -0
- package/dist/host/native.d.ts +64 -0
- package/dist/host/native.d.ts.map +1 -0
- package/dist/host/native.js +126 -0
- package/dist/host/native.js.map +1 -0
- package/dist/host/object.d.ts +331 -0
- package/dist/host/object.d.ts.map +1 -0
- package/dist/host/object.js +1296 -0
- package/dist/host/object.js.map +1 -0
- package/dist/host/old-work.d.ts +34 -0
- package/dist/host/old-work.d.ts.map +1 -0
- package/dist/host/old-work.js +52 -0
- package/dist/host/old-work.js.map +1 -0
- package/dist/host/parked.d.ts +23 -0
- package/dist/host/parked.d.ts.map +1 -0
- package/dist/host/parked.js +79 -0
- package/dist/host/parked.js.map +1 -0
- package/dist/host/presence.d.ts +34 -0
- package/dist/host/presence.d.ts.map +1 -0
- package/dist/host/presence.js +117 -0
- package/dist/host/presence.js.map +1 -0
- package/dist/host/readiness.d.ts +27 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.js +134 -0
- package/dist/host/readiness.js.map +1 -0
- package/dist/host/ref-state.d.ts +53 -0
- package/dist/host/ref-state.d.ts.map +1 -0
- package/dist/host/ref-state.js +83 -0
- package/dist/host/ref-state.js.map +1 -0
- package/dist/host/reference-keys.d.ts +36 -0
- package/dist/host/reference-keys.d.ts.map +1 -0
- package/dist/host/reference-keys.js +168 -0
- package/dist/host/reference-keys.js.map +1 -0
- package/dist/host/reference-source.d.ts +65 -0
- package/dist/host/reference-source.d.ts.map +1 -0
- package/dist/host/reference-source.js +285 -0
- package/dist/host/reference-source.js.map +1 -0
- package/dist/host/reference.d.ts +321 -0
- package/dist/host/reference.d.ts.map +1 -0
- package/dist/host/reference.js +797 -0
- package/dist/host/reference.js.map +1 -0
- package/dist/host/reload-cycle.d.ts +16 -0
- package/dist/host/reload-cycle.d.ts.map +1 -0
- package/dist/host/reload-cycle.js +81 -0
- package/dist/host/reload-cycle.js.map +1 -0
- package/dist/host/retry-on.d.ts +28 -0
- package/dist/host/retry-on.d.ts.map +1 -0
- package/dist/host/retry-on.js +52 -0
- package/dist/host/retry-on.js.map +1 -0
- package/dist/host/revocation.d.ts +16 -0
- package/dist/host/revocation.d.ts.map +1 -0
- package/dist/host/revocation.js +27 -0
- package/dist/host/revocation.js.map +1 -0
- package/dist/host/root.d.ts +37 -0
- package/dist/host/root.d.ts.map +1 -0
- package/dist/host/root.js +68 -0
- package/dist/host/root.js.map +1 -0
- package/dist/host/route.d.ts +64 -0
- package/dist/host/route.d.ts.map +1 -0
- package/dist/host/route.js +227 -0
- package/dist/host/route.js.map +1 -0
- package/dist/host/routines.d.ts +78 -0
- package/dist/host/routines.d.ts.map +1 -0
- package/dist/host/routines.js +398 -0
- package/dist/host/routines.js.map +1 -0
- package/dist/host/sleep.d.ts +9 -0
- package/dist/host/sleep.d.ts.map +1 -0
- package/dist/host/sleep.js +40 -0
- package/dist/host/sleep.js.map +1 -0
- package/dist/host/staging.d.ts +94 -0
- package/dist/host/staging.d.ts.map +1 -0
- package/dist/host/staging.js +304 -0
- package/dist/host/staging.js.map +1 -0
- package/dist/host/unbound-clock.d.ts +23 -0
- package/dist/host/unbound-clock.d.ts.map +1 -0
- package/dist/host/unbound-clock.js +58 -0
- package/dist/host/unbound-clock.js.map +1 -0
- package/dist/host/unbound.d.ts +37 -0
- package/dist/host/unbound.d.ts.map +1 -0
- package/dist/host/unbound.js +88 -0
- package/dist/host/unbound.js.map +1 -0
- package/dist/host/uuid.d.ts +3 -0
- package/dist/host/uuid.d.ts.map +1 -0
- package/dist/host/uuid.js +38 -0
- package/dist/host/uuid.js.map +1 -0
- package/dist/index.d.ts +29 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/jobs/definition.d.ts +96 -0
- package/dist/jobs/definition.d.ts.map +1 -0
- package/dist/jobs/definition.js +83 -0
- package/dist/jobs/definition.js.map +1 -0
- package/dist/jobs/index.d.ts +5 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +3 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/internal.d.ts +3 -0
- package/dist/jobs/internal.d.ts.map +1 -0
- package/dist/jobs/internal.js +4 -0
- package/dist/jobs/internal.js.map +1 -0
- package/dist/jobs/job.d.ts +149 -0
- package/dist/jobs/job.d.ts.map +1 -0
- package/dist/jobs/job.js +387 -0
- package/dist/jobs/job.js.map +1 -0
- package/dist/jobs/persisted.d.ts +38 -0
- package/dist/jobs/persisted.d.ts.map +1 -0
- package/dist/jobs/persisted.js +95 -0
- package/dist/jobs/persisted.js.map +1 -0
- package/dist/jobs/records.d.ts +231 -0
- package/dist/jobs/records.d.ts.map +1 -0
- package/dist/jobs/records.js +871 -0
- package/dist/jobs/records.js.map +1 -0
- package/dist/jobs/run-states.d.ts +69 -0
- package/dist/jobs/run-states.d.ts.map +1 -0
- package/dist/jobs/run-states.js +228 -0
- package/dist/jobs/run-states.js.map +1 -0
- package/dist/jobs/run.d.ts +117 -0
- package/dist/jobs/run.d.ts.map +1 -0
- package/dist/jobs/run.js +204 -0
- package/dist/jobs/run.js.map +1 -0
- package/dist/jobs/running.d.ts +44 -0
- package/dist/jobs/running.d.ts.map +1 -0
- package/dist/jobs/running.js +117 -0
- package/dist/jobs/running.js.map +1 -0
- package/dist/jobs/stored.d.ts +63 -0
- package/dist/jobs/stored.d.ts.map +1 -0
- package/dist/jobs/stored.js +55 -0
- package/dist/jobs/stored.js.map +1 -0
- package/dist/link/binary.d.ts +4 -0
- package/dist/link/binary.d.ts.map +1 -0
- package/dist/link/binary.js +544 -0
- package/dist/link/binary.js.map +1 -0
- package/dist/link/channel.d.ts +68 -0
- package/dist/link/channel.d.ts.map +1 -0
- package/dist/link/channel.js +215 -0
- package/dist/link/channel.js.map +1 -0
- package/dist/link/errors.d.ts +7 -0
- package/dist/link/errors.d.ts.map +1 -0
- package/dist/link/errors.js +21 -0
- package/dist/link/errors.js.map +1 -0
- package/dist/link/index.d.ts +8 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +8 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/internal.d.ts +9 -0
- package/dist/link/internal.d.ts.map +1 -0
- package/dist/link/internal.js +10 -0
- package/dist/link/internal.js.map +1 -0
- package/dist/link/ipc.d.ts +22 -0
- package/dist/link/ipc.d.ts.map +1 -0
- package/dist/link/ipc.js +64 -0
- package/dist/link/ipc.js.map +1 -0
- package/dist/link/link.d.ts +34 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +87 -0
- package/dist/link/link.js.map +1 -0
- package/dist/link/message.d.ts +262 -0
- package/dist/link/message.d.ts.map +1 -0
- package/dist/link/message.js +156 -0
- package/dist/link/message.js.map +1 -0
- package/dist/link/part.d.ts +80 -0
- package/dist/link/part.d.ts.map +1 -0
- package/dist/link/part.js +165 -0
- package/dist/link/part.js.map +1 -0
- package/dist/link/text.d.ts +6 -0
- package/dist/link/text.d.ts.map +1 -0
- package/dist/link/text.js +355 -0
- package/dist/link/text.js.map +1 -0
- package/dist/link/values.d.ts +40 -0
- package/dist/link/values.d.ts.map +1 -0
- package/dist/link/values.js +121 -0
- package/dist/link/values.js.map +1 -0
- package/dist/link/websocket.d.ts +26 -0
- package/dist/link/websocket.d.ts.map +1 -0
- package/dist/link/websocket.js +91 -0
- package/dist/link/websocket.js.map +1 -0
- package/dist/node/app/app.d.ts +269 -0
- package/dist/node/app/app.d.ts.map +1 -0
- package/dist/node/app/app.js +513 -0
- package/dist/node/app/app.js.map +1 -0
- package/dist/node/app/archive.d.ts +37 -0
- package/dist/node/app/archive.d.ts.map +1 -0
- package/dist/node/app/archive.js +204 -0
- package/dist/node/app/archive.js.map +1 -0
- package/dist/node/app/blobs.d.ts +23 -0
- package/dist/node/app/blobs.d.ts.map +1 -0
- package/dist/node/app/blobs.js +64 -0
- package/dist/node/app/blobs.js.map +1 -0
- package/dist/node/app/data.d.ts +35 -0
- package/dist/node/app/data.d.ts.map +1 -0
- package/dist/node/app/data.js +44 -0
- package/dist/node/app/data.js.map +1 -0
- package/dist/node/app/ephemeral-sessions.d.ts +20 -0
- package/dist/node/app/ephemeral-sessions.d.ts.map +1 -0
- package/dist/node/app/ephemeral-sessions.js +69 -0
- package/dist/node/app/ephemeral-sessions.js.map +1 -0
- package/dist/node/app/ephemeral.d.ts +11 -0
- package/dist/node/app/ephemeral.d.ts.map +1 -0
- package/dist/node/app/ephemeral.js +34 -0
- package/dist/node/app/ephemeral.js.map +1 -0
- package/dist/node/app/files-copy.d.ts +13 -0
- package/dist/node/app/files-copy.d.ts.map +1 -0
- package/dist/node/app/files-copy.js +86 -0
- package/dist/node/app/files-copy.js.map +1 -0
- package/dist/node/app/files-entry.d.ts +4 -0
- package/dist/node/app/files-entry.d.ts.map +1 -0
- package/dist/node/app/files-entry.js +7 -0
- package/dist/node/app/files-entry.js.map +1 -0
- package/dist/node/app/files-index.d.ts +180 -0
- package/dist/node/app/files-index.d.ts.map +1 -0
- package/dist/node/app/files-index.js +535 -0
- package/dist/node/app/files-index.js.map +1 -0
- package/dist/node/app/files.d.ts +363 -0
- package/dist/node/app/files.d.ts.map +1 -0
- package/dist/node/app/files.js +368 -0
- package/dist/node/app/files.js.map +1 -0
- package/dist/node/app/folder-views.d.ts +21 -0
- package/dist/node/app/folder-views.d.ts.map +1 -0
- package/dist/node/app/folder-views.js +55 -0
- package/dist/node/app/folder-views.js.map +1 -0
- package/dist/node/app/index.d.ts +12 -0
- package/dist/node/app/index.d.ts.map +1 -0
- package/dist/node/app/index.js +15 -0
- package/dist/node/app/index.js.map +1 -0
- package/dist/node/app/info.d.ts +66 -0
- package/dist/node/app/info.d.ts.map +1 -0
- package/dist/node/app/info.js +37 -0
- package/dist/node/app/info.js.map +1 -0
- package/dist/node/app/invite.d.ts +5 -0
- package/dist/node/app/invite.d.ts.map +1 -0
- package/dist/node/app/invite.js +64 -0
- package/dist/node/app/invite.js.map +1 -0
- package/dist/node/app/layout.d.ts +36 -0
- package/dist/node/app/layout.d.ts.map +1 -0
- package/dist/node/app/layout.js +87 -0
- package/dist/node/app/layout.js.map +1 -0
- package/dist/node/app/owner.d.ts +31 -0
- package/dist/node/app/owner.d.ts.map +1 -0
- package/dist/node/app/owner.js +104 -0
- package/dist/node/app/owner.js.map +1 -0
- package/dist/node/app/pairing.d.ts +55 -0
- package/dist/node/app/pairing.d.ts.map +1 -0
- package/dist/node/app/pairing.js +183 -0
- package/dist/node/app/pairing.js.map +1 -0
- package/dist/node/app/secrets.d.ts +16 -0
- package/dist/node/app/secrets.d.ts.map +1 -0
- package/dist/node/app/secrets.js +72 -0
- package/dist/node/app/secrets.js.map +1 -0
- package/dist/node/app/sessions.d.ts +72 -0
- package/dist/node/app/sessions.d.ts.map +1 -0
- package/dist/node/app/sessions.js +222 -0
- package/dist/node/app/sessions.js.map +1 -0
- package/dist/node/app/tar.d.ts +24 -0
- package/dist/node/app/tar.d.ts.map +1 -0
- package/dist/node/app/tar.js +167 -0
- package/dist/node/app/tar.js.map +1 -0
- package/dist/node/app/uploads.d.ts +37 -0
- package/dist/node/app/uploads.d.ts.map +1 -0
- package/dist/node/app/uploads.js +157 -0
- package/dist/node/app/uploads.js.map +1 -0
- package/dist/node/app/users.d.ts +37 -0
- package/dist/node/app/users.d.ts.map +1 -0
- package/dist/node/app/users.js +62 -0
- package/dist/node/app/users.js.map +1 -0
- package/dist/node/app/worker.d.ts +18 -0
- package/dist/node/app/worker.d.ts.map +1 -0
- package/dist/node/app/worker.js +84 -0
- package/dist/node/app/worker.js.map +1 -0
- package/dist/node/compression.d.ts +7 -0
- package/dist/node/compression.d.ts.map +1 -0
- package/dist/node/compression.js +25 -0
- package/dist/node/compression.js.map +1 -0
- package/dist/node/http/admission.d.ts +63 -0
- package/dist/node/http/admission.d.ts.map +1 -0
- package/dist/node/http/admission.js +134 -0
- package/dist/node/http/admission.js.map +1 -0
- package/dist/node/http/authenticate.d.ts +21 -0
- package/dist/node/http/authenticate.d.ts.map +1 -0
- package/dist/node/http/authenticate.js +34 -0
- package/dist/node/http/authenticate.js.map +1 -0
- package/dist/node/http/cookies.d.ts +32 -0
- package/dist/node/http/cookies.d.ts.map +1 -0
- package/dist/node/http/cookies.js +70 -0
- package/dist/node/http/cookies.js.map +1 -0
- package/dist/node/http/file.d.ts +23 -0
- package/dist/node/http/file.d.ts.map +1 -0
- package/dist/node/http/file.js +94 -0
- package/dist/node/http/file.js.map +1 -0
- package/dist/node/http/headers.d.ts +37 -0
- package/dist/node/http/headers.d.ts.map +1 -0
- package/dist/node/http/headers.js +136 -0
- package/dist/node/http/headers.js.map +1 -0
- package/dist/node/http/http.d.ts +111 -0
- package/dist/node/http/http.d.ts.map +1 -0
- package/dist/node/http/http.js +524 -0
- package/dist/node/http/http.js.map +1 -0
- package/dist/node/http/incoming.d.ts +19 -0
- package/dist/node/http/incoming.d.ts.map +1 -0
- package/dist/node/http/incoming.js +31 -0
- package/dist/node/http/incoming.js.map +1 -0
- package/dist/node/http/index.d.ts +11 -0
- package/dist/node/http/index.d.ts.map +1 -0
- package/dist/node/http/index.js +12 -0
- package/dist/node/http/index.js.map +1 -0
- package/dist/node/http/node.d.ts +78 -0
- package/dist/node/http/node.d.ts.map +1 -0
- package/dist/node/http/node.js +291 -0
- package/dist/node/http/node.js.map +1 -0
- package/dist/node/http/request.d.ts +60 -0
- package/dist/node/http/request.d.ts.map +1 -0
- package/dist/node/http/request.js +118 -0
- package/dist/node/http/request.js.map +1 -0
- package/dist/node/http/response.d.ts +63 -0
- package/dist/node/http/response.d.ts.map +1 -0
- package/dist/node/http/response.js +202 -0
- package/dist/node/http/response.js.map +1 -0
- package/dist/node/http/router.d.ts +132 -0
- package/dist/node/http/router.d.ts.map +1 -0
- package/dist/node/http/router.js +267 -0
- package/dist/node/http/router.js.map +1 -0
- package/dist/node/http/upgrades.d.ts +61 -0
- package/dist/node/http/upgrades.d.ts.map +1 -0
- package/dist/node/http/upgrades.js +192 -0
- package/dist/node/http/upgrades.js.map +1 -0
- package/dist/node/plugins/base-inputs.d.ts +14 -0
- package/dist/node/plugins/base-inputs.d.ts.map +1 -0
- package/dist/node/plugins/base-inputs.js +33 -0
- package/dist/node/plugins/base-inputs.js.map +1 -0
- package/dist/node/plugins/build.d.ts +77 -0
- package/dist/node/plugins/build.d.ts.map +1 -0
- package/dist/node/plugins/build.js +576 -0
- package/dist/node/plugins/build.js.map +1 -0
- package/dist/node/plugins/css-modules.d.ts +13 -0
- package/dist/node/plugins/css-modules.d.ts.map +1 -0
- package/dist/node/plugins/css-modules.js +58 -0
- package/dist/node/plugins/css-modules.js.map +1 -0
- package/dist/node/plugins/discover.d.ts +67 -0
- package/dist/node/plugins/discover.d.ts.map +1 -0
- package/dist/node/plugins/discover.js +369 -0
- package/dist/node/plugins/discover.js.map +1 -0
- package/dist/node/plugins/evaluate.d.ts +33 -0
- package/dist/node/plugins/evaluate.d.ts.map +1 -0
- package/dist/node/plugins/evaluate.js +121 -0
- package/dist/node/plugins/evaluate.js.map +1 -0
- package/dist/node/plugins/index.d.ts +11 -0
- package/dist/node/plugins/index.d.ts.map +1 -0
- package/dist/node/plugins/index.js +13 -0
- package/dist/node/plugins/index.js.map +1 -0
- package/dist/node/plugins/install.d.ts +38 -0
- package/dist/node/plugins/install.d.ts.map +1 -0
- package/dist/node/plugins/install.js +213 -0
- package/dist/node/plugins/install.js.map +1 -0
- package/dist/node/plugins/plugins.d.ts +162 -0
- package/dist/node/plugins/plugins.d.ts.map +1 -0
- package/dist/node/plugins/plugins.js +244 -0
- package/dist/node/plugins/plugins.js.map +1 -0
- package/dist/node/plugins/runtime.d.ts +57 -0
- package/dist/node/plugins/runtime.d.ts.map +1 -0
- package/dist/node/plugins/runtime.js +92 -0
- package/dist/node/plugins/runtime.js.map +1 -0
- package/dist/node/plugins/stack.d.ts +16 -0
- package/dist/node/plugins/stack.d.ts.map +1 -0
- package/dist/node/plugins/stack.js +61 -0
- package/dist/node/plugins/stack.js.map +1 -0
- package/dist/node/plugins/testing.d.ts +58 -0
- package/dist/node/plugins/testing.d.ts.map +1 -0
- package/dist/node/plugins/testing.js +210 -0
- package/dist/node/plugins/testing.js.map +1 -0
- package/dist/node/plugins/watcher.d.ts +69 -0
- package/dist/node/plugins/watcher.d.ts.map +1 -0
- package/dist/node/plugins/watcher.js +622 -0
- package/dist/node/plugins/watcher.js.map +1 -0
- package/dist/node/surfaces/bundle.d.ts +31 -0
- package/dist/node/surfaces/bundle.d.ts.map +1 -0
- package/dist/node/surfaces/bundle.js +118 -0
- package/dist/node/surfaces/bundle.js.map +1 -0
- package/dist/node/surfaces/current.d.ts +17 -0
- package/dist/node/surfaces/current.d.ts.map +1 -0
- package/dist/node/surfaces/current.js +54 -0
- package/dist/node/surfaces/current.js.map +1 -0
- package/dist/node/surfaces/index.d.ts +6 -0
- package/dist/node/surfaces/index.d.ts.map +1 -0
- package/dist/node/surfaces/index.js +6 -0
- package/dist/node/surfaces/index.js.map +1 -0
- package/dist/node/surfaces/published.d.ts +27 -0
- package/dist/node/surfaces/published.d.ts.map +1 -0
- package/dist/node/surfaces/published.js +142 -0
- package/dist/node/surfaces/published.js.map +1 -0
- package/dist/node/surfaces/served.d.ts +15 -0
- package/dist/node/surfaces/served.d.ts.map +1 -0
- package/dist/node/surfaces/served.js +42 -0
- package/dist/node/surfaces/served.js.map +1 -0
- package/dist/node/surfaces/surface-build.d.ts +53 -0
- package/dist/node/surfaces/surface-build.d.ts.map +1 -0
- package/dist/node/surfaces/surface-build.js +105 -0
- package/dist/node/surfaces/surface-build.js.map +1 -0
- package/dist/node/surfaces/tui.d.ts +40 -0
- package/dist/node/surfaces/tui.d.ts.map +1 -0
- package/dist/node/surfaces/tui.js +55 -0
- package/dist/node/surfaces/tui.js.map +1 -0
- package/dist/node/surfaces/web.d.ts +56 -0
- package/dist/node/surfaces/web.d.ts.map +1 -0
- package/dist/node/surfaces/web.js +108 -0
- package/dist/node/surfaces/web.js.map +1 -0
- package/dist/node/tui/actions.d.ts +49 -0
- package/dist/node/tui/actions.d.ts.map +1 -0
- package/dist/node/tui/actions.js +195 -0
- package/dist/node/tui/actions.js.map +1 -0
- package/dist/node/tui/credentials.d.ts +17 -0
- package/dist/node/tui/credentials.d.ts.map +1 -0
- package/dist/node/tui/credentials.js +54 -0
- package/dist/node/tui/credentials.js.map +1 -0
- package/dist/node/tui/filter.d.ts +5 -0
- package/dist/node/tui/filter.d.ts.map +1 -0
- package/dist/node/tui/filter.js +79 -0
- package/dist/node/tui/filter.js.map +1 -0
- package/dist/node/tui/index.d.ts +6 -0
- package/dist/node/tui/index.d.ts.map +1 -0
- package/dist/node/tui/index.js +6 -0
- package/dist/node/tui/index.js.map +1 -0
- package/dist/node/tui/launcher.d.ts +40 -0
- package/dist/node/tui/launcher.d.ts.map +1 -0
- package/dist/node/tui/launcher.js +439 -0
- package/dist/node/tui/launcher.js.map +1 -0
- package/dist/node/tui/pipe.d.ts +18 -0
- package/dist/node/tui/pipe.d.ts.map +1 -0
- package/dist/node/tui/pipe.js +134 -0
- package/dist/node/tui/pipe.js.map +1 -0
- package/dist/node/tui/sandbox.d.ts +54 -0
- package/dist/node/tui/sandbox.d.ts.map +1 -0
- package/dist/node/tui/sandbox.js +431 -0
- package/dist/node/tui/sandbox.js.map +1 -0
- package/dist/node/workers/base.d.ts +30 -0
- package/dist/node/workers/base.d.ts.map +1 -0
- package/dist/node/workers/base.js +255 -0
- package/dist/node/workers/base.js.map +1 -0
- package/dist/node/workers/child.d.ts +4 -0
- package/dist/node/workers/child.d.ts.map +1 -0
- package/dist/node/workers/child.js +6 -0
- package/dist/node/workers/child.js.map +1 -0
- package/dist/node/workers/control.d.ts +83 -0
- package/dist/node/workers/control.d.ts.map +1 -0
- package/dist/node/workers/control.js +77 -0
- package/dist/node/workers/control.js.map +1 -0
- package/dist/node/workers/index.d.ts +4 -0
- package/dist/node/workers/index.d.ts.map +1 -0
- package/dist/node/workers/index.js +7 -0
- package/dist/node/workers/index.js.map +1 -0
- package/dist/node/workers/lock.d.ts +30 -0
- package/dist/node/workers/lock.d.ts.map +1 -0
- package/dist/node/workers/lock.js +180 -0
- package/dist/node/workers/lock.js.map +1 -0
- package/dist/node/workers/main.d.ts +46 -0
- package/dist/node/workers/main.d.ts.map +1 -0
- package/dist/node/workers/main.js +230 -0
- package/dist/node/workers/main.js.map +1 -0
- package/dist/node/workers/process.d.ts +42 -0
- package/dist/node/workers/process.d.ts.map +1 -0
- package/dist/node/workers/process.js +125 -0
- package/dist/node/workers/process.js.map +1 -0
- package/dist/node/workers/workers.d.ts +122 -0
- package/dist/node/workers/workers.d.ts.map +1 -0
- package/dist/node/workers/workers.js +677 -0
- package/dist/node/workers/workers.js.map +1 -0
- package/dist/output.d.ts +1 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +4 -2
- package/dist/output.js.map +1 -1
- package/dist/react/hooks.d.ts +43 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +82 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/stores.d.ts +9 -0
- package/dist/react/stores.d.ts.map +1 -0
- package/dist/react/stores.js +37 -0
- package/dist/react/stores.js.map +1 -0
- package/dist/registries/contribution.d.ts +50 -0
- package/dist/registries/contribution.d.ts.map +1 -0
- package/dist/registries/contribution.js +129 -0
- package/dist/registries/contribution.js.map +1 -0
- package/dist/registries/entries.d.ts +18 -0
- package/dist/registries/entries.d.ts.map +1 -0
- package/dist/registries/entries.js +42 -0
- package/dist/registries/entries.js.map +1 -0
- package/dist/registries/index.d.ts +3 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/index.js +5 -0
- package/dist/registries/index.js.map +1 -0
- package/dist/registries/internal.d.ts +4 -0
- package/dist/registries/internal.d.ts.map +1 -0
- package/dist/registries/internal.js +5 -0
- package/dist/registries/internal.js.map +1 -0
- package/dist/registries/record.d.ts +115 -0
- package/dist/registries/record.d.ts.map +1 -0
- package/dist/registries/record.js +283 -0
- package/dist/registries/record.js.map +1 -0
- package/dist/registries/registry.d.ts +74 -0
- package/dist/registries/registry.d.ts.map +1 -0
- package/dist/registries/registry.js +14 -0
- package/dist/registries/registry.js.map +1 -0
- package/dist/registries/value.d.ts +48 -0
- package/dist/registries/value.d.ts.map +1 -0
- package/dist/registries/value.js +224 -0
- package/dist/registries/value.js.map +1 -0
- package/dist/remote/calls.d.ts +25 -0
- package/dist/remote/calls.d.ts.map +1 -0
- package/dist/remote/calls.js +62 -0
- package/dist/remote/calls.js.map +1 -0
- package/dist/remote/consumer.d.ts +43 -0
- package/dist/remote/consumer.d.ts.map +1 -0
- package/dist/remote/consumer.js +350 -0
- package/dist/remote/consumer.js.map +1 -0
- package/dist/remote/hold.d.ts +141 -0
- package/dist/remote/hold.d.ts.map +1 -0
- package/dist/remote/hold.js +579 -0
- package/dist/remote/hold.js.map +1 -0
- package/dist/remote/host-link.d.ts +77 -0
- package/dist/remote/host-link.d.ts.map +1 -0
- package/dist/remote/host-link.js +184 -0
- package/dist/remote/host-link.js.map +1 -0
- package/dist/remote/internal.d.ts +6 -0
- package/dist/remote/internal.d.ts.map +1 -0
- package/dist/remote/internal.js +6 -0
- package/dist/remote/internal.js.map +1 -0
- package/dist/remote/path.d.ts +46 -0
- package/dist/remote/path.d.ts.map +1 -0
- package/dist/remote/path.js +73 -0
- package/dist/remote/path.js.map +1 -0
- package/dist/remote/provider.d.ts +89 -0
- package/dist/remote/provider.d.ts.map +1 -0
- package/dist/remote/provider.js +597 -0
- package/dist/remote/provider.js.map +1 -0
- package/dist/remote/relay.d.ts +69 -0
- package/dist/remote/relay.d.ts.map +1 -0
- package/dist/remote/relay.js +219 -0
- package/dist/remote/relay.js.map +1 -0
- package/dist/remote/remote-object.d.ts +138 -0
- package/dist/remote/remote-object.d.ts.map +1 -0
- package/dist/remote/remote-object.js +492 -0
- package/dist/remote/remote-object.js.map +1 -0
- package/dist/remote/replica.d.ts +59 -0
- package/dist/remote/replica.d.ts.map +1 -0
- package/dist/remote/replica.js +125 -0
- package/dist/remote/replica.js.map +1 -0
- package/dist/sqlite/cloudflare.d.ts +2 -0
- package/dist/sqlite/cloudflare.d.ts.map +1 -1
- package/dist/sqlite/cloudflare.js +10 -0
- package/dist/sqlite/cloudflare.js.map +1 -1
- package/dist/sqlite/database.d.ts +5 -2
- package/dist/sqlite/database.d.ts.map +1 -1
- package/dist/sqlite/database.js.map +1 -1
- package/dist/sqlite/node.d.ts +13 -2
- package/dist/sqlite/node.d.ts.map +1 -1
- package/dist/sqlite/node.js +31 -8
- package/dist/sqlite/node.js.map +1 -1
- package/dist/state/batch.d.ts +64 -0
- package/dist/state/batch.d.ts.map +1 -0
- package/dist/state/batch.js +164 -0
- package/dist/state/batch.js.map +1 -0
- package/dist/state/derive.d.ts +52 -0
- package/dist/state/derive.d.ts.map +1 -0
- package/dist/state/derive.js +182 -0
- package/dist/state/derive.js.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +4 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/internal.d.ts +6 -0
- package/dist/state/internal.d.ts.map +1 -0
- package/dist/state/internal.js +8 -0
- package/dist/state/internal.js.map +1 -0
- package/dist/state/native-source.d.ts +106 -0
- package/dist/state/native-source.d.ts.map +1 -0
- package/dist/state/native-source.js +240 -0
- package/dist/state/native-source.js.map +1 -0
- package/dist/state/watchable.d.ts +114 -0
- package/dist/state/watchable.d.ts.map +1 -0
- package/dist/state/watchable.js +156 -0
- package/dist/state/watchable.js.map +1 -0
- package/dist/state/writable.d.ts +32 -0
- package/dist/state/writable.d.ts.map +1 -0
- package/dist/state/writable.js +49 -0
- package/dist/state/writable.js.map +1 -0
- package/dist/store/adapter.d.ts +67 -0
- package/dist/store/adapter.d.ts.map +1 -0
- package/dist/store/adapter.js +118 -0
- package/dist/store/adapter.js.map +1 -0
- package/dist/store/allocator.d.ts +17 -0
- package/dist/store/allocator.d.ts.map +1 -0
- package/dist/store/allocator.js +30 -0
- package/dist/store/allocator.js.map +1 -0
- package/dist/store/applier.d.ts +8 -0
- package/dist/store/applier.d.ts.map +1 -0
- package/dist/store/applier.js +375 -0
- package/dist/store/applier.js.map +1 -0
- package/dist/store/apply-batch.d.ts +12 -0
- package/dist/store/apply-batch.d.ts.map +1 -0
- package/dist/store/apply-batch.js +83 -0
- package/dist/store/apply-batch.js.map +1 -0
- package/dist/store/archive.d.ts +32 -0
- package/dist/store/archive.d.ts.map +1 -0
- package/dist/store/archive.js +130 -0
- package/dist/store/archive.js.map +1 -0
- package/dist/store/backend.d.ts +10 -0
- package/dist/store/backend.d.ts.map +1 -0
- package/dist/store/backend.js +15 -0
- package/dist/store/backend.js.map +1 -0
- package/dist/store/catalog.d.ts +24 -0
- package/dist/store/catalog.d.ts.map +1 -0
- package/dist/store/catalog.js +17 -0
- package/dist/store/catalog.js.map +1 -0
- package/dist/store/claims.d.ts +23 -0
- package/dist/store/claims.d.ts.map +1 -0
- package/dist/store/claims.js +65 -0
- package/dist/store/claims.js.map +1 -0
- package/dist/store/columns.d.ts +77 -0
- package/dist/store/columns.d.ts.map +1 -0
- package/dist/store/columns.js +77 -0
- package/dist/store/columns.js.map +1 -0
- package/dist/store/engine.d.ts +176 -0
- package/dist/store/engine.d.ts.map +1 -0
- package/dist/store/engine.js +283 -0
- package/dist/store/engine.js.map +1 -0
- package/dist/store/evaluate.d.ts +17 -0
- package/dist/store/evaluate.d.ts.map +1 -0
- package/dist/store/evaluate.js +128 -0
- package/dist/store/evaluate.js.map +1 -0
- package/dist/store/export.d.ts +17 -0
- package/dist/store/export.d.ts.map +1 -0
- package/dist/store/export.js +200 -0
- package/dist/store/export.js.map +1 -0
- package/dist/store/expression.d.ts +150 -0
- package/dist/store/expression.d.ts.map +1 -0
- package/dist/store/expression.js +268 -0
- package/dist/store/expression.js.map +1 -0
- package/dist/store/import.d.ts +10 -0
- package/dist/store/import.d.ts.map +1 -0
- package/dist/store/import.js +276 -0
- package/dist/store/import.js.map +1 -0
- package/dist/store/index.d.ts +16 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +13 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/json-column.d.ts +33 -0
- package/dist/store/json-column.d.ts.map +1 -0
- package/dist/store/json-column.js +62 -0
- package/dist/store/json-column.js.map +1 -0
- package/dist/store/jsonl.d.ts +9 -0
- package/dist/store/jsonl.d.ts.map +1 -0
- package/dist/store/jsonl.js +61 -0
- package/dist/store/jsonl.js.map +1 -0
- package/dist/store/live-query.d.ts +108 -0
- package/dist/store/live-query.d.ts.map +1 -0
- package/dist/store/live-query.js +254 -0
- package/dist/store/live-query.js.map +1 -0
- package/dist/store/outbox.d.ts +26 -0
- package/dist/store/outbox.d.ts.map +1 -0
- package/dist/store/outbox.js +80 -0
- package/dist/store/outbox.js.map +1 -0
- package/dist/store/query.d.ts +39 -0
- package/dist/store/query.d.ts.map +1 -0
- package/dist/store/query.js +97 -0
- package/dist/store/query.js.map +1 -0
- package/dist/store/refusal.d.ts +15 -0
- package/dist/store/refusal.d.ts.map +1 -0
- package/dist/store/refusal.js +36 -0
- package/dist/store/refusal.js.map +1 -0
- package/dist/store/rows.d.ts +80 -0
- package/dist/store/rows.d.ts.map +1 -0
- package/dist/store/rows.js +183 -0
- package/dist/store/rows.js.map +1 -0
- package/dist/store/schema.d.ts +25 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +115 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/sql.d.ts +73 -0
- package/dist/store/sql.d.ts.map +1 -0
- package/dist/store/sql.js +234 -0
- package/dist/store/sql.js.map +1 -0
- package/dist/store/step.d.ts +50 -0
- package/dist/store/step.d.ts.map +1 -0
- package/dist/store/step.js +52 -0
- package/dist/store/step.js.map +1 -0
- package/dist/store/store.d.ts +171 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +818 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/table-changes.d.ts +29 -0
- package/dist/store/table-changes.d.ts.map +1 -0
- package/dist/store/table-changes.js +102 -0
- package/dist/store/table-changes.js.map +1 -0
- package/dist/store/table-evolve.d.ts +74 -0
- package/dist/store/table-evolve.d.ts.map +1 -0
- package/dist/store/table-evolve.js +201 -0
- package/dist/store/table-evolve.js.map +1 -0
- package/dist/store/table-handle.d.ts +73 -0
- package/dist/store/table-handle.d.ts.map +1 -0
- package/dist/store/table-handle.js +101 -0
- package/dist/store/table-handle.js.map +1 -0
- package/dist/store/table-history.d.ts +75 -0
- package/dist/store/table-history.d.ts.map +1 -0
- package/dist/store/table-history.js +42 -0
- package/dist/store/table-history.js.map +1 -0
- package/dist/store/table-migration.d.ts +16 -0
- package/dist/store/table-migration.d.ts.map +1 -0
- package/dist/store/table-migration.js +202 -0
- package/dist/store/table-migration.js.map +1 -0
- package/dist/store/table-writes.d.ts +125 -0
- package/dist/store/table-writes.d.ts.map +1 -0
- package/dist/store/table-writes.js +170 -0
- package/dist/store/table-writes.js.map +1 -0
- package/dist/store/table.d.ts +80 -0
- package/dist/store/table.d.ts.map +1 -0
- package/dist/store/table.js +103 -0
- package/dist/store/table.js.map +1 -0
- package/dist/store/text.d.ts +14 -0
- package/dist/store/text.d.ts.map +1 -0
- package/dist/store/text.js +51 -0
- package/dist/store/text.js.map +1 -0
- package/dist/store/writes.d.ts +5 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +4 -0
- package/dist/store/writes.js.map +1 -0
- package/dist/surfaces/active-language.d.ts +20 -0
- package/dist/surfaces/active-language.d.ts.map +1 -0
- package/dist/surfaces/active-language.js +78 -0
- package/dist/surfaces/active-language.js.map +1 -0
- package/dist/surfaces/active-theme.d.ts +16 -0
- package/dist/surfaces/active-theme.d.ts.map +1 -0
- package/dist/surfaces/active-theme.js +47 -0
- package/dist/surfaces/active-theme.js.map +1 -0
- package/dist/surfaces/client.d.ts +96 -0
- package/dist/surfaces/client.d.ts.map +1 -0
- package/dist/surfaces/client.js +264 -0
- package/dist/surfaces/client.js.map +1 -0
- package/dist/surfaces/connection.d.ts +49 -0
- package/dist/surfaces/connection.d.ts.map +1 -0
- package/dist/surfaces/connection.js +142 -0
- package/dist/surfaces/connection.js.map +1 -0
- package/dist/surfaces/format.d.ts +5 -0
- package/dist/surfaces/format.d.ts.map +1 -0
- package/dist/surfaces/format.js +37 -0
- package/dist/surfaces/format.js.map +1 -0
- package/dist/surfaces/index.d.ts +15 -0
- package/dist/surfaces/index.d.ts.map +1 -0
- package/dist/surfaces/index.js +18 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/language.d.ts +53 -0
- package/dist/surfaces/language.d.ts.map +1 -0
- package/dist/surfaces/language.js +74 -0
- package/dist/surfaces/language.js.map +1 -0
- package/dist/surfaces/loaded.d.ts +42 -0
- package/dist/surfaces/loaded.d.ts.map +1 -0
- package/dist/surfaces/loaded.js +116 -0
- package/dist/surfaces/loaded.js.map +1 -0
- package/dist/surfaces/locale-choice.d.ts +25 -0
- package/dist/surfaces/locale-choice.d.ts.map +1 -0
- package/dist/surfaces/locale-choice.js +14 -0
- package/dist/surfaces/locale-choice.js.map +1 -0
- package/dist/surfaces/messages.d.ts +67 -0
- package/dist/surfaces/messages.d.ts.map +1 -0
- package/dist/surfaces/messages.js +112 -0
- package/dist/surfaces/messages.js.map +1 -0
- package/dist/surfaces/page-state.d.ts +14 -0
- package/dist/surfaces/page-state.d.ts.map +1 -0
- package/dist/surfaces/page-state.js +43 -0
- package/dist/surfaces/page-state.js.map +1 -0
- package/dist/surfaces/preference.d.ts +32 -0
- package/dist/surfaces/preference.d.ts.map +1 -0
- package/dist/surfaces/preference.js +72 -0
- package/dist/surfaces/preference.js.map +1 -0
- package/dist/surfaces/registered.d.ts +33 -0
- package/dist/surfaces/registered.d.ts.map +1 -0
- package/dist/surfaces/registered.js +51 -0
- package/dist/surfaces/registered.js.map +1 -0
- package/dist/surfaces/scripts.d.ts +84 -0
- package/dist/surfaces/scripts.d.ts.map +1 -0
- package/dist/surfaces/scripts.js +28 -0
- package/dist/surfaces/scripts.js.map +1 -0
- package/dist/surfaces/theme-choice.d.ts +31 -0
- package/dist/surfaces/theme-choice.d.ts.map +1 -0
- package/dist/surfaces/theme-choice.js +18 -0
- package/dist/surfaces/theme-choice.js.map +1 -0
- package/dist/surfaces/themes.d.ts +43 -0
- package/dist/surfaces/themes.d.ts.map +1 -0
- package/dist/surfaces/themes.js +110 -0
- package/dist/surfaces/themes.js.map +1 -0
- package/dist/surfaces/translations.d.ts +29 -0
- package/dist/surfaces/translations.d.ts.map +1 -0
- package/dist/surfaces/translations.js +57 -0
- package/dist/surfaces/translations.js.map +1 -0
- package/dist/sync/batch.d.ts +18 -0
- package/dist/sync/batch.d.ts.map +1 -0
- package/dist/sync/batch.js +125 -0
- package/dist/sync/batch.js.map +1 -0
- package/dist/sync/client.d.ts +166 -0
- package/dist/sync/client.d.ts.map +1 -0
- package/dist/sync/client.js +438 -0
- package/dist/sync/client.js.map +1 -0
- package/dist/sync/files.d.ts +46 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +13 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/filesystem.d.ts +37 -0
- package/dist/sync/filesystem.d.ts.map +1 -0
- package/dist/sync/filesystem.js +185 -0
- package/dist/sync/filesystem.js.map +1 -0
- package/dist/sync/index.d.ts +8 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +9 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/lines.d.ts +18 -0
- package/dist/sync/lines.d.ts.map +1 -0
- package/dist/sync/lines.js +46 -0
- package/dist/sync/lines.js.map +1 -0
- package/dist/sync/remote.d.ts +130 -0
- package/dist/sync/remote.d.ts.map +1 -0
- package/dist/sync/remote.js +46 -0
- package/dist/sync/remote.js.map +1 -0
- package/dist/sync/state.d.ts +17 -0
- package/dist/sync/state.d.ts.map +1 -0
- package/dist/sync/state.js +40 -0
- package/dist/sync/state.js.map +1 -0
- package/dist/telemetry-ingest/batch.d.ts +70 -0
- package/dist/telemetry-ingest/batch.d.ts.map +1 -0
- package/dist/telemetry-ingest/batch.js +110 -0
- package/dist/telemetry-ingest/batch.js.map +1 -0
- package/dist/telemetry-ingest/facet.d.ts +21 -0
- package/dist/telemetry-ingest/facet.d.ts.map +1 -0
- package/dist/telemetry-ingest/facet.js +96 -0
- package/dist/telemetry-ingest/facet.js.map +1 -0
- package/dist/telemetry-ingest/index.d.ts +5 -0
- package/dist/telemetry-ingest/index.d.ts.map +1 -0
- package/dist/telemetry-ingest/index.js +8 -0
- package/dist/telemetry-ingest/index.js.map +1 -0
- package/dist/telemetry-ingest/recorder.d.ts +50 -0
- package/dist/telemetry-ingest/recorder.d.ts.map +1 -0
- package/dist/telemetry-ingest/recorder.js +298 -0
- package/dist/telemetry-ingest/recorder.js.map +1 -0
- package/dist/telemetry-ingest/sender.d.ts +14 -0
- package/dist/telemetry-ingest/sender.d.ts.map +1 -0
- package/dist/telemetry-ingest/sender.js +64 -0
- package/dist/telemetry-ingest/sender.js.map +1 -0
- package/dist/telemetry-sqlite/index.d.ts +13 -4
- package/dist/telemetry-sqlite/index.d.ts.map +1 -1
- package/dist/telemetry-sqlite/index.js +81 -241
- package/dist/telemetry-sqlite/index.js.map +1 -1
- package/dist/telemetry-sqlite/node.d.ts +13 -0
- package/dist/telemetry-sqlite/node.d.ts.map +1 -0
- package/dist/telemetry-sqlite/node.js +27 -0
- package/dist/telemetry-sqlite/node.js.map +1 -0
- package/dist/telemetry-sqlite/schema.d.ts +9 -0
- package/dist/telemetry-sqlite/schema.d.ts.map +1 -0
- package/dist/telemetry-sqlite/schema.js +61 -0
- package/dist/telemetry-sqlite/schema.js.map +1 -0
- package/dist/telemetry-sqlite/store.d.ts +3 -0
- package/dist/telemetry-sqlite/store.d.ts.map +1 -1
- package/dist/telemetry-sqlite/store.js +24 -13
- package/dist/telemetry-sqlite/store.js.map +1 -1
- package/dist/telemetry.d.ts +937 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +470 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tui/bridge.d.ts +112 -0
- package/dist/tui/bridge.d.ts.map +1 -0
- package/dist/tui/bridge.js +9 -0
- package/dist/tui/bridge.js.map +1 -0
- package/dist/tui/channel.d.ts +44 -0
- package/dist/tui/channel.d.ts.map +1 -0
- package/dist/tui/channel.js +150 -0
- package/dist/tui/channel.js.map +1 -0
- package/dist/tui/frames.d.ts +5 -0
- package/dist/tui/frames.d.ts.map +1 -0
- package/dist/tui/frames.js +52 -0
- package/dist/tui/frames.js.map +1 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/runtime.d.ts +46 -0
- package/dist/tui/runtime.d.ts.map +1 -0
- package/dist/tui/runtime.js +101 -0
- package/dist/tui/runtime.js.map +1 -0
- package/dist/tui/scope.d.ts +46 -0
- package/dist/tui/scope.d.ts.map +1 -0
- package/dist/tui/scope.js +141 -0
- package/dist/tui/scope.js.map +1 -0
- package/dist/tui/terminal.d.ts +15 -0
- package/dist/tui/terminal.d.ts.map +1 -0
- package/dist/tui/terminal.js +37 -0
- package/dist/tui/terminal.js.map +1 -0
- package/dist/tui/theme.d.ts +17 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +38 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/watch.d.ts +194 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +383 -0
- package/dist/watch.js.map +1 -0
- package/dist/web/environment.d.ts +4 -0
- package/dist/web/environment.d.ts.map +1 -0
- package/dist/web/environment.js +37 -0
- package/dist/web/environment.js.map +1 -0
- package/dist/web/index.d.ts +5 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +7 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/language.d.ts +7 -0
- package/dist/web/language.d.ts.map +1 -0
- package/dist/web/language.js +21 -0
- package/dist/web/language.js.map +1 -0
- package/dist/web/page.d.ts +29 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +92 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/scripts.d.ts +23 -0
- package/dist/web/scripts.d.ts.map +1 -0
- package/dist/web/scripts.js +50 -0
- package/dist/web/scripts.js.map +1 -0
- package/dist/web/styles.d.ts +17 -0
- package/dist/web/styles.d.ts.map +1 -0
- package/dist/web/styles.js +218 -0
- package/dist/web/styles.js.map +1 -0
- package/dist/web/themes.d.ts +6 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +31 -0
- package/dist/web/themes.js.map +1 -0
- package/docs/benchmarks.md +1036 -0
- package/docs/decisions.md +3436 -0
- package/docs/dependencies/book.md +1671 -0
- package/docs/dependencies/index.html +2641 -0
- package/docs/dependencies/model.md +330 -0
- package/docs/design.md +3065 -0
- package/docs/durable-observers/book.md +432 -0
- package/docs/durable-observers/index.html +517 -0
- package/docs/flow-control/book.md +333 -0
- package/docs/flow-control/fold/index.html +265 -0
- package/docs/flow-control/index.html +548 -0
- package/docs/flow-control/window/index.html +228 -0
- package/docs/guide-plugins-hosts/book.md +957 -0
- package/docs/guide-plugins-hosts/index.html +952 -0
- package/docs/http-workers/book.md +378 -0
- package/docs/http-workers/index.html +515 -0
- package/docs/i18n/book.md +217 -0
- package/docs/i18n/index.html +344 -0
- package/docs/layer-1.md +311 -0
- package/docs/layer-2.md +216 -0
- package/docs/p3-features/README.md +6 -0
- package/docs/p3-features/book.md +478 -0
- package/docs/plugin-authoring.md +276 -0
- package/docs/plugin-model/book.md +186 -0
- package/docs/plugin-model/index.html +310 -0
- package/docs/plugin-primer/book.md +273 -0
- package/docs/plugin-primer/index.html +430 -0
- package/docs/slice-1.md +236 -0
- package/docs/slice-10.md +288 -0
- package/docs/slice-11.md +114 -0
- package/docs/slice-12.md +132 -0
- package/docs/slice-13.md +121 -0
- package/docs/slice-2.md +174 -0
- package/docs/slice-3a.md +296 -0
- package/docs/slice-3b.md +197 -0
- package/docs/slice-4.md +146 -0
- package/docs/slice-4a.md +418 -0
- package/docs/slice-4b.md +208 -0
- package/docs/slice-5.md +281 -0
- package/docs/slice-6a.md +676 -0
- package/docs/slice-6b.md +332 -0
- package/docs/slice-7a.md +130 -0
- package/docs/slice-7b/book.md +608 -0
- package/docs/slice-7b/index.html +842 -0
- package/docs/slice-7b.md +255 -0
- package/docs/slice-7c.md +165 -0
- package/docs/slice-8.md +194 -0
- package/docs/slice-9.md +110 -0
- package/docs/slices.md +241 -0
- package/docs/store/book.md +670 -0
- package/docs/store/index.html +861 -0
- package/docs/store/walkthrough.md +193 -0
- package/docs/theming/book.md +223 -0
- package/docs/theming/index.html +371 -0
- package/docs/tutorial/book.md +2169 -0
- package/docs/tutorial/index.html +2112 -0
- package/docs/tutorial/screens/click-after.png +0 -0
- package/docs/tutorial/screens/click-before.png +0 -0
- package/docs/tutorial/screens/edited.png +0 -0
- package/docs/tutorial/screens/french.png +0 -0
- package/docs/tutorial/screens/harbor.png +0 -0
- package/docs/tutorial/screens/page.png +0 -0
- package/docs/tutorial/screens/traces-ada.png +0 -0
- package/docs/tutorial/screens/traces.png +0 -0
- package/package.json +114 -20
- package/src/delta/README.md +69 -0
- package/dist/cell.d.ts +0 -122
- package/dist/cell.d.ts.map +0 -1
- package/dist/cell.js +0 -356
- package/dist/cell.js.map +0 -1
- package/dist/cluster.d.ts +0 -27
- package/dist/cluster.d.ts.map +0 -1
- package/dist/cluster.js +0 -230
- package/dist/cluster.js.map +0 -1
- package/dist/connection.d.ts +0 -270
- package/dist/connection.d.ts.map +0 -1
- package/dist/connection.js +0 -1216
- package/dist/connection.js.map +0 -1
- package/dist/contract.d.ts +0 -208
- package/dist/contract.d.ts.map +0 -1
- package/dist/contract.js +0 -246
- package/dist/contract.js.map +0 -1
- package/dist/declare.d.ts +0 -33
- package/dist/declare.d.ts.map +0 -1
- package/dist/declare.js +0 -2
- package/dist/declare.js.map +0 -1
- package/dist/errors.d.ts +0 -28
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -59
- package/dist/errors.js.map +0 -1
- package/dist/host.d.ts +0 -348
- package/dist/host.d.ts.map +0 -1
- package/dist/host.js +0 -1000
- package/dist/host.js.map +0 -1
- package/dist/link.d.ts +0 -107
- package/dist/link.d.ts.map +0 -1
- package/dist/link.js +0 -355
- package/dist/link.js.map +0 -1
- package/dist/loader.d.ts +0 -4
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -73
- package/dist/loader.js.map +0 -1
- package/dist/manager.d.ts +0 -115
- package/dist/manager.d.ts.map +0 -1
- package/dist/manager.js +0 -345
- package/dist/manager.js.map +0 -1
- package/dist/node.d.ts +0 -4
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -4
- package/dist/node.js.map +0 -1
- package/dist/object.d.ts +0 -438
- package/dist/object.d.ts.map +0 -1
- package/dist/object.js +0 -1571
- package/dist/object.js.map +0 -1
- package/dist/publish.d.ts +0 -5
- package/dist/publish.d.ts.map +0 -1
- package/dist/publish.js +0 -40
- package/dist/publish.js.map +0 -1
- package/dist/registry.d.ts +0 -25
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -6
- package/dist/registry.js.map +0 -1
- package/dist/reload.d.ts +0 -126
- package/dist/reload.d.ts.map +0 -1
- package/dist/reload.js +0 -653
- package/dist/reload.js.map +0 -1
- package/dist/remote.d.ts +0 -165
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -612
- package/dist/remote.js.map +0 -1
- package/dist/schema.d.ts +0 -21
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -228
- package/dist/schema.js.map +0 -1
- package/dist/state.d.ts +0 -92
- package/dist/state.d.ts.map +0 -1
- package/dist/state.js +0 -287
- package/dist/state.js.map +0 -1
- package/dist/types.d.ts +0 -88
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/websocket.d.ts +0 -15
- package/dist/websocket.d.ts.map +0 -1
- package/dist/websocket.js +0 -16
- package/dist/websocket.js.map +0 -1
- package/dist/wire.d.ts +0 -216
- package/dist/wire.d.ts.map +0 -1
- package/dist/wire.js +0 -165
- package/dist/wire.js.map +0 -1
- package/docs/guide.md +0 -814
- package/docs/spec.md +0 -288
- package/docs/tutorial.md +0 -931
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
// The watcher and its marks (slice 7c §5, slice 12 §4): `fs.watch` on every directory of the plugin roots and the app's
|
|
2
|
+
// base code, `node_modules` and `.git` never watched (a directory appearing later gets its watch), marks what changed and
|
|
3
|
+
// never applies it. A changed file dirties every plugin whose facets used it (a copied contract every user), whose
|
|
4
|
+
// directory contains it or which is a single-file plugin of it; a changed `package.json` asks for an install (and for
|
|
5
|
+
// its metadata to be read again); a plugin directory, a facet file or a single-file plugin's file added or removed asks
|
|
6
|
+
// for discovery again. Base code is compared, not latched: `base` (the app restarts its hosts) is true exactly while a
|
|
7
|
+
// file differs from what a running base artifact read (its bytes' hash: the server's own code hashed at start, each
|
|
8
|
+
// base bundle's record), is gone, or is a source file new in a base directory; checked once when its watch starts and
|
|
9
|
+
// again at each event, the reads of one path in order. The marks are a JSON watchable; each plugin mark records the
|
|
10
|
+
// generation of its latest change (generations only increase), so a change during a build keeps its mark, however
|
|
11
|
+
// late an older build's rollout clears.
|
|
12
|
+
import { existsSync, lstatSync, readdirSync, readFileSync, realpathSync, watch, } from "node:fs";
|
|
13
|
+
import { readFile } from "node:fs/promises";
|
|
14
|
+
import { basename, dirname, extname, join, resolve, sep } from "node:path";
|
|
15
|
+
import { BACKGROUND_CONTEXT } from "../../context/index.js";
|
|
16
|
+
import { Source } from "../../state/internal.js";
|
|
17
|
+
import { contentHash } from "./base-inputs.js";
|
|
18
|
+
import { inside } from "./build.js";
|
|
19
|
+
import { FACET_EXTENSIONS, sameFiles } from "./discover.js";
|
|
20
|
+
/** Directories never watched, and changes under them never marked. */
|
|
21
|
+
const IGNORED = new Set(["node_modules", ".git"]);
|
|
22
|
+
/** The files of a base directory that are code: one added there marks `base` (a swap file or a note does not). */
|
|
23
|
+
const SOURCE_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs", ".json", ".css"]);
|
|
24
|
+
/**
|
|
25
|
+
* The watcher and the marks (`state`), a JSON watchable published at most once per microtask turn with changes. It
|
|
26
|
+
* marks for the plugins of the last discovery (`know`) and the files their last builds read (`used`).
|
|
27
|
+
*/
|
|
28
|
+
export class PluginWatcher extends Source {
|
|
29
|
+
#options;
|
|
30
|
+
#roots;
|
|
31
|
+
/** The base directories (watched as trees): a source file new in one marks `base`. */
|
|
32
|
+
#baseDirs;
|
|
33
|
+
/** What each running base artifact read: each file's bytes' hash, by real path (the server's own first). */
|
|
34
|
+
#records = [];
|
|
35
|
+
/** Every file a record names. */
|
|
36
|
+
#recorded = new Set();
|
|
37
|
+
/** The base files that differ now (changed, gone, or new in a base directory): `base` while there is one. */
|
|
38
|
+
#differing = new Set();
|
|
39
|
+
/** Each path's comparison under way: the next one runs after it (the latest read decides). */
|
|
40
|
+
#comparing = new Map();
|
|
41
|
+
/** Where base code lives: the base directories and the directories of recorded files outside them. */
|
|
42
|
+
#locations = new Set();
|
|
43
|
+
/** The locations and every ancestor of theirs: an entry there created, removed, moved or replaced concerns base code. */
|
|
44
|
+
#anchored = new Set();
|
|
45
|
+
/**
|
|
46
|
+
* The directories watched alone for base code: the recorded files' directories outside the base directories, and
|
|
47
|
+
* every existing ancestor of a location (its replacement or move is an event of its parent's watch).
|
|
48
|
+
*/
|
|
49
|
+
#baseWatchers = new Map();
|
|
50
|
+
/**
|
|
51
|
+
* The identity (inode and birth time) of each directory watched, by path: an event naming one whose identity is the
|
|
52
|
+
* same changed its attributes (`fs.watch` reports those as `rename` too), not the directory.
|
|
53
|
+
*/
|
|
54
|
+
#identities = new Map();
|
|
55
|
+
/** Entries on the way to base code replaced since the last renewal: one renewal per burst of events. */
|
|
56
|
+
#renamed = new Set();
|
|
57
|
+
#renewing = false;
|
|
58
|
+
#closed = false;
|
|
59
|
+
/** The trees it watches: the roots, the base code, and plugin directories linked from outside the roots. */
|
|
60
|
+
#trees = new Set();
|
|
61
|
+
/** Its watches, one per directory of its trees. */
|
|
62
|
+
#watchers = new Map();
|
|
63
|
+
/** A failure to watch was reported (once). */
|
|
64
|
+
#reported = false;
|
|
65
|
+
/** The generation the next change gets: every mark records a newer one than any before it. */
|
|
66
|
+
#generation = 1;
|
|
67
|
+
/** Each dirty plugin's latest change, by generation. */
|
|
68
|
+
#dirty = new Map();
|
|
69
|
+
#install = new Set();
|
|
70
|
+
/** The latest change of the plugin set since the last discovery (0: none). */
|
|
71
|
+
#set = 0;
|
|
72
|
+
/** The latest change of a known plugin's `package.json` since the last discovery (0: none). */
|
|
73
|
+
#manifest = 0;
|
|
74
|
+
#discovery = { plugins: [], problems: [] };
|
|
75
|
+
/** The files each built facet read (its inputs and copies), by plugin and kind. */
|
|
76
|
+
#used = new Map();
|
|
77
|
+
#value;
|
|
78
|
+
#scheduled = false;
|
|
79
|
+
constructor(options, batch) {
|
|
80
|
+
super(batch);
|
|
81
|
+
this.#options = options;
|
|
82
|
+
// Events name paths under the directories as watched: by their real paths, as discovery names plugins.
|
|
83
|
+
this.#roots = options.roots.map(real);
|
|
84
|
+
const base = options.base.map(real);
|
|
85
|
+
this.#baseDirs = base.filter(isDirectory);
|
|
86
|
+
for (const dir of [...this.#roots, ...this.#baseDirs])
|
|
87
|
+
this.#watchTree(dir);
|
|
88
|
+
this.#recordOwn(base);
|
|
89
|
+
}
|
|
90
|
+
get value() {
|
|
91
|
+
this.#value ??= {
|
|
92
|
+
dirty: [...this.#dirty.keys()].sort(),
|
|
93
|
+
install: [...this.#install].sort(),
|
|
94
|
+
set: this.#set > 0,
|
|
95
|
+
base: this.#differing.size > 0,
|
|
96
|
+
};
|
|
97
|
+
return this.#value;
|
|
98
|
+
}
|
|
99
|
+
deliver(context) {
|
|
100
|
+
const value = this.value;
|
|
101
|
+
this.publish(value, [["r", value]], false, context);
|
|
102
|
+
}
|
|
103
|
+
/** Whether the next build discovers again: the plugin set or a plugin's `package.json` changed. */
|
|
104
|
+
get needsDiscovery() {
|
|
105
|
+
return this.#set > 0 || this.#manifest > 0;
|
|
106
|
+
}
|
|
107
|
+
/** What a discovery that starts now has seen. */
|
|
108
|
+
discoverySnapshot() {
|
|
109
|
+
return { set: this.#set, manifest: this.#manifest };
|
|
110
|
+
}
|
|
111
|
+
/** The plugins discovery found: marks are for them (a removed one's install clears); the changes it had seen clear. */
|
|
112
|
+
know(discovery, seen) {
|
|
113
|
+
// A plugin whose files moved (a single file became a directory, a facet file came or went) is dirty.
|
|
114
|
+
const generation = this.#generation++;
|
|
115
|
+
for (const plugin of discovery.plugins) {
|
|
116
|
+
const before = this.#discovery.plugins.find(({ name }) => name === plugin.name);
|
|
117
|
+
if (before !== undefined && !sameFiles(before, plugin))
|
|
118
|
+
this.#dirty.set(plugin.name, generation);
|
|
119
|
+
}
|
|
120
|
+
// A plugin no longer discovered: what its builds read no longer dirties anything.
|
|
121
|
+
for (const [key, { plugin }] of this.#used) {
|
|
122
|
+
if (!discovery.plugins.some(({ name }) => name === plugin))
|
|
123
|
+
this.#used.delete(key);
|
|
124
|
+
}
|
|
125
|
+
this.#discovery = discovery;
|
|
126
|
+
if (this.#set === seen.set)
|
|
127
|
+
this.#set = 0;
|
|
128
|
+
if (this.#manifest === seen.manifest)
|
|
129
|
+
this.#manifest = 0;
|
|
130
|
+
// A removed plugin has nothing to install (its directory went, its package.json with it).
|
|
131
|
+
for (const name of this.#install)
|
|
132
|
+
if (!discovery.plugins.some((plugin) => plugin.name === name))
|
|
133
|
+
this.#install.delete(name);
|
|
134
|
+
// A plugin directory linked from outside the roots: a tree of its own (a symlink is not followed).
|
|
135
|
+
const linked = discovery.plugins.filter(({ dir, layout }) => layout === "directory" && !this.#roots.some((root) => inside(root, dir)));
|
|
136
|
+
for (const { dir } of linked)
|
|
137
|
+
this.#watchTree(dir);
|
|
138
|
+
for (const tree of this.#trees) {
|
|
139
|
+
const kept = this.#roots.includes(tree) || this.#baseDirs.includes(tree) || linked.some((each) => each.dir === tree);
|
|
140
|
+
if (!kept)
|
|
141
|
+
this.#unwatchTree(tree);
|
|
142
|
+
}
|
|
143
|
+
this.#changed();
|
|
144
|
+
}
|
|
145
|
+
/** What `built` facets read: a later change of one of these files dirties their plugins. */
|
|
146
|
+
used(built) {
|
|
147
|
+
for (const facet of built) {
|
|
148
|
+
if (facet.kind !== "script")
|
|
149
|
+
continue;
|
|
150
|
+
const files = new Set([...facet.inputs.map(({ file }) => file), ...facet.copied]);
|
|
151
|
+
this.#used.set(`${facet.plugin}\u0000${facet.facet}`, { plugin: facet.plugin, files });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** The marks a build of `names` starts from: each one's latest change. */
|
|
155
|
+
snapshot(names) {
|
|
156
|
+
const plugins = new Map();
|
|
157
|
+
for (const name of names)
|
|
158
|
+
plugins.set(name, this.#dirty.get(name) ?? 0);
|
|
159
|
+
return { plugins };
|
|
160
|
+
}
|
|
161
|
+
/** `names` were applied everywhere: their marks clear unless a change came after `snapshot`. */
|
|
162
|
+
applied(names, snapshot) {
|
|
163
|
+
for (const name of names) {
|
|
164
|
+
const latest = this.#dirty.get(name);
|
|
165
|
+
if (latest !== undefined && latest <= (snapshot.plugins.get(name) ?? 0))
|
|
166
|
+
this.#dirty.delete(name);
|
|
167
|
+
}
|
|
168
|
+
this.#changed();
|
|
169
|
+
}
|
|
170
|
+
/** Plugin `name`'s dependencies were installed: its install mark clears and it is dirty (its packages changed). */
|
|
171
|
+
installed(name) {
|
|
172
|
+
this.#install.delete(name);
|
|
173
|
+
this.#dirty.set(name, this.#generation++);
|
|
174
|
+
this.#changed();
|
|
175
|
+
}
|
|
176
|
+
/** Plugins were installed into a root: discovery runs at the next build (without waiting for the watch's events). */
|
|
177
|
+
added() {
|
|
178
|
+
this.#set = this.#generation++;
|
|
179
|
+
this.#changed();
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Adds the record of a running base artifact (a base bundle's `inputs`): `base` is set while one of its files differs
|
|
183
|
+
* from it. Each file's directory is watched alone (not its tree), then every file is compared once (an edit since the
|
|
184
|
+
* build has no later event); files under ignored directories are skipped. Settles once those first comparisons did:
|
|
185
|
+
* `base` then knows the record.
|
|
186
|
+
*/
|
|
187
|
+
recordBase(inputs) {
|
|
188
|
+
// A record arriving after the close (a scan that ended late) watches nothing.
|
|
189
|
+
if (this.#closed)
|
|
190
|
+
return Promise.resolve();
|
|
191
|
+
const record = new Map();
|
|
192
|
+
for (const [file, hash] of inputs) {
|
|
193
|
+
const path = real(file);
|
|
194
|
+
if (!ignored(path))
|
|
195
|
+
record.set(path, hash);
|
|
196
|
+
}
|
|
197
|
+
for (const path of record.keys())
|
|
198
|
+
this.#locate(dirname(path));
|
|
199
|
+
this.#records.push(record);
|
|
200
|
+
const compared = [];
|
|
201
|
+
for (const path of record.keys()) {
|
|
202
|
+
this.#recorded.add(path);
|
|
203
|
+
compared.push(this.#compare(path));
|
|
204
|
+
}
|
|
205
|
+
return Promise.all(compared).then(() => { });
|
|
206
|
+
}
|
|
207
|
+
/** Marks what a change of the file or directory at `path` (absolute) asks for. */
|
|
208
|
+
mark(path) {
|
|
209
|
+
if (ignored(path))
|
|
210
|
+
return;
|
|
211
|
+
if (this.#isBase(path)) {
|
|
212
|
+
this.#compareAt(path);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this.#markPlugin(path, this.#generation++);
|
|
216
|
+
this.#changed();
|
|
217
|
+
}
|
|
218
|
+
/** Stops watching. */
|
|
219
|
+
close() {
|
|
220
|
+
this.#closed = true;
|
|
221
|
+
for (const watcher of [...this.#watchers.values(), ...this.#baseWatchers.values()])
|
|
222
|
+
watcher.close();
|
|
223
|
+
this.#watchers.clear();
|
|
224
|
+
this.#baseWatchers.clear();
|
|
225
|
+
this.#identities.clear();
|
|
226
|
+
this.#trees.clear();
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Records the server's own base code `base` (files and the source files of directories), after their watches: the
|
|
230
|
+
* bytes Node loaded, as far as a read now can tell (an edit between Node's load and this read is not seen).
|
|
231
|
+
*/
|
|
232
|
+
#recordOwn(base) {
|
|
233
|
+
const files = base.flatMap((path) => (this.#baseDirs.includes(path) ? sourceFiles(path) : [path]));
|
|
234
|
+
for (const dir of this.#baseDirs)
|
|
235
|
+
this.#locate(dir);
|
|
236
|
+
for (const file of files)
|
|
237
|
+
this.#locate(dirname(file));
|
|
238
|
+
const record = new Map();
|
|
239
|
+
for (const file of files) {
|
|
240
|
+
const hash = hashNow(file);
|
|
241
|
+
if (hash !== undefined)
|
|
242
|
+
record.set(file, hash);
|
|
243
|
+
}
|
|
244
|
+
this.#records.push(record);
|
|
245
|
+
for (const path of record.keys())
|
|
246
|
+
this.#recorded.add(path);
|
|
247
|
+
}
|
|
248
|
+
/** Whether a change at `path` concerns base code: a recorded or differing file, or anything in a base directory. */
|
|
249
|
+
#isBase(path) {
|
|
250
|
+
if (this.#recorded.has(path) || this.#differing.has(path) || this.#inBaseDir(path))
|
|
251
|
+
return true;
|
|
252
|
+
for (const file of this.#recorded)
|
|
253
|
+
if (inside(path, file))
|
|
254
|
+
return true;
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
/** Whether `path` is a base directory or in one. */
|
|
258
|
+
#inBaseDir(path) {
|
|
259
|
+
return this.#baseDirs.some((dir) => dir === path || inside(dir, path));
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Compares the base files at or under `path` again: the recorded and differing ones, and the source files now in the
|
|
263
|
+
* base directories there (a directory added, removed or moved names only itself).
|
|
264
|
+
*/
|
|
265
|
+
#compareAt(path) {
|
|
266
|
+
const paths = new Set();
|
|
267
|
+
if (this.#recorded.has(path) || this.#differing.has(path))
|
|
268
|
+
paths.add(path);
|
|
269
|
+
else {
|
|
270
|
+
for (const file of [...this.#recorded, ...this.#differing])
|
|
271
|
+
if (inside(path, file))
|
|
272
|
+
paths.add(file);
|
|
273
|
+
for (const dir of this.#baseDirs) {
|
|
274
|
+
const scanned = dir === path || inside(path, dir) ? dir : inside(dir, path) ? path : undefined;
|
|
275
|
+
if (scanned !== undefined)
|
|
276
|
+
for (const file of sourceFiles(scanned))
|
|
277
|
+
paths.add(file);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
for (const file of paths)
|
|
281
|
+
this.#compare(file);
|
|
282
|
+
}
|
|
283
|
+
/** Compares the base file at `path` once its comparisons under way are done: reads of one path run in order. */
|
|
284
|
+
#compare(path) {
|
|
285
|
+
const next = (this.#comparing.get(path) ?? Promise.resolve()).then(() => this.#compareNow(path));
|
|
286
|
+
this.#comparing.set(path, next);
|
|
287
|
+
void next.then(() => {
|
|
288
|
+
if (this.#comparing.get(path) === next)
|
|
289
|
+
this.#comparing.delete(path);
|
|
290
|
+
});
|
|
291
|
+
return next;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Reads the file at `path`: it differs while any record has other bytes for it (or it is gone), or, recorded by none,
|
|
295
|
+
* while it is a source file in a base directory.
|
|
296
|
+
*/
|
|
297
|
+
async #compareNow(path) {
|
|
298
|
+
const hash = await hashOf(path);
|
|
299
|
+
const recorded = this.#records.flatMap((record) => record.get(path) ?? []);
|
|
300
|
+
const differs = recorded.length > 0
|
|
301
|
+
? recorded.some((each) => each !== hash)
|
|
302
|
+
: hash !== undefined && this.#inBaseDir(path) && SOURCE_EXTENSIONS.has(extname(path));
|
|
303
|
+
if (differs === this.#differing.has(path))
|
|
304
|
+
return;
|
|
305
|
+
if (differs)
|
|
306
|
+
this.#differing.add(path);
|
|
307
|
+
else
|
|
308
|
+
this.#differing.delete(path);
|
|
309
|
+
this.#changed();
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* A change under a root, at `generation`: in a plugin's directory, it dirties that plugin (and asks for an install
|
|
313
|
+
* and a new reading of its metadata for its `package.json`, for discovery for a facet file at its top); a single-file
|
|
314
|
+
* plugin's file dirties it (and asks for discovery when it is gone); elsewhere under a root (a directory or a
|
|
315
|
+
* single-file plugin's file added or removed, a directory that is no plugin yet), discovery; every plugin whose
|
|
316
|
+
* facets read the file is dirty too.
|
|
317
|
+
*/
|
|
318
|
+
#markPlugin(path, generation) {
|
|
319
|
+
const plugin = this.#discovery.plugins.find((each) => owns(each, path));
|
|
320
|
+
if (plugin === undefined) {
|
|
321
|
+
if (this.#roots.some((root) => inside(root, path)))
|
|
322
|
+
this.#set = generation;
|
|
323
|
+
}
|
|
324
|
+
else if (plugin.layout === "file") {
|
|
325
|
+
if (!existsSync(path))
|
|
326
|
+
this.#set = generation;
|
|
327
|
+
this.#dirty.set(plugin.name, generation);
|
|
328
|
+
}
|
|
329
|
+
else if (path === join(plugin.dir, "package.json")) {
|
|
330
|
+
this.#install.add(plugin.name);
|
|
331
|
+
this.#manifest = generation;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
if (path === plugin.dir || (dirname(path) === plugin.dir && this.#isFacetFile(basename(path)))) {
|
|
335
|
+
this.#set = generation;
|
|
336
|
+
}
|
|
337
|
+
this.#dirty.set(plugin.name, generation);
|
|
338
|
+
}
|
|
339
|
+
for (const { plugin: user, files } of this.#used.values())
|
|
340
|
+
if (files.has(path))
|
|
341
|
+
this.#dirty.set(user, generation);
|
|
342
|
+
}
|
|
343
|
+
/** Whether `file` (at a plugin's top) is named as a facet file of one of the app's kinds. */
|
|
344
|
+
#isFacetFile(file) {
|
|
345
|
+
return this.#options.kinds.some((kind) => FACET_EXTENSIONS.some((extension) => file === `${kind}${extension}`));
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Adds `dir` to where base code lives (a base directory, or one holding recorded files outside them): it and its
|
|
349
|
+
* ancestors are watched. A directory inside a base directory is its tree's.
|
|
350
|
+
*/
|
|
351
|
+
#locate(dir) {
|
|
352
|
+
if (this.#locations.has(dir) || (this.#inBaseDir(dir) && !this.#baseDirs.includes(dir)))
|
|
353
|
+
return;
|
|
354
|
+
this.#locations.add(dir);
|
|
355
|
+
for (let each = dir;; each = dirname(each)) {
|
|
356
|
+
this.#anchored.add(each);
|
|
357
|
+
if (each === dirname(each))
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
this.#watchLocation(dir);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Watches location `dir`'s existing ancestors alone, then `dir` itself: as a tree for a base directory, alone for
|
|
364
|
+
* one holding recorded files. A part that does not exist is skipped: its parent's watch reports its arrival.
|
|
365
|
+
*/
|
|
366
|
+
#watchLocation(dir) {
|
|
367
|
+
const ancestors = [];
|
|
368
|
+
for (let each = dirname(dir);; each = dirname(each)) {
|
|
369
|
+
ancestors.unshift(each);
|
|
370
|
+
if (each === dirname(each))
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
for (const ancestor of ancestors)
|
|
374
|
+
this.#watchAlone(ancestor);
|
|
375
|
+
if (this.#baseDirs.includes(dir))
|
|
376
|
+
this.#watchDirs(dir);
|
|
377
|
+
else
|
|
378
|
+
this.#watchAlone(dir);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Watches directory `dir` alone (once) for base code: a recorded (or differing) file there is compared; an entry on the
|
|
382
|
+
* way to a location created, removed, moved or replaced (another identity: not an attribute change) renews the
|
|
383
|
+
* watches under it. A directory that does not exist or cannot be watched (an ancestor without access) is skipped.
|
|
384
|
+
*/
|
|
385
|
+
#watchAlone(dir) {
|
|
386
|
+
if (this.#baseWatchers.has(dir) || this.#reported)
|
|
387
|
+
return;
|
|
388
|
+
let watcher;
|
|
389
|
+
try {
|
|
390
|
+
watcher = watch(dir, (event, file) => {
|
|
391
|
+
if (file === null)
|
|
392
|
+
return;
|
|
393
|
+
const path = join(dir, file);
|
|
394
|
+
if (this.#recorded.has(path) || this.#differing.has(path))
|
|
395
|
+
this.mark(path);
|
|
396
|
+
else if (event === "rename" && this.#anchored.has(path) && this.#replaced(path))
|
|
397
|
+
this.#renamedOnTheWay(path);
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
catch (error) {
|
|
401
|
+
const code = error.code;
|
|
402
|
+
if (code !== "ENOENT" && code !== "EACCES" && code !== "EPERM")
|
|
403
|
+
this.#failed(error);
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
watcher.on("error", (error) => this.#failed(error));
|
|
407
|
+
this.#baseWatchers.set(dir, watcher);
|
|
408
|
+
this.#identities.set(dir, identityOf(dir));
|
|
409
|
+
}
|
|
410
|
+
/** Whether the directory at `path` is not the one watched there (created, removed, or another one now). */
|
|
411
|
+
#replaced(path) {
|
|
412
|
+
return identityOf(path) !== this.#identities.get(path);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Renews the watches under `path`, renamed on the way to base code, once the events of this task are in: a burst
|
|
416
|
+
* renews each subtree once (the outermost renamed path covers those under it).
|
|
417
|
+
*/
|
|
418
|
+
#renamedOnTheWay(path) {
|
|
419
|
+
this.#renamed.add(path);
|
|
420
|
+
if (this.#renewing)
|
|
421
|
+
return;
|
|
422
|
+
this.#renewing = true;
|
|
423
|
+
setImmediate(() => {
|
|
424
|
+
this.#renewing = false;
|
|
425
|
+
const renamed = [...this.#renamed];
|
|
426
|
+
this.#renamed.clear();
|
|
427
|
+
if (this.#closed || this.#reported)
|
|
428
|
+
return;
|
|
429
|
+
for (const each of renamed)
|
|
430
|
+
if (!renamed.some((other) => inside(other, each)))
|
|
431
|
+
this.#reconcile(each);
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* The directory at `path`, on the way to base code, was created, removed, moved or replaced (its watches may be dead,
|
|
436
|
+
* its inode reused: renewed whatever they are): every base watch at or under it starts again where the paths now are,
|
|
437
|
+
* and the base files there are compared.
|
|
438
|
+
*/
|
|
439
|
+
#reconcile(path) {
|
|
440
|
+
for (const [dir, watcher] of this.#baseWatchers) {
|
|
441
|
+
if (dir !== path && !inside(path, dir))
|
|
442
|
+
continue;
|
|
443
|
+
watcher.close();
|
|
444
|
+
this.#baseWatchers.delete(dir);
|
|
445
|
+
this.#identities.delete(dir);
|
|
446
|
+
}
|
|
447
|
+
for (const dir of this.#baseDirs)
|
|
448
|
+
if (dir === path || inside(path, dir))
|
|
449
|
+
this.#unwatchDirs(dir);
|
|
450
|
+
for (const dir of this.#locations)
|
|
451
|
+
if (dir === path || inside(path, dir))
|
|
452
|
+
this.#watchLocation(dir);
|
|
453
|
+
this.#compareAt(path);
|
|
454
|
+
}
|
|
455
|
+
/** Watches the tree at `dir` (once): it and every directory under it but ignored ones; a missing one is skipped. */
|
|
456
|
+
#watchTree(dir) {
|
|
457
|
+
if (this.#trees.has(dir))
|
|
458
|
+
return;
|
|
459
|
+
this.#trees.add(dir);
|
|
460
|
+
this.#watchDirs(dir);
|
|
461
|
+
}
|
|
462
|
+
/** Stops watching the tree at `dir`. */
|
|
463
|
+
#unwatchTree(dir) {
|
|
464
|
+
this.#trees.delete(dir);
|
|
465
|
+
this.#unwatchDirs(dir);
|
|
466
|
+
}
|
|
467
|
+
/** Watches `dir` and, walking down, every directory under it but ignored ones (each not watched yet). */
|
|
468
|
+
#watchDirs(dir) {
|
|
469
|
+
if (this.#watchers.has(dir) || this.#reported)
|
|
470
|
+
return;
|
|
471
|
+
let watcher;
|
|
472
|
+
try {
|
|
473
|
+
watcher = watch(dir, (_event, file) => {
|
|
474
|
+
if (file !== null)
|
|
475
|
+
this.#changedIn(join(dir, file));
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
catch (error) {
|
|
479
|
+
if (error.code !== "ENOENT")
|
|
480
|
+
this.#failed(error);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
watcher.on("error", (error) => this.#failed(error));
|
|
484
|
+
this.#watchers.set(dir, watcher);
|
|
485
|
+
this.#identities.set(dir, identityOf(dir));
|
|
486
|
+
let entries;
|
|
487
|
+
try {
|
|
488
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
489
|
+
}
|
|
490
|
+
catch {
|
|
491
|
+
// Removed meanwhile: its parent's event says so.
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
for (const entry of entries) {
|
|
495
|
+
if (entry.isDirectory() && !IGNORED.has(entry.name))
|
|
496
|
+
this.#watchDirs(join(dir, entry.name));
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* An event for `path` in a watched directory: a directory gets its watches (renewed when it is another directory than
|
|
501
|
+
* the one watched: removed and made again, its old watches dead, its inode possibly reused), a removed one loses
|
|
502
|
+
* them; marked.
|
|
503
|
+
*/
|
|
504
|
+
#changedIn(path) {
|
|
505
|
+
const name = basename(path);
|
|
506
|
+
if (!IGNORED.has(name)) {
|
|
507
|
+
if (isDirectory(path)) {
|
|
508
|
+
if (this.#watchers.has(path) && this.#replaced(path))
|
|
509
|
+
this.#unwatchDirs(path);
|
|
510
|
+
this.#watchDirs(path);
|
|
511
|
+
}
|
|
512
|
+
else if (this.#watchers.has(path))
|
|
513
|
+
this.#unwatchDirs(path);
|
|
514
|
+
}
|
|
515
|
+
this.mark(path);
|
|
516
|
+
}
|
|
517
|
+
/** Stops watching `dir` and the directories under it (it was removed, or its tree is not watched any more). */
|
|
518
|
+
#unwatchDirs(dir) {
|
|
519
|
+
for (const [watched, watcher] of this.#watchers) {
|
|
520
|
+
if (watched !== dir && !inside(dir, watched))
|
|
521
|
+
continue;
|
|
522
|
+
watcher.close();
|
|
523
|
+
this.#watchers.delete(watched);
|
|
524
|
+
this.#identities.delete(watched);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
/** Watching failed: reported once; every watch stops (the app builds on demand). */
|
|
528
|
+
#failed(error) {
|
|
529
|
+
this.close();
|
|
530
|
+
if (this.#reported)
|
|
531
|
+
return;
|
|
532
|
+
this.#reported = true;
|
|
533
|
+
this.#options.failed(error);
|
|
534
|
+
}
|
|
535
|
+
/** The marks changed: one publication per microtask turn while someone watches or derives from them. */
|
|
536
|
+
#changed() {
|
|
537
|
+
this.#value = undefined;
|
|
538
|
+
if (this.#scheduled || (!this.watched && this.dependents.size === 0))
|
|
539
|
+
return;
|
|
540
|
+
this.#scheduled = true;
|
|
541
|
+
queueMicrotask(() => {
|
|
542
|
+
this.#scheduled = false;
|
|
543
|
+
this.batch.within(() => this.changed(), BACKGROUND_CONTEXT);
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
/** Whether `path` is `plugin`'s: in its directory, or one of a single-file plugin's files. */
|
|
548
|
+
function owns(plugin, path) {
|
|
549
|
+
if (plugin.layout === "file")
|
|
550
|
+
return Object.values(plugin.facets).includes(path);
|
|
551
|
+
return plugin.dir === path || inside(plugin.dir, path);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Whether `path` is a directory, never following a link (as the scan of a tree does not); one that cannot be read (gone,
|
|
555
|
+
* a link loop, no access) is none: a watch callback must not throw.
|
|
556
|
+
*/
|
|
557
|
+
function isDirectory(path) {
|
|
558
|
+
try {
|
|
559
|
+
return lstatSync(path, { throwIfNoEntry: false })?.isDirectory() === true;
|
|
560
|
+
}
|
|
561
|
+
catch {
|
|
562
|
+
return false;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/** Whether `path` lies under a directory never watched (`node_modules`, `.git`). */
|
|
566
|
+
function ignored(path) {
|
|
567
|
+
return path.split(sep).some((part) => IGNORED.has(part));
|
|
568
|
+
}
|
|
569
|
+
/** The source files at `path`: itself when it is one, every one under it (ignored directories skipped) when a directory. */
|
|
570
|
+
function sourceFiles(path) {
|
|
571
|
+
if (!isDirectory(path))
|
|
572
|
+
return SOURCE_EXTENSIONS.has(extname(path)) ? [path] : [];
|
|
573
|
+
let entries;
|
|
574
|
+
try {
|
|
575
|
+
entries = readdirSync(path, { withFileTypes: true });
|
|
576
|
+
}
|
|
577
|
+
catch {
|
|
578
|
+
return [];
|
|
579
|
+
}
|
|
580
|
+
return entries.flatMap((entry) => (IGNORED.has(entry.name) ? [] : sourceFiles(join(path, entry.name))));
|
|
581
|
+
}
|
|
582
|
+
/** The hash of the bytes of the file at `path` now (synchronously), `undefined` when it cannot be read. */
|
|
583
|
+
function hashNow(path) {
|
|
584
|
+
try {
|
|
585
|
+
return contentHash(readFileSync(path));
|
|
586
|
+
}
|
|
587
|
+
catch {
|
|
588
|
+
return undefined;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
/** The hash of the bytes of the file at `path`, `undefined` when it cannot be read (gone, a directory, no access). */
|
|
592
|
+
async function hashOf(path) {
|
|
593
|
+
try {
|
|
594
|
+
return contentHash(await readFile(path));
|
|
595
|
+
}
|
|
596
|
+
catch {
|
|
597
|
+
return undefined;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* The identity of the directory at `path`: its inode and birth time (an inode is reused at once by a directory made
|
|
602
|
+
* again; its birth time is new), not following a link; `undefined` when there is none.
|
|
603
|
+
*/
|
|
604
|
+
function identityOf(path) {
|
|
605
|
+
try {
|
|
606
|
+
const stats = lstatSync(path, { bigint: true });
|
|
607
|
+
return `${stats.ino}:${stats.birthtimeNs}`;
|
|
608
|
+
}
|
|
609
|
+
catch {
|
|
610
|
+
return undefined;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
/** `dir` absolute and by its real path; as given (absolute) when it does not exist. */
|
|
614
|
+
function real(dir) {
|
|
615
|
+
try {
|
|
616
|
+
return realpathSync(dir);
|
|
617
|
+
}
|
|
618
|
+
catch {
|
|
619
|
+
return resolve(dir);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
//# sourceMappingURL=watcher.js.map
|