On this page
npm release target managing version tracking in package.json, CI scaffolding, package manager detection, asset builds, and dev-install.
#rlsbl.targets.npm
#rlsbl.targets.npm
npm release target that manages version tracking in package.json and scaffolds CI workflows for automated publishing to the npm registry.
#NpmTarget
Release target for npm/Node.js projects (package.json).
#name
def name(self)#detect
def detect(self, dir_path)#read_name
def read_name(self, dir_path)Read the package name from package.json.
#read_metadata
def read_metadata(self, dir_path)Read license and description from package.json.
#_detect_package_manager
def _detect_package_manager(self, dir_path)Detect the package manager by walking up from dir_path to the git root.
Checks each directory for lock files in priority order:
- pnpm-lock.yaml -> "pnpm"
- yarn.lock -> "yarn"
- package-lock.json -> "npm"
Stops at the git root (.git directory) or filesystem root. Returns "npm" as fallback if no lock file is found.
#read_version
def read_version(self, dir_path)Read the version from package.json in the given directory.
#write_version
def write_version(self, dir_path, version)Write a new version to package.json, preserving formatting.
Returns a list of relative file paths that were modified.
#version_file
def version_file(self)#tag_format
def tag_format(self, version)#template_dir
def template_dir(self)#template_vars
def template_vars(self, dir_path)Extract template variables from the target project's package.json.
#template_mappings
def template_mappings(self)#build_assets
def build_assets(self, dir_path, version, dist_dir)Pack a tarball for GH Release upload.
#publish
def publish(self, dir_path, version)Publish to npm based on per-target config and NPM_TOKEN availability.
#check_project_exists
def check_project_exists(self, dir_path)#get_project_init_hint
def get_project_init_hint(self)#dev_install_command
def dev_install_command(self, project_dir)