Skip to content

ioncakephper/cli-scaffold

Repository files navigation

cli-scaffold

Small CLI scaffold used for examples and tests.

npm version actions status license maintained

More badges

npm downloads codecov release stars forks watchers last commit contributors issues pull requests repo size top language languages

Table of Contents

Running locally

Install dependencies:

npm install

Run the CLI:

node ./bin/cli.js hello
node ./bin/cli.js help hello

Running tests (Jest)

Run the test suite:

npm test

Run tests with coverage:

npm test -- --coverage

CI (GitHub Actions)

A workflow is provided at .github/workflows/ci.yml. It runs the Jest suite across Linux, Windows, and macOS for Node.js 18 and 20 and uploads coverage artifacts for each matrix job.

Optional Codecov upload

The workflow uploads coverage to Codecov for public repositories by default. To enable uploads for private repos, add a CODECOV_TOKEN repository secret and the workflow will use it.

How to open a PR with these changes

I cannot open a remote PR from this environment. To create a PR locally:

  1. Create a new branch:
git checkout -b feature/ci-readme
  1. Commit the changes:
git add .
git commit -m "Add CI workflow, tests, and README"
  1. Push and open a PR on GitHub:
git push -u origin feature/ci-readme

Then open a PR from the branch in the repository UI.

If you want, I can prepare a patch or branch here for you to push.

Project Structure

└── cli-scaffold/
    ├── bin/
    │   └── cli.js
    ├── config/
    │   └── default.config.js
    ├── coverage/
    │   ├── lcov-report/
    │   │   ├── base.css
    │   │   ├── block-navigation.js
    │   │   ├── favicon.png
    │   │   ├── index.html
    │   │   ├── prettify.css
    │   │   ├── prettify.js
    │   │   ├── sort-arrow-sprite.png
    │   │   └── sorter.js
    │   ├── clover.xml
    │   ├── coverage-final.json
    │   └── lcov.info
    ├── src/
    │   ├── commands/
    │   │   └── hello/
    │   │       ...
    │   ├── config.js
    │   ├── index.js
    │   ├── mergeConfig.js
    │   └── resolveValue.js
    ├── test/
    │   ├── __tests__/
    │   │   ├── cascading-config.test.js
    │   │   ├── config-flag.test.js
    │   │   ├── debug-quiet-flags.test.js
    │   │   └── help-hello.test.js
    │   ├── config-flag.js
    │   ├── debug-quiet-flags.js
    │   └── help-hello.js
    ├── .prettierrc.json
    ├── CHANGELOG.md
    ├── CONTRIBUTING.md
    ├── eslint.config.mjs
    ├── LICENSE
    ├── markdown-magic.config.js
    ├── package-lock.json
    ├── package.json
    ├── README.md
    └── RULES_OF_CONDUCT.md

Contributing

See CONTRIBUTING.md for details on how to raise issues, propose changes, and submit pull requests. In short:

  • Open issues for bugs or feature requests with clear reproduction steps.
  • For code contributions, fork the repo, create a branch, add tests, and open a PR against main.

License

This project is licensed under the terms of the MIT License. See the LICENSE file for details.

Acknowledgments

Thanks to the following projects and tools used in this repository:

  • @eslint/js — ESLint JavaScript language implementation
  • @eslint/markdown — The official ESLint language plugin for Markdown
  • commander — the complete solution for node.js command-line programs
  • cosmiconfig — Find and load configuration from a package.json property, rc file, TypeScript module, and more!
  • cross-spawn — Cross platform child_process#spawn and child_process#spawnSync
  • eslint — An AST-based pattern checker for JavaScript.
  • eslint-plugin-json — eslint plugin for JSON files
  • eslint-plugin-yaml — Lint YAML files
  • jest — Delightful JavaScript Testing.
  • jsonc-eslint-parser — JSON, JSONC and JSON5 parser for use with ESLint plugins
  • markdown-eslint-parser — The ESLint custom parser for *.md files.
  • markdown-magic-scripts — Automatically generate a dynamic, customizable dashboard of your npm scripts in your README.md using this markdown-magic transform. Keep your project documentation in sync with your package.json.
  • markdown-magic-transform-badges — No description available
  • minimist — parse argument options
  • prettier — Prettier is an opinionated code formatter
  • yaml-eslint-parser — A YAML parser that produces output compatible with ESLint

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •