odoro 1.0.9 → 2.1.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/README.md +94 -0
- package/client.d.ts +90 -16
- package/dist/build-XJIP4GNT.js +5 -0
- package/dist/{chunk-34RGOZFA.js → chunk-4D56Z7G3.js} +49 -50
- package/dist/{chunk-JMEHF3KN.js → chunk-7ZB5MAM6.js} +4 -4
- package/dist/chunk-DF67LADH.js +735 -0
- package/dist/{chunk-LHZGX5ML.js → chunk-HS7NGZLM.js} +307 -196
- package/dist/chunk-LIKVHWB4.js +231 -0
- package/dist/chunk-QOVBLN7A.js +241 -0
- package/dist/chunk-RTWJ5GFB.js +729 -0
- package/dist/chunk-TONYIKCN.js +57 -0
- package/dist/cli.d.ts +12 -13
- package/dist/cli.js +86 -63
- package/dist/{commands-AHMXBWQQ.js → commands-GYA7NTCX.js} +124 -124
- package/dist/commands-UOWN3IK4.js +181 -0
- package/dist/{create-CYVSVDAD.js → create-B2TLV6XI.js} +198 -160
- package/dist/index.d.ts +603 -151
- package/dist/index.js +6 -6
- package/dist/{package-EIDLKAA6.js → package-3ZJOEXM4.js} +6 -5
- package/dist/preview-3IRG7MHV.js +4 -0
- package/dist/registry/index.d.ts +75 -76
- package/dist/registry/index.js +1 -1
- package/dist/{server-4UGN3SFS.js → server-ZB3P3EGS.js} +3 -3
- package/package.json +6 -5
- package/templates/react-ts/README.md +71 -35
- package/templates/react-ts/_env.example +9 -0
- package/templates/react-ts/_variants/with-engine/src/background.tsx +118 -0
- package/templates/react-ts/_variants/without-libs/src/App.tsx +380 -0
- package/templates/react-ts/_variants/without-libs/src/background.tsx +24 -0
- package/templates/react-ts/_variants/without-libs/src/entry-server.tsx +39 -0
- package/templates/react-ts/_variants/without-libs/src/main.tsx +26 -0
- package/templates/{react-ts-server/_variantes/sans-libs/client → react-ts/_variants/without-libs}/src/styles.css +137 -137
- package/templates/react-ts/{_variantes/sans-routeur → _variants/without-router}/src/App.tsx +141 -141
- package/templates/react-ts/_variants/without-router/src/entry-server.tsx +39 -0
- package/templates/react-ts/index.html +4 -4
- package/templates/react-ts/odoro.config.ts +5 -0
- package/templates/react-ts/src/App.tsx +219 -209
- package/templates/react-ts/src/background.tsx +66 -0
- package/templates/react-ts/src/entry-server.tsx +85 -0
- package/templates/react-ts/src/main.tsx +13 -4
- package/templates/react-ts/src/router.tsx +65 -45
- package/templates/react-ts/src/styles.css +5 -5
- package/templates/react-ts-server/Dockerfile +9 -9
- package/templates/react-ts-server/README.md +97 -45
- package/templates/react-ts-server/_env.example +31 -33
- package/templates/react-ts-server/_variants/with-engine/client/src/background.tsx +118 -0
- package/templates/react-ts-server/_variants/without-libs/client/src/App.tsx +380 -0
- package/templates/react-ts-server/_variants/without-libs/client/src/background.tsx +24 -0
- package/templates/react-ts-server/_variants/without-libs/client/src/entry-server.tsx +39 -0
- package/templates/react-ts-server/_variants/without-libs/client/src/main.tsx +26 -0
- package/templates/{react-ts/_variantes/sans-libs → react-ts-server/_variants/without-libs/client}/src/styles.css +137 -137
- package/templates/react-ts-server/{_variantes/sans-routeur → _variants/without-router}/client/src/App.tsx +141 -141
- package/templates/react-ts-server/_variants/without-router/client/src/entry-server.tsx +39 -0
- package/templates/react-ts-server/client/index.html +4 -4
- package/templates/react-ts-server/client/src/App.tsx +228 -210
- package/templates/react-ts-server/client/src/account.tsx +267 -0
- package/templates/react-ts-server/client/src/auth.tsx +139 -0
- package/templates/react-ts-server/client/src/background.tsx +66 -0
- package/templates/react-ts-server/client/src/entry-server.tsx +92 -0
- package/templates/react-ts-server/client/src/main.tsx +17 -5
- package/templates/react-ts-server/client/src/router.tsx +77 -45
- package/templates/react-ts-server/client/src/styles.css +5 -5
- package/templates/react-ts-server/odoro.config.ts +7 -4
- package/templates/react-ts-server/package.json +2 -0
- package/templates/react-ts-server/scripts/dev.mjs +14 -14
- package/templates/react-ts-server/server/src/main.ts +119 -45
- package/templates/react-ts-server/server/src/modules/auth/index.ts +238 -0
- package/templates/react-ts-server/server/src/modules/auth/password.ts +122 -0
- package/templates/react-ts-server/server/src/modules/auth/store.ts +193 -0
- package/templates/react-ts-server/server/src/modules/health/index.ts +45 -46
- package/dist/build-JFQHODAT.js +0 -5
- package/dist/chunk-22KJTV2R.js +0 -380
- package/dist/chunk-3SZIN6VG.js +0 -64
- package/dist/chunk-DL3NPC4H.js +0 -113
- package/dist/chunk-TQUJ3MFS.js +0 -268
- package/dist/chunk-ZVL7EXJO.js +0 -66
- package/dist/commands-4JRBD55Z.js +0 -245
- package/dist/preview-7DKEAQOQ.js +0 -4
- package/templates/react-ts/_variantes/avec-moteur/src/fond.tsx +0 -118
- package/templates/react-ts/_variantes/sans-libs/src/App.tsx +0 -382
- package/templates/react-ts/_variantes/sans-libs/src/fond.tsx +0 -23
- package/templates/react-ts/_variantes/sans-libs/src/main.tsx +0 -17
- package/templates/react-ts/src/fond.tsx +0 -66
- package/templates/react-ts-server/_variantes/avec-moteur/client/src/fond.tsx +0 -118
- package/templates/react-ts-server/_variantes/sans-libs/client/src/App.tsx +0 -382
- package/templates/react-ts-server/_variantes/sans-libs/client/src/fond.tsx +0 -23
- package/templates/react-ts-server/_variantes/sans-libs/client/src/main.tsx +0 -17
- package/templates/react-ts-server/client/src/fond.tsx +0 -66
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { isAssetRequest, sendFile, listen, openBrowser } from './chunk-RTWJ5GFB.js';
|
|
3
|
+
import { warn, success, info, colors } from './chunk-7ZB5MAM6.js';
|
|
4
|
+
import { existsSync, statSync } from 'fs';
|
|
5
|
+
import { createServer } from 'http';
|
|
6
|
+
import { normalize, join, extname } from 'path';
|
|
7
|
+
|
|
8
|
+
async function startPreviewServer(config, port = config.server.port + 1) {
|
|
9
|
+
if (!existsSync(config.outDir)) {
|
|
10
|
+
throw new Error(`[odoro] Nothing to preview: run "odoro build" first.`);
|
|
11
|
+
}
|
|
12
|
+
const server = createServer((incoming, response) => {
|
|
13
|
+
const path = (incoming.url ?? "/").split("?")[0] ?? "/";
|
|
14
|
+
const relativePath = normalize(decodeURIComponent(path)).split(/[\\/]/).filter(Boolean).join("/");
|
|
15
|
+
const candidate = join(config.outDir, relativePath);
|
|
16
|
+
const inDirectory = ["index.html", "index.md"].map((name) => join(candidate, name)).find((path2) => existsSync(path2) && statSync(path2).isFile());
|
|
17
|
+
const existing = existsSync(candidate) && statSync(candidate).isFile() ? candidate : inDirectory;
|
|
18
|
+
if (existing === void 0 && (extname(relativePath) !== "" || isAssetRequest(incoming.headers))) {
|
|
19
|
+
response.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
|
20
|
+
response.end(`Not found: /${relativePath}`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const file = existing ?? join(config.outDir, "index.html");
|
|
24
|
+
if (!file.startsWith(config.outDir)) {
|
|
25
|
+
response.writeHead(403, { "Content-Type": "text/plain" });
|
|
26
|
+
response.end("Forbidden");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const immutable = relativePath.startsWith("assets/");
|
|
30
|
+
sendFile(response, file, {
|
|
31
|
+
cacheControl: immutable ? "public, max-age=31536000, immutable" : "no-cache",
|
|
32
|
+
range: incoming.headers.range,
|
|
33
|
+
headOnly: incoming.method === "HEAD"
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
const { port: obtained, requested } = await listen(
|
|
37
|
+
server,
|
|
38
|
+
port,
|
|
39
|
+
config.server.host,
|
|
40
|
+
config.server.strictPort ? 1 : void 0
|
|
41
|
+
);
|
|
42
|
+
if (requested !== void 0) {
|
|
43
|
+
warn(
|
|
44
|
+
`port ${String(requested)} in use \u2014 preview listening on ${String(obtained)}`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const url = `http://${config.server.host}:${String(obtained)}${config.base}`;
|
|
48
|
+
success("preview of the production build");
|
|
49
|
+
info(` ${colors.cyan(url)}`);
|
|
50
|
+
if (config.server.open) openBrowser(url);
|
|
51
|
+
return {
|
|
52
|
+
url,
|
|
53
|
+
close: () => new Promise((done) => server.close(() => done()))
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { startPreviewServer };
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Command line entry of the Odoro engine.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* poids compte.
|
|
4
|
+
* The argument parsing is written by hand: it fits in forty lines, and the
|
|
5
|
+
* binary is downloaded on every `npm create odoro`, so its weight counts.
|
|
7
6
|
*
|
|
8
7
|
* @module
|
|
9
8
|
*/
|
|
10
|
-
/**
|
|
9
|
+
/** Parsed arguments. */
|
|
11
10
|
interface ParsedArgs {
|
|
12
|
-
/**
|
|
11
|
+
/** Subcommand requested. */
|
|
13
12
|
command: string;
|
|
14
|
-
/**
|
|
13
|
+
/** Remaining positional arguments. */
|
|
15
14
|
positional: string[];
|
|
16
|
-
/**
|
|
15
|
+
/** Named options. */
|
|
17
16
|
flags: Record<string, string | boolean>;
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* Parses a command line.
|
|
21
20
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Recognises `--option`, `--option=value`, `--option value`, `--no-option` and
|
|
22
|
+
* the short aliases `-h` and `-v`.
|
|
24
23
|
*
|
|
25
24
|
* @example
|
|
26
25
|
* parseArgs(['create', 'site', '--template=react-ts', '--no-git'])
|
|
@@ -28,9 +27,9 @@ interface ParsedArgs {
|
|
|
28
27
|
*/
|
|
29
28
|
declare function parseArgs(argv: readonly string[]): ParsedArgs;
|
|
30
29
|
/**
|
|
31
|
-
*
|
|
30
|
+
* Entry point of the binary.
|
|
32
31
|
*
|
|
33
|
-
* @returns
|
|
32
|
+
* @returns The exit code of the process.
|
|
34
33
|
*
|
|
35
34
|
* @example
|
|
36
35
|
* const code = await run(['dev', '--port', '3000'])
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { loadConfig } from './chunk-
|
|
2
|
+
import { loadConfig } from './chunk-QOVBLN7A.js';
|
|
3
3
|
import './chunk-T6RLHSCW.js';
|
|
4
|
-
import { error } from './chunk-
|
|
4
|
+
import { error } from './chunk-7ZB5MAM6.js';
|
|
5
5
|
import { realpathSync } from 'fs';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
import colors from 'picocolors';
|
|
@@ -46,66 +46,73 @@ function parseArgs(argv) {
|
|
|
46
46
|
return { command, positional, flags };
|
|
47
47
|
}
|
|
48
48
|
var HELP = `
|
|
49
|
-
${colors.bold(colors.magenta("odoro"))} \u2014
|
|
49
|
+
${colors.bold(colors.magenta("odoro"))} \u2014 development engine and scaffolder
|
|
50
50
|
|
|
51
|
-
${colors.bold("
|
|
52
|
-
odoro <
|
|
51
|
+
${colors.bold("Usage")}
|
|
52
|
+
odoro <command> [options]
|
|
53
53
|
|
|
54
|
-
${colors.bold("
|
|
55
|
-
create [
|
|
56
|
-
dev
|
|
57
|
-
build
|
|
58
|
-
preview
|
|
54
|
+
${colors.bold("Commands")}
|
|
55
|
+
create [name] Create a project from a template
|
|
56
|
+
dev Start the development server
|
|
57
|
+
build Build the project for production
|
|
58
|
+
preview Serve the result of the build
|
|
59
59
|
|
|
60
|
-
${colors.bold("
|
|
61
|
-
init Prepare
|
|
62
|
-
add <
|
|
63
|
-
list
|
|
64
|
-
diff Compare
|
|
65
|
-
doctor
|
|
60
|
+
${colors.bold("Component registry")}
|
|
61
|
+
init Prepare the project to receive components
|
|
62
|
+
add <name...> Copy a component and its dependencies
|
|
63
|
+
list Show the catalogue
|
|
64
|
+
diff Compare what is installed to what the registry serves
|
|
65
|
+
doctor Check that the project is in working order
|
|
66
66
|
|
|
67
|
-
${colors.bold("
|
|
68
|
-
db:login
|
|
69
|
-
db:status
|
|
70
|
-
db:create
|
|
71
|
-
db:branch
|
|
72
|
-
${colors.dim("
|
|
73
|
-
${colors.dim("
|
|
74
|
-
${colors.dim("
|
|
67
|
+
${colors.bold("Database")}
|
|
68
|
+
db:login Record a platform token
|
|
69
|
+
db:status List the databases of the project
|
|
70
|
+
db:create Provision a database and write .env
|
|
71
|
+
db:branch Create a per-branch preview
|
|
72
|
+
${colors.dim("These commands need @odoro-cli/cloud-sdk, installed separately:")}
|
|
73
|
+
${colors.dim("it does not ship with this binary, which is downloaded on")}
|
|
74
|
+
${colors.dim("every project creation.")}
|
|
75
75
|
|
|
76
|
-
${colors.bold("
|
|
77
|
-
--registry <src> URL
|
|
78
|
-
--yes
|
|
76
|
+
${colors.bold("Registry options")}
|
|
77
|
+
--registry <src> URL or local directory, instead of the project one
|
|
78
|
+
--yes Waits for no confirmation
|
|
79
79
|
|
|
80
|
-
${colors.bold("
|
|
81
|
-
--template <
|
|
82
|
-
--modules <
|
|
83
|
-
--pm <
|
|
84
|
-
--no-git
|
|
85
|
-
--no-install
|
|
86
|
-
--overwrite
|
|
87
|
-
--merge
|
|
88
|
-
--yes
|
|
80
|
+
${colors.bold("create options")}
|
|
81
|
+
--template <name> Template to use
|
|
82
|
+
--modules <list> libs,router,icons,engine,registre \u2014 or "none"
|
|
83
|
+
--pm <name> Package manager (pnpm, npm, yarn, bun)
|
|
84
|
+
--no-git Does not initialise a git repository
|
|
85
|
+
--no-install Does not install the dependencies
|
|
86
|
+
--overwrite Empties the target directory before creating
|
|
87
|
+
--merge Writes over the existing content
|
|
88
|
+
--yes Accepts every default value
|
|
89
89
|
|
|
90
|
-
${colors.bold("
|
|
91
|
-
--env <
|
|
92
|
-
--
|
|
93
|
-
--
|
|
94
|
-
--
|
|
90
|
+
${colors.bold("Database options")}
|
|
91
|
+
--env <name> Target environment (production, staging, preview-42)
|
|
92
|
+
--region <name> Where the database lives; asked when absent
|
|
93
|
+
--from <env> Environment to branch from
|
|
94
|
+
--name <name> Name of the branch
|
|
95
|
+
--api <url> Root of the API, instead of the default one
|
|
95
96
|
|
|
96
|
-
${colors.bold("
|
|
97
|
-
--port <
|
|
98
|
-
--host <
|
|
97
|
+
${colors.bold("dev and preview options")}
|
|
98
|
+
--port <number> Port to listen on
|
|
99
|
+
--host <address> Interface to listen on
|
|
100
|
+
--strict-port Fails if the port is taken, instead of sliding
|
|
101
|
+
--open Opens the browser on startup
|
|
99
102
|
|
|
100
|
-
${colors.bold("
|
|
101
|
-
--outdir <
|
|
102
|
-
--no-minify
|
|
103
|
-
--no-sourcemap
|
|
103
|
+
${colors.bold("build options")}
|
|
104
|
+
--outdir <path> Output directory
|
|
105
|
+
--no-minify Does not minify
|
|
106
|
+
--no-sourcemap Does not emit source maps
|
|
107
|
+
--no-manifest Does not write manifest.json
|
|
108
|
+
--no-preload Does not declare the chunks as modulepreload
|
|
109
|
+
--prerender [r,r] Renders the routes to HTML (default: those of the entry)
|
|
104
110
|
|
|
105
|
-
${colors.bold("
|
|
106
|
-
--root <
|
|
107
|
-
|
|
108
|
-
-
|
|
111
|
+
${colors.bold("General options")}
|
|
112
|
+
--root <path> Project root
|
|
113
|
+
--mode <name> Mode: chooses the .env files read and fills import.meta.env.MODE
|
|
114
|
+
-h, --help Show this help
|
|
115
|
+
-v, --version Show the version
|
|
109
116
|
`;
|
|
110
117
|
function numberFlag(flags, name) {
|
|
111
118
|
const value = flags[name];
|
|
@@ -118,11 +125,22 @@ function overridesFrom(flags) {
|
|
|
118
125
|
const port = numberFlag(flags, "port");
|
|
119
126
|
if (port !== void 0) server.port = port;
|
|
120
127
|
if (typeof flags["host"] === "string") server.host = flags["host"];
|
|
128
|
+
if (flags["strict-port"] === true) server.strictPort = true;
|
|
129
|
+
if (flags["open"] === true) server.open = true;
|
|
121
130
|
const build = {};
|
|
122
131
|
if (typeof flags["outdir"] === "string") build.outDir = flags["outdir"];
|
|
123
132
|
if (flags["minify"] === false) build.minify = false;
|
|
124
133
|
if (flags["sourcemap"] === false) build.sourcemap = false;
|
|
125
|
-
|
|
134
|
+
if (flags["manifest"] === false) build.manifest = false;
|
|
135
|
+
if (flags["preload"] === false) build.preload = false;
|
|
136
|
+
const prerender = flags["prerender"];
|
|
137
|
+
if (prerender === true) build.prerender = true;
|
|
138
|
+
else if (typeof prerender === "string") {
|
|
139
|
+
build.prerender = prerender.split(",").map((route) => route.trim()).filter((route) => route !== "");
|
|
140
|
+
}
|
|
141
|
+
const overrides = { server, build };
|
|
142
|
+
if (typeof flags["mode"] === "string") overrides.mode = flags["mode"];
|
|
143
|
+
return overrides;
|
|
126
144
|
}
|
|
127
145
|
function rootFrom(flags, positional) {
|
|
128
146
|
if (typeof flags["root"] === "string") return flags["root"];
|
|
@@ -131,7 +149,7 @@ function rootFrom(flags, positional) {
|
|
|
131
149
|
async function run(argv) {
|
|
132
150
|
const { command, positional, flags } = parseArgs(argv);
|
|
133
151
|
if (flags["version"] === true) {
|
|
134
|
-
const manifest = await import('./package-
|
|
152
|
+
const manifest = await import('./package-3ZJOEXM4.js');
|
|
135
153
|
console.log(manifest.default.version);
|
|
136
154
|
return 0;
|
|
137
155
|
}
|
|
@@ -142,7 +160,7 @@ async function run(argv) {
|
|
|
142
160
|
switch (command) {
|
|
143
161
|
case "create":
|
|
144
162
|
case "new": {
|
|
145
|
-
const { createCommand } = await import('./create-
|
|
163
|
+
const { createCommand } = await import('./create-B2TLV6XI.js');
|
|
146
164
|
const options = {};
|
|
147
165
|
if (positional[0] !== void 0) options.name = positional[0];
|
|
148
166
|
if (typeof flags["template"] === "string") options.template = flags["template"];
|
|
@@ -156,20 +174,24 @@ async function run(argv) {
|
|
|
156
174
|
return createCommand(options);
|
|
157
175
|
}
|
|
158
176
|
case "dev": {
|
|
159
|
-
const { startDevServer } = await import('./server-
|
|
160
|
-
const config = await loadConfig(
|
|
177
|
+
const { startDevServer } = await import('./server-ZB3P3EGS.js');
|
|
178
|
+
const config = await loadConfig(
|
|
179
|
+
rootFrom(flags, positional),
|
|
180
|
+
overridesFrom(flags),
|
|
181
|
+
"development"
|
|
182
|
+
);
|
|
161
183
|
await startDevServer(config);
|
|
162
184
|
return new Promise(() => void 0);
|
|
163
185
|
}
|
|
164
186
|
case "build": {
|
|
165
|
-
const { buildProject, reportBuild } = await import('./build-
|
|
187
|
+
const { buildProject, reportBuild } = await import('./build-XJIP4GNT.js');
|
|
166
188
|
const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
|
|
167
189
|
const output = await buildProject(config);
|
|
168
190
|
reportBuild(output, process.cwd());
|
|
169
191
|
return 0;
|
|
170
192
|
}
|
|
171
193
|
case "preview": {
|
|
172
|
-
const { startPreviewServer } = await import('./preview-
|
|
194
|
+
const { startPreviewServer } = await import('./preview-3IRG7MHV.js');
|
|
173
195
|
const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
|
|
174
196
|
const port = numberFlag(flags, "port");
|
|
175
197
|
await startPreviewServer(config, port);
|
|
@@ -180,7 +202,7 @@ async function run(argv) {
|
|
|
180
202
|
case "list":
|
|
181
203
|
case "diff":
|
|
182
204
|
case "doctor": {
|
|
183
|
-
const registry = await import('./commands-
|
|
205
|
+
const registry = await import('./commands-GYA7NTCX.js');
|
|
184
206
|
const options = {
|
|
185
207
|
root: typeof flags["root"] === "string" ? flags["root"] : process.cwd(),
|
|
186
208
|
registry: typeof flags["registry"] === "string" ? flags["registry"] : void 0,
|
|
@@ -196,11 +218,12 @@ async function run(argv) {
|
|
|
196
218
|
case "db:status":
|
|
197
219
|
case "db:create":
|
|
198
220
|
case "db:branch": {
|
|
199
|
-
const db = await import('./commands-
|
|
221
|
+
const db = await import('./commands-UOWN3IK4.js');
|
|
200
222
|
const options = {
|
|
201
223
|
root: typeof flags["root"] === "string" ? flags["root"] : process.cwd(),
|
|
202
224
|
...typeof flags["api"] === "string" ? { apiUrl: flags["api"] } : {},
|
|
203
225
|
...typeof flags["env"] === "string" ? { env: flags["env"] } : {},
|
|
226
|
+
...typeof flags["region"] === "string" ? { region: flags["region"] } : {},
|
|
204
227
|
yes: flags["yes"] === true
|
|
205
228
|
};
|
|
206
229
|
if (command === "db:login") return db.loginCommand(options);
|
|
@@ -213,7 +236,7 @@ async function run(argv) {
|
|
|
213
236
|
});
|
|
214
237
|
}
|
|
215
238
|
default:
|
|
216
|
-
error(`
|
|
239
|
+
error(`Unknown command: "${command}". Try "odoro help".`);
|
|
217
240
|
return 1;
|
|
218
241
|
}
|
|
219
242
|
}
|
|
@@ -230,7 +253,7 @@ if (isEntryPoint()) {
|
|
|
230
253
|
run(process.argv.slice(2)).then((code) => {
|
|
231
254
|
if (code !== 0) process.exitCode = code;
|
|
232
255
|
}).catch((cause) => {
|
|
233
|
-
error("
|
|
256
|
+
error("the command failed", cause);
|
|
234
257
|
process.exitCode = 1;
|
|
235
258
|
});
|
|
236
259
|
}
|