MCPcopy
hub / github.com/FredKSchott/snowpack / command

Function command

snowpack/src/commands/prepare.ts:6–32  ·  view source on GitHub ↗
(commandOptions: CommandOptions)

Source from the content-addressed store, hash-verified

4import {CommandOptions} from '../types';
5
6export async function command(commandOptions: CommandOptions) {
7 const {config, lockfile} = commandOptions;
8 logger.info(colors.yellow('! preparing your project...'));
9 if (config.packageOptions.source === 'remote') {
10 if (!config.packageOptions.types) {
11 logger.info(
12 colors.green('✔') +
13 ' nothing to prepare. ' +
14 colors.dim(
15 '(if using TypeScript, set `packageOptions.types=true` to fetch package TypeScript types ahead-of-time.)',
16 ),
17 );
18 return;
19 }
20 if (!lockfile) {
21 logger.info(
22 colors.yellow(
23 '! no dependencies found. run "snowpack add [package]" to add a dependencies to your project.',
24 ),
25 );
26 return;
27 }
28 }
29 const pkgSource = getPackageSource(config);
30 await pkgSource.prepare();
31 logger.info(colors.green('✔') + ' project ready!');
32}

Callers

nothing calls this directly

Calls 3

getPackageSourceFunction · 0.90
infoMethod · 0.80
prepareMethod · 0.65

Tested by

no test coverage detected