Skip to content

Commit fae283f

Browse files
committed
remove components folder and modify cli package lookup logic for templates
1 parent 3369204 commit fae283f

File tree

12 files changed

+18
-307
lines changed

12 files changed

+18
-307
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ npx nativecn init
7373
npx nativecn add button
7474
```
7575

76-
### Alternatively, you can link individual packages
76+
### Alternatively, you can link the CLI package directly
7777

7878
```bash
79-
# Link individual packages
80-
npm link @nativecn/cli @nativecn/components
79+
# Link CLI package
80+
npm link @nativecn/cli
8181

8282
# Run commands
8383
npx nativecn init

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default [
1313
'packages/*/dist/**',
1414
'packages/*/.turbo/**',
1515
'packages/cli/src/**/*.js',
16+
'packages/cli/templates/**',
1617
'dist/**',
1718
'**/*.d.ts',
1819
'coverage/**',

packages/cli/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.1.6] - 2025-03-16
9+
10+
### Changed
11+
12+
- Modified template lookup to not check the components package
13+
- added author to package.json
14+
815
## [0.1.5] - 2025-03-16
916

1017
### Changed

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@nativecn/cli",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"private": false,
55
"description": "CLI tool for initializing and managing NativeCN components in React Native projects",
6-
"author": "Your Name <your.email@example.com>",
6+
"author": "major tom <tailwiinder@gmail.com>",
77
"license": "MIT",
88
"homepage": "https://github.com/tailwiinder/nativecn#readme",
99
"repository": {

packages/cli/src/commands/init.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,7 @@ async function addPresetToTailwindConfig(configPath: string): Promise<boolean> {
193193
let configContent = await fs.readFile(configPath, 'utf8');
194194

195195
// Check if our preset is already there
196-
if (
197-
configContent.includes('nativecn-preset') ||
198-
configContent.includes('@nativecn/components/preset')
199-
) {
196+
if (configContent.includes('nativecn-preset')) {
200197
console.log(chalk.blue('i'), 'NativeCN preset already in tailwind.config.js');
201198
return true;
202199
}

packages/cli/src/utils/templates.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ import { NativeCNConfig, readConfig } from './config';
99
* Get the template directory for a component
1010
*/
1111
export function getTemplateDir(component: string) {
12-
// Try multiple possible locations for component templates
12+
// Try possible locations for component templates
1313
const possiblePaths = [
14-
// First check if there are templates within the CLI package
14+
// Check for templates within the CLI package
1515
path.resolve(__dirname, '../../templates', component),
1616

17-
// Then check relative to the CLI package in a monorepo setup
18-
path.resolve(__dirname, '../../../components/ui', component),
19-
2017
// Lastly, check relative to current directory for local development
2118
path.resolve(process.cwd(), 'components/ui', component),
2219
];

packages/cli/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"jsx": "react",
34
"target": "es2016",
45
"module": "commonjs",
56
"declaration": true,
@@ -14,6 +15,6 @@
1415
"*": ["node_modules/*"]
1516
}
1617
},
17-
"include": ["src/**/*"],
18+
"include": ["src/**/*", "templates/**/*"],
1819
"exclude": ["node_modules", "dist"]
1920
}

packages/components/nativecn-env.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/components/package.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/components/preset.js

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)