[ci] yarn format

This commit is contained in:
matthewp 2021-06-08 15:12:07 +00:00 committed by GitHub Actions
parent 6bca7c83a7
commit a7594cfcdf
3 changed files with 85 additions and 83 deletions

View file

@ -17,7 +17,6 @@ export function mkdirp(dir: string) {
}
}
const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
export async function main() {
@ -34,7 +33,7 @@ export async function main() {
type: 'confirm',
name: 'forceOverwrite',
message: 'Directory not empty. Continue?',
initial: false
initial: false,
});
if (!response.forceOverwrite) {
process.exit(1);
@ -44,14 +43,14 @@ export async function main() {
mkdirp(cwd);
}
const options = /** @type {import('./types/internal').Options} */ (await prompts([
const options = /** @type {import('./types/internal').Options} */ await prompts([
{
type: 'select',
name: 'template',
message: 'Which app template would you like to use?',
choices: TEMPLATES
choices: TEMPLATES,
},
]));
]);
const emitter = degit(`snowpackjs/astro/examples/${options.template}`, {
cache: false,

View file

@ -1,16 +1,19 @@
export const TEMPLATES = [,
export const TEMPLATES = [
,
{
title: 'Starter Kit (Generic)',
value: 'starter'
}, {
value: 'starter',
},
{
title: 'Blog',
value: 'blog'
value: 'blog',
},
{
title: 'Documentation',
value: 'docs'
value: 'docs',
},
{
title: 'Portfolio',
value: 'portfolio'
}];
value: 'portfolio',
},
];

View file

@ -5,7 +5,7 @@ import { suite } from 'uvu';
import execa from 'execa';
import del from 'del';
import * as assert from 'uvu/assert';
import {TEMPLATES} from '../dist/templates.js';
import { TEMPLATES } from '../dist/templates.js';
const CreateAstro = suite('npm init astro');
@ -17,7 +17,7 @@ CreateAstro.before(async () => {
await fs.promises.mkdir(fixturesDir);
});
for (const {value: template} of TEMPLATES) {
for (const { value: template } of TEMPLATES) {
// TODO: Unskip once repo is made public. Because the repo is private, the templates can't yet be downloaded.
CreateAstro.skip(template, async () => {
const testDirectory = path.join(fixturesDir, template);