create-nextblock 0.8.2 → 0.8.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
CHANGED
|
@@ -795,7 +795,10 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
795
795
|
// access token so no browser login is required.
|
|
796
796
|
const supabaseBin = await getSupabaseBinary(projectPath);
|
|
797
797
|
const command = supabaseBin === 'npx' ? 'npx' : supabaseBin;
|
|
798
|
-
|
|
798
|
+
// `--yes` skips npx's "Ok to proceed?" install prompt if it ever falls back to npx
|
|
799
|
+
// (i.e. the supabase devDependency somehow isn't installed) so it can't hang the wizard.
|
|
800
|
+
const sbArgs = (args) =>
|
|
801
|
+
supabaseBin === 'npx' ? ['--yes', 'supabase', ...args] : args;
|
|
799
802
|
const supabaseEnv = {
|
|
800
803
|
...process.env,
|
|
801
804
|
SUPABASE_ACCESS_TOKEN: supabase.accessToken,
|
|
@@ -814,8 +817,9 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
814
817
|
handleWizardCancel('Setup cancelled.');
|
|
815
818
|
}
|
|
816
819
|
|
|
817
|
-
|
|
818
|
-
|
|
820
|
+
// Stream the Supabase CLI's own output (stdio: inherit) instead of hiding it behind a
|
|
821
|
+
// spinner — link/push are long-running and a spinner over inherited output looks frozen.
|
|
822
|
+
clack.log.step('Linking to your Supabase project...');
|
|
819
823
|
try {
|
|
820
824
|
await execa(
|
|
821
825
|
command,
|
|
@@ -824,7 +828,9 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
824
828
|
);
|
|
825
829
|
|
|
826
830
|
if (applySchema) {
|
|
827
|
-
|
|
831
|
+
clack.log.step(
|
|
832
|
+
'Applying the database schema — this can take a minute on a fresh project...',
|
|
833
|
+
);
|
|
828
834
|
await execa(command, sbArgs(['db', 'push', '--include-all']), {
|
|
829
835
|
stdio: ['pipe', 'inherit', 'inherit'],
|
|
830
836
|
cwd: projectPath,
|
|
@@ -832,21 +838,21 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
832
838
|
env: supabaseEnv,
|
|
833
839
|
});
|
|
834
840
|
|
|
835
|
-
|
|
841
|
+
clack.log.step('Syncing Supabase config (auth settings)...');
|
|
836
842
|
await execa(command, sbArgs(['config', 'push']), {
|
|
837
843
|
stdio: ['pipe', 'inherit', 'inherit'],
|
|
838
844
|
cwd: projectPath,
|
|
839
845
|
env: supabaseEnv,
|
|
840
846
|
});
|
|
841
847
|
|
|
842
|
-
|
|
848
|
+
clack.log.success('Database schema and config applied.');
|
|
843
849
|
} else {
|
|
844
|
-
|
|
850
|
+
clack.log.info(
|
|
845
851
|
'Linked. Skipped schema push — run `npx supabase db push --include-all` when ready.',
|
|
846
852
|
);
|
|
847
853
|
}
|
|
848
854
|
} catch (error) {
|
|
849
|
-
|
|
855
|
+
clack.log.warn(
|
|
850
856
|
'Database setup failed. You can run `npx supabase db push --include-all` manually.',
|
|
851
857
|
);
|
|
852
858
|
if (error instanceof Error) {
|
|
@@ -1830,17 +1836,31 @@ async function transformPackageJson(projectDir) {
|
|
|
1830
1836
|
keygrip: 'npm:keygrip@latest',
|
|
1831
1837
|
};
|
|
1832
1838
|
let rootOverrides = FALLBACK_OVERRIDES;
|
|
1839
|
+
let supabaseCliVersion = '^2.95.6'; // keep in sync with the repo root devDependency
|
|
1833
1840
|
try {
|
|
1834
1841
|
const rootPkg = await fs.readJSON(resolve(REPO_ROOT, 'package.json'));
|
|
1835
1842
|
if (rootPkg?.overrides && Object.keys(rootPkg.overrides).length > 0) {
|
|
1836
1843
|
rootOverrides = rootPkg.overrides;
|
|
1837
1844
|
}
|
|
1845
|
+
const rootSupabase =
|
|
1846
|
+
rootPkg?.devDependencies?.supabase ?? rootPkg?.dependencies?.supabase;
|
|
1847
|
+
if (rootSupabase) {
|
|
1848
|
+
supabaseCliVersion = rootSupabase;
|
|
1849
|
+
}
|
|
1838
1850
|
} catch {
|
|
1839
|
-
// Published CLI: repo root package.json not present — keep the baked-in
|
|
1851
|
+
// Published CLI: repo root package.json not present — keep the baked-in fallbacks.
|
|
1840
1852
|
}
|
|
1841
1853
|
// Project-specific overrides (if any) win over the inherited defaults.
|
|
1842
1854
|
packageJson.overrides = { ...rootOverrides, ...(packageJson.overrides ?? {}) };
|
|
1843
1855
|
|
|
1856
|
+
// Ship the Supabase CLI as a devDependency so setup / link / db push use a locally-installed
|
|
1857
|
+
// binary. Without it, `npx supabase` downloads the CLI (~40MB) and shows an "Ok to proceed?"
|
|
1858
|
+
// prompt mid-wizard that looks like a hang.
|
|
1859
|
+
packageJson.devDependencies = packageJson.devDependencies ?? {};
|
|
1860
|
+
if (!packageJson.devDependencies.supabase) {
|
|
1861
|
+
packageJson.devDependencies.supabase = supabaseCliVersion;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1844
1864
|
// npm throws EOVERRIDE when a package is BOTH a direct dependency and has an override with a
|
|
1845
1865
|
// different spec (e.g. dependencies.uuid ^11.0.4 vs overrides.uuid ^11.1.1). Align any such
|
|
1846
1866
|
// direct (dev)dependency to the override value so they share the exact same spec — which is
|
package/package.json
CHANGED