@hatchet-dev/typescript-sdk 1.9.6 → 1.9.8

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.
@@ -0,0 +1,65 @@
1
+ /* eslint-disable no-console */
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const semver = require('semver');
5
+
6
+ const WARNINGS = {
7
+ '1.4.0':
8
+ 'Breaking Changes in v1.4.0: This release fixes a critical bug which makes the runNoWait methods async. You will need to await this method to access the runRef.',
9
+ };
10
+
11
+ try {
12
+ // Get the current package version
13
+ // eslint-disable-next-line global-require
14
+ const currentVersion = require('../package.json').version;
15
+
16
+ // Look for the package.json in various possible locations
17
+ const possiblePaths = [
18
+ // npm
19
+ path.join(process.cwd(), 'package.json'),
20
+ // pnpm
21
+ path.join(process.cwd(), '..', 'package.json'),
22
+ // yarn
23
+ path.join(process.cwd(), '..', '..', 'package.json'),
24
+ // monorepo setup
25
+ path.join(process.cwd(), '..', '..', '..', 'package.json'),
26
+ ];
27
+
28
+ let parentPackagePath = null;
29
+ for (const possiblePath of possiblePaths) {
30
+ if (fs.existsSync(possiblePath)) {
31
+ parentPackagePath = possiblePath;
32
+ break;
33
+ }
34
+ }
35
+
36
+ if (parentPackagePath) {
37
+ const parentPackage = JSON.parse(fs.readFileSync(parentPackagePath, 'utf8'));
38
+ const dependencies = {
39
+ ...parentPackage.dependencies,
40
+ ...parentPackage.devDependencies,
41
+ };
42
+
43
+ const installedVersion = dependencies['@hatchet-dev/typescript-sdk'];
44
+
45
+ // If there's no installed version, this is a first-time install
46
+ if (!installedVersion) {
47
+ // Show all warnings for the current version
48
+ for (const [version, warning] of Object.entries(WARNINGS)) {
49
+ if (semver.gte(currentVersion, version)) {
50
+ console.warn('\x1b[33m%s\x1b[0m', warning);
51
+ }
52
+ }
53
+ } else {
54
+ // Check for specific version warnings
55
+ for (const [version, warning] of Object.entries(WARNINGS)) {
56
+ if (semver.gte(currentVersion, version) && semver.lt(installedVersion, version)) {
57
+ console.warn('\x1b[33m%s\x1b[0m', warning);
58
+ }
59
+ }
60
+ }
61
+ }
62
+ } catch (error) {
63
+ // Silently fail - this is just a warning system
64
+ // console.error(error);
65
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "1.9.6",
3
+ "version": "1.9.8",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -15,30 +15,6 @@
15
15
  "type": "git",
16
16
  "url": "https://github.com/hatchet-dev/hatchet.git"
17
17
  },
18
- "scripts": {
19
- "build": "echo 'build hatchet sdk with `npm run tsc:build` to ensure it is not build during the publish step' && exit 0",
20
- "prepare": "npm run build",
21
- "postinstall": "node scripts/version-check.js",
22
- "dump-version": "node -e \"console.log('export const HATCHET_VERSION = \\'' + require('./package.json').version + '\\';');\" > src/version.ts",
23
- "tsc:build": "npm run dump-version && tsc && resolve-tspaths",
24
- "test:unit": "jest --testMatch='**/*.test.ts'",
25
- "test:e2e": "jest --testMatch='**/*.e2e.ts'",
26
- "test:unit:watch": "jest --testMatch='**/*.test.ts' --watch",
27
- "generate": "pnpm run '/generate-.*/'",
28
- "generate-api": "npx --yes swagger-cli bundle ../../api-contracts/openapi/openapi.yaml --outfile openapi.yaml --type yaml && npx swagger-typescript-api@13.1.0 generate -p openapi.yaml -o src/clients/rest/generated -n hatchet.ts --modular --axios",
29
- "generate-protoc": "./generate-protoc.sh",
30
- "lint:check": "npm run eslint:check && npm run prettier:check",
31
- "lint:fix": "npm run eslint:fix && npm run prettier:fix",
32
- "eslint:check": "eslint \"{src,tests}/**/*.{ts,tsx,js}\"",
33
- "eslint:fix": "eslint \"{src,tests}/**/*.{ts,tsx,js}\" --fix",
34
- "prettier:check": "prettier \"src/**/*.{ts,tsx}\" --list-different",
35
- "prettier:fix": "prettier \"src/**/*.{ts,tsx}\" --write",
36
- "prepublish": "cp package.json dist/package.json; cp README.md dist/; cp -r scripts dist/",
37
- "publish:ci": "rm -rf ./dist && npm run dump-version && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks",
38
- "publish:ci:alpha": "rm -rf ./dist && npm run dump-version && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks --tag alpha",
39
- "generate-docs": "typedoc",
40
- "exec": "npx dotenv -- ts-node -r tsconfig-paths/register --project tsconfig.json"
41
- },
42
18
  "keywords": [],
43
19
  "author": "",
44
20
  "license": "MIT",
@@ -67,7 +43,7 @@
67
43
  "grpc-tools": "^1.13.0",
68
44
  "jest": "^29.7.0",
69
45
  "jest-tsd": "^0.2.2",
70
- "pino": "^9.8.0",
46
+ "pino": "^9.12.0",
71
47
  "prettier": "^3.5.3",
72
48
  "resolve-tspaths": "^0.8.23",
73
49
  "ts-jest": "^29.3.1",
@@ -91,5 +67,28 @@
91
67
  "yaml": "^2.7.1",
92
68
  "zod": "^3.24.2"
93
69
  },
94
- "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
95
- }
70
+ "packageManager": "pnpm@10.16.1",
71
+ "scripts": {
72
+ "build": "echo 'build hatchet sdk with `npm run tsc:build` to ensure it is not build during the publish step' && exit 0",
73
+ "postinstall": "node scripts/version-check.js",
74
+ "dump-version": "node -e \"console.log('export const HATCHET_VERSION = \\'' + require('./package.json').version + '\\';');\" > src/version.ts",
75
+ "tsc:build": "pnpm run dump-version && tsc && resolve-tspaths",
76
+ "test:unit": "jest --testMatch='**/*.test.ts'",
77
+ "test:e2e": "jest --testMatch='**/*.e2e.ts'",
78
+ "test:unit:watch": "jest --testMatch='**/*.test.ts' --watch",
79
+ "generate": "pnpm run '/generate-.*/'",
80
+ "generate-api": "npx --yes swagger-cli bundle ../../api-contracts/openapi/openapi.yaml --outfile openapi.yaml --type yaml && npx swagger-typescript-api@13.1.0 generate -p openapi.yaml -o src/clients/rest/generated -n hatchet.ts --modular --axios",
81
+ "generate-protoc": "./generate-protoc.sh",
82
+ "lint:check": "pnpm run eslint:check && pnpm run prettier:check",
83
+ "lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix",
84
+ "eslint:check": "eslint \"{src,tests}/**/*.{ts,tsx,js}\"",
85
+ "eslint:fix": "eslint \"{src,tests}/**/*.{ts,tsx,js}\" --fix",
86
+ "prettier:check": "prettier \"src/**/*.{ts,tsx}\" --list-different",
87
+ "prettier:fix": "prettier \"src/**/*.{ts,tsx}\" --write",
88
+ "prepublish": "cp package.json dist/package.json; cp README.md dist/; cp -r scripts dist/",
89
+ "publish:ci": "rm -rf ./dist && pnpm run dump-version && pnpm run tsc:build && pnpm run prepublish && cd dist && pnpm publish --access public --no-git-checks",
90
+ "publish:ci:alpha": "rm -rf ./dist && pnpm run dump-version && pnpm run tsc:build && pnpm run prepublish && cd dist && pnpm publish --access public --no-git-checks --tag alpha",
91
+ "generate-docs": "typedoc",
92
+ "exec": "npx dotenv -- ts-node -r tsconfig-paths/register --project tsconfig.json"
93
+ }
94
+ }
@@ -127,7 +127,7 @@ class V1Worker {
127
127
  try {
128
128
  const { concurrency } = workflow;
129
129
  let onFailureTask;
130
- if (!durable && workflow.onFailure && typeof workflow.onFailure === 'function') {
130
+ if (workflow.onFailure && typeof workflow.onFailure === 'function') {
131
131
  onFailureTask = {
132
132
  readableId: 'on-failure-task',
133
133
  action: onFailureTaskName(workflow),
@@ -140,7 +140,7 @@ class V1Worker {
140
140
  concurrency: [],
141
141
  };
142
142
  }
143
- if (!durable && workflow.onFailure && typeof workflow.onFailure === 'object') {
143
+ if (workflow.onFailure && typeof workflow.onFailure === 'object') {
144
144
  const onFailure = workflow.onFailure;
145
145
  onFailureTask = {
146
146
  readableId: 'on-failure-task',
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const HATCHET_VERSION = "1.9.6";
1
+ export declare const HATCHET_VERSION = "1.9.8";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HATCHET_VERSION = void 0;
4
- exports.HATCHET_VERSION = '1.9.6';
4
+ exports.HATCHET_VERSION = '1.9.8';