Skip to content

Latest commit

 

History

History
263 lines (187 loc) · 10.4 KB

api.md

File metadata and controls

263 lines (187 loc) · 10.4 KB

Classes

SevnStackCLI

The SevnStackCLI class manages the command-line interface for the SevnStack application. It sets up commands, handles user input, and invokes the appropriate actions.

Scaffolder

Class representing the scaffolder for SevnStack projects. This class handles the process of setting up the project structure, processing templates, and installing dependencies.

SevnStackCLI

The SevnStackCLI class manages the command-line interface for the SevnStack application. It sets up commands, handles user input, and invokes the appropriate actions.

Kind: global class

new SevnStackCLI()

Constructs the CLI application and sets up the commands.

sevnStackCLI.setupCommands()

Sets up CLI commands and their corresponding actions.

Kind: instance method of SevnStackCLI

sevnStackCLI.findQuestion(name) ⇒ object

Finds a question by its name from the predefined list of questions.

Kind: instance method of SevnStackCLI
Returns: object - The found question object.

Param Type Description
name string The name of the question to find.

sevnStackCLI.commandCreate(appName, options) ⇒ Promise.<void>

Handles the 'create' command to scaffold a new full-stack web application.

Kind: instance method of SevnStackCLI

Param Type Description
appName string The name of the application to create.
options object Command-line options provided by the user.

sevnStackCLI.commandInit()

Initializes a new project in an existing directory.

Kind: instance method of SevnStackCLI

sevnStackCLI.commandAddFeature()

Adds new features to an existing project.

Kind: instance method of SevnStackCLI

sevnStackCLI.commandUpdate()

Updates the project dependencies or migrates to a newer version.

Kind: instance method of SevnStackCLI

sevnStackCLI.commandBuild()

Builds the project for production deployment.

Kind: instance method of SevnStackCLI

sevnStackCLI.commandStart()

Starts the development server for the project.

Kind: instance method of SevnStackCLI

sevnStackCLI.commandDeploy()

Assists with the deployment of the project to different environments.

Kind: instance method of SevnStackCLI

sevnStackCLI.scaffold(config) ⇒ Promise.<void>

Scaffolds the project based on the provided configuration.

Kind: instance method of SevnStackCLI

Param Type Description
config object The configuration for scaffolding the project.

sevnStackCLI.getDefaults(appName, options) ⇒ Promise.<object>

Gets the default configuration for the project based on provided options.

Kind: instance method of SevnStackCLI
Returns: Promise.<object> - The default configuration object.

Param Type Description
appName string The name of the application.
options object Command-line options provided by the user.

sevnStackCLI.execute() ⇒ void

Parses the command-line arguments and executes the corresponding command. This method triggers the action bound to the command entered by the user.

Kind: instance method of SevnStackCLI

SevnStackCLI.execute() ⇒ void

Static method to create an instance of SevnStackCLI and execute it. This is the entry point for running the CLI from an external caller.

Kind: static method of SevnStackCLI

Scaffolder

Class representing the scaffolder for SevnStack projects. This class handles the process of setting up the project structure, processing templates, and installing dependencies.

Kind: global class

new Scaffolder(config)

Create a Scaffolder.

Param Type Description
config Object The configuration object for scaffolding.

scaffolder.prepareConfig()

Prepares the configuration object by modifying and adding necessary properties.

Kind: instance method of Scaffolder

scaffolder.getFilesRecursively(dir, [baseDir]) ⇒ Promise.<Array.<string>>

Recursively retrieves files from a directory.

Kind: instance method of Scaffolder
Returns: Promise.<Array.<string>> - - A promise that resolves to an array of file paths.

Param Type Default Description
dir string The directory to search in.
[baseDir] string "''" The base directory path for recursion.

scaffolder.execute()

Executes the entire scaffolding process.

Kind: instance method of Scaffolder

scaffolder.createDirectories()

Creates necessary directories for the project based on its configuration.

Kind: instance method of Scaffolder

scaffolder.processFiles()

Processes and prepares files for scaffolding - includes handling templates and static files.

Kind: instance method of Scaffolder

scaffolder.prepareFilesToProcess() ⇒ Promise.<Array.<Object>>

Prepares the list of files to be processed for scaffolding.

Kind: instance method of Scaffolder
Returns: Promise.<Array.<Object>> - - A promise that resolves to an array of file objects to process.

scaffolder.addFilesToProcess(filePaths, filesToProcess, basePath, prefix)

Adds files to the processing list, adjusting paths and determining if they are templates.

Kind: instance method of Scaffolder

Param Type Description
filePaths Array.<string> Array of file paths to process.
filesToProcess Array.<Object> Array of file objects that are being processed.
basePath string Base path for the files.
prefix string Prefix to prepend to file paths.

scaffolder.installDependencies()

Installs dependencies in the appropriate directories (client/server or src).

Kind: instance method of Scaffolder

scaffolder.runNpmInstall(directory) ⇒ Promise.<void>

Runs npm install in the specified directory.

Kind: instance method of Scaffolder
Returns: Promise.<void> - - A promise that resolves when the installation is complete.

Param Type Description
directory string The directory to run npm install in.

scaffolder.cleanupResources()

Cleans up resources by removing the scaffolding target directory in case of errors.

Kind: instance method of Scaffolder