From 6ac39586245a2ba0bc70d2438040bd498034579a Mon Sep 17 00:00:00 2001 From: Hexagon Date: Wed, 27 Mar 2024 22:12:29 +0100 Subject: [PATCH] Replace uuid with ulid to support node 18 --- .github/workflows/test.yml | 4 ++-- README.md | 12 ++++++------ deno.json | 2 +- src/ops/mktempdir.ts | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 477066c..ff1e1a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,9 +13,9 @@ jobs: bun_ci: uses: cross-org/workflows/.github/workflows/bun-ci.yml@main with: - jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid" + jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/ulid" node_ci: uses: cross-org/workflows/.github/workflows/node-ci.yml@main with: - jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid" + jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/ulid" test_target: "src/**/*.test.ts" \ No newline at end of file diff --git a/README.md b/README.md index 4663e6d..7eb4bbd 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,9 @@ console.log(await mktempdir("my-prefix")); // -> /tmp/my-prefix-7a8s78-as67d6as6-asd67a6sd-asdyda/ ``` -| Method | Deno | Node | Bun | Browser (LocalStorage) | -| ---------- | ---- | ---- | --- | ---------------------- | -| unlink | X | X | X | | -| mkdir | X | X | X | | -| mktempdir | X | X | X | | -| rmdir | X | X | X | | +| Method | Deno | Node | Bun | Browser (LocalStorage) | +| --------- | ---- | ---- | --- | ---------------------- | +| unlink | X | X | X | | +| mkdir | X | X | X | | +| mktempdir | X | X | X | | +| rmdir | X | X | X | | diff --git a/deno.json b/deno.json index 568df2a..2aaac76 100644 --- a/deno.json +++ b/deno.json @@ -13,7 +13,7 @@ "@cross/test": "jsr:@cross/test@^0.0.9", "@std/assert": "jsr:@std/assert@^0.220.1", "@std/path": "jsr:@std/path@^0.220.1", - "@std/uuid": "jsr:@std/uuid@^0.220.1" + "@std/ulid": "jsr:@std/ulid@^0.220.1" }, "publish": { "exclude": [".github", "*.test.ts"] diff --git a/src/ops/mktempdir.ts b/src/ops/mktempdir.ts index 038a19b..2c22378 100644 --- a/src/ops/mktempdir.ts +++ b/src/ops/mktempdir.ts @@ -1,5 +1,5 @@ import { dir } from "@cross/dir"; -import { generate } from "@std/uuid/v1"; +import { ulid } from "@std/ulid"; import { join } from "@std/path"; import { mkdir } from "./mkdir.ts"; @@ -12,7 +12,7 @@ import { mkdir } from "./mkdir.ts"; */ export async function mktempdir(prefix?: string): Promise { const tempBaseDir = await dir("tmp"); - let uuid = generate(); + let uuid = ulid(); if (prefix) { uuid = `${prefix}-${uuid}`; }