remove container name
This commit is contained in:
@@ -58,47 +58,158 @@ To publish this package to npm:
|
||||
```
|
||||
The `prepublishOnly` hook will automatically sync the template from the main project before publishing.
|
||||
|
||||
## Template Updates
|
||||
## Maintainer Guide: Updating & Publishing
|
||||
|
||||
### Automatic Sync (Recommended)
|
||||
This section is for maintainers who need to update the npm package after making changes to the main project.
|
||||
|
||||
### Complete Publishing Workflow
|
||||
|
||||
Follow these steps **every time** you make changes to the main project and want to publish them:
|
||||
|
||||
#### Step 1: Make Changes to Main Project
|
||||
|
||||
Edit any files in the main project (outside of `create-agentic-app/` folder):
|
||||
- `src/` components and pages
|
||||
- `docker-compose.yml`
|
||||
- `package.json`
|
||||
- Configuration files
|
||||
- etc.
|
||||
|
||||
#### Step 2: Navigate to create-agentic-app Directory
|
||||
|
||||
When publishing, the template syncs automatically via the `prepublishOnly` hook. Just run:
|
||||
```bash
|
||||
cd create-agentic-app
|
||||
npm publish
|
||||
```
|
||||
|
||||
### Manual Sync
|
||||
#### Step 3: Sync Template from Main Project
|
||||
|
||||
If you want to sync without publishing:
|
||||
This copies all your changes from the main project into the template folder:
|
||||
|
||||
**From the project root:**
|
||||
```bash
|
||||
npm run sync-template
|
||||
```
|
||||
|
||||
**Or from the create-agentic-app directory:**
|
||||
```bash
|
||||
npm run sync
|
||||
```
|
||||
|
||||
The sync script automatically:
|
||||
- Copies all files from the main project to `template/`
|
||||
- Excludes build artifacts (node_modules, .next, lock files, etc.)
|
||||
- Removes `"private": true` from template's package.json
|
||||
- Removes the `sync-template` script (users don't need it)
|
||||
**What this does:**
|
||||
- Deletes everything in `create-agentic-app/template/`
|
||||
- Copies ALL files from your main project into `template/`
|
||||
- Excludes: `node_modules`, `.next`, `.git`, lock files, `.env`, and the `create-agentic-app` folder itself
|
||||
- Cleans up the template's `package.json` (removes `private` field and `sync-template` script)
|
||||
|
||||
### Publishing Workflow
|
||||
#### Step 4: Bump the Version
|
||||
|
||||
1. **Make changes** to the main boilerplate project
|
||||
2. **Test your changes**
|
||||
3. **Bump version** in `create-agentic-app/package.json`
|
||||
4. **Publish**:
|
||||
Update the version number in `create-agentic-app/package.json`:
|
||||
|
||||
**Option A - Using npm version command (recommended):**
|
||||
```bash
|
||||
npm version patch # 1.1.3 → 1.1.4 (bug fixes)
|
||||
# or
|
||||
npm version minor # 1.1.3 → 1.2.0 (new features)
|
||||
# or
|
||||
npm version major # 1.1.3 → 2.0.0 (breaking changes)
|
||||
```
|
||||
|
||||
**Option B - Manual:**
|
||||
Edit `create-agentic-app/package.json` and change the version number.
|
||||
|
||||
#### Step 5: Verify Everything Looks Good (Optional)
|
||||
|
||||
Quick check to make sure your changes are in the package:
|
||||
|
||||
```bash
|
||||
npm pack --dry-run | grep "template/"
|
||||
```
|
||||
|
||||
This shows all files that will be published. Look for your changed files.
|
||||
|
||||
#### Step 6: Publish to npm
|
||||
|
||||
```bash
|
||||
npm publish
|
||||
```
|
||||
|
||||
**What happens:**
|
||||
- The `prepublishOnly` hook automatically runs `npm run sync` again (safety check)
|
||||
- Your package gets published to npm with the new version
|
||||
|
||||
#### Step 7: Test It
|
||||
|
||||
In a different directory, test that it works:
|
||||
|
||||
```bash
|
||||
cd /path/to/test-directory
|
||||
npx create-agentic-app@latest test-project
|
||||
# or use the specific version
|
||||
npx create-agentic-app@1.1.4 test-project
|
||||
```
|
||||
|
||||
### Quick Reference Commands
|
||||
|
||||
```bash
|
||||
# Complete workflow in 4 commands:
|
||||
cd create-agentic-app
|
||||
npm run sync
|
||||
npm version patch
|
||||
npm publish
|
||||
```
|
||||
|
||||
### Common Scenarios
|
||||
|
||||
**Scenario 1: You edited `docker-compose.yml` in the main project**
|
||||
```bash
|
||||
cd create-agentic-app
|
||||
npm run sync # Copies docker-compose.yml to template/
|
||||
npm version patch # Bumps to next version
|
||||
npm publish # Publishes to npm
|
||||
```
|
||||
|
||||
**Scenario 2: You added a new component in `src/components/`**
|
||||
```bash
|
||||
cd create-agentic-app
|
||||
npm run sync # Copies new component to template/
|
||||
npm version patch # Bumps version
|
||||
npm publish # Publishes
|
||||
```
|
||||
|
||||
**Scenario 3: You updated multiple files**
|
||||
```bash
|
||||
cd create-agentic-app
|
||||
npm run sync # Copies ALL changes to template/
|
||||
npm version patch # Bumps version
|
||||
npm publish # Publishes
|
||||
```
|
||||
|
||||
### What Gets Excluded from the Template
|
||||
|
||||
The sync script excludes these patterns (see `scripts/sync-templates.js`):
|
||||
- `node_modules`
|
||||
- `.next`
|
||||
- `.git`
|
||||
- `pnpm-lock.yaml`
|
||||
- `package-lock.json`
|
||||
- `yarn.lock`
|
||||
- `tsconfig.tsbuildinfo`
|
||||
- `.env`
|
||||
- `create-agentic-app` (the folder itself)
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
**Issue: npmjs.com shows old version after publishing**
|
||||
- The npm website can take 5-10 minutes to update due to CDN caching
|
||||
- Verify actual registry: `npm view create-agentic-app version`
|
||||
- The package is available to users immediately via `npx` even if the website hasn't updated
|
||||
|
||||
**Issue: Users getting old version with `npx`**
|
||||
- Users may have cached versions. Tell them to:
|
||||
```bash
|
||||
cd create-agentic-app
|
||||
npm publish
|
||||
npx clear-npx-cache
|
||||
npx create-agentic-app@latest my-project
|
||||
# or use specific version
|
||||
npx create-agentic-app@1.1.4 my-project
|
||||
```
|
||||
(Template syncs automatically before publishing)
|
||||
|
||||
**Issue: Forgot to run sync before publishing**
|
||||
- No problem! The `prepublishOnly` hook runs it automatically
|
||||
- But it's good practice to run manually first to verify changes
|
||||
|
||||
## License
|
||||
|
||||
|
||||
4
create-agentic-app/package-lock.json
generated
4
create-agentic-app/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "create-agentic-app",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "create-agentic-app",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.4",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chalk": "^5.3.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-agentic-app",
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.4",
|
||||
"description": "Scaffold a new agentic AI application with Next.js, Better Auth, and AI SDK",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
Reference in New Issue
Block a user