@astroscope/health 0.2.0 → 0.2.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/index.js +6 -13
- package/dist/register.d.ts +5 -0
- package/dist/register.js +6 -0
- package/package.json +5 -5
- package/dist/setup.d.ts +0 -2
- package/dist/setup.js +0 -7
- /package/dist/{chunk-SBLQMZG6.js → chunk-VKEMDBBI.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerHealth
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VKEMDBBI.js";
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
import MagicString from "magic-string";
|
|
7
7
|
import { checks, K8sPaths, SimplePaths } from "health-probes";
|
|
8
|
-
var VIRTUAL_MODULE_ID = "virtual:@astroscope/health/config";
|
|
9
|
-
var RESOLVED_VIRTUAL_MODULE_ID = `\0${VIRTUAL_MODULE_ID}`;
|
|
10
8
|
function health(options = {}) {
|
|
11
9
|
const enableDev = options.dev ?? false;
|
|
12
10
|
const serverOptions = {
|
|
@@ -36,14 +34,6 @@ function health(options = {}) {
|
|
|
36
34
|
plugins: [
|
|
37
35
|
{
|
|
38
36
|
name: "@astroscope/health",
|
|
39
|
-
resolveId(id) {
|
|
40
|
-
if (id === VIRTUAL_MODULE_ID) return RESOLVED_VIRTUAL_MODULE_ID;
|
|
41
|
-
},
|
|
42
|
-
load(id) {
|
|
43
|
-
if (id === RESOLVED_VIRTUAL_MODULE_ID) {
|
|
44
|
-
return `export const config = ${JSON.stringify(serverOptions)};`;
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
37
|
configureServer() {
|
|
48
38
|
if (!enableDev) return;
|
|
49
39
|
registerHealth(serverOptions);
|
|
@@ -53,8 +43,11 @@ function health(options = {}) {
|
|
|
53
43
|
const entryChunk = bundle["entry.mjs"];
|
|
54
44
|
if (!entryChunk || entryChunk.type !== "chunk") return;
|
|
55
45
|
const s = new MagicString(entryChunk.code);
|
|
56
|
-
s.prepend(
|
|
57
|
-
`
|
|
46
|
+
s.prepend(
|
|
47
|
+
`import { registerHealth as __astroscope_registerHealth } from '@astroscope/health/setup';
|
|
48
|
+
__astroscope_registerHealth(${JSON.stringify(serverOptions)});
|
|
49
|
+
`
|
|
50
|
+
);
|
|
58
51
|
entryChunk.code = s.toString();
|
|
59
52
|
if (entryChunk.map) {
|
|
60
53
|
entryChunk.map = s.generateMap({ hires: true });
|
package/dist/register.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astroscope/health",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Kubernetes-style health probes integration for Astro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"./setup": {
|
|
14
|
-
"types": "./dist/
|
|
15
|
-
"import": "./dist/
|
|
14
|
+
"types": "./dist/register.d.ts",
|
|
15
|
+
"import": "./dist/register.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/smnbbrv/astroscope/tree/main/packages/health#readme",
|
|
47
47
|
"scripts": {
|
|
48
|
-
"build": "tsup src/index.ts src/
|
|
48
|
+
"build": "tsup src/index.ts src/register.ts --format esm --dts",
|
|
49
49
|
"typecheck": "tsc --noEmit",
|
|
50
50
|
"lint": "eslint 'src/**/*.ts'",
|
|
51
51
|
"lint:fix": "eslint 'src/**/*.ts' --fix"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"typescript": "^5.9.3"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@astroscope/boot": ">=0.3.
|
|
64
|
+
"@astroscope/boot": ">=0.3.2",
|
|
65
65
|
"astro": "^5.0.0"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/dist/setup.d.ts
DELETED
package/dist/setup.js
DELETED
|
File without changes
|