@mojojs/core 0.5.6 → 0.5.7
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/lib/cli/gen-full-app.js +5 -8
- package/lib/user-agent/test.d.ts +1 -1
- package/lib/util.d.ts +1 -1
- package/package.json +1 -1
package/lib/cli/gen-full-app.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as util from './../util.js';
|
|
|
3
3
|
export default async function genLiteAppCommand(app, args) {
|
|
4
4
|
const name = args[1] ?? 'index.js';
|
|
5
5
|
process.stdout.write('Generating application directory struture:\n');
|
|
6
|
-
await util.cliCreateFile('config.
|
|
6
|
+
await util.cliCreateFile('config.yml', yamlConfig, { secret: crypto.randomBytes(16).toString('hex') });
|
|
7
7
|
await util.cliCreateFile(name, jsIndex);
|
|
8
8
|
await util.cliCreateDir('controllers');
|
|
9
9
|
await util.cliCreateFile('controllers/example.js', jsController);
|
|
@@ -27,17 +27,14 @@ genLiteAppCommand.usage = `Usage: APPLICATION gen-full-app [OPTIONS] [NAME]
|
|
|
27
27
|
Options:
|
|
28
28
|
-h, --help Show this summary of available options
|
|
29
29
|
`;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
"<%= secret %>"
|
|
33
|
-
]
|
|
34
|
-
}
|
|
30
|
+
const yamlConfig = `---
|
|
31
|
+
secrets: [<%= secret %>]
|
|
35
32
|
`;
|
|
36
|
-
const jsIndex = `import mojo, {
|
|
33
|
+
const jsIndex = `import mojo, {yamlConfigPlugin} from '@mojojs/core';
|
|
37
34
|
|
|
38
35
|
export const app = mojo();
|
|
39
36
|
|
|
40
|
-
app.plugin(
|
|
37
|
+
app.plugin(yamlConfigPlugin);
|
|
41
38
|
app.secrets = [app.config.secrets];
|
|
42
39
|
|
|
43
40
|
app.get('/').to('example#welcome');
|
package/lib/user-agent/test.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export declare class TestUserAgent extends MockUserAgent {
|
|
|
49
49
|
typeLike(regex: RegExp): this;
|
|
50
50
|
websocketOk(url: string | URL, options?: UserAgentWebSocketOptions): Promise<void>;
|
|
51
51
|
get ws(): WebSocket;
|
|
52
|
-
yamlIs(value:
|
|
52
|
+
yamlIs(value: JSONValue, pointer?: string): this;
|
|
53
53
|
get _cheerio(): cheerio.Root;
|
|
54
54
|
_prepareTap(tap: Tap.Tap): void;
|
|
55
55
|
_requestOk(skip: SkipFunction, method: string, url: string | URL, options?: UserAgentRequestOptions): Promise<this>;
|
package/lib/util.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare function exceptionContext(error: Error, options?: {
|
|
|
26
26
|
} | null>;
|
|
27
27
|
export declare function htmlEscape(value: string | SafeString): string;
|
|
28
28
|
export declare function htmlTag(name: string, attrs?: Record<string, string> | string | SafeString, content?: string | SafeString): SafeString;
|
|
29
|
-
export declare function jsonPointer(value: JSONValue, pointer: string):
|
|
29
|
+
export declare function jsonPointer(value: JSONValue, pointer: string): JSONValue | undefined;
|
|
30
30
|
export declare function loadModules(dirs: string[]): Promise<Record<string, any>>;
|
|
31
31
|
export declare const sleep: typeof setTimeout;
|
|
32
32
|
export declare function tablify(rows?: string[][]): string;
|