@hatchet-dev/typescript-sdk 1.4.0 → 1.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -33,7 +33,7 @@
33
33
  "eslint:fix": "eslint \"{src,tests}/**/*.{ts,tsx,js}\" --fix",
34
34
  "prettier:check": "prettier \"src/**/*.{ts,tsx}\" --list-different",
35
35
  "prettier:fix": "prettier \"src/**/*.{ts,tsx}\" --write",
36
- "prepublish": "cp package.json dist/package.json; cp README.md dist/",
36
+ "prepublish": "cp package.json dist/package.json; cp README.md dist/; cp -r scripts dist/",
37
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
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
39
  "generate-docs": "typedoc",
@@ -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/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const HATCHET_VERSION = "1.4.0";
1
+ export declare const HATCHET_VERSION = "1.4.1";
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.4.0';
4
+ exports.HATCHET_VERSION = '1.4.1';