@highstate/backend 0.20.0 → 0.21.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/dist/chunk-b05q6fm2.js +37 -0
- package/dist/{chunk-52MY2TCE.js → chunk-gxjwa93h.js} +506 -734
- package/dist/{chunk-X2WG3WGL.js → chunk-vzdz6chj.js} +18 -15
- package/dist/highstate.manifest.json +4 -4
- package/dist/index.js +4020 -3558
- package/dist/library/package-resolution-worker.js +121 -10
- package/dist/library/worker/main.js +27 -16
- package/dist/shared/index.js +254 -4
- package/package.json +15 -16
- package/src/artifact/factory.ts +3 -2
- package/src/library/find-package-json.test.ts +77 -0
- package/src/library/find-package-json.ts +149 -0
- package/src/library/package-resolution-worker.ts +7 -3
- package/src/orchestrator/operation.ts +2 -0
- package/src/orchestrator/operation.update.skip.test.ts +86 -0
- package/src/runner/factory.ts +3 -3
- package/src/runner/force-abort.ts +7 -2
- package/src/runner/local.ts +8 -3
- package/src/runner/pulumi.ts +3 -5
- package/src/services.ts +1 -1
- package/src/terminal/run.sh.ts +9 -4
- package/LICENSE +0 -21
- package/dist/chunk-52MY2TCE.js.map +0 -1
- package/dist/chunk-UAWBPTDW.js +0 -49
- package/dist/chunk-UAWBPTDW.js.map +0 -1
- package/dist/chunk-X2WG3WGL.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/library/package-resolution-worker.js.map +0 -1
- package/dist/library/worker/main.js.map +0 -1
- package/dist/shared/index.js.map +0 -1
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { mkdir } from 'node:fs/promises';
|
|
3
|
-
import { basename, dirname, relative } from 'node:path';
|
|
4
|
-
import { findWorkspaceDir, readPackageJSON, resolvePackageJSON } from 'pkg-types';
|
|
5
|
-
|
|
1
|
+
// @bun
|
|
6
2
|
// src/common/utils.ts
|
|
3
|
+
import { z } from "zod";
|
|
7
4
|
async function runWithRetryOnError(runner, tryHandleError, maxRetries = 1) {
|
|
8
5
|
let lastError;
|
|
9
|
-
for (let i = 0;
|
|
6
|
+
for (let i = 0;i < maxRetries + 1; i++) {
|
|
10
7
|
try {
|
|
11
8
|
return await runner();
|
|
12
9
|
} catch (e) {
|
|
@@ -19,12 +16,13 @@ async function runWithRetryOnError(runner, tryHandleError, maxRetries = 1) {
|
|
|
19
16
|
}
|
|
20
17
|
throw lastError;
|
|
21
18
|
}
|
|
22
|
-
|
|
19
|
+
|
|
20
|
+
class AbortError extends Error {
|
|
23
21
|
constructor(message, options) {
|
|
24
22
|
super(message, options);
|
|
25
23
|
this.name = "AbortError";
|
|
26
24
|
}
|
|
27
|
-
}
|
|
25
|
+
}
|
|
28
26
|
function isAbortError(error) {
|
|
29
27
|
return error instanceof Error && error.name === "AbortError";
|
|
30
28
|
}
|
|
@@ -68,6 +66,12 @@ function waitForAbort(signal) {
|
|
|
68
66
|
signal.addEventListener("abort", () => resolve(), { once: true });
|
|
69
67
|
});
|
|
70
68
|
}
|
|
69
|
+
|
|
70
|
+
// src/common/codebase.ts
|
|
71
|
+
import { mkdir } from "fs/promises";
|
|
72
|
+
import { dirname, relative } from "path";
|
|
73
|
+
import { resolvePackageJSON } from "pkg-types";
|
|
74
|
+
import z2 from "zod";
|
|
71
75
|
var codebaseConfig = z2.object({
|
|
72
76
|
HIGHSTATE_CODEBASE_PATH: z2.string().optional()
|
|
73
77
|
});
|
|
@@ -103,6 +107,9 @@ async function getCodebaseHighstatePath(config, logger) {
|
|
|
103
107
|
}
|
|
104
108
|
return codebaseHighstatePath;
|
|
105
109
|
}
|
|
110
|
+
// src/common/local.ts
|
|
111
|
+
import { basename } from "path";
|
|
112
|
+
import { findWorkspaceDir, readPackageJSON } from "pkg-types";
|
|
106
113
|
async function resolveMainLocalProject(projectPath, projectName) {
|
|
107
114
|
if (!projectPath) {
|
|
108
115
|
projectPath = await findWorkspaceDir();
|
|
@@ -116,12 +123,10 @@ async function resolveMainLocalProject(projectPath, projectName) {
|
|
|
116
123
|
}
|
|
117
124
|
return [projectPath, projectName];
|
|
118
125
|
}
|
|
119
|
-
|
|
120
126
|
// src/common/logger.ts
|
|
121
127
|
function createProjectLogger(logger, projectId) {
|
|
122
128
|
return logger.child({ projectId }, { msgPrefix: `[project:${projectId}] ` });
|
|
123
129
|
}
|
|
124
|
-
|
|
125
130
|
// src/common/tree.ts
|
|
126
131
|
function renderTree(node) {
|
|
127
132
|
const lines = [];
|
|
@@ -138,9 +143,7 @@ function renderTree(node) {
|
|
|
138
143
|
const isLastChild = index === node.children.length - 1;
|
|
139
144
|
renderNode(child, "", isLastChild);
|
|
140
145
|
});
|
|
141
|
-
return lines.join(
|
|
146
|
+
return lines.join(`
|
|
147
|
+
`);
|
|
142
148
|
}
|
|
143
|
-
|
|
144
|
-
export { AbortError, codebaseConfig, createProjectLogger, errorToString, getCodebaseHighstatePath, isAbortErrorLike, renderTree, resolveMainLocalProject, runWithRetryOnError, stringArrayType, waitForAbort };
|
|
145
|
-
//# sourceMappingURL=chunk-X2WG3WGL.js.map
|
|
146
|
-
//# sourceMappingURL=chunk-X2WG3WGL.js.map
|
|
149
|
+
export { codebaseConfig, getCodebaseHighstatePath, resolveMainLocalProject, createProjectLogger, renderTree, runWithRetryOnError, AbortError, isAbortErrorLike, stringArrayType, errorToString, waitForAbort };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sourceHashes": {
|
|
3
|
-
"./dist/index.js":
|
|
4
|
-
"./dist/shared/index.js":
|
|
5
|
-
"./dist/library/worker/main.js":
|
|
6
|
-
"./dist/library/package-resolution-worker.js":
|
|
3
|
+
"./dist/index.js": 542555825,
|
|
4
|
+
"./dist/shared/index.js": 998634541,
|
|
5
|
+
"./dist/library/worker/main.js": 3821435996,
|
|
6
|
+
"./dist/library/package-resolution-worker.js": 704325585
|
|
7
7
|
}
|
|
8
8
|
}
|