@palmetto/pubsub 3.4.1 → 3.4.2

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/dist/publisher.js CHANGED
@@ -11,8 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Publisher = void 0;
13
13
  const zod_1 = require("zod");
14
- const uuid_1 = require("uuid");
15
- const crypto_1 = require("crypto");
14
+ const node_crypto_1 = require("node:crypto");
16
15
  const trace_1 = require("@palmetto/trace");
17
16
  const errors_js_1 = require("./errors.js");
18
17
  const message_logger_js_1 = require("./message-logger.js");
@@ -77,7 +76,7 @@ class Publisher {
77
76
  const { schema, schemaId } = this.assertSchema(config);
78
77
  const mappedMessages = messages.map((msg) => {
79
78
  if (!msg.id) {
80
- msg.id = (0, uuid_1.v4)();
79
+ msg.id = (0, node_crypto_1.randomUUID)();
81
80
  }
82
81
  if (!msg.meta) {
83
82
  msg.meta = {
@@ -174,7 +173,7 @@ class Publisher {
174
173
  if (!hash) {
175
174
  (_b = (_a = this.logger).debug) === null || _b === void 0 ? void 0 : _b.call(_a, `Calculating schema id for ${config.name}`);
176
175
  const jsonSchema = JSON.stringify(zod_1.z.toJSONSchema(schema, { io: "input" }), null, 2);
177
- hash = (0, crypto_1.createHash)("sha256").update(jsonSchema).digest("hex");
176
+ hash = (0, node_crypto_1.createHash)("sha256").update(jsonSchema).digest("hex");
178
177
  this.hashes.set(schema, hash);
179
178
  }
180
179
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palmetto/pubsub",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/palmetto/galaxy"
@@ -10,18 +10,19 @@
10
10
  "lint": "yarn run -T eslint --fix ./src",
11
11
  "format": "yarn run -T prettier --write --loglevel warn .",
12
12
  "tc": "tsc --noEmit",
13
- "build": "yarn clean && tsc -p tsconfig.build.json",
13
+ "test": "yarn test-runner 'vitest run'",
14
+ "test:watch": "yarn test-runner 'vitest watch'",
15
+ "build": "yarn clean && yarn ci:build",
14
16
  "clean": "rm -rf ./dist/",
15
17
  "ci:build": "tsc -p tsconfig.build.json",
16
18
  "ci:lint": "yarn run -T eslint . && yarn run -T prettier --check --loglevel warn .",
17
19
  "ci:tc": "yarn tc",
20
+ "ci:test": "yarn run -T ci:test --project=@palmetto/pubsub",
18
21
  "hook:lint": "eslint --cache --fix",
19
22
  "hook:format": "prettier --write --loglevel warn",
20
23
  "hook:tc": "yarn tc",
21
24
  "prepublishOnly": "yarn build",
22
- "test-runner": "../../scripts/test-runner.sh",
23
- "test": "yarn run test-runner vitest run",
24
- "test:watch": "yarn run test-runner vitest watch"
25
+ "test-runner": "../../scripts/test-runner.sh yarn run -T $0 --project @palmetto/pubsub"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@google-cloud/pubsub": "^5.2.3",
@@ -33,7 +34,7 @@
33
34
  "bullmq": "^5.70.2",
34
35
  "ts-node": "^10.9.2",
35
36
  "typescript": "^5.8.3",
36
- "vitest": "^3.2.4",
37
+ "vitest": "^4.1.5",
37
38
  "zod": "^4.1.13"
38
39
  },
39
40
  "files": [
@@ -46,9 +47,6 @@
46
47
  "publishConfig": {
47
48
  "access": "public"
48
49
  },
49
- "dependencies": {
50
- "uuid": "^11.1.0"
51
- },
52
50
  "peerDependencies": {
53
51
  "@google-cloud/pubsub": "^5.2",
54
52
  "@palmetto/trace": "^0.1.1",