CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-snowpack

A lightning-fast frontend build tool designed to leverage JavaScript's native ESM system for unbundled development with instant browser updates.

82

1.22x
Overview
Eval results
Files

task.mdevals/scenario-5/

Snowpack CLI Manager

A command-line utility that provides a structured interface for executing Snowpack build tool commands programmatically. This utility should simplify the execution of Snowpack operations by providing helper functions that handle command construction and execution.

Capabilities

Initialize Project Configuration

  • Creates a new Snowpack configuration file in the specified directory @test
  • Returns the exit code and any error messages if initialization fails @test

Start Development Server

  • Starts the Snowpack development server with the default configuration @test
  • Starts the server with a custom port specified via --port flag @test
  • Starts the server with a custom config file using --config flag @test

Build for Production

  • Builds the project for production with default settings @test
  • Builds with verbose output when --verbose flag is provided @test

Prepare Project

  • Prepares the project by processing dependencies @test
  • Clears cache and prepares when --reload flag is provided @test

Implementation

@generates

API

/**
 * Executes snowpack init command to create a configuration file
 * @param {string} cwd - Working directory where command should be executed
 * @returns {Promise<{exitCode: number, stdout: string, stderr: string}>}
 */
async function initProject(cwd) {
  // IMPLEMENTATION HERE
}

/**
 * Starts the Snowpack development server
 * @param {string} cwd - Working directory where command should be executed
 * @param {Object} options - Server options
 * @param {number} [options.port] - Custom port number
 * @param {string} [options.config] - Path to custom config file
 * @returns {Promise<{exitCode: number, stdout: string, stderr: string}>}
 */
async function startDev(cwd, options = {}) {
  // IMPLEMENTATION HERE
}

/**
 * Builds the project for production
 * @param {string} cwd - Working directory where command should be executed
 * @param {Object} options - Build options
 * @param {boolean} [options.verbose] - Enable verbose output
 * @returns {Promise<{exitCode: number, stdout: string, stderr: string}>}
 */
async function buildProject(cwd, options = {}) {
  // IMPLEMENTATION HERE
}

/**
 * Prepares the project by processing dependencies
 * @param {string} cwd - Working directory where command should be executed
 * @param {Object} options - Prepare options
 * @param {boolean} [options.reload] - Clear cache before preparing
 * @returns {Promise<{exitCode: number, stdout: string, stderr: string}>}
 */
async function prepareProject(cwd, options = {}) {
  // IMPLEMENTATION HERE
}

module.exports = {
  initProject,
  startDev,
  buildProject,
  prepareProject
};

Dependencies { .dependencies }

snowpack { .dependency }

Provides the build tool CLI commands that this utility wraps.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-snowpack

tile.json