@enormora/clock 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -67
- package/package.json +1 -1
- package/sbom.cdx.json +4 -4
package/README.md
CHANGED
|
@@ -83,7 +83,9 @@ type Session = {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export function isSessionExpired(clock: Clock, session: Session): boolean {
|
|
86
|
-
return
|
|
86
|
+
return (
|
|
87
|
+
clock.currentUnixEpochMilliseconds >= session.expiresAtUnixEpochMilliseconds
|
|
88
|
+
);
|
|
87
89
|
}
|
|
88
90
|
```
|
|
89
91
|
|
|
@@ -225,7 +227,9 @@ export type Clock = {
|
|
|
225
227
|
|
|
226
228
|
```ts
|
|
227
229
|
export type DeterministicClock = Clock & {
|
|
228
|
-
readonly setCurrentUnixEpochMicroseconds: (
|
|
230
|
+
readonly setCurrentUnixEpochMicroseconds: (
|
|
231
|
+
nextUnixEpochMicroseconds: bigint
|
|
232
|
+
) => void;
|
|
229
233
|
readonly advanceByMicroseconds: (delayInMicroseconds: bigint) => void;
|
|
230
234
|
readonly advanceByMilliseconds: (delayInMilliseconds: number) => void;
|
|
231
235
|
};
|
|
@@ -244,68 +248,3 @@ export function createDeterministicClock(options: {
|
|
|
244
248
|
readonly initialUnixEpochMicroseconds: bigint;
|
|
245
249
|
}): DeterministicClock;
|
|
246
250
|
```
|
|
247
|
-
|
|
248
|
-
## Development
|
|
249
|
-
|
|
250
|
-
Install dependencies:
|
|
251
|
-
|
|
252
|
-
```sh
|
|
253
|
-
npm clean-install
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
Compile:
|
|
257
|
-
|
|
258
|
-
```sh
|
|
259
|
-
just compile
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
Run lint checks:
|
|
263
|
-
|
|
264
|
-
```sh
|
|
265
|
-
just lint
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
Run tests:
|
|
269
|
-
|
|
270
|
-
```sh
|
|
271
|
-
just test
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
Run a Packtory dry-run:
|
|
275
|
-
|
|
276
|
-
```sh
|
|
277
|
-
just packtory-dry-run
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
## Publishing
|
|
281
|
-
|
|
282
|
-
Pull requests that should appear in the changelog need exactly one changelog label. Supported labels:
|
|
283
|
-
|
|
284
|
-
- `breaking`
|
|
285
|
-
- `bug`
|
|
286
|
-
- `feature`
|
|
287
|
-
- `enhancement`
|
|
288
|
-
- `documentation`
|
|
289
|
-
- `upgrade`
|
|
290
|
-
- `refactor`
|
|
291
|
-
- `build`
|
|
292
|
-
|
|
293
|
-
The package is released through a release pull request:
|
|
294
|
-
|
|
295
|
-
1. Go to GitHub Actions -> Release -> Run workflow.
|
|
296
|
-
2. The workflow creates or updates a `Prepare release` pull request with the generated `CHANGELOG.md` changes.
|
|
297
|
-
3. Review and merge the release pull request through the normal merge queue.
|
|
298
|
-
4. After the release pull request is merged, the publish workflow publishes to npm, pushes the package tag, and creates
|
|
299
|
-
the GitHub Release.
|
|
300
|
-
|
|
301
|
-
The dry-run command validates the package shape without publishing.
|
|
302
|
-
|
|
303
|
-
```sh
|
|
304
|
-
just packtory-dry-run
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
Inspect the next release plan:
|
|
308
|
-
|
|
309
|
-
```sh
|
|
310
|
-
just release-plan
|
|
311
|
-
```
|
package/package.json
CHANGED
package/sbom.cdx.json
CHANGED
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "@enormora/clock",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/@enormora/clock@0.0.
|
|
21
|
-
"purl": "pkg:npm/@enormora/clock@0.0.
|
|
19
|
+
"version": "0.0.3",
|
|
20
|
+
"bom-ref": "pkg:npm/@enormora/clock@0.0.3",
|
|
21
|
+
"purl": "pkg:npm/@enormora/clock@0.0.3"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [],
|
|
25
25
|
"dependencies": [
|
|
26
26
|
{
|
|
27
|
-
"ref": "pkg:npm/@enormora/clock@0.0.
|
|
27
|
+
"ref": "pkg:npm/@enormora/clock@0.0.3"
|
|
28
28
|
}
|
|
29
29
|
]
|
|
30
30
|
}
|