Skip to content

refactor: optimize tech stack — 10x smaller bundle, zero heavy deps#5

Merged
doanbactam merged 9 commits intomasterfrom
refactor/optimize-tech-stack
Mar 27, 2026
Merged

refactor: optimize tech stack — 10x smaller bundle, zero heavy deps#5
doanbactam merged 9 commits intomasterfrom
refactor/optimize-tech-stack

Conversation

@doanbactam
Copy link
Copy Markdown
Owner

@doanbactam doanbactam commented Mar 27, 2026

Summary

  • Replaced chalk, ora, listr2, prompts with built-in Node.js APIs (ANSI escape codes, readline/promises)
  • Bundle size reduced from ~900KB (8 files) to 85KB (1 file) — 10x improvement
  • Added email-domain AI pattern matching for better false-positive reduction
  • Added ESLint + Prettier + typescript-eslint tooling
  • Fixed CI: triggers on master (was main), added PR check job (lint/test/build)
  • Version synced to single source (package.json), bumped to 1.1.0

Changes

Area Before After
Runtime deps 5 (chalk, ora, listr2, prompts, commander) 1 (commander)
Bundle size ~900KB, 8 dist files 85KB, 1 file
Build 2 passes (Bun + Node), overwrites 1 pass (Node target)
Version 3 sources (conflicting) 1 source (package.json)
Linting None ESLint + Prettier
CI Release only PR check + Release
Patterns Name-only Name + Email domain

Pre-Landing Review

  • [FIXED] CI triggers on branches: [main] but repo uses master
  • [FIXED] Missing await on runInstallCommand({}) (fire-and-forget)

Test plan

  • bun test — 25/25 pass
  • bun run build — 84.63 KB bundle
  • bun run lint — 0 errors, 0 warnings
  • node dist/cli.js --version1.1.0
  • node dist/cli.js patterns → lists 2 pattern groups
  • node dist/cli.js status → shows install status

doanbactam and others added 9 commits March 28, 2026 00:50
Replace chalk/ora with ANSI escape codes, add email-domain AI
pattern for better false-positive reduction. Logger reduced from
128 to 62 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove listr2 task lists and prompts dependency. Use built-in
readline/promises for interactive input. Sequential async flow
replaces Listr wrappers. Remove unused main() exports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove chalk, ora, listr2, prompts from dependencies
- Add ESLint + Prettier with typescript-eslint config
- Fix build: single bun build --target node instead of dual
- Fix CI: trigger on master (not main), add PR check job
- Sync VERSION to 1.0.5
- Add dist/ and *.tgz to .gitignore
- Remove dead files: .noco-config.json, pnpm-lock.yaml, package-lock.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delete .noco-config.json (unused), nococli-1.0.1.tgz,
extra lockfiles (package-lock.json, pnpm-lock.yaml), and
old per-file dist outputs. Only dist/cli.js bundle remains.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This is a test.

Co-Authored-By: Claude <noreply@anthropic.com>
The generated git hook now uses Node.js (fs + RegExp) instead of
bash/sed. This makes the hook work on Windows where sed is not
available by default.

- Hook uses #!/usr/bin/env node instead of #!/bin/bash
- Patterns use JS RegExp with 'i' flag (replaces [Cc][Oo] char class hacks)
- Trailing blank line cleanup via while-loop instead of sed :a ba
- E2E tests updated: cross-platform GIT_SEQUENCE_EDITOR via Node.js
- Unit tests: 27 pass (added regression test for commit body keywords)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI type-check failed: getGitUserEmail was used but not imported.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI format-check failed on src/cli.ts after import fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@doanbactam doanbactam merged commit e495e6c into master Mar 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant