Skip to content

Commit 862aae4

Browse files
committed
feat: US-188 - Add uuid project-matrix fixture
1 parent f86aea1 commit 862aae4

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

docs/nodejs-compatibility.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ The [project-matrix test suite](https://github.com/rivet-dev/secure-exec/tree/ma
8484
| [chalk](https://npmjs.com/package/chalk) | Terminal | Terminal string styling, ANSI escape codes |
8585
| [lodash-es](https://npmjs.com/package/lodash-es) | Utility | Large ESM module resolution at scale |
8686
| [pino](https://npmjs.com/package/pino) | Logging | Structured JSON logging, child loggers, serializers |
87+
| [uuid](https://npmjs.com/package/uuid) | Crypto | UUID generation (v4, v5), validation, version detection |
8788
| [yaml](https://npmjs.com/package/yaml) | Utility | YAML parsing, stringifying, document API |
8889
| [zod](https://npmjs.com/package/zod) | Validation | Schema definition, parsing, safe parse, transforms |
8990
| [rivetkit](https://npmjs.com/package/rivetkit) | SDK | Local vendor package resolution |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"entry": "src/index.js",
3+
"expectation": "pass"
4+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "project-matrix-uuid-pass",
3+
"private": true,
4+
"type": "module",
5+
"dependencies": {
6+
"uuid": "11.1.0"
7+
}
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { v4, v5, validate, version, NIL } from "uuid";
2+
3+
// Generate a random v4 UUID and validate its format
4+
const id4 = v4();
5+
const isValid4 = validate(id4);
6+
const ver4 = version(id4);
7+
8+
// Deterministic v5 UUID with DNS namespace
9+
const DNS_NAMESPACE = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
10+
const id5 = v5("secure-exec.test", DNS_NAMESPACE);
11+
const isValid5 = validate(id5);
12+
const ver5 = version(id5);
13+
14+
// Validate the nil UUID
15+
const nilValid = validate(NIL);
16+
17+
const result = {
18+
v4: { valid: isValid4, version: ver4 },
19+
v5: { value: id5, valid: isValid5, version: ver5 },
20+
nil: { value: NIL, valid: nilValid },
21+
};
22+
23+
console.log(JSON.stringify(result));

0 commit comments

Comments
 (0)