@valkyrjaio/valkyrja 26.4.0 → 26.5.0
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 +1 -1
- package/src/Valkyrja/Application/Constant/ApplicationInfo.ts +2 -2
- package/src/Valkyrja/Application/Entry/Abstract/App.ts +3 -4
- package/src/Valkyrja/Application/Kernel/Valkyrja.ts +1 -3
- package/src/Valkyrja/Cli/Interaction/Message/Answer.ts +2 -1
- package/src/Valkyrja/Cli/Interaction/Writer/QuestionWriter.ts +5 -5
package/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
export class ApplicationInfo {
|
|
11
|
-
static readonly VERSION = '26.
|
|
12
|
-
static readonly VERSION_BUILD_DATE_TIME = 'July
|
|
11
|
+
static readonly VERSION = '26.5.0' as const;
|
|
12
|
+
static readonly VERSION_BUILD_DATE_TIME = 'July 31 2026 08:59:22 MST' as const;
|
|
13
13
|
static readonly ASCII = `
|
|
14
14
|
_ _ _
|
|
15
15
|
/\\ /\\__ _| | | ___ _ _ __(_) __ _
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
import { Valkyrja } from '../../Kernel/Valkyrja.ts';
|
|
11
11
|
import { Directory } from '../../Directory/Directory.ts';
|
|
12
|
-
import { Config } from '../../Data/Config.ts';
|
|
13
12
|
import { ContainerServiceProvider } from '../../../Container/Provider/ContainerServiceProvider.ts';
|
|
14
13
|
import { Container } from '../../../Container/Manager/Container.ts';
|
|
15
14
|
import { ApplicationServiceId } from '../../Constant/ApplicationServiceId.ts';
|
|
@@ -25,7 +24,7 @@ import type { ThrowableHandlerContract } from '../../../Throwable/Handler/Contra
|
|
|
25
24
|
let appStartTime: number | undefined;
|
|
26
25
|
|
|
27
26
|
export abstract class App {
|
|
28
|
-
static start(config: ConfigContract
|
|
27
|
+
static start(config: ConfigContract): ApplicationContract {
|
|
29
28
|
if (config.debugMode) {
|
|
30
29
|
this.defaultExceptionHandler();
|
|
31
30
|
}
|
|
@@ -46,7 +45,7 @@ export abstract class App {
|
|
|
46
45
|
Directory.basePath = dir;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
static app(config: ConfigContract
|
|
48
|
+
static app(config: ConfigContract): ApplicationContract {
|
|
50
49
|
const container = this.getContainer();
|
|
51
50
|
const app = this.getApplication(container, config);
|
|
52
51
|
|
|
@@ -55,7 +54,7 @@ export abstract class App {
|
|
|
55
54
|
return app;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
static getApplication(container: ContainerContract, config: ConfigContract
|
|
57
|
+
static getApplication(container: ContainerContract, config: ConfigContract): ApplicationContract {
|
|
59
58
|
return new Valkyrja(container, config);
|
|
60
59
|
}
|
|
61
60
|
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { Config } from '../Data/Config.ts';
|
|
11
|
-
|
|
12
10
|
import type { ApplicationContract } from './Contract/ApplicationContract.ts';
|
|
13
11
|
import type { ConfigContract } from '../Data/Contract/ConfigContract.ts';
|
|
14
12
|
import type { ComponentProviderContract } from '../Provider/Contract/ComponentProviderContract.ts';
|
|
@@ -27,7 +25,7 @@ export class Valkyrja implements ApplicationContract {
|
|
|
27
25
|
|
|
28
26
|
constructor(
|
|
29
27
|
protected readonly container: ContainerContract,
|
|
30
|
-
protected readonly config: ConfigContract
|
|
28
|
+
protected readonly config: ConfigContract,
|
|
31
29
|
) {
|
|
32
30
|
this.bootstrapTimezone();
|
|
33
31
|
}
|
|
@@ -121,8 +121,9 @@ export class Answer extends Message implements AnswerContract {
|
|
|
121
121
|
const validationCallable = this.validationCallable;
|
|
122
122
|
const userResponse = this.userResponse;
|
|
123
123
|
|
|
124
|
+
// allowedResponses always contains at least the default response (seeded by every
|
|
125
|
+
// constructor and mutator), so the "no constraints at all" case is unreachable.
|
|
124
126
|
return (
|
|
125
|
-
(this.allowedResponses.length === 0 && validationCallable === null) ||
|
|
126
127
|
this.allowedResponses.includes(userResponse) ||
|
|
127
128
|
(validationCallable !== null && validationCallable(userResponse))
|
|
128
129
|
);
|
|
@@ -62,11 +62,11 @@ export class QuestionWriter implements WriterContract {
|
|
|
62
62
|
const answer = question.getAnswer();
|
|
63
63
|
const validResponses = answer.getAllowedResponses();
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
// An answer always carries at least its default response, so there is always at least one
|
|
66
|
+
// valid response to render.
|
|
67
|
+
output = output.writeMessage(new Message(' ('));
|
|
68
|
+
output = output.writeMessage(new Message(validResponses.map((v) => `\`${v}\``).join(' or ')));
|
|
69
|
+
output = output.writeMessage(new Message(')'));
|
|
70
70
|
|
|
71
71
|
output = output.writeMessage(new Message(' [default: "'));
|
|
72
72
|
output = output.writeMessage(new Message(answer.getDefaultResponse(), new HighlightedTextFormatter()));
|