Skip to content

Commit acd1623

Browse files
chore: update .gitignore to include .codacy and ensure proper file exclusions (#19)
1 parent 8bdf011 commit acd1623

File tree

16 files changed

+941
-815
lines changed

16 files changed

+941
-815
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# GitHub Actions workflow for publishing create-tbk-app to npm
2+
#
3+
# SETUP INSTRUCTIONS:
4+
# 1. Go to your repository Settings > Secrets and variables > Actions
5+
# 2. Click "New repository secret"
6+
# 3. Name: NPM_TOKEN
7+
# 4. Value: Your npm access token (create at https://www.npmjs.com/settings/{username}/tokens)
8+
# 5. Select "Automation" token type for CI/CD use
9+
# 6. Save the secret
10+
#
11+
# For more info: https://docs.github.com/en/actions/security-guides/encrypted-secrets
12+
13+
name: Publish create-tbk-app to npm
14+
15+
on:
16+
workflow_dispatch:
17+
inputs:
18+
version_type:
19+
description: 'Version bump type'
20+
required: true
21+
type: choice
22+
options:
23+
- patch
24+
- minor
25+
- major
26+
27+
jobs:
28+
publish:
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: write
32+
id-token: write
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: '18'
44+
45+
- name: Setup pnpm
46+
uses: pnpm/action-setup@v4
47+
with:
48+
version: 9.9.0
49+
50+
- name: Configure Git
51+
run: |
52+
git config --global user.name "github-actions[bot]"
53+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
54+
55+
- name: Install dependencies
56+
run: pnpm install --frozen-lockfile
57+
58+
- name: Bump version in package.json
59+
id: bump-version
60+
working-directory: packages/create-tbk-app
61+
run: |
62+
# Get current version
63+
CURRENT_VERSION=$(node -p "require('./package.json').version")
64+
echo "Current version: $CURRENT_VERSION"
65+
66+
# Bump version based on input
67+
npm version ${{ inputs.version_type }} --no-git-tag-version
68+
69+
# Get new version
70+
NEW_VERSION=$(node -p "require('./package.json').version")
71+
echo "New version: $NEW_VERSION"
72+
73+
# Set output for subsequent steps
74+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
75+
echo "tag=create-tbk-app-v$NEW_VERSION" >> $GITHUB_OUTPUT
76+
77+
- name: Commit version bump
78+
run: |
79+
git add packages/create-tbk-app/package.json
80+
git commit -m "chore(create-tbk-app): bump version to ${{ steps.bump-version.outputs.version }}"
81+
git push origin HEAD:${{ github.ref_name }}
82+
83+
- name: Build package
84+
working-directory: packages/create-tbk-app
85+
run: pnpm build
86+
87+
- name: Publish to npm
88+
working-directory: packages/create-tbk-app
89+
env:
90+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
91+
run: |
92+
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
93+
pnpm publish --access public
94+
rm .npmrc
95+
96+
- name: Create git tag
97+
run: |
98+
git tag ${{ steps.bump-version.outputs.tag }}
99+
git push origin ${{ steps.bump-version.outputs.tag }}
100+
101+
- name: Summary
102+
run: |
103+
echo "✅ Successfully published create-tbk-app@${{ steps.bump-version.outputs.version }} to npm"
104+
echo "📦 Tagged as ${{ steps.bump-version.outputs.tag }}"
105+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,6 @@ Api.ts
146146
#Ignore cursor AI rules
147147
.cursor/rules/codacy.mdc
148148

149-
/docs
149+
/docs
150+
151+
.codacy

packages/create-tbk-app/README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ CLI tool to scaffold TypeScript Backend Toolkit projects with customizable featu
55
## Quick Start
66

77
```bash
8-
# Interactive mode (recommended)
8+
# Guided prompts (recommended)
99
npx create-tbk-app my-backend-api
1010

11-
# With preset
12-
npx create-tbk-app my-api --preset=standard
11+
# Skip prompts and use defaults from flags
12+
npx create-tbk-app my-api -y --preset=standard
1313

14-
# Custom configuration via flags
14+
# Provide defaults and confirm step-by-step
1515
npx create-tbk-app my-api --auth=jwt --cache=redis --email=resend
1616
```
1717

@@ -66,15 +66,22 @@ create-tbk-app [project-name] [options]
6666
Options:
6767
--preset <type> Preset configuration (minimal, standard, full, custom)
6868
--auth <type> Authentication (none, jwt, jwt-sessions)
69+
--session-driver <driver> Session storage driver (mongo, redis)
6970
--cache <provider> Cache provider (none, memory, redis)
7071
--storage <provider> Storage provider (none, local, s3, r2)
7172
--email <provider> Email provider (none, resend, mailgun, smtp)
72-
--queues Enable background jobs
73-
--realtime Enable real-time features
74-
--admin Include admin panel
73+
--queues / --no-queues Toggle background jobs
74+
--queue-dashboard Include queue monitoring dashboard (with queues)
75+
--no-queue-dashboard Disable queue monitoring dashboard
76+
--realtime / --no-realtime Toggle real-time features
77+
--admin / --no-admin Toggle admin panel
78+
--google-oauth Enable Google OAuth login (with auth)
79+
--observability <level> Observability level (basic, full)
7580
--pm <manager> Package manager (pnpm, npm, yarn)
7681
--skip-git Skip git initialization
7782
--skip-install Skip dependency installation
83+
-y, --yes Skip prompts and accept defaults
84+
--force Overwrite existing directory without prompting
7885
-h, --help Display help
7986
-V, --version Display version
8087
```
@@ -93,6 +100,7 @@ You'll be prompted for:
93100
3. Custom features (if preset is "custom")
94101
4. Package manager preference
95102
5. Git/install preferences
103+
6. Final summary confirmation
96104

97105
### Non-Interactive Mode
98106

@@ -102,7 +110,7 @@ You'll be prompted for:
102110
npx create-tbk-app my-api --preset=minimal
103111

104112
# Standard with npm
105-
npx create-tbk-app my-api --preset=standard --pm=npm
113+
npx create-tbk-app my-api --preset=standard --pm=npm --skip-install --skip-git
106114

107115
# Full-featured
108116
npx create-tbk-app my-api --preset=full
@@ -124,13 +132,19 @@ npx create-tbk-app my-api \
124132
--storage=s3 \
125133
--email=resend \
126134
--realtime \
127-
--admin
135+
--admin \
136+
--pm=pnpm \
137+
--skip-install \
138+
--skip-git
128139
```
129140

130141
**Skip options:**
131142
```bash
132143
# Don't install dependencies or init git
133144
npx create-tbk-app my-api --preset=standard --skip-install --skip-git
145+
146+
# Force overwrite and skip prompts
147+
npx create-tbk-app my-api -y --preset=standard --pm=pnpm --force
134148
```
135149

136150
## What Gets Generated

packages/create-tbk-app/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,16 @@
3838
},
3939
"license": "MIT",
4040
"dependencies": {
41+
"@clack/prompts": "^0.7.0",
4142
"chalk": "^5.3.0",
4243
"commander": "^14.0.1",
4344
"fs-extra": "^11.2.0",
4445
"handlebars": "^4.7.8",
45-
"inquirer": "^9.2.12",
4646
"ora": "^8.0.1",
4747
"validate-npm-package-name": "^5.0.0"
4848
},
4949
"devDependencies": {
5050
"@types/fs-extra": "^11.0.4",
51-
"@types/inquirer": "^9.0.7",
5251
"@types/node": "^18.11.18",
5352
"@types/validate-npm-package-name": "^4.0.2",
5453
"tsup": "^8.1.0",

0 commit comments

Comments
 (0)