create-nextblock 0.8.4 → 0.8.5
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/bin/create-nextblock.js
CHANGED
|
@@ -804,8 +804,6 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
804
804
|
SUPABASE_ACCESS_TOKEN: supabase.accessToken,
|
|
805
805
|
SUPABASE_DB_PASSWORD: dbPassword,
|
|
806
806
|
POSTGRES_URL: postgresUrl,
|
|
807
|
-
// Available for env() substitution in supabase config.toml during `config push`.
|
|
808
|
-
NEXT_PUBLIC_URL: siteUrl,
|
|
809
807
|
};
|
|
810
808
|
|
|
811
809
|
const applySchema = await clack.confirm({
|
|
@@ -838,14 +836,7 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
838
836
|
env: supabaseEnv,
|
|
839
837
|
});
|
|
840
838
|
|
|
841
|
-
clack.log.
|
|
842
|
-
await execa(command, sbArgs(['config', 'push']), {
|
|
843
|
-
stdio: ['pipe', 'inherit', 'inherit'],
|
|
844
|
-
cwd: projectPath,
|
|
845
|
-
env: supabaseEnv,
|
|
846
|
-
});
|
|
847
|
-
|
|
848
|
-
clack.log.success('Database schema and config applied.');
|
|
839
|
+
clack.log.success('Database schema applied.');
|
|
849
840
|
} else {
|
|
850
841
|
clack.log.info(
|
|
851
842
|
'Linked. Skipped schema push — run `npx supabase db push --include-all` when ready.',
|
|
@@ -860,10 +851,11 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
860
851
|
}
|
|
861
852
|
}
|
|
862
853
|
|
|
863
|
-
// 7.
|
|
864
|
-
//
|
|
865
|
-
// lets Supabase email your first admin
|
|
866
|
-
|
|
854
|
+
// 7. Configure hosted Supabase Auth via the Management API: site URL + custom SMTP +
|
|
855
|
+
// branded email templates. This is the same mechanism as `npm run configure:supabase-auth`
|
|
856
|
+
// in the monorepo, and it's what lets Supabase email your first admin's confirmation link.
|
|
857
|
+
// (We deliberately do NOT `supabase config push` the whole config.toml — that pushes
|
|
858
|
+
// local-only/unset values like env(TARGET_URL) and isn't what the monorepo does.)
|
|
867
859
|
await configureHostedSupabaseAuth(projectPath, {
|
|
868
860
|
projectId,
|
|
869
861
|
siteUrl,
|
|
@@ -906,48 +898,6 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
906
898
|
);
|
|
907
899
|
}
|
|
908
900
|
|
|
909
|
-
async function enableSupabaseSmtpConfig(projectDir) {
|
|
910
|
-
const configPath = resolve(projectDir, 'supabase', 'config.toml');
|
|
911
|
-
|
|
912
|
-
if (!(await fs.pathExists(configPath))) {
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
const smtpBlock = `# [auth.email.smtp]
|
|
917
|
-
# host = "env(SMTP_HOST)"
|
|
918
|
-
# port = 587
|
|
919
|
-
# user = "env(SMTP_USER)"
|
|
920
|
-
# pass = "env(SMTP_PASS)"
|
|
921
|
-
# admin_email = "env(SMTP_FROM_EMAIL)"
|
|
922
|
-
# sender_name = "env(SMTP_FROM_NAME)"`;
|
|
923
|
-
|
|
924
|
-
const enabledSmtpBlock = `[auth.email.smtp]
|
|
925
|
-
host = "env(SMTP_HOST)"
|
|
926
|
-
port = 587
|
|
927
|
-
user = "env(SMTP_USER)"
|
|
928
|
-
pass = "env(SMTP_PASS)"
|
|
929
|
-
admin_email = "env(SMTP_FROM_EMAIL)"
|
|
930
|
-
sender_name = "env(SMTP_FROM_NAME)"`;
|
|
931
|
-
|
|
932
|
-
const configContents = await fs.readFile(configPath, 'utf8');
|
|
933
|
-
|
|
934
|
-
if (configContents.includes(enabledSmtpBlock)) {
|
|
935
|
-
return;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
if (!configContents.includes(smtpBlock)) {
|
|
939
|
-
throw new Error(
|
|
940
|
-
`Could not find the SMTP placeholder block in ${configPath}.`,
|
|
941
|
-
);
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
await fs.writeFile(
|
|
945
|
-
configPath,
|
|
946
|
-
configContents.replace(smtpBlock, enabledSmtpBlock),
|
|
947
|
-
'utf8',
|
|
948
|
-
);
|
|
949
|
-
}
|
|
950
|
-
|
|
951
901
|
async function configureHostedSupabaseAuth(
|
|
952
902
|
projectDir,
|
|
953
903
|
{ projectId, siteUrl, accessToken, smtpValues },
|
package/package.json
CHANGED