create-nextblock 0.2.3 → 0.2.4
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 +37 -11
- package/package.json +1 -1
package/bin/create-nextblock.js
CHANGED
|
@@ -131,6 +131,9 @@ async function handleCommand(projectDirectory, options) {
|
|
|
131
131
|
await ensureEnvExample(projectDir);
|
|
132
132
|
console.log(chalk.green('.env.example ready.'));
|
|
133
133
|
|
|
134
|
+
await ensureSupabaseAssets(projectDir);
|
|
135
|
+
console.log(chalk.green('Supabase migrations ready.'));
|
|
136
|
+
|
|
134
137
|
if (!yes) {
|
|
135
138
|
await runSetupWizard(projectDir, projectName);
|
|
136
139
|
} else {
|
|
@@ -625,11 +628,11 @@ async function ensureGitignore(projectDir) {
|
|
|
625
628
|
}
|
|
626
629
|
}
|
|
627
630
|
|
|
628
|
-
async function ensureEnvExample(projectDir) {
|
|
629
|
-
const destination = resolve(projectDir, '.env.example');
|
|
630
|
-
if (await fs.pathExists(destination)) {
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
631
|
+
async function ensureEnvExample(projectDir) {
|
|
632
|
+
const destination = resolve(projectDir, '.env.example');
|
|
633
|
+
if (await fs.pathExists(destination)) {
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
633
636
|
|
|
634
637
|
const templatePaths = [
|
|
635
638
|
resolve(TEMPLATE_DIR, '.env.example'),
|
|
@@ -673,12 +676,35 @@ SMTP_FROM_NAME=
|
|
|
673
676
|
|
|
674
677
|
await fs.writeFile(destination, placeholder);
|
|
675
678
|
}
|
|
676
|
-
|
|
677
|
-
async function
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
679
|
+
|
|
680
|
+
async function ensureSupabaseAssets(projectDir) {
|
|
681
|
+
const sourceSupabaseDir = resolve(REPO_ROOT, 'libs/db/src/supabase');
|
|
682
|
+
const destSupabaseDir = resolve(projectDir, 'supabase');
|
|
683
|
+
|
|
684
|
+
if (!(await fs.pathExists(sourceSupabaseDir))) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
await fs.ensureDir(destSupabaseDir);
|
|
689
|
+
|
|
690
|
+
const sourceConfig = resolve(sourceSupabaseDir, 'config.toml');
|
|
691
|
+
const destConfig = resolve(destSupabaseDir, 'config.toml');
|
|
692
|
+
if (!(await fs.pathExists(destConfig)) && (await fs.pathExists(sourceConfig))) {
|
|
693
|
+
await fs.copy(sourceConfig, destConfig);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
const sourceMigrations = resolve(sourceSupabaseDir, 'migrations');
|
|
697
|
+
const destMigrations = resolve(destSupabaseDir, 'migrations');
|
|
698
|
+
if (await fs.pathExists(sourceMigrations)) {
|
|
699
|
+
await fs.copy(sourceMigrations, destMigrations, { overwrite: false, errorOnExist: false });
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
async function ensureClientComponents(projectDir) {
|
|
704
|
+
const relativePaths = [
|
|
705
|
+
'components/env-var-warning.tsx',
|
|
706
|
+
'app/providers.tsx',
|
|
707
|
+
'app/ToasterProvider.tsx',
|
|
682
708
|
'context/AuthContext.tsx',
|
|
683
709
|
'context/CurrentContentContext.tsx',
|
|
684
710
|
'context/LanguageContext.tsx',
|