This guide will help you manually test the make-ca CLI tool both locally and via npx.
-
Install dependencies:
npm install
-
Build the project:
npm run build
-
Create a local symlink:
npm link
Test in a specific directory:
make-ca init -p ./test-projectTest in current directory:
mkdir test-current-dir
cd test-current-dir
make-ca initGenerate in a specific project:
make-ca generate user -p ./test-projectGenerate with skip options:
make-ca generate product --skip-domain -p ./test-projectGenerate in current directory:
cd test-current-dir
make-ca generate category-
Publish the package to npm:
npm publish
Or for testing without publishing:
npm pack
# Direct npx usage
npx make-ca init -p ./npx-test-project
# Using the tarball (if you used npm pack)
npx ./make-ca-1.0.0.tgz init -p ./npx-test-project# Direct npx usage
npx make-ca generate user -p ./npx-test-project
# With skip options
npx make-ca generate product --skip-domain -p ./npx-test-projectTry generating entities with invalid names to verify the validation works:
# Too short
npx make-ca generate ab
# Starting with number
npx make-ca generate 123user
# Invalid characters
npx make-ca generate user_profile
# Reserved word
npx make-ca generate classEach should display an appropriate error message.
You can run the automated test script:
./test.shThis will:
- Build the package
- Create a test directory
- Run various commands to test functionality
- Verify the output structure