[ci] yarn format
This commit is contained in:
parent
6bca7c83a7
commit
a7594cfcdf
3 changed files with 85 additions and 83 deletions
|
@ -17,7 +17,6 @@ export function mkdirp(dir: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
||||||
|
|
||||||
export async function main() {
|
export async function main() {
|
||||||
|
@ -34,7 +33,7 @@ export async function main() {
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
name: 'forceOverwrite',
|
name: 'forceOverwrite',
|
||||||
message: 'Directory not empty. Continue?',
|
message: 'Directory not empty. Continue?',
|
||||||
initial: false
|
initial: false,
|
||||||
});
|
});
|
||||||
if (!response.forceOverwrite) {
|
if (!response.forceOverwrite) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
@ -44,14 +43,14 @@ export async function main() {
|
||||||
mkdirp(cwd);
|
mkdirp(cwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = /** @type {import('./types/internal').Options} */ (await prompts([
|
const options = /** @type {import('./types/internal').Options} */ await prompts([
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
name: 'template',
|
name: 'template',
|
||||||
message: 'Which app template would you like to use?',
|
message: 'Which app template would you like to use?',
|
||||||
choices: TEMPLATES
|
choices: TEMPLATES,
|
||||||
},
|
},
|
||||||
]));
|
]);
|
||||||
|
|
||||||
const emitter = degit(`snowpackjs/astro/examples/${options.template}`, {
|
const emitter = degit(`snowpackjs/astro/examples/${options.template}`, {
|
||||||
cache: false,
|
cache: false,
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
export const TEMPLATES = [,
|
export const TEMPLATES = [
|
||||||
|
,
|
||||||
{
|
{
|
||||||
title: 'Starter Kit (Generic)',
|
title: 'Starter Kit (Generic)',
|
||||||
value: 'starter'
|
value: 'starter',
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
title: 'Blog',
|
title: 'Blog',
|
||||||
value: 'blog'
|
value: 'blog',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Documentation',
|
title: 'Documentation',
|
||||||
value: 'docs'
|
value: 'docs',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Portfolio',
|
title: 'Portfolio',
|
||||||
value: 'portfolio'
|
value: 'portfolio',
|
||||||
}];
|
},
|
||||||
|
];
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { suite } from 'uvu';
|
||||||
import execa from 'execa';
|
import execa from 'execa';
|
||||||
import del from 'del';
|
import del from 'del';
|
||||||
import * as assert from 'uvu/assert';
|
import * as assert from 'uvu/assert';
|
||||||
import {TEMPLATES} from '../dist/templates.js';
|
import { TEMPLATES } from '../dist/templates.js';
|
||||||
|
|
||||||
const CreateAstro = suite('npm init astro');
|
const CreateAstro = suite('npm init astro');
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ CreateAstro.before(async () => {
|
||||||
await fs.promises.mkdir(fixturesDir);
|
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.
|
// TODO: Unskip once repo is made public. Because the repo is private, the templates can't yet be downloaded.
|
||||||
CreateAstro.skip(template, async () => {
|
CreateAstro.skip(template, async () => {
|
||||||
const testDirectory = path.join(fixturesDir, template);
|
const testDirectory = path.join(fixturesDir, template);
|
||||||
|
|
Loading…
Reference in a new issue