@hatchet-dev/typescript-sdk 1.9.6 → 1.9.7
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/version-check.js +65 -0
- package/package.json +26 -27
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -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.
|
|
3
|
+
"version": "1.9.7",
|
|
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",
|
|
@@ -91,5 +67,28 @@
|
|
|
91
67
|
"yaml": "^2.7.1",
|
|
92
68
|
"zod": "^3.24.2"
|
|
93
69
|
},
|
|
94
|
-
"packageManager": "pnpm@
|
|
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
|
+
}
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.9.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.9.7";
|
package/version.js
CHANGED