odoro 1.0.8 → 2.0.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.
Files changed (85) hide show
  1. package/README.md +94 -0
  2. package/client.d.ts +90 -16
  3. package/dist/build-LZAUDJST.js +5 -0
  4. package/dist/{chunk-34RGOZFA.js → chunk-4D56Z7G3.js} +49 -50
  5. package/dist/{chunk-JMEHF3KN.js → chunk-7ZB5MAM6.js} +4 -4
  6. package/dist/{chunk-LHZGX5ML.js → chunk-OMHEQVIW.js} +295 -160
  7. package/dist/{chunk-3SZIN6VG.js → chunk-P3DJITWE.js} +10 -10
  8. package/dist/{chunk-ZVL7EXJO.js → chunk-PRWVZ2SM.js} +22 -14
  9. package/dist/chunk-Q2KCMTB5.js +741 -0
  10. package/dist/chunk-QOVBLN7A.js +241 -0
  11. package/dist/chunk-WWTDEV4Y.js +604 -0
  12. package/dist/cli.d.ts +12 -13
  13. package/dist/cli.js +84 -63
  14. package/dist/{commands-4JRBD55Z.js → commands-EUGVLQWL.js} +44 -45
  15. package/dist/{commands-AHMXBWQQ.js → commands-GYA7NTCX.js} +124 -124
  16. package/dist/{create-CDKS7KZ3.js → create-QX5LEWMS.js} +158 -154
  17. package/dist/index.d.ts +603 -151
  18. package/dist/index.js +6 -6
  19. package/dist/{package-NBP5NDX6.js → package-T4Z7OBOH.js} +5 -5
  20. package/dist/preview-P4WY5GEY.js +4 -0
  21. package/dist/registry/index.d.ts +75 -76
  22. package/dist/registry/index.js +1 -1
  23. package/dist/{server-4UGN3SFS.js → server-2WP562EV.js} +3 -3
  24. package/package.json +5 -5
  25. package/templates/react-ts/README.md +71 -35
  26. package/templates/react-ts/_env.example +9 -0
  27. package/templates/react-ts/_variants/with-engine/src/background.tsx +118 -0
  28. package/templates/react-ts/_variants/without-libs/src/App.tsx +380 -0
  29. package/templates/react-ts/_variants/without-libs/src/background.tsx +24 -0
  30. package/templates/react-ts/_variants/without-libs/src/entry-server.tsx +39 -0
  31. package/templates/react-ts/_variants/without-libs/src/main.tsx +26 -0
  32. package/templates/{react-ts-server/_variantes/sans-libs/client → react-ts/_variants/without-libs}/src/styles.css +137 -137
  33. package/templates/react-ts/{_variantes/sans-routeur → _variants/without-router}/src/App.tsx +141 -141
  34. package/templates/react-ts/_variants/without-router/src/entry-server.tsx +39 -0
  35. package/templates/react-ts/index.html +4 -4
  36. package/templates/react-ts/odoro.config.ts +5 -0
  37. package/templates/react-ts/src/App.tsx +219 -209
  38. package/templates/react-ts/src/background.tsx +66 -0
  39. package/templates/react-ts/src/entry-server.tsx +85 -0
  40. package/templates/react-ts/src/main.tsx +13 -4
  41. package/templates/react-ts/src/router.tsx +65 -45
  42. package/templates/react-ts/src/styles.css +5 -5
  43. package/templates/react-ts-server/Dockerfile +9 -9
  44. package/templates/react-ts-server/README.md +97 -45
  45. package/templates/react-ts-server/_env.example +31 -33
  46. package/templates/react-ts-server/_variants/with-engine/client/src/background.tsx +118 -0
  47. package/templates/react-ts-server/_variants/without-libs/client/src/App.tsx +380 -0
  48. package/templates/react-ts-server/_variants/without-libs/client/src/background.tsx +24 -0
  49. package/templates/react-ts-server/_variants/without-libs/client/src/entry-server.tsx +39 -0
  50. package/templates/react-ts-server/_variants/without-libs/client/src/main.tsx +26 -0
  51. package/templates/{react-ts/_variantes/sans-libs → react-ts-server/_variants/without-libs/client}/src/styles.css +137 -137
  52. package/templates/react-ts-server/{_variantes/sans-routeur → _variants/without-router}/client/src/App.tsx +141 -141
  53. package/templates/react-ts-server/_variants/without-router/client/src/entry-server.tsx +39 -0
  54. package/templates/react-ts-server/client/index.html +4 -4
  55. package/templates/react-ts-server/client/src/App.tsx +228 -210
  56. package/templates/react-ts-server/client/src/account.tsx +267 -0
  57. package/templates/react-ts-server/client/src/auth.tsx +139 -0
  58. package/templates/react-ts-server/client/src/background.tsx +66 -0
  59. package/templates/react-ts-server/client/src/entry-server.tsx +92 -0
  60. package/templates/react-ts-server/client/src/main.tsx +17 -5
  61. package/templates/react-ts-server/client/src/router.tsx +77 -45
  62. package/templates/react-ts-server/client/src/styles.css +5 -5
  63. package/templates/react-ts-server/odoro.config.ts +7 -4
  64. package/templates/react-ts-server/package.json +2 -0
  65. package/templates/react-ts-server/scripts/dev.mjs +14 -14
  66. package/templates/react-ts-server/server/src/main.ts +119 -45
  67. package/templates/react-ts-server/server/src/modules/auth/index.ts +238 -0
  68. package/templates/react-ts-server/server/src/modules/auth/password.ts +122 -0
  69. package/templates/react-ts-server/server/src/modules/auth/store.ts +193 -0
  70. package/templates/react-ts-server/server/src/modules/health/index.ts +45 -46
  71. package/dist/build-JFQHODAT.js +0 -5
  72. package/dist/chunk-22KJTV2R.js +0 -380
  73. package/dist/chunk-DL3NPC4H.js +0 -113
  74. package/dist/chunk-TQUJ3MFS.js +0 -268
  75. package/dist/preview-7DKEAQOQ.js +0 -4
  76. package/templates/react-ts/_variantes/avec-moteur/src/fond.tsx +0 -118
  77. package/templates/react-ts/_variantes/sans-libs/src/App.tsx +0 -382
  78. package/templates/react-ts/_variantes/sans-libs/src/fond.tsx +0 -23
  79. package/templates/react-ts/_variantes/sans-libs/src/main.tsx +0 -17
  80. package/templates/react-ts/src/fond.tsx +0 -42
  81. package/templates/react-ts-server/_variantes/avec-moteur/client/src/fond.tsx +0 -118
  82. package/templates/react-ts-server/_variantes/sans-libs/client/src/App.tsx +0 -382
  83. package/templates/react-ts-server/_variantes/sans-libs/client/src/fond.tsx +0 -23
  84. package/templates/react-ts-server/_variantes/sans-libs/client/src/main.tsx +0 -17
  85. package/templates/react-ts-server/client/src/fond.tsx +0 -42
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { loadConfig } from './chunk-DL3NPC4H.js';
2
+ import { loadConfig } from './chunk-QOVBLN7A.js';
3
3
  import './chunk-T6RLHSCW.js';
4
- import { error } from './chunk-JMEHF3KN.js';
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,72 @@ function parseArgs(argv) {
46
46
  return { command, positional, flags };
47
47
  }
48
48
  var HELP = `
49
- ${colors.bold(colors.magenta("odoro"))} \u2014 moteur de developpement et echafaudage
49
+ ${colors.bold(colors.magenta("odoro"))} \u2014 development engine and scaffolder
50
50
 
51
- ${colors.bold("Utilisation")}
52
- odoro <commande> [options]
51
+ ${colors.bold("Usage")}
52
+ odoro <command> [options]
53
53
 
54
- ${colors.bold("Commandes")}
55
- create [nom] Cree un projet a partir d'un template
56
- dev Demarre le serveur de developpement
57
- build Compile le projet pour la production
58
- preview Sert le resultat de la compilation
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("Registre de composants")}
61
- init Prepare le projet a recevoir des composants
62
- add <nom...> Copie un composant et ses dependances
63
- list Affiche le catalogue
64
- diff Compare l'installe a ce que le registre sert
65
- doctor Verifie que le projet est en etat
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("Base de donnees")}
68
- db:login Enregistre un jeton de plateforme
69
- db:status Liste les bases du projet
70
- db:create Provisionne une base et ecrit .env
71
- db:branch Cree une previsualisation par branche
72
- ${colors.dim("Ces commandes demandent @odoro-cli/cloud-sdk, installe a part :")}
73
- ${colors.dim("il ne vient pas avec, ce binaire etant telecharge a chaque")}
74
- ${colors.dim("creation de projet.")}
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("Options du registre")}
77
- --registry <src> URL ou dossier local, au lieu de celui du projet
78
- --yes N'attend aucune confirmation
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("Options de create")}
81
- --template <nom> Template a utiliser
82
- --modules <liste> libs,router,icons,engine,registre \u2014 ou "aucun"
83
- --pm <nom> Gestionnaire de paquets (pnpm, npm, yarn, bun)
84
- --no-git N'initialise pas de depot git
85
- --no-install N'installe pas les dependances
86
- --overwrite Vide le dossier cible avant de creer
87
- --merge Ecrit par-dessus le contenu existant
88
- --yes Accepte toutes les valeurs par defaut
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("Options de base de donnees")}
91
- --env <nom> Environnement vise (production, staging, preview-42)
92
- --from <env> Environnement dont brancher
93
- --name <nom> Nom de la branche
94
- --api <url> Racine de l'API, au lieu de celle par defaut
90
+ ${colors.bold("Database options")}
91
+ --env <name> Target environment (production, staging, preview-42)
92
+ --from <env> Environment to branch from
93
+ --name <name> Name of the branch
94
+ --api <url> Root of the API, instead of the default one
95
95
 
96
- ${colors.bold("Options de dev et preview")}
97
- --port <numero> Port d'ecoute
98
- --host <adresse> Interface d'ecoute
96
+ ${colors.bold("dev and preview options")}
97
+ --port <number> Port to listen on
98
+ --host <address> Interface to listen on
99
+ --strict-port Fails if the port is taken, instead of sliding
100
+ --open Opens the browser on startup
99
101
 
100
- ${colors.bold("Options de build")}
101
- --outdir <chemin> Dossier de sortie
102
- --no-minify Ne minifie pas
103
- --no-sourcemap N'emet pas de cartes de source
102
+ ${colors.bold("build options")}
103
+ --outdir <path> Output directory
104
+ --no-minify Does not minify
105
+ --no-sourcemap Does not emit source maps
106
+ --no-manifest Does not write manifest.json
107
+ --no-preload Does not declare the chunks as modulepreload
108
+ --prerender [r,r] Renders the routes to HTML (default: those of the entry)
104
109
 
105
- ${colors.bold("Options generales")}
106
- --root <chemin> Racine du projet
107
- -h, --help Affiche cette aide
108
- -v, --version Affiche la version
110
+ ${colors.bold("General options")}
111
+ --root <path> Project root
112
+ --mode <name> Mode: chooses the .env files read and fills import.meta.env.MODE
113
+ -h, --help Show this help
114
+ -v, --version Show the version
109
115
  `;
110
116
  function numberFlag(flags, name) {
111
117
  const value = flags[name];
@@ -118,11 +124,22 @@ function overridesFrom(flags) {
118
124
  const port = numberFlag(flags, "port");
119
125
  if (port !== void 0) server.port = port;
120
126
  if (typeof flags["host"] === "string") server.host = flags["host"];
127
+ if (flags["strict-port"] === true) server.strictPort = true;
128
+ if (flags["open"] === true) server.open = true;
121
129
  const build = {};
122
130
  if (typeof flags["outdir"] === "string") build.outDir = flags["outdir"];
123
131
  if (flags["minify"] === false) build.minify = false;
124
132
  if (flags["sourcemap"] === false) build.sourcemap = false;
125
- return { server, build };
133
+ if (flags["manifest"] === false) build.manifest = false;
134
+ if (flags["preload"] === false) build.preload = false;
135
+ const prerender = flags["prerender"];
136
+ if (prerender === true) build.prerender = true;
137
+ else if (typeof prerender === "string") {
138
+ build.prerender = prerender.split(",").map((route) => route.trim()).filter((route) => route !== "");
139
+ }
140
+ const overrides = { server, build };
141
+ if (typeof flags["mode"] === "string") overrides.mode = flags["mode"];
142
+ return overrides;
126
143
  }
127
144
  function rootFrom(flags, positional) {
128
145
  if (typeof flags["root"] === "string") return flags["root"];
@@ -131,7 +148,7 @@ function rootFrom(flags, positional) {
131
148
  async function run(argv) {
132
149
  const { command, positional, flags } = parseArgs(argv);
133
150
  if (flags["version"] === true) {
134
- const manifest = await import('./package-NBP5NDX6.js');
151
+ const manifest = await import('./package-T4Z7OBOH.js');
135
152
  console.log(manifest.default.version);
136
153
  return 0;
137
154
  }
@@ -142,7 +159,7 @@ async function run(argv) {
142
159
  switch (command) {
143
160
  case "create":
144
161
  case "new": {
145
- const { createCommand } = await import('./create-CDKS7KZ3.js');
162
+ const { createCommand } = await import('./create-QX5LEWMS.js');
146
163
  const options = {};
147
164
  if (positional[0] !== void 0) options.name = positional[0];
148
165
  if (typeof flags["template"] === "string") options.template = flags["template"];
@@ -156,20 +173,24 @@ async function run(argv) {
156
173
  return createCommand(options);
157
174
  }
158
175
  case "dev": {
159
- const { startDevServer } = await import('./server-4UGN3SFS.js');
160
- const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
176
+ const { startDevServer } = await import('./server-2WP562EV.js');
177
+ const config = await loadConfig(
178
+ rootFrom(flags, positional),
179
+ overridesFrom(flags),
180
+ "development"
181
+ );
161
182
  await startDevServer(config);
162
183
  return new Promise(() => void 0);
163
184
  }
164
185
  case "build": {
165
- const { buildProject, reportBuild } = await import('./build-JFQHODAT.js');
186
+ const { buildProject, reportBuild } = await import('./build-LZAUDJST.js');
166
187
  const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
167
188
  const output = await buildProject(config);
168
189
  reportBuild(output, process.cwd());
169
190
  return 0;
170
191
  }
171
192
  case "preview": {
172
- const { startPreviewServer } = await import('./preview-7DKEAQOQ.js');
193
+ const { startPreviewServer } = await import('./preview-P4WY5GEY.js');
173
194
  const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
174
195
  const port = numberFlag(flags, "port");
175
196
  await startPreviewServer(config, port);
@@ -180,7 +201,7 @@ async function run(argv) {
180
201
  case "list":
181
202
  case "diff":
182
203
  case "doctor": {
183
- const registry = await import('./commands-AHMXBWQQ.js');
204
+ const registry = await import('./commands-GYA7NTCX.js');
184
205
  const options = {
185
206
  root: typeof flags["root"] === "string" ? flags["root"] : process.cwd(),
186
207
  registry: typeof flags["registry"] === "string" ? flags["registry"] : void 0,
@@ -196,7 +217,7 @@ async function run(argv) {
196
217
  case "db:status":
197
218
  case "db:create":
198
219
  case "db:branch": {
199
- const db = await import('./commands-4JRBD55Z.js');
220
+ const db = await import('./commands-EUGVLQWL.js');
200
221
  const options = {
201
222
  root: typeof flags["root"] === "string" ? flags["root"] : process.cwd(),
202
223
  ...typeof flags["api"] === "string" ? { apiUrl: flags["api"] } : {},
@@ -213,7 +234,7 @@ async function run(argv) {
213
234
  });
214
235
  }
215
236
  default:
216
- error(`Commande inconnue : "${command}". Essayez "odoro help".`);
237
+ error(`Unknown command: "${command}". Try "odoro help".`);
217
238
  return 1;
218
239
  }
219
240
  }
@@ -230,7 +251,7 @@ if (isEntryPoint()) {
230
251
  run(process.argv.slice(2)).then((code) => {
231
252
  if (code !== 0) process.exitCode = code;
232
253
  }).catch((cause) => {
233
- error("echec de la commande", cause);
254
+ error("the command failed", cause);
234
255
  process.exitCode = 1;
235
256
  });
236
257
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { writeDatabaseUrl, assertEnvIgnored } from './chunk-3SZIN6VG.js';
3
- import { info, success, colors, warn, error } from './chunk-JMEHF3KN.js';
2
+ import { writeDatabaseUrl, assertEnvIgnored } from './chunk-P3DJITWE.js';
3
+ import { info, success, colors, warn, error } from './chunk-7ZB5MAM6.js';
4
4
  import { randomBytes } from 'crypto';
5
5
  import { readFile, mkdir, writeFile, chmod } from 'fs/promises';
6
6
  import { platform, homedir } from 'os';
@@ -67,12 +67,12 @@ async function loadSdk() {
67
67
  } catch {
68
68
  return {
69
69
  ok: false,
70
- reason: `Cette commande a besoin de ${SDK_PACKAGE}, qui n'est pas installe.
70
+ reason: `This command needs ${SDK_PACKAGE}, which is not installed.
71
71
 
72
72
  npm install --save-dev ${SDK_PACKAGE}
73
73
 
74
- Il n'est pas fourni avec odoro : ce binaire est telecharge a chaque
75
- creation de projet, et la plupart n'emploient pas la plateforme.`
74
+ It does not ship with odoro: this binary is downloaded on every
75
+ project creation, and most projects do not use the platform.`
76
76
  };
77
77
  }
78
78
  }
@@ -92,12 +92,12 @@ async function connect(options) {
92
92
  const token = await findToken(apiUrl);
93
93
  if (token === void 0) {
94
94
  error(
95
- `Aucun jeton pour ${apiUrl}.
95
+ `No token for ${apiUrl}.
96
96
 
97
97
  odoro db:login
98
98
 
99
- Ou fournissez-le par la variable ODORO_TOKEN, ce que fait une
100
- integration continue.`
99
+ Or provide it through the ODORO_TOKEN variable, which is what a
100
+ continuous integration does.`
101
101
  );
102
102
  return void 0;
103
103
  }
@@ -107,18 +107,18 @@ async function loginCommand(options) {
107
107
  const apiUrl = options.apiUrl ?? DEFAULT_API_URL;
108
108
  const prompts = await import('@clack/prompts');
109
109
  const value = await prompts.password({
110
- message: `Jeton pour ${apiUrl}`,
111
- validate: (input) => input.startsWith("odk_") ? void 0 : "Un jeton commence par odk_live_ ou odk_test_"
110
+ message: `Token for ${apiUrl}`,
111
+ validate: (input) => input.startsWith("odk_") ? void 0 : "A token starts with odk_live_ or odk_test_"
112
112
  });
113
113
  if (prompts.isCancel(value)) {
114
- info("Annule.");
114
+ info("Cancelled.");
115
115
  return 0;
116
116
  }
117
117
  const report = await storeToken(apiUrl, value);
118
- success(`Jeton enregistre dans ${colors.dim(report.path)}`);
118
+ success(`Token recorded in ${colors.dim(report.path)}`);
119
119
  if (!report.restricted) {
120
120
  warn(
121
- "Les droits restrictifs du fichier n ont pas pu etre poses sur ce systeme : verifiez que ce dossier n est pas partage ni synchronise."
121
+ "The restrictive file permissions could not be set on this system: check that this directory is neither shared nor synchronised."
122
122
  );
123
123
  }
124
124
  return 0;
@@ -130,12 +130,12 @@ async function statusCommand(options) {
130
130
  options.env === void 0 ? {} : { environmentId: options.env }
131
131
  );
132
132
  if (databases.length === 0) {
133
- info("Aucune base. `odoro db:create` en provisionne une.");
133
+ info("No database. `odoro db:create` provisions one.");
134
134
  return 0;
135
135
  }
136
- for (const base of databases) {
137
- const etat = base.state === "ready" ? colors.green(base.state) : base.state === "failed" || base.state === "quarantined" ? colors.red(base.state) : colors.dim(base.state);
138
- console.log(` ${base.id} ${etat} ${colors.dim(base.region)}`);
136
+ for (const database of databases) {
137
+ const state = database.state === "ready" ? colors.green(database.state) : database.state === "failed" || database.state === "quarantined" ? colors.red(database.state) : colors.dim(database.state);
138
+ console.log(` ${database.id} ${state} ${colors.dim(database.region)}`);
139
139
  }
140
140
  return 0;
141
141
  }
@@ -144,25 +144,25 @@ async function createCommand(options) {
144
144
  if (connection === void 0) return 1;
145
145
  const environmentId = options.env;
146
146
  if (environmentId === void 0) {
147
- error("Precisez l environnement : `odoro db:create --env production`.");
147
+ error("Name the environment: `odoro db:create --env production`.");
148
148
  return 1;
149
149
  }
150
150
  const prompts = await import('@clack/prompts');
151
151
  const spinner = prompts.spinner();
152
- spinner.start("Provisionnement");
152
+ spinner.start("Provisioning");
153
153
  const abort = new AbortController();
154
154
  const onInterrupt = () => abort.abort();
155
155
  process.once("SIGINT", onInterrupt);
156
156
  try {
157
- const fini = await connection.client.databases.createAndWait(
157
+ const finished = await connection.client.databases.createAndWait(
158
158
  { idempotencyKey: idempotencyKey(), environmentId, region: "eu-central-1" },
159
159
  { signal: abort.signal }
160
160
  );
161
- spinner.stop("Base provisionnee");
162
- const databaseId = fini.subject;
161
+ spinner.stop("Database provisioned");
162
+ const databaseId = finished.subject;
163
163
  if (databaseId === void 0) {
164
164
  warn(
165
- "L operation a abouti sans nommer la base creee. `odoro db:status` la montrera."
165
+ "The operation succeeded without naming the created database. `odoro db:status` will show it."
166
166
  );
167
167
  return 0;
168
168
  }
@@ -170,15 +170,15 @@ async function createCommand(options) {
170
170
  databaseId
171
171
  });
172
172
  await writeDatabaseUrl(options.root, connectionString);
173
- success("DATABASE_URL ecrite dans .env");
174
- const risque = await assertEnvIgnored(options.root);
175
- if (risque !== void 0) warn(risque);
173
+ success("DATABASE_URL written to .env");
174
+ const risk = await assertEnvIgnored(options.root);
175
+ if (risk !== void 0) warn(risk);
176
176
  return 0;
177
177
  } catch (cause) {
178
- spinner.stop("Provisionnement interrompu");
178
+ spinner.stop("Provisioning interrupted");
179
179
  if (abort.signal.aborted) {
180
180
  info(
181
- "Attente abandonnee. Le provisionnement continue : `odoro db:status` en montrera l aboutissement."
181
+ "Wait abandoned. The provisioning carries on: `odoro db:status` will show its outcome."
182
182
  );
183
183
  return 0;
184
184
  }
@@ -192,27 +192,26 @@ async function branchCommand(options) {
192
192
  const connection = await connect(options);
193
193
  if (connection === void 0) return 1;
194
194
  if (options.from === void 0 || options.name === void 0) {
195
- error("Usage : `odoro db:branch --from production --name preview-42`");
195
+ error("Usage: `odoro db:branch --from production --name preview-42`");
196
196
  return 1;
197
197
  }
198
198
  const prompts = await import('@clack/prompts');
199
199
  const spinner = prompts.spinner();
200
- spinner.start(`Branche depuis ${options.from}`);
200
+ spinner.start(`Branching from ${options.from}`);
201
201
  try {
202
- const fini = await connection.client.databases.branchAndWait({
202
+ const finished = await connection.client.databases.branchAndWait({
203
203
  idempotencyKey: idempotencyKey(),
204
204
  parentEnvironmentId: options.from,
205
205
  name: options.name,
206
- // Sans regle declaree, la plateforme refuse. On ne devine pas a sa
207
- // place : une regle inventee ici anonymiserait la mauvaise colonne, ou
208
- // aucune.
206
+ // Without a declared rule, the platform refuses. We do not guess in its
207
+ // place: a rule invented here would anonymise the wrong column, or none.
209
208
  anonymization: []
210
209
  });
211
- spinner.stop("Branche creee");
212
- info(`Base : ${fini.subject ?? "voir odoro db:status"}`);
210
+ spinner.stop("Branch created");
211
+ info(`Database: ${finished.subject ?? "see odoro db:status"}`);
213
212
  return 0;
214
213
  } catch (cause) {
215
- spinner.stop("Branche refusee");
214
+ spinner.stop("Branch refused");
216
215
  error(describe(cause, connection.sdk));
217
216
  return 1;
218
217
  }
@@ -221,25 +220,25 @@ function describe(cause, sdk) {
221
220
  if (sdk.isApiError(cause, "VALIDATION")) {
222
221
  const errors = cause.options?.errors;
223
222
  return [
224
- "La demande a ete refusee :",
223
+ "The request was refused:",
225
224
  ...(errors ?? []).map(({ field, message }) => ` ${field} \u2014 ${message}`)
226
225
  ].join("\n");
227
226
  }
228
227
  if (sdk.isApiError(cause, "RATE_LIMIT")) {
229
- return "Trop de demandes. Les routes qui provisionnent sont volontairement limitees : chaque creation coute.";
228
+ return "Too many requests. The routes that provision are deliberately rate limited: every creation costs.";
230
229
  }
231
230
  if (sdk.isApiError(cause, "UNAUTHORIZED")) {
232
- return `Jeton refuse. \`odoro db:login\` en enregistre un autre.`;
231
+ return `Token refused. \`odoro db:login\` records another one.`;
233
232
  }
234
233
  return cause instanceof Error ? cause.message : String(cause);
235
234
  }
236
235
  var DB_HELP = [
237
- " db:login Enregistre un jeton de plateforme",
238
- " db:status Liste les bases du projet",
239
- " db:create --env <e> Provisionne une base et ecrit .env",
236
+ " db:login Record a platform token",
237
+ " db:status List the databases of the project",
238
+ " db:create --env <e> Provision a database and write .env",
240
239
  " db:branch --from <e> --name <n>",
241
- " Cree une previsualisation par branche",
242
- ` (necessite ${SDK_PACKAGE})`
240
+ " Create a per-branch preview",
241
+ ` (requires ${SDK_PACKAGE})`
243
242
  ].join("\n");
244
243
 
245
244
  export { DB_HELP, branchCommand, createCommand, loginCommand, statusCommand };