create-atxp
v1.21.2
Published
Create ATXP projects - Scaffold new ATXP applications from templates
Readme
create-atxp
Developer documentation for the create-atxp wrapper package.
Overview
The create-atxp package is a thin wrapper that enables the npm create atxp syntax by proxying calls to the main atxp package. This follows the convention used by other CLI tools like create-react-app, create-next-app, etc.
Architecture
npm create atxp my-app --framework express
↓
create-atxp/index.js
↓
npx atxp create my-app --framework express
↓
packages/atxp/src/index.tsHow it works:
- User runs
npm create atxp <args> - npm automatically runs
npx create-atxp <args> create-atxp/index.jstransforms this intonpx atxp create <args>- The main
atxppackage handles the actual project creation
Development
Prerequisites
- Node.js 18+
- The main
atxppackage built and available
Setup
cd packages/create-atxp
npm installTesting the Wrapper
Test Basic Functionality
# From packages/create-atxp directory
node index.js test-app
# Should be equivalent to:
# npx atxp create test-appTest with Flags
# Test framework flag
node index.js test-app --framework express
# Test git flags
node index.js test-app --no-git
node index.js test-app --git
# Test help
node index.js --helpTest npm create Syntax
# From repo root, test the actual npm create flow
npm create atxp test-app
npm create atxp test-app --framework express --no-gitDebugging
Enable Verbose Output
# See exactly what command is being executed
node index.js test-app --verboseCheck Dependencies
# Verify atxp package is available
npx atxp --help
# Check if create-atxp can find atxp
npm ls atxpCommon Issues
"Command not found" errors
- Ensure
atxppackage is built:cd ../atxp && npm run build - Check that
atxpis in dependencies: checkpackage.json
Arguments not passing through
- Verify
process.argv.slice(2)is correctly capturing all arguments - Test with
console.log(atxpArgs)inindex.js
Version mismatches
- Both packages should have the same version number
- Check
atxpdependency version inpackage.json
Version Management
The create-atxp package version should always match the main atxp package:
# Check current versions
cd packages/atxp && npm version
cd ../create-atxp && npm version
# Update versions (should be done together)
npm version patch # in both packagesTesting Checklist
Before releasing, verify:
- [ ]
node index.js test-appcreates project successfully - [ ]
node index.js test-app --framework expressworks - [ ]
node index.js test-app --no-gitskips git initialization - [ ]
node index.js test-app --gitforces git initialization - [ ]
node index.js --helpshows help information - [ ]
npm create atxp test-appworks from repo root - [ ] All arguments pass through correctly
- [ ] Error messages are clear and helpful
- [ ] Package.json versions match between both packages
File Structure
packages/create-atxp/
├── README.md # This developer documentation
├── package.json # Package configuration and dependencies
├── index.js # Main wrapper script
└── eslint.config.js # ESLint configurationDependencies
atxp: The main CLI package (exact version match)eslint,globals: Development dependencies for linting
Publishing
This package is published to npm as create-atxp and should be published alongside the main atxp package with matching versions.
# Build and test first
npm run build
npm test
# Publish (from packages/create-atxp)
npm publishContributing
When modifying the wrapper:
- Test locally with
node index.js - Test with
npm create atxpsyntax - Verify all flags and arguments pass through
- Update tests if needed
- Ensure version stays in sync with main package
