aboutsummaryrefslogtreecommitdiff
path: root/packages/create-astro/src
diff options
context:
space:
mode:
authorGravatar Florian Lefebvre <contact@florian-lefebvre.dev> 2025-04-22 18:10:07 +0200
committerGravatar GitHub <noreply@github.com> 2025-04-22 18:10:07 +0200
commit5dd2d3fde8a138ed611dedf39ffa5dfeeed315f8 (patch)
tree2236963411bc2ff76decf446c36ec39295756e2a /packages/create-astro/src
parenta3fe86ed2e3c9fbca02abd70cbaf1ac0530b3c2d (diff)
downloadastro-5dd2d3fde8a138ed611dedf39ffa5dfeeed315f8.tar.gz
astro-5dd2d3fde8a138ed611dedf39ffa5dfeeed315f8.tar.zst
astro-5dd2d3fde8a138ed611dedf39ffa5dfeeed315f8.zip
chore: clean dead code (#13591)
Diffstat (limited to 'packages/create-astro/src')
-rw-r--r--packages/create-astro/src/actions/shared.ts2
-rw-r--r--packages/create-astro/src/actions/template.ts2
-rw-r--r--packages/create-astro/src/messages.ts17
-rw-r--r--packages/create-astro/src/shell.ts4
4 files changed, 5 insertions, 20 deletions
diff --git a/packages/create-astro/src/actions/shared.ts b/packages/create-astro/src/actions/shared.ts
index 4bd852529..da19677d0 100644
--- a/packages/create-astro/src/actions/shared.ts
+++ b/packages/create-astro/src/actions/shared.ts
@@ -41,7 +41,7 @@ export function isEmpty(dirPath: string) {
return conflicts.length === 0;
}
-export function isValidName(projectName: string) {
+function isValidName(projectName: string) {
return /^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(projectName);
}
diff --git a/packages/create-astro/src/actions/template.ts b/packages/create-astro/src/actions/template.ts
index 9aadb8128..cf58d90a8 100644
--- a/packages/create-astro/src/actions/template.ts
+++ b/packages/create-astro/src/actions/template.ts
@@ -94,7 +94,7 @@ export function getTemplateTarget(tmpl: string, ref = 'latest') {
}
}
-export default async function copyTemplate(tmpl: string, ctx: Context) {
+async function copyTemplate(tmpl: string, ctx: Context) {
const templateTarget = getTemplateTarget(tmpl, ctx.ref);
// Copy
if (!ctx.dryRun) {
diff --git a/packages/create-astro/src/messages.ts b/packages/create-astro/src/messages.ts
index 898c9c728..17fffbed7 100644
--- a/packages/create-astro/src/messages.ts
+++ b/packages/create-astro/src/messages.ts
@@ -1,7 +1,7 @@
import { exec } from 'node:child_process';
import { stripVTControlCharacters } from 'node:util';
/* eslint no-console: 'off' */
-import { color, say as houston, label, spinner as load } from '@astrojs/cli-kit';
+import { color, say as houston, label } from '@astrojs/cli-kit';
import { align, sleep } from '@astrojs/cli-kit/utils';
import { shell } from './shell.js';
@@ -34,15 +34,6 @@ export async function say(messages: string | string[], { clear = false, hat = ''
return houston(messages, { clear, hat, tie, stdout });
}
-export async function spinner(args: {
- start: string;
- end: string;
- onError?: (error: any) => void;
- while: (...args: any) => Promise<any>;
-}) {
- await load(args, { stdout });
-}
-
export const title = (text: string) => align(label(text), 'end', 7) + ' ';
export const getName = () =>
@@ -99,12 +90,6 @@ export const error = async (prefix: string, text: string) => {
}
};
-export const typescriptByDefault = async () => {
- await info(`No worries!`, 'TypeScript is supported in Astro by default,');
- log(`${' '.repeat(9)}${color.dim('but you are free to continue writing JavaScript instead.')}`);
- await sleep(1000);
-};
-
export const nextSteps = async ({ projectDir, devCmd }: { projectDir: string; devCmd: string }) => {
const max = stdout.columns;
const prefix = max < 80 ? ' ' : ' '.repeat(9);
diff --git a/packages/create-astro/src/shell.ts b/packages/create-astro/src/shell.ts
index 7c3e22622..253097c4a 100644
--- a/packages/create-astro/src/shell.ts
+++ b/packages/create-astro/src/shell.ts
@@ -6,12 +6,12 @@ import type { Readable } from 'node:stream';
import { spawn } from 'node:child_process';
import { text as textFromStream } from 'node:stream/consumers';
-export interface ExecaOptions {
+interface ExecaOptions {
cwd?: string | URL;
stdio?: StdioOptions;
timeout?: number;
}
-export interface Output {
+interface Output {
stdout: string;
stderr: string;
exitCode: number;