@amerged/ohmyhost-cli 0.1.24 → 0.1.25
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 +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-QIJJFWW6.js → chunk-YOEEWHSQ.js} +10 -21
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/apps/product-cli/package.json +1 -1
- package/src/apps/product-cli/src/repository-init.ts +14 -10
- package/src/packages/contracts/src/customer-auth-admission.ts +3 -11
- package/src/packages/contracts/src/framework-admission.ts +3 -15
- package/src/packages/sdk-ts/package.json +1 -1
- package/src/packages/sdk-ts/src/generated/sdk.gen.ts +1 -1
package/README.md
CHANGED
package/dist/bin.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire as __ohmyhostCreateRequire } from "node:module"; const require = __ohmyhostCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
runProductionCli
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YOEEWHSQ.js";
|
|
6
6
|
import "./chunk-7D2RFLWM.js";
|
|
7
7
|
|
|
8
8
|
// apps/product-cli/dist/bin.js
|
|
@@ -17008,9 +17008,6 @@ function isAdmittedFrameworkBuildScript(framework, script) {
|
|
|
17008
17008
|
}
|
|
17009
17009
|
|
|
17010
17010
|
// packages/contracts/dist/customer-auth-admission.js
|
|
17011
|
-
function managedCustomerAuthMailMessage(path) {
|
|
17012
|
-
return `"${path}" selects the managed Better Auth bridge, which sends verification and password-reset email through ohmyhost Mail. Set mail.enabled: true and set up a verified mail sender, or set auth.provider: none and keep the application-owned Better Auth configuration and sender. Commit and push the change, then plan the new commit.`;
|
|
17013
|
-
}
|
|
17014
17011
|
function managedCustomerAuthDatabaseMessage(path) {
|
|
17015
17012
|
return `"${path}" selects the managed Better Auth bridge, which requires the managed PostgreSQL database. Set database.enabled: true with an admitted migrations path, or set auth.provider: none and keep the application-owned authentication configuration. Commit and push the change, then plan the new commit.`;
|
|
17016
17013
|
}
|
|
@@ -17024,12 +17021,7 @@ function managedCustomerAuthAdmissionIssue(capabilities) {
|
|
|
17024
17021
|
message: managedCustomerAuthDatabaseMessage("ohmyhost.yaml")
|
|
17025
17022
|
});
|
|
17026
17023
|
}
|
|
17027
|
-
|
|
17028
|
-
return null;
|
|
17029
|
-
return Object.freeze({
|
|
17030
|
-
code: "managed_auth_mail_required",
|
|
17031
|
-
message: managedCustomerAuthMailMessage("ohmyhost.yaml")
|
|
17032
|
-
});
|
|
17024
|
+
return null;
|
|
17033
17025
|
}
|
|
17034
17026
|
|
|
17035
17027
|
// packages/contracts/dist/framework-admission.js
|
|
@@ -17155,10 +17147,6 @@ var FRAMEWORK_CONVERSION_DETAILS = Object.freeze({
|
|
|
17155
17147
|
render: managedCustomerAuthDatabaseMessage,
|
|
17156
17148
|
pattern: /^"([^"]+)" selects the managed Better Auth bridge, which requires the managed PostgreSQL database\. Set database\.enabled: true with an admitted migrations path, or set auth\.provider: none and keep the application-owned authentication configuration\. Commit and push the change, then plan the new commit\.$/u
|
|
17157
17149
|
}),
|
|
17158
|
-
managed_auth_mail_required: Object.freeze({
|
|
17159
|
-
render: managedCustomerAuthMailMessage,
|
|
17160
|
-
pattern: /^"([^"]+)" selects the managed Better Auth bridge, which sends verification and password-reset email through ohmyhost Mail\. Set mail\.enabled: true and set up a verified mail sender, or set auth\.provider: none and keep the application-owned Better Auth configuration and sender\. Commit and push the change, then plan the new commit\.$/u
|
|
17161
|
-
}),
|
|
17162
17150
|
database_binding_private: Object.freeze({
|
|
17163
17151
|
render: (path) => `"${path}" reads a database connection string (DATABASE_URL, HYPERDRIVE, connectionString or a postgres:// URL); none reaches a customer Worker. Call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database". ${PUSH_AND_PLAN}`,
|
|
17164
17152
|
pattern: /^"([^"]+)" reads a database connection string \(DATABASE_URL, HYPERDRIVE, connectionString or a postgres:\/\/ URL\); none reaches a customer Worker\. Call the database with createPrivateDatabaseClient from "@ohmyhost\/customer-runtime\/database"\. Commit and push the change, then plan the new commit\.$/u
|
|
@@ -17205,7 +17193,7 @@ function parseFrameworkConversionDiagnostic(value) {
|
|
|
17205
17193
|
const record5 = value;
|
|
17206
17194
|
const path = record5["path"];
|
|
17207
17195
|
const code = record5["code"];
|
|
17208
|
-
if (Object.keys(record5).length !== 2 || !isFrameworkConversionDiagnosticCode(code) || typeof path !== "string" || path.length > 240 || (code === "
|
|
17196
|
+
if (Object.keys(record5).length !== 2 || !isFrameworkConversionDiagnosticCode(code) || typeof path !== "string" || path.length > 240 || (code === "managed_auth_database_required" ? path !== "ohmyhost.yaml" : !/^[A-Za-z0-9_@()[\]./-]+\.(?:[cm]?[jt]sx?)$/u.test(path)) || path.split("/").some((segment) => segment === "" || segment === "." || segment === ".."))
|
|
17209
17197
|
return null;
|
|
17210
17198
|
return Object.freeze({ code, path });
|
|
17211
17199
|
}
|
|
@@ -18948,7 +18936,7 @@ function exact2(v, keys) {
|
|
|
18948
18936
|
// apps/product-cli/package.json
|
|
18949
18937
|
var package_default = {
|
|
18950
18938
|
name: "@ohmyhost/product-cli",
|
|
18951
|
-
version: "0.1.
|
|
18939
|
+
version: "0.1.25",
|
|
18952
18940
|
private: true,
|
|
18953
18941
|
ohmyhost: {
|
|
18954
18942
|
deployment: "production",
|
|
@@ -25249,6 +25237,7 @@ async function initializeRepository(input) {
|
|
|
25249
25237
|
const configuredDatabase = existingConfiguration?.database?.enabled === true;
|
|
25250
25238
|
const databaseProvider = supabaseMigrationCount > 0 ? "supabase" : postgresMigrationCount > 0 || configuredDatabase ? "postgresql" : "none";
|
|
25251
25239
|
const migrationCount = databaseProvider === "supabase" ? supabaseMigrationCount : postgresMigrationCount;
|
|
25240
|
+
const selectedDatabaseProvider = existingConfiguration === null ? databaseProvider : configuredDatabase ? "postgresql" : "none";
|
|
25252
25241
|
const betterAuth = dependencies.has("better-auth") || existingConfiguration?.auth?.provider === "better-auth";
|
|
25253
25242
|
const workos = [
|
|
25254
25243
|
"@workos-inc/authkit-react",
|
|
@@ -25301,19 +25290,19 @@ async function initializeRepository(input) {
|
|
|
25301
25290
|
});
|
|
25302
25291
|
const configurationYaml = existingConfigurationYaml ?? generatedConfigurationYaml;
|
|
25303
25292
|
const capabilities = Object.freeze({
|
|
25304
|
-
database:
|
|
25293
|
+
database: selectedDatabaseProvider !== "none",
|
|
25305
25294
|
auth: targetBetterAuth,
|
|
25306
25295
|
mail: targetMail,
|
|
25307
25296
|
storage: targetStorage
|
|
25308
25297
|
});
|
|
25309
25298
|
const companion = companionRequired ? viteCompanionScaffold(applicationFiles, capabilities) : null;
|
|
25310
25299
|
const companionSourcePresent = companion !== null && applicationFiles.includes(companion.sourceEntryPoint);
|
|
25311
|
-
const migrationSqlAdmissionBlockers = await migrationSqlBlockers(applicationDirectory, applicationFiles, existingConfiguration?.database?.migrations,
|
|
25300
|
+
const migrationSqlAdmissionBlockers = await migrationSqlBlockers(applicationDirectory, applicationFiles, existingConfiguration?.database?.migrations, selectedDatabaseProvider);
|
|
25312
25301
|
const blockers = [
|
|
25313
25302
|
...repositoryAdmissionBlockers,
|
|
25314
25303
|
...await workerModuleBlockers(framework, applicationDirectory, applicationFiles),
|
|
25315
25304
|
...await cronBlockers(framework, existingConfiguration, applicationDirectory, applicationFiles),
|
|
25316
|
-
...migrationFilenameBlockers(applicationFiles, existingConfiguration?.database?.migrations,
|
|
25305
|
+
...selectedDatabaseProvider === "none" ? [] : migrationFilenameBlockers(applicationFiles, existingConfiguration?.database?.migrations, selectedDatabaseProvider),
|
|
25317
25306
|
...migrationSqlAdmissionBlockers,
|
|
25318
25307
|
...await storageClientBlockers(existingConfiguration, applicationDirectory, applicationFiles),
|
|
25319
25308
|
...await databaseContractBlockers(existingConfiguration, applicationDirectory, applicationFiles)
|
|
@@ -25882,9 +25871,9 @@ function repositoryBlockers(packageJson, framework, nextStandaloneOutput, tanSta
|
|
|
25882
25871
|
});
|
|
25883
25872
|
}
|
|
25884
25873
|
const betterAuthVersion = dependencyVersion(packageJson, "better-auth");
|
|
25885
|
-
const
|
|
25886
|
-
if (
|
|
25887
|
-
blockers.push(
|
|
25874
|
+
const managedAuthIssue = managedCustomerAuthAdmissionIssue(existingConfiguration);
|
|
25875
|
+
if (managedAuthIssue !== null)
|
|
25876
|
+
blockers.push(managedAuthIssue);
|
|
25888
25877
|
if (existingConfiguration?.auth?.provider === "better-auth" && betterAuthVersion !== null && betterAuthVersion !== SUPPORTED_BETTER_AUTH_VERSION) {
|
|
25889
25878
|
blockers.push({
|
|
25890
25879
|
code: "better_auth_version_unsupported",
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -102,7 +102,6 @@ export interface RepositoryInitBlocker {
|
|
|
102
102
|
| "database_driver_unsupported"
|
|
103
103
|
| "build_script_missing"
|
|
104
104
|
| "better_auth_version_unsupported"
|
|
105
|
-
| "managed_auth_mail_required"
|
|
106
105
|
| "managed_auth_database_required"
|
|
107
106
|
| "framework_ambiguous"
|
|
108
107
|
| "framework_unsupported"
|
|
@@ -315,6 +314,9 @@ export async function initializeRepository(
|
|
|
315
314
|
: "none";
|
|
316
315
|
const migrationCount =
|
|
317
316
|
databaseProvider === "supabase" ? supabaseMigrationCount : postgresMigrationCount;
|
|
317
|
+
// Inventory remains evidence; an existing configuration selects the managed capabilities.
|
|
318
|
+
const selectedDatabaseProvider =
|
|
319
|
+
existingConfiguration === null ? databaseProvider : configuredDatabase ? "postgresql" : "none";
|
|
318
320
|
const betterAuth =
|
|
319
321
|
dependencies.has("better-auth") || existingConfiguration?.auth?.provider === "better-auth";
|
|
320
322
|
const workos = [
|
|
@@ -390,7 +392,7 @@ export async function initializeRepository(
|
|
|
390
392
|
});
|
|
391
393
|
const configurationYaml = existingConfigurationYaml ?? generatedConfigurationYaml;
|
|
392
394
|
const capabilities: RuntimeCapabilities = Object.freeze({
|
|
393
|
-
database:
|
|
395
|
+
database: selectedDatabaseProvider !== "none",
|
|
394
396
|
auth: targetBetterAuth,
|
|
395
397
|
mail: targetMail,
|
|
396
398
|
storage: targetStorage,
|
|
@@ -404,7 +406,7 @@ export async function initializeRepository(
|
|
|
404
406
|
applicationDirectory,
|
|
405
407
|
applicationFiles,
|
|
406
408
|
existingConfiguration?.database?.migrations,
|
|
407
|
-
|
|
409
|
+
selectedDatabaseProvider,
|
|
408
410
|
);
|
|
409
411
|
const blockers = [
|
|
410
412
|
...repositoryAdmissionBlockers,
|
|
@@ -415,11 +417,13 @@ export async function initializeRepository(
|
|
|
415
417
|
applicationDirectory,
|
|
416
418
|
applicationFiles,
|
|
417
419
|
)),
|
|
418
|
-
...
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
...(selectedDatabaseProvider === "none"
|
|
421
|
+
? []
|
|
422
|
+
: migrationFilenameBlockers(
|
|
423
|
+
applicationFiles,
|
|
424
|
+
existingConfiguration?.database?.migrations,
|
|
425
|
+
selectedDatabaseProvider,
|
|
426
|
+
)),
|
|
423
427
|
...migrationSqlAdmissionBlockers,
|
|
424
428
|
...(await storageClientBlockers(existingConfiguration, applicationDirectory, applicationFiles)),
|
|
425
429
|
...(await databaseContractBlockers(
|
|
@@ -1244,8 +1248,8 @@ function repositoryBlockers(
|
|
|
1244
1248
|
});
|
|
1245
1249
|
}
|
|
1246
1250
|
const betterAuthVersion = dependencyVersion(packageJson, "better-auth");
|
|
1247
|
-
const
|
|
1248
|
-
if (
|
|
1251
|
+
const managedAuthIssue = managedCustomerAuthAdmissionIssue(existingConfiguration);
|
|
1252
|
+
if (managedAuthIssue !== null) blockers.push(managedAuthIssue);
|
|
1249
1253
|
if (
|
|
1250
1254
|
existingConfiguration?.auth?.provider === "better-auth" &&
|
|
1251
1255
|
betterAuthVersion !== null &&
|
|
@@ -4,19 +4,15 @@ export interface ManagedCustomerAuthCapabilities {
|
|
|
4
4
|
readonly mail?: Readonly<{ enabled: boolean }>;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export function managedCustomerAuthMailMessage(path: string): string {
|
|
8
|
-
return `"${path}" selects the managed Better Auth bridge, which sends verification and password-reset email through ohmyhost Mail. Set mail.enabled: true and set up a verified mail sender, or set auth.provider: none and keep the application-owned Better Auth configuration and sender. Commit and push the change, then plan the new commit.`;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
7
|
export function managedCustomerAuthDatabaseMessage(path: string): string {
|
|
12
8
|
return `"${path}" selects the managed Better Auth bridge, which requires the managed PostgreSQL database. Set database.enabled: true with an admitted migrations path, or set auth.provider: none and keep the application-owned authentication configuration. Commit and push the change, then plan the new commit.`;
|
|
13
9
|
}
|
|
14
10
|
|
|
15
|
-
/**
|
|
11
|
+
/** Managed auth needs its real database; Mail remains an independent optional capability. */
|
|
16
12
|
export function managedCustomerAuthAdmissionIssue(
|
|
17
13
|
capabilities: ManagedCustomerAuthCapabilities | null | undefined,
|
|
18
14
|
): Readonly<{
|
|
19
|
-
code: "managed_auth_database_required"
|
|
15
|
+
code: "managed_auth_database_required";
|
|
20
16
|
message: string;
|
|
21
17
|
}> | null {
|
|
22
18
|
if (capabilities?.auth?.provider !== "better-auth") {
|
|
@@ -28,9 +24,5 @@ export function managedCustomerAuthAdmissionIssue(
|
|
|
28
24
|
message: managedCustomerAuthDatabaseMessage("ohmyhost.yaml"),
|
|
29
25
|
});
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
return Object.freeze({
|
|
33
|
-
code: "managed_auth_mail_required" as const,
|
|
34
|
-
message: managedCustomerAuthMailMessage("ohmyhost.yaml"),
|
|
35
|
-
});
|
|
27
|
+
return null;
|
|
36
28
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { PINNED_BUN_VERSION } from "./framework-build-script.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
managedCustomerAuthDatabaseMessage,
|
|
5
|
-
} from "./customer-auth-admission.js";
|
|
6
|
-
export {
|
|
7
|
-
managedCustomerAuthAdmissionIssue,
|
|
8
|
-
managedCustomerAuthMailMessage,
|
|
9
|
-
} from "./customer-auth-admission.js";
|
|
2
|
+
import { managedCustomerAuthDatabaseMessage } from "./customer-auth-admission.js";
|
|
3
|
+
export { managedCustomerAuthAdmissionIssue } from "./customer-auth-admission.js";
|
|
10
4
|
|
|
11
5
|
export type PackageManagerName = "bun" | "npm" | "pnpm" | "yarn";
|
|
12
6
|
|
|
@@ -202,7 +196,6 @@ function versionAdmission(
|
|
|
202
196
|
|
|
203
197
|
export type FrameworkConversionDiagnosticCode =
|
|
204
198
|
| "managed_auth_database_required"
|
|
205
|
-
| "managed_auth_mail_required"
|
|
206
199
|
| "database_binding_private"
|
|
207
200
|
| "database_driver_unsupported"
|
|
208
201
|
| "source_syntax_invalid"
|
|
@@ -233,11 +226,6 @@ const FRAMEWORK_CONVERSION_DETAILS: Readonly<
|
|
|
233
226
|
pattern:
|
|
234
227
|
/^"([^"]+)" selects the managed Better Auth bridge, which requires the managed PostgreSQL database\. Set database\.enabled: true with an admitted migrations path, or set auth\.provider: none and keep the application-owned authentication configuration\. Commit and push the change, then plan the new commit\.$/u,
|
|
235
228
|
}),
|
|
236
|
-
managed_auth_mail_required: Object.freeze({
|
|
237
|
-
render: managedCustomerAuthMailMessage,
|
|
238
|
-
pattern:
|
|
239
|
-
/^"([^"]+)" selects the managed Better Auth bridge, which sends verification and password-reset email through ohmyhost Mail\. Set mail\.enabled: true and set up a verified mail sender, or set auth\.provider: none and keep the application-owned Better Auth configuration and sender\. Commit and push the change, then plan the new commit\.$/u,
|
|
240
|
-
}),
|
|
241
229
|
database_binding_private: Object.freeze({
|
|
242
230
|
render: (path: string) =>
|
|
243
231
|
`"${path}" reads a database connection string (DATABASE_URL, HYPERDRIVE, connectionString or a postgres:// URL); none reaches a customer Worker. Call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database". ${PUSH_AND_PLAN}`,
|
|
@@ -329,7 +317,7 @@ export function parseFrameworkConversionDiagnostic(
|
|
|
329
317
|
!isFrameworkConversionDiagnosticCode(code) ||
|
|
330
318
|
typeof path !== "string" ||
|
|
331
319
|
path.length > 240 ||
|
|
332
|
-
(code === "
|
|
320
|
+
(code === "managed_auth_database_required"
|
|
333
321
|
? path !== "ohmyhost.yaml"
|
|
334
322
|
: !/^[A-Za-z0-9_@()[\]./-]+\.(?:[cm]?[jt]sx?)$/u.test(path)) ||
|
|
335
323
|
path.split("/").some((segment) => segment === "" || segment === "." || segment === "..")
|
|
@@ -2749,7 +2749,7 @@ export const applyPaidProjectDomain = <ThrowOnError extends boolean = true>(
|
|
|
2749
2749
|
/**
|
|
2750
2750
|
* Plan a deployment
|
|
2751
2751
|
*
|
|
2752
|
-
* Resolves immutable inputs and estimates effects without provider mutation or billable work. The plan targets Dev unless `environment` is `prod`; a Prod plan builds straight into Prod, except that a project with shared data and a database only reaches Prod through promotion.
|
|
2752
|
+
* Resolves immutable inputs and estimates effects without provider mutation or billable work. The plan targets Dev unless `environment` is `prod`; a Prod plan builds straight into Prod, except that a project with shared data and a database only reaches Prod through promotion. Managed mail requires a confirmed Paid service period; it is checked again before build reservation. Selecting the managed Better Auth bridge does not require managed mail or Paid access. An old sender configuration is not Paid authority.
|
|
2753
2753
|
*/
|
|
2754
2754
|
export const planDeployment = <ThrowOnError extends boolean = true>(
|
|
2755
2755
|
parameters: {
|