fix: exclude settings.local.json from cli install (#16)

- Add .npmignore to exclude settings.local.json and __pycache__
- Add filter in copyFolders() to skip settings.local.json during copy
- Bump version to 1.1.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Viet Tran 2025-12-03 12:14:31 +07:00 committed by GitHub
parent 44b32d146e
commit 5586da9381
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 4 deletions

2
cli/.npmignore Normal file
View File

@ -0,0 +1,2 @@
**/settings.local.json
**/__pycache__/

View File

@ -1,6 +1,6 @@
{ {
"name": "uipro-cli", "name": "uipro-cli",
"version": "1.1.0", "version": "1.1.1",
"description": "CLI to install UI/UX Pro Max skill for AI coding assistants", "description": "CLI to install UI/UX Pro Max skill for AI coding assistants",
"type": "module", "type": "module",
"bin": { "bin": {

View File

@ -12,7 +12,7 @@ const program = new Command();
program program
.name('uipro') .name('uipro')
.description('CLI to install UI/UX Pro Max skill for AI coding assistants') .description('CLI to install UI/UX Pro Max skill for AI coding assistants')
.version('1.1.0'); .version('1.1.1');
program program
.command('init') .command('init')

View File

@ -1,5 +1,5 @@
import { mkdir, rm, access, cp } from 'node:fs/promises'; import { mkdir, rm, access, cp } from 'node:fs/promises';
import { join } from 'node:path'; import { join, basename } from 'node:path';
import { exec } from 'node:child_process'; import { exec } from 'node:child_process';
import { promisify } from 'node:util'; import { promisify } from 'node:util';
import type { AIType } from '../types/index.js'; import type { AIType } from '../types/index.js';
@ -7,6 +7,8 @@ import { AI_FOLDERS } from '../types/index.js';
const execAsync = promisify(exec); const execAsync = promisify(exec);
const EXCLUDED_FILES = ['settings.local.json'];
export async function extractZip(zipPath: string, destDir: string): Promise<void> { export async function extractZip(zipPath: string, destDir: string): Promise<void> {
try { try {
const isWindows = process.platform === 'win32'; const isWindows = process.platform === 'win32';
@ -56,9 +58,15 @@ export async function copyFolders(
// Create target directory if needed // Create target directory if needed
await mkdir(targetPath, { recursive: true }); await mkdir(targetPath, { recursive: true });
// Filter function to exclude certain files
const filterFn = (src: string): boolean => {
const fileName = basename(src);
return !EXCLUDED_FILES.includes(fileName);
};
// Copy recursively // Copy recursively
try { try {
await cp(sourcePath, targetPath, { recursive: true }); await cp(sourcePath, targetPath, { recursive: true, filter: filterFn });
copiedFolders.push(folder); copiedFolders.push(folder);
} catch { } catch {
// Try shell fallback for older Node versions // Try shell fallback for older Node versions