Skip to content

Latest commit

 

History

History

README.md

@joycostudio/scripts

Joyco utility scripts bundled as a pnpx CLI.

Usage

pnpx @joycostudio/scripts --help
pnpx @joycostudio/scripts compress ./images ./output --quality 80
pnpx @joycostudio/scripts resize ./images ./output --width 1920 --height 1080
pnpx @joycostudio/scripts sequence -z 4 ./frames ./output/frame_%n.png
pnpx @joycostudio/scripts fix-svg src --dry --print
pnpx @joycostudio/scripts agents -s codex

For local development, build the CLI before running it directly:

pnpm build
node dist/cli.js --help

Adding a new script

  1. Add or update the core logic in src/core/ so it can be unit tested without spawning the CLI.
  2. Create a new command module in src/commands/ that exports a register(program) function.
  3. Wire the new command into src/cli.ts by adding it to the registrations list.

Commands own their Commander configuration directly (args/options/help/examples), so you can use full Commander features when needed.

🦋 Version Management

This library uses Changesets to manage versions and publish releases.

Adding a changeset

When you make changes that need to be released:

pnpm changeset

This will prompt you to:

  1. Select which packages you want to include in the changeset
  2. Choose whether it's a major/minor/patch bump
  3. Provide a summary of the changes

Creating a release

To create a new version and update the changelog:

# 1. Create new versions of packages
pnpm version:package

# 2. Release (publishes to npm)
pnpm release

Remember to commit all changes after creating a release.

🤖 Automatic Workflows

This package comes with two GitHub Actions workflows:

  1. Release Workflow (.github/workflows/release.yml): Automates the release process using Changesets. It will automatically create release pull requests and publish to npm when changes are pushed to the main branch.

  2. Publish Any Commit (.github/workflows/publish-any-commit.yml): Builds and publishes packages for any commit or pull request using pkg.pr.new.

Note: For the PR preview workflow, you need to install PKG.PR.NEW on the target repository.

Note: For the release workflow, you need to add an NPM_TOKEN secret to your repository settings.