betterstart-cli 0.0.9 → 0.0.11
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.
|
@@ -210,7 +210,7 @@ export function MediaPageContent() {
|
|
|
210
210
|
}
|
|
211
211
|
/>
|
|
212
212
|
|
|
213
|
-
<main className="space-y-3 px-4 pb-4
|
|
213
|
+
<main className="space-y-3 px-4 pb-4 flex-1">
|
|
214
214
|
<div className="flex w-full flex-col gap-4 pt-px">
|
|
215
215
|
{activeTab === 'url' ? (
|
|
216
216
|
<MediaUrlImporter
|
package/dist/cli.js
CHANGED
|
@@ -1254,6 +1254,9 @@ var DRIZZLE_CONFIG_BANNER_PATTERNS = [
|
|
|
1254
1254
|
/^Reading config file '.+drizzle\.config\.ts'$/,
|
|
1255
1255
|
/^Using 'pg' driver for database querying$/
|
|
1256
1256
|
];
|
|
1257
|
+
function resolveDrizzlePushStdio(inheritStdio) {
|
|
1258
|
+
return inheritStdio ? "inherit" : "pipe";
|
|
1259
|
+
}
|
|
1257
1260
|
function shouldSuppressWarningLine(line, state) {
|
|
1258
1261
|
const text6 = line.trimEnd();
|
|
1259
1262
|
if (state.suppressNextTraceHint) {
|
|
@@ -1323,7 +1326,7 @@ function runDrizzlePush(cwd, options = {}) {
|
|
|
1323
1326
|
const drizzleBin = path9.join(cwd, "node_modules", ".bin", "drizzle-kit");
|
|
1324
1327
|
const child = spawn2(drizzleBin, ["push", "--force"], {
|
|
1325
1328
|
cwd,
|
|
1326
|
-
stdio: options.inheritStdio
|
|
1329
|
+
stdio: resolveDrizzlePushStdio(options.inheritStdio),
|
|
1327
1330
|
env: { ...process.env }
|
|
1328
1331
|
});
|
|
1329
1332
|
let stdout = "";
|
|
@@ -13530,8 +13533,10 @@ ${cardJSX}
|
|
|
13530
13533
|
cards.push(options2.conditionalTabs ? wrapSidebarCardForTab(cardJSX, entry.tabName) : cardJSX);
|
|
13531
13534
|
}
|
|
13532
13535
|
flushDefaultCardFields();
|
|
13533
|
-
const columnClassName = options2.scrollable ? "relative h-fit max-h-full space-y-4 overflow-y-auto pb-4 lg:sticky lg:top-0" :
|
|
13534
|
-
|
|
13536
|
+
const columnClassName = options2.scrollable ? 'className="relative h-fit max-h-full space-y-4 overflow-y-auto pb-4 lg:sticky lg:top-0"' : showMetadataWidget ? `className={initialData?.id != null
|
|
13537
|
+
? 'lg:sticky lg:top-32 space-y-4 pb-4'
|
|
13538
|
+
: 'lg:sticky lg:top-14 space-y-4 pb-4'}` : 'className="lg:sticky lg:top-14 space-y-4 pb-4"';
|
|
13539
|
+
return ` <div ${columnClassName}>
|
|
13535
13540
|
${cards.join("\n")}
|
|
13536
13541
|
</div>`;
|
|
13537
13542
|
};
|
|
@@ -13854,8 +13859,9 @@ ${sidebarCardJSX}
|
|
|
13854
13859
|
"handleErrors"
|
|
13855
13860
|
]);
|
|
13856
13861
|
const hookReturnObject = hookReturnNames.map((name) => ` ${name}`).join(",\n");
|
|
13862
|
+
const contentUsesInitialData = hasDraft || hasSidebarFields && showMetadataWidget || topLevelTabsField && showMetadataWidget;
|
|
13857
13863
|
const contentStateNames = uniqueNames([
|
|
13858
|
-
...
|
|
13864
|
+
...contentUsesInitialData ? ["initialData"] : [],
|
|
13859
13865
|
"form",
|
|
13860
13866
|
...contentUsesPendingState ? ["isPending"] : [],
|
|
13861
13867
|
...hasTabsField ? ["activeTab", "setActiveTab"] : [],
|
|
@@ -13869,7 +13875,6 @@ ${sidebarCardJSX}
|
|
|
13869
13875
|
]);
|
|
13870
13876
|
const contentStateDestructure = contentStateNames.map((name) => ` ${name}`).join(",\n");
|
|
13871
13877
|
const needsCn = hasRelationship || hasSelectCombobox || shouldGuardSidebarByTab || Boolean(topLevelTabsField && showMetadataWidget);
|
|
13872
|
-
const needsReact = mainRelFields.length > 0 || hasNestedList || hasDraft || hasCreatableSelect || staticMultiSelectFields.length > 0;
|
|
13873
13878
|
const metadataOffsetConst = showMetadataWidget ? "const SCROLL_BORDER_OFFSET = 8;\n\n" : "";
|
|
13874
13879
|
const tabParserConst = hasTabsField ? `const TAB_VALUES = [${tabNames.map((name) => JSON.stringify(name)).join(", ")}] as const
|
|
13875
13880
|
const TAB_PARSER = parseAsStringLiteral(TAB_VALUES).withDefault(TAB_VALUES[0])
|
|
@@ -13901,7 +13906,8 @@ export type TabValue = (typeof TAB_VALUES)[number]
|
|
|
13901
13906
|
|
|
13902
13907
|
` : "";
|
|
13903
13908
|
const hookContent = `'use client'
|
|
13904
|
-
|
|
13909
|
+
|
|
13910
|
+
import * as React from 'react'
|
|
13905
13911
|
import { standardSchemaResolver } from '@hookform/resolvers/standard-schema'
|
|
13906
13912
|
import { useMutation, ${hasCreatableSelect ? "useQuery, " : ""}useQueryClient } from '@tanstack/react-query'
|
|
13907
13913
|
import { useRouter } from 'next/navigation'
|
|
@@ -13961,12 +13967,22 @@ ${staticMultiSelectState}` : ""}${hasDraft ? "\n const [submitIntent, setSubmit
|
|
|
13961
13967
|
|
|
13962
13968
|
const isPending = createMutation.isPending || updateMutation.isPending
|
|
13963
13969
|
|
|
13970
|
+
const defaultValues: FormValues = {
|
|
13971
|
+
${defaultValues}
|
|
13972
|
+
}
|
|
13973
|
+
|
|
13964
13974
|
const form = useForm<FormValues>({
|
|
13965
13975
|
resolver: standardSchemaResolver(formSchema),
|
|
13966
|
-
defaultValues
|
|
13967
|
-
${defaultValues}
|
|
13968
|
-
}
|
|
13976
|
+
defaultValues
|
|
13969
13977
|
})
|
|
13978
|
+
const defaultValuesRef = React.useRef(defaultValues)
|
|
13979
|
+
defaultValuesRef.current = defaultValues
|
|
13980
|
+
React.useEffect(
|
|
13981
|
+
() => () => {
|
|
13982
|
+
form.reset(defaultValuesRef.current)
|
|
13983
|
+
},
|
|
13984
|
+
[form]
|
|
13985
|
+
)
|
|
13970
13986
|
const { isDirty } = form.formState
|
|
13971
13987
|
${hasDraft ? " const canPublishPristineDraft = Boolean(initialData && !initialData.published)\n const canSubmitDraftAction = Boolean(initialData?.published || isDirty)\n const canSubmitPublishAction = isDirty || canPublishPristineDraft\n" : ""}
|
|
13972
13988
|
${defaultValueFromSyncFunctions ? `
|