CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-js-lib--cli

CLI tool for scaffolding JavaScript and TypeScript third-party libraries with modern development practices

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

project-updates.mddocs/

Project Updates

Update functionality for existing jslib projects, allowing seamless upgrades to the latest template version and tooling configuration.

Capabilities

Update Command

Updates an existing jslib project to the latest CLI version and template configuration.

jslib update
jslib u

# Requirements:
# - Must be run in project root directory
# - Directory must contain jslib.json configuration file
# - Project must have been created with @js-lib/cli

Usage Examples:

# Update current project
cd my-existing-project
npx @js-lib/cli update

# Will update:
# - Build configuration files
# - Package.json scripts and dependencies
# - Linting and formatting configuration  
# - CI/CD workflows
# - Preserve custom source code and tests

Update Process

The CLI handles project updates through the following process:

  1. Configuration Loading: Reads existing jslib.json configuration file
  2. Version Update: Updates CLI version metadata in project configuration
  3. Template Application: Applies latest template files based on project type (js/ts)
  4. Dependency Updates: Updates package.json dependencies to latest versions
  5. Configuration Sync: Updates build tools and linting configuration
  6. Preservation: Carefully preserves all custom source code and tests

Configuration File

Projects store metadata in jslib.json to enable updates:

{
  "pathname": "my-project",
  "name": "My Project", 
  "npmname": "my-project",
  "umdname": "MyProject",
  "username": "johndoe",
  "type": "js",
  "manager": "npm",
  "version": "3.0.6"
}

Update Process

The update process follows these steps:

  1. Validation: Confirms jslib.json exists and is valid
  2. Version Check: Updates CLI version in project metadata
  3. Template Application: Applies latest template files based on project type
  4. Dependency Updates: Updates package.json with latest dependencies
  5. Configuration Sync: Updates build and tooling configuration files
  6. Preservation: Preserves custom source code, tests, and documentation

Updated Components

During updates, the following components are refreshed:

Build System

  • Rollup configuration updates
  • Package.json scripts and dependencies
  • Build target and output configuration

Code Quality Tools

  • ESLint configuration and rules
  • Prettier formatting configuration
  • Husky git hooks setup
  • lint-staged configuration

Testing Framework

  • Mocha test configuration
  • Coverage reporting setup (Istanbul/NYC)
  • Test scripts and utilities

CI/CD Pipeline

  • GitHub Actions workflow updates
  • Node.js version matrix updates
  • Automated testing and publishing

Root Files

  • README.md template updates
  • License and changelog templates
  • Git ignore patterns
  • Editor configuration

Error Handling

The update process includes comprehensive error handling:

  • Missing Configuration: Clear error if jslib.json is not found
  • Invalid JSON: Validation and error messages for malformed configuration
  • File Conflicts: Safe handling of existing customizations
  • Permission Issues: Graceful handling of file system permissions
  • Backup Strategy: Automatic backup of critical files before updates

Selective Updates

The update process is intelligent about preserving customizations:

  • Source Code: Never modified during updates
  • Tests: Preserved with framework updates only
  • Documentation: Custom content preserved, templates updated
  • Configuration: Merged intelligently with new defaults
  • Dependencies: Updated while preserving custom additions

Compatibility

Updates maintain backward compatibility:

  • Node.js Versions: Respects minimum version requirements
  • API Changes: Handles breaking changes in dependencies gracefully
  • File Structure: Maintains existing project organization
  • Custom Scripts: Preserves custom package.json scripts

docs

file-utilities.md

index.md

interactive-configuration.md

project-creation.md

project-updates.md

template-system.md

tile.json