gent-cli 1.9.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gent-cli",
3
- "version": "1.9.0",
3
+ "version": "2.0.0",
4
4
  "description": "A modern, Git-like version control CLI with built-in cloud authentication and global user identity management.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -76,14 +76,17 @@ async function create(repoName, options) {
76
76
  'main'
77
77
  );
78
78
 
79
- spinner.succeed(chalk.green(`Repository created: ${repository.name}`));
79
+ const ownerId = repository.owner_id || repository.owner?.id || repository.owner;
80
+ const name = repository.name || repository.project_name || repoName;
81
+
82
+ spinner.succeed(chalk.green(`Repository created: ${name}`));
80
83
 
81
84
  console.log(chalk.cyan('\nRepository Details:'));
82
- console.log(chalk.gray(' Name:'), repository.name);
83
- console.log(chalk.gray(' Owner:'), repository.owner_email);
85
+ console.log(chalk.gray(' Name:'), name);
86
+ console.log(chalk.gray(' Owner:'), ownerId);
84
87
  console.log(chalk.gray(' Private:'), repository.is_private ? 'Yes' : 'No');
85
88
  console.log(chalk.gray(' Description:'), repository.description || '(none)');
86
- console.log(chalk.gray(' Created:'), new Date(repository.created_at).toLocaleString());
89
+ console.log(chalk.gray(' Created:'), new Date(repository.created_at || repository.created || new Date()).toLocaleString());
87
90
 
88
91
  // Initialize local repository if requested
89
92
  if (options.initLocal) {
@@ -96,7 +99,7 @@ async function create(repoName, options) {
96
99
  await ensureDir(path.join(gentPath, 'refs', 'heads'));
97
100
 
98
101
  // Add remote
99
- await addRemote('origin', repository.owner_id, repository.name, cwd);
102
+ await addRemote('origin', ownerId, name, cwd);
100
103
 
101
104
  console.log(chalk.green('\n✓ Local repository initialized and remote added'));
102
105
  console.log(chalk.yellow('\nNext steps:'));
@@ -127,8 +127,11 @@ node_modules/
127
127
  'main'
128
128
  );
129
129
 
130
- await addRemote('origin', repository.owner_id, repository.name, cwd);
131
- spinner.succeed(chalk.green(`Created cloud repository: ${repository.owner_id}/${repository.name}`));
130
+ const ownerId = repository.owner_id || repository.owner?.id || repository.owner;
131
+ const name = repository.name || repository.project_name || repoName;
132
+
133
+ await addRemote('origin', ownerId, name, cwd);
134
+ spinner.succeed(chalk.green(`Created cloud repository: ${ownerId}/${name}`));
132
135
  console.log(chalk.gray(`Remote 'origin' added`));
133
136
  } catch (error) {
134
137
  console.log(chalk.red(`\nFailed to create cloud repository: ${error.message}`));
@@ -32,6 +32,7 @@ async function createRepository(name, description = '', isPrivate = false, defau
32
32
  try {
33
33
  const response = await apiClient.post(API_ENDPOINTS.REPOS_CREATE, {
34
34
  name,
35
+ project_name: name, // Add project_name as well for consistency
35
36
  description,
36
37
  is_private: isPrivate,
37
38
  default_branch: defaultBranch
@@ -113,23 +113,31 @@ async function getAllFiles(dir, ignorePatterns = []) {
113
113
  */
114
114
  function shouldIgnore(filePath, patterns) {
115
115
  const normalizedPath = filePath.replace(/\\/g, '/');
116
+ const segments = normalizedPath.split('/');
116
117
 
117
118
  for (const pattern of patterns) {
118
- // Exact match
119
- if (normalizedPath === pattern || normalizedPath.startsWith(pattern + '/')) {
119
+ const normalizedPattern = pattern.replace(/\/$/, '');
120
+
121
+ // Check if any segment matches the pattern (for directory-level ignores like node_modules)
122
+ if (segments.some(segment => segment === normalizedPattern)) {
123
+ return true;
124
+ }
125
+
126
+ // Exact match or starts with pattern
127
+ if (normalizedPath === normalizedPattern || normalizedPath.startsWith(normalizedPattern + '/')) {
120
128
  return true;
121
129
  }
122
130
 
123
131
  // Wildcard match
124
- if (pattern.includes('*')) {
125
- const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
132
+ if (normalizedPattern.includes('*')) {
133
+ const regex = new RegExp('^' + normalizedPattern.replace(/\*/g, '.*') + '$');
126
134
  if (regex.test(normalizedPath)) {
127
135
  return true;
128
136
  }
129
137
  }
130
138
 
131
139
  // Extension match
132
- if (pattern.startsWith('*.') && normalizedPath.endsWith(pattern.substring(1))) {
140
+ if (normalizedPattern.startsWith('*.') && normalizedPath.endsWith(normalizedPattern.substring(1))) {
133
141
  return true;
134
142
  }
135
143
  }