@deslop/deploy 0.1.1266 → 0.1.1267
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/server.js +7 -7
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -91829,7 +91829,7 @@ String$6.check(isPattern(/^\d+(?:,\d+)*$/u));
|
|
|
91829
91829
|
function flagsOf(settings) {
|
|
91830
91830
|
return map$9(settings, (setting, key) => pipe(String$1(setting.flag), withSchema(setting.schema), withFallbackConfig(schema$1(setting.schema, key)), withDescription(`${setting.description} [${key}]`), optional));
|
|
91831
91831
|
}
|
|
91832
|
-
const
|
|
91832
|
+
const configProvider = fnUntraced(function* (given, defaultPort) {
|
|
91833
91833
|
const port = given["PORT"] ?? `${defaultPort}`;
|
|
91834
91834
|
const url = given["APP_URL"] ?? `http://localhost:${port}`;
|
|
91835
91835
|
if (given["AUTH_URL"] !== void 0 && new URL(url).protocol !== "https:") return yield* AppError.make({ message: "With --auth, set --url to the app's HTTPS origin" });
|
|
@@ -91875,12 +91875,12 @@ function runApp(app) {
|
|
|
91875
91875
|
};
|
|
91876
91876
|
const root = pipe(make$5(name), withSharedFlags(flagsOf(settings)));
|
|
91877
91877
|
const given = map$5(root, (input) => getSomes$1(input));
|
|
91878
|
-
return yield* pipe(root, withHandler((input) => flatMap$2(
|
|
91878
|
+
return yield* pipe(root, withHandler((input) => flatMap$2(configProvider(getSomes$1(input), metadata.config.port), (values) => provideService(server(app), ConfigProvider, values))), withSubcommands([pipe(make$5("service"), withSubcommands([
|
|
91879
91879
|
make$5("install", {}, fnUntraced(function* () {
|
|
91880
91880
|
const fs = yield* FileSystem;
|
|
91881
91881
|
const path = yield* Path$1;
|
|
91882
91882
|
const flags = yield* given;
|
|
91883
|
-
yield*
|
|
91883
|
+
yield* configProvider(flags, metadata.config.port);
|
|
91884
91884
|
const entry = path.join(yield* activate(name, yield* fs.realPath(packageRoot)), "dist", "server.js");
|
|
91885
91885
|
const args = flatten$3(collect$2(flags, (key, value) => [`--${settings[key]?.flag ?? key}`, value]));
|
|
91886
91886
|
yield* output(yield* install(name, [
|
|
@@ -92993,7 +92993,7 @@ function appShares(current, previous) {
|
|
|
92993
92993
|
}
|
|
92994
92994
|
// src/services/metrics/service.ts
|
|
92995
92995
|
const CGROUP = "/sys/fs/cgroup";
|
|
92996
|
-
const
|
|
92996
|
+
const HOURLY_FILE_PREFIX = "metrics-";
|
|
92997
92997
|
var Metrics = class Metrics extends Service$1()("@deslop/deploy/services/metrics/service/Metrics") {
|
|
92998
92998
|
static layer = effect(Metrics, gen(function* () {
|
|
92999
92999
|
const fs = yield* FileSystem;
|
|
@@ -93002,7 +93002,7 @@ var Metrics = class Metrics extends Service$1()("@deslop/deploy/services/metrics
|
|
|
93002
93002
|
const base = yield* KeyValueStore;
|
|
93003
93003
|
const store = toSchemaStore(base, ArraySchema(Sample));
|
|
93004
93004
|
const now = yield* currentTimeMillis;
|
|
93005
|
-
const saved = yield* forEach$1(filter$3(yield* base.keys, (key) => startsWith(
|
|
93005
|
+
const saved = yield* forEach$1(filter$3(yield* base.keys, (key) => startsWith(HOURLY_FILE_PREFIX)(key) && !endsWith(".tmp")(key)), (key) => pipe(store.get(key), orElseSucceed(() => none())), { concurrency: 8 });
|
|
93006
93006
|
const state = yield* make$44(sort(filter$3(flatten$3(getSomes(saved)), (value) => value.time >= now - 6048e5), mapInput(Number$6, (value) => value.time)));
|
|
93007
93007
|
const previous = yield* make$44(none());
|
|
93008
93008
|
const lastApps = yield* make$44(none());
|
|
@@ -93122,11 +93122,11 @@ var Metrics = class Metrics extends Service$1()("@deslop/deploy/services/metrics
|
|
|
93122
93122
|
const time = yield* currentTimeMillis;
|
|
93123
93123
|
const buckets = yield* getAndSet(dirty, []);
|
|
93124
93124
|
const samples = yield* get$1(state);
|
|
93125
|
-
yield* pipe(forEach$1(buckets, (bucket) => store.set(`${
|
|
93125
|
+
yield* pipe(forEach$1(buckets, (bucket) => store.set(`${HOURLY_FILE_PREFIX}${bucket}`, filter$3(samples, (entry) => Math.floor(entry.time / 36e5) === bucket)), {
|
|
93126
93126
|
concurrency: 1,
|
|
93127
93127
|
discard: true
|
|
93128
93128
|
}), onError(() => update$1(dirty, (pending) => dedupe([...pending, ...buckets]))));
|
|
93129
|
-
yield* forEach$1(filter$3(yield* base.keys, (key) => startsWith(
|
|
93129
|
+
yield* forEach$1(filter$3(yield* base.keys, (key) => startsWith(HOURLY_FILE_PREFIX)(key) && (endsWith(".tmp")(key) || exists(parse$3(slice$1(8)(key)), (bucket) => bucket < Math.floor(time / 36e5) - 168))), (key) => base.remove(key), {
|
|
93130
93130
|
concurrency: 1,
|
|
93131
93131
|
discard: true
|
|
93132
93132
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/deploy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1267",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/MP281X/deslop.git",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=26"
|
|
40
40
|
},
|
|
41
|
-
"fingerprint": "
|
|
41
|
+
"fingerprint": "ebe6e164f697be6b47c451a04da33e84dbfada082e954083847da3dbfd68db28"
|
|
42
42
|
}
|