@decohere/core 0.0.1-dev.20261106.228 → 0.0.1-dev.20261107.245
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/es6/src/hosting/app.js
CHANGED
|
@@ -23,6 +23,17 @@ const DEFAULT_SHUTDOWN_SIGNALS = [
|
|
|
23
23
|
];
|
|
24
24
|
const DEFAULT_SHUTDOWN_TIMEOUT_MS = 10_000;
|
|
25
25
|
export class ApiConfiguration {
|
|
26
|
+
static schema = {
|
|
27
|
+
type: "object",
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
properties: {
|
|
30
|
+
port: {
|
|
31
|
+
type: "integer",
|
|
32
|
+
minimum: 0,
|
|
33
|
+
maximum: 65535
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
26
37
|
port;
|
|
27
38
|
}
|
|
28
39
|
export class App {
|
|
@@ -3,3 +3,10 @@ export const Environments = {
|
|
|
3
3
|
development: "development"
|
|
4
4
|
};
|
|
5
5
|
export const DefaultEnvironment = Environments.development;
|
|
6
|
+
/**
|
|
7
|
+
* True only when NODE_ENV says development: `development` or `dev`. Anything else, unset, staging or
|
|
8
|
+
* a typo included, isn't. Use it to refuse settings that are unsafe outside development.
|
|
9
|
+
*/ export function isDevelopmentEnv(nodeEnv = process.env.NODE_ENV) {
|
|
10
|
+
const env = nodeEnv?.toLowerCase();
|
|
11
|
+
return env === "development" || env === "dev";
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decohere/core",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.20261107.245",
|
|
4
4
|
"description": "The runtime base every Decohere package builds on: reflection, composition, configuration types, extensibility, collections, objects, caching on a Map, and basic file IO. No side effects on import.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@decohere/scribe": "0.0.1-dev.
|
|
71
|
+
"@decohere/scribe": "0.0.1-dev.20261107.245",
|
|
72
72
|
"reflect-metadata": "^0.2.2"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {}
|
|
@@ -2,6 +2,17 @@ import { type LifetimeScope } from "../composition/index.js";
|
|
|
2
2
|
import { type IConfigurationService } from "../configuration/index.js";
|
|
3
3
|
import type { HostedServiceHost } from "./hosted-service-host.js";
|
|
4
4
|
export declare class ApiConfiguration {
|
|
5
|
+
static schema: {
|
|
6
|
+
type: string;
|
|
7
|
+
additionalProperties: boolean;
|
|
8
|
+
properties: {
|
|
9
|
+
port: {
|
|
10
|
+
type: string;
|
|
11
|
+
minimum: number;
|
|
12
|
+
maximum: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
5
16
|
port: number;
|
|
6
17
|
}
|
|
7
18
|
export type AppServerStartOptions = {
|
|
@@ -4,3 +4,8 @@ export declare const Environments: {
|
|
|
4
4
|
development: "development";
|
|
5
5
|
};
|
|
6
6
|
export declare const DefaultEnvironment: "development";
|
|
7
|
+
/**
|
|
8
|
+
* True only when NODE_ENV says development: `development` or `dev`. Anything else, unset, staging or
|
|
9
|
+
* a typo included, isn't. Use it to refuse settings that are unsafe outside development.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isDevelopmentEnv(nodeEnv?: string | undefined): boolean;
|