@git.zone/cli 2.13.8 → 2.13.11

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.
Files changed (106) hide show
  1. package/assets/templates/gitignore/_gitignore +4 -0
  2. package/assets/templates/{npmextra/npmextra.json → smartconfig/_smartconfig.json} +3 -0
  3. package/dist_ts/00_commitinfo_data.js +2 -2
  4. package/dist_ts/classes.gitzoneconfig.js +4 -4
  5. package/dist_ts/gitzone.cli.js +1 -15
  6. package/dist_ts/mod_commit/index.js +4 -4
  7. package/dist_ts/mod_config/classes.commitconfig.d.ts +3 -3
  8. package/dist_ts/mod_config/classes.commitconfig.js +20 -20
  9. package/dist_ts/mod_config/classes.releaseconfig.d.ts +3 -3
  10. package/dist_ts/mod_config/classes.releaseconfig.js +21 -21
  11. package/dist_ts/mod_config/index.js +12 -12
  12. package/dist_ts/mod_format/classes.baseformatter.d.ts +2 -9
  13. package/dist_ts/mod_format/classes.baseformatter.js +13 -26
  14. package/dist_ts/mod_format/classes.formatplanner.d.ts +1 -3
  15. package/dist_ts/mod_format/classes.formatplanner.js +11 -39
  16. package/dist_ts/mod_format/classes.formatstats.d.ts +0 -5
  17. package/dist_ts/mod_format/classes.formatstats.js +3 -35
  18. package/dist_ts/mod_format/formatters/cleanup.formatter.js +1 -2
  19. package/dist_ts/mod_format/formatters/copy.formatter.js +5 -8
  20. package/dist_ts/mod_format/formatters/gitignore.formatter.d.ts +5 -0
  21. package/dist_ts/mod_format/formatters/gitignore.formatter.js +23 -29
  22. package/dist_ts/mod_format/formatters/packagejson.formatter.js +5 -5
  23. package/dist_ts/mod_format/formatters/prettier.formatter.js +4 -12
  24. package/dist_ts/mod_format/formatters/{npmextra.formatter.d.ts → smartconfig.formatter.d.ts} +6 -1
  25. package/dist_ts/mod_format/formatters/smartconfig.formatter.js +180 -0
  26. package/dist_ts/mod_format/formatters/templates.formatter.js +1 -10
  27. package/dist_ts/mod_format/formatters/tsconfig.formatter.js +6 -4
  28. package/dist_ts/mod_format/index.d.ts +0 -4
  29. package/dist_ts/mod_format/index.js +27 -78
  30. package/dist_ts/mod_format/interfaces.format.d.ts +1 -18
  31. package/dist_ts/mod_format/interfaces.format.js +16 -2
  32. package/dist_ts/mod_format/mod.plugins.d.ts +2 -7
  33. package/dist_ts/mod_format/mod.plugins.js +3 -8
  34. package/dist_ts/mod_services/classes.globalregistry.js +2 -2
  35. package/dist_ts/mod_services/classes.servicemanager.d.ts +2 -2
  36. package/dist_ts/mod_services/classes.servicemanager.js +21 -21
  37. package/dist_ts/plugins.d.ts +2 -2
  38. package/dist_ts/plugins.js +3 -3
  39. package/package.json +11 -17
  40. package/readme.md +231 -218
  41. package/ts/00_commitinfo_data.ts +1 -1
  42. package/ts/classes.gitzoneconfig.ts +3 -3
  43. package/ts/gitzone.cli.ts +0 -17
  44. package/ts/mod_commit/index.ts +3 -3
  45. package/ts/mod_config/classes.commitconfig.ts +19 -19
  46. package/ts/mod_config/classes.releaseconfig.ts +20 -20
  47. package/ts/mod_config/index.ts +11 -11
  48. package/ts/mod_format/classes.baseformatter.ts +14 -25
  49. package/ts/mod_format/classes.formatplanner.ts +10 -39
  50. package/ts/mod_format/classes.formatstats.ts +2 -42
  51. package/ts/mod_format/formatters/cleanup.formatter.ts +0 -1
  52. package/ts/mod_format/formatters/copy.formatter.ts +4 -8
  53. package/ts/mod_format/formatters/gitignore.formatter.ts +25 -29
  54. package/ts/mod_format/formatters/packagejson.formatter.ts +4 -4
  55. package/ts/mod_format/formatters/prettier.formatter.ts +3 -13
  56. package/ts/mod_format/formatters/smartconfig.formatter.ts +213 -0
  57. package/ts/mod_format/formatters/templates.formatter.ts +0 -9
  58. package/ts/mod_format/formatters/tsconfig.formatter.ts +6 -3
  59. package/ts/mod_format/index.ts +35 -98
  60. package/ts/mod_format/interfaces.format.ts +16 -19
  61. package/ts/mod_format/mod.plugins.ts +2 -12
  62. package/ts/mod_services/classes.globalregistry.ts +2 -2
  63. package/ts/mod_services/classes.servicemanager.ts +20 -20
  64. package/ts/plugins.ts +2 -2
  65. package/dist_ts/mod_format/classes.changecache.d.ts +0 -26
  66. package/dist_ts/mod_format/classes.changecache.js +0 -181
  67. package/dist_ts/mod_format/classes.dependency-analyzer.d.ts +0 -13
  68. package/dist_ts/mod_format/classes.dependency-analyzer.js +0 -93
  69. package/dist_ts/mod_format/classes.rollbackmanager.d.ts +0 -22
  70. package/dist_ts/mod_format/classes.rollbackmanager.js +0 -259
  71. package/dist_ts/mod_format/format.cleanup.d.ts +0 -2
  72. package/dist_ts/mod_format/format.cleanup.js +0 -25
  73. package/dist_ts/mod_format/format.copy.d.ts +0 -24
  74. package/dist_ts/mod_format/format.copy.js +0 -77
  75. package/dist_ts/mod_format/format.gitignore.d.ts +0 -2
  76. package/dist_ts/mod_format/format.gitignore.js +0 -48
  77. package/dist_ts/mod_format/format.license.d.ts +0 -2
  78. package/dist_ts/mod_format/format.license.js +0 -26
  79. package/dist_ts/mod_format/format.npmextra.d.ts +0 -5
  80. package/dist_ts/mod_format/format.npmextra.js +0 -125
  81. package/dist_ts/mod_format/format.packagejson.d.ts +0 -2
  82. package/dist_ts/mod_format/format.packagejson.js +0 -145
  83. package/dist_ts/mod_format/format.prettier.d.ts +0 -2
  84. package/dist_ts/mod_format/format.prettier.js +0 -56
  85. package/dist_ts/mod_format/format.readme.d.ts +0 -1
  86. package/dist_ts/mod_format/format.readme.js +0 -29
  87. package/dist_ts/mod_format/format.templates.d.ts +0 -5
  88. package/dist_ts/mod_format/format.templates.js +0 -68
  89. package/dist_ts/mod_format/format.tsconfig.d.ts +0 -2
  90. package/dist_ts/mod_format/format.tsconfig.js +0 -28
  91. package/dist_ts/mod_format/formatters/npmextra.formatter.js +0 -142
  92. package/ts/mod_format/classes.changecache.ts +0 -235
  93. package/ts/mod_format/classes.dependency-analyzer.ts +0 -117
  94. package/ts/mod_format/classes.rollbackmanager.ts +0 -340
  95. package/ts/mod_format/format.cleanup.ts +0 -26
  96. package/ts/mod_format/format.copy.ts +0 -93
  97. package/ts/mod_format/format.gitignore.ts +0 -54
  98. package/ts/mod_format/format.license.ts +0 -32
  99. package/ts/mod_format/format.npmextra.ts +0 -151
  100. package/ts/mod_format/format.packagejson.ts +0 -196
  101. package/ts/mod_format/format.prettier.ts +0 -66
  102. package/ts/mod_format/format.readme.ts +0 -29
  103. package/ts/mod_format/format.templates.ts +0 -79
  104. package/ts/mod_format/format.tsconfig.ts +0 -31
  105. package/ts/mod_format/formatters/npmextra.formatter.ts +0 -174
  106. /package/{npmextra.json → .smartconfig.json} +0 -0
@@ -5,9 +5,8 @@ import { FormatPlanner } from './classes.formatplanner.js';
5
5
  import { BaseFormatter } from './classes.baseformatter.js';
6
6
  import { logger, setVerboseMode } from '../gitzone.logging.js';
7
7
 
8
- // Import wrapper classes for formatters
9
8
  import { CleanupFormatter } from './formatters/cleanup.formatter.js';
10
- import { NpmextraFormatter } from './formatters/npmextra.formatter.js';
9
+ import { SmartconfigFormatter } from './formatters/smartconfig.formatter.js';
11
10
  import { LicenseFormatter } from './formatters/license.formatter.js';
12
11
  import { PackageJsonFormatter } from './formatters/packagejson.formatter.js';
13
12
  import { TemplatesFormatter } from './formatters/templates.formatter.js';
@@ -17,82 +16,66 @@ import { PrettierFormatter } from './formatters/prettier.formatter.js';
17
16
  import { ReadmeFormatter } from './formatters/readme.formatter.js';
18
17
  import { CopyFormatter } from './formatters/copy.formatter.js';
19
18
 
19
+ // Shared formatter class map used by both run() and runFormatter()
20
+ const formatterMap: Record<string, new (ctx: FormatContext, proj: Project) => BaseFormatter> = {
21
+ cleanup: CleanupFormatter,
22
+ smartconfig: SmartconfigFormatter,
23
+ license: LicenseFormatter,
24
+ packagejson: PackageJsonFormatter,
25
+ templates: TemplatesFormatter,
26
+ gitignore: GitignoreFormatter,
27
+ tsconfig: TsconfigFormatter,
28
+ prettier: PrettierFormatter,
29
+ readme: ReadmeFormatter,
30
+ copy: CopyFormatter,
31
+ };
32
+
33
+ // Formatters that don't require projectType to be set
34
+ const formattersNotRequiringProjectType = ['smartconfig', 'prettier', 'cleanup', 'packagejson'];
35
+
20
36
  export let run = async (
21
37
  options: {
22
- write?: boolean; // Explicitly write changes (default: false, dry-mode)
23
- dryRun?: boolean; // Deprecated, kept for compatibility
38
+ write?: boolean;
39
+ dryRun?: boolean; // Deprecated, kept for compatibility
24
40
  yes?: boolean;
25
41
  planOnly?: boolean;
26
42
  savePlan?: string;
27
43
  fromPlan?: string;
28
44
  detailed?: boolean;
29
45
  interactive?: boolean;
30
- parallel?: boolean;
31
46
  verbose?: boolean;
32
- diff?: boolean; // Show file diffs
47
+ diff?: boolean;
33
48
  } = {},
34
49
  ): Promise<any> => {
35
- // Set verbose mode if requested
36
50
  if (options.verbose) {
37
51
  setVerboseMode(true);
38
52
  }
39
53
 
40
- // Determine if we should write changes
41
- // Default is dry-mode (no writing) unless --write/-w is specified
42
54
  const shouldWrite = options.write ?? (options.dryRun === false);
43
55
 
44
56
  const project = await Project.fromCwd({ requireProjectType: false });
45
57
  const context = new FormatContext();
46
- // Cache system removed - no longer needed
47
58
  const planner = new FormatPlanner();
48
59
 
49
- // Get configuration from npmextra
50
- const npmextraConfig = new plugins.npmextra.Npmextra();
51
- const formatConfig = npmextraConfig.dataFor<any>('@git.zone/cli.format', {
60
+ const smartconfigInstance = new plugins.smartconfig.Smartconfig();
61
+ const formatConfig = smartconfigInstance.dataFor<any>('@git.zone/cli.format', {
52
62
  interactive: true,
53
63
  showDiffs: false,
54
64
  autoApprove: false,
55
- planTimeout: 30000,
56
- rollback: {
57
- enabled: true,
58
- autoRollbackOnError: true,
59
- backupRetentionDays: 7,
60
- maxBackupSize: '100MB',
61
- excludePatterns: ['node_modules/**', '.git/**'],
62
- },
63
65
  modules: {
64
66
  skip: [],
65
67
  only: [],
66
- order: [],
67
- },
68
- parallel: true,
69
- cache: {
70
- enabled: true,
71
- clean: true, // Clean invalid entries from cache
72
68
  },
73
69
  });
74
70
 
75
- // Cache cleaning removed - no longer using cache system
76
-
77
- // Override config with command options
78
71
  const interactive = options.interactive ?? formatConfig.interactive;
79
72
  const autoApprove = options.yes ?? formatConfig.autoApprove;
80
- const parallel = options.parallel ?? formatConfig.parallel;
81
73
 
82
74
  try {
83
- // Initialize formatters
84
- const formatters = [
85
- new CleanupFormatter(context, project),
86
- new NpmextraFormatter(context, project),
87
- new LicenseFormatter(context, project),
88
- new PackageJsonFormatter(context, project),
89
- new TemplatesFormatter(context, project),
90
- new GitignoreFormatter(context, project),
91
- new TsconfigFormatter(context, project),
92
- new PrettierFormatter(context, project),
93
- new ReadmeFormatter(context, project),
94
- new CopyFormatter(context, project),
95
- ];
75
+ // Initialize formatters in execution order
76
+ const formatters = Object.entries(formatterMap).map(
77
+ ([, FormatterClass]) => new FormatterClass(context, project),
78
+ );
96
79
 
97
80
  // Filter formatters based on configuration
98
81
  const activeFormatters = formatters.filter((formatter) => {
@@ -128,13 +111,13 @@ export let run = async (
128
111
  logger.log('info', `Plan saved to ${options.savePlan}`);
129
112
  }
130
113
 
131
- // Exit if plan-only mode
132
114
  if (options.planOnly) {
133
115
  return;
134
116
  }
135
117
 
136
- // Show diffs if requested (works in both dry-run and write modes)
137
- if (options.diff) {
118
+ // Show diffs if explicitly requested or before interactive write confirmation
119
+ const showDiffs = options.diff || (shouldWrite && interactive && !autoApprove);
120
+ if (showDiffs) {
138
121
  logger.log('info', 'Showing file diffs:');
139
122
  console.log('');
140
123
 
@@ -171,22 +154,16 @@ export let run = async (
171
154
  }
172
155
 
173
156
  // Execute phase
174
- logger.log(
175
- 'info',
176
- `Executing format operations${parallel ? ' in parallel' : ' sequentially'}...`,
177
- );
178
- await planner.executePlan(plan, activeFormatters, context, parallel);
157
+ logger.log('info', 'Executing format operations...');
158
+ await planner.executePlan(plan, activeFormatters, context);
179
159
 
180
- // Finish statistics tracking
181
160
  context.getFormatStats().finish();
182
161
 
183
- // Display statistics
184
- const showStats = npmextraConfig.dataFor('gitzone.format.showStats', true);
162
+ const showStats = smartconfigInstance.dataFor('gitzone.format.showStats', true);
185
163
  if (showStats) {
186
164
  context.getFormatStats().displayStats();
187
165
  }
188
166
 
189
- // Save stats if requested
190
167
  if (options.detailed) {
191
168
  const statsPath = `.nogit/format-stats-${Date.now()}.json`;
192
169
  await context.getFormatStats().saveReport(statsPath);
@@ -195,36 +172,13 @@ export let run = async (
195
172
  logger.log('success', 'Format operations completed successfully!');
196
173
  } catch (error) {
197
174
  logger.log('error', `Format operation failed: ${error.message}`);
198
-
199
- // Rollback system has been removed for stability
200
-
201
175
  throw error;
202
176
  }
203
177
  };
204
178
 
205
- // Export CLI command handlers
206
- export const handleRollback = async (operationId?: string): Promise<void> => {
207
- logger.log('info', 'Rollback system has been disabled for stability');
208
- };
209
-
210
- export const handleListBackups = async (): Promise<void> => {
211
- logger.log('info', 'Backup system has been disabled for stability');
212
- };
213
-
214
- export const handleCleanBackups = async (): Promise<void> => {
215
- logger.log(
216
- 'info',
217
- 'Backup cleaning has been disabled - backup system removed',
218
- );
219
- };
220
-
221
- // Import the ICheckResult type for external use
222
179
  import type { ICheckResult } from './interfaces.format.js';
223
180
  export type { ICheckResult };
224
181
 
225
- // Formatters that don't require projectType to be set
226
- const formattersNotRequiringProjectType = ['npmextra', 'prettier', 'cleanup', 'packagejson'];
227
-
228
182
  /**
229
183
  * Run a single formatter by name (for use by other modules)
230
184
  */
@@ -232,29 +186,14 @@ export const runFormatter = async (
232
186
  formatterName: string,
233
187
  options: {
234
188
  silent?: boolean;
235
- checkOnly?: boolean; // Only check for diffs, don't apply
236
- showDiff?: boolean; // Show the diff output
189
+ checkOnly?: boolean;
190
+ showDiff?: boolean;
237
191
  } = {}
238
192
  ): Promise<ICheckResult | void> => {
239
- // Determine if this formatter requires projectType
240
193
  const requireProjectType = !formattersNotRequiringProjectType.includes(formatterName);
241
194
  const project = await Project.fromCwd({ requireProjectType });
242
195
  const context = new FormatContext();
243
196
 
244
- // Map formatter names to classes
245
- const formatterMap: Record<string, new (ctx: FormatContext, proj: Project) => BaseFormatter> = {
246
- cleanup: CleanupFormatter,
247
- npmextra: NpmextraFormatter,
248
- license: LicenseFormatter,
249
- packagejson: PackageJsonFormatter,
250
- templates: TemplatesFormatter,
251
- gitignore: GitignoreFormatter,
252
- tsconfig: TsconfigFormatter,
253
- prettier: PrettierFormatter,
254
- readme: ReadmeFormatter,
255
- copy: CopyFormatter,
256
- };
257
-
258
197
  const FormatterClass = formatterMap[formatterName];
259
198
  if (!FormatterClass) {
260
199
  throw new Error(`Unknown formatter: ${formatterName}`);
@@ -262,7 +201,6 @@ export const runFormatter = async (
262
201
 
263
202
  const formatter = new FormatterClass(context, project);
264
203
 
265
- // Check-only mode: just check for diffs and optionally display them
266
204
  if (options.checkOnly) {
267
205
  const result = await formatter.check();
268
206
  if (result.hasDiff && options.showDiff) {
@@ -271,7 +209,6 @@ export const runFormatter = async (
271
209
  return result;
272
210
  }
273
211
 
274
- // Normal mode: analyze and apply changes
275
212
  const changes = await formatter.analyze();
276
213
 
277
214
  for (const change of changes) {
@@ -1,31 +1,15 @@
1
- export type IFormatOperation = {
2
- id: string;
3
- timestamp: number;
4
- files: Array<{
5
- path: string;
6
- originalContent: string;
7
- checksum: string;
8
- permissions: string;
9
- }>;
10
- status: 'pending' | 'in-progress' | 'completed' | 'failed' | 'rolled-back';
11
- error?: Error;
12
- };
13
-
14
1
  export type IFormatPlan = {
15
2
  summary: {
16
3
  totalFiles: number;
17
4
  filesAdded: number;
18
5
  filesModified: number;
19
6
  filesRemoved: number;
20
- estimatedTime: number;
21
7
  };
22
8
  changes: Array<{
23
9
  type: 'create' | 'modify' | 'delete';
24
10
  path: string;
25
11
  module: string;
26
12
  description: string;
27
- diff?: string;
28
- size?: number;
29
13
  }>;
30
14
  warnings: Array<{
31
15
  level: 'info' | 'warning' | 'error';
@@ -40,9 +24,6 @@ export type IPlannedChange = {
40
24
  module: string;
41
25
  description: string;
42
26
  content?: string; // New content for create/modify operations
43
- originalContent?: string; // Original content for comparison
44
- diff?: string;
45
- size?: number;
46
27
  };
47
28
 
48
29
  export interface ICheckResult {
@@ -54,3 +35,19 @@ export interface ICheckResult {
54
35
  after?: string;
55
36
  }>;
56
37
  }
38
+
39
+ export function getModuleIcon(module: string): string {
40
+ const icons: Record<string, string> = {
41
+ packagejson: '📦',
42
+ license: '📝',
43
+ tsconfig: '🔧',
44
+ cleanup: '🚮',
45
+ gitignore: '🔒',
46
+ prettier: '✨',
47
+ readme: '📖',
48
+ templates: '📄',
49
+ smartconfig: '⚙️',
50
+ copy: '📋',
51
+ };
52
+ return icons[module] || '📁';
53
+ }
@@ -1,31 +1,21 @@
1
1
  export * from '../plugins.js';
2
2
 
3
- import * as crypto from 'crypto';
4
3
  import * as path from 'path';
5
- import * as lik from '@push.rocks/lik';
6
4
  import * as smartfile from '@push.rocks/smartfile';
7
- import * as smartgulp from '@push.rocks/smartgulp';
8
5
  import * as smartinteract from '@push.rocks/smartinteract';
9
6
  import * as smartlegal from '@push.rocks/smartlegal';
10
7
  import * as smartobject from '@push.rocks/smartobject';
11
8
  import * as smartnpm from '@push.rocks/smartnpm';
12
- import * as smartstream from '@push.rocks/smartstream';
13
- import * as through2 from 'through2';
14
- import * as npmextra from '@push.rocks/npmextra';
9
+ import * as smartconfig from '@push.rocks/smartconfig';
15
10
  import * as smartdiff from '@push.rocks/smartdiff';
16
11
 
17
12
  export {
18
- crypto,
19
13
  path,
20
- lik,
21
14
  smartfile,
22
- smartgulp,
23
15
  smartinteract,
24
16
  smartlegal,
25
17
  smartobject,
26
18
  smartnpm,
27
- smartstream,
28
- through2,
29
- npmextra,
19
+ smartconfig,
30
20
  smartdiff,
31
21
  };
@@ -26,11 +26,11 @@ export interface IGlobalRegistryData {
26
26
 
27
27
  export class GlobalRegistry {
28
28
  private static instance: GlobalRegistry | null = null;
29
- private kvStore: plugins.npmextra.KeyValueStore<IGlobalRegistryData>;
29
+ private kvStore: plugins.smartconfig.KeyValueStore<IGlobalRegistryData>;
30
30
  private docker: DockerContainer;
31
31
 
32
32
  private constructor() {
33
- this.kvStore = new plugins.npmextra.KeyValueStore({
33
+ this.kvStore = new plugins.smartconfig.KeyValueStore({
34
34
  typeArg: 'userHomeDir',
35
35
  identityArg: 'gitzone-services',
36
36
  });
@@ -31,7 +31,7 @@ export class ServiceManager {
31
31
  await this.config.loadOrCreate();
32
32
  logger.log('info', `📋 Project: ${this.config.getConfig().PROJECT_NAME}`);
33
33
 
34
- // Load service selection from npmextra.json
34
+ // Load service selection from .smartconfig.json
35
35
  await this.loadServiceConfiguration();
36
36
 
37
37
  // Validate and update ports if needed
@@ -39,11 +39,11 @@ export class ServiceManager {
39
39
  }
40
40
 
41
41
  /**
42
- * Load service configuration from npmextra.json
42
+ * Load service configuration from .smartconfig.json
43
43
  */
44
44
  private async loadServiceConfiguration(): Promise<void> {
45
- const npmextraConfig = new plugins.npmextra.Npmextra(process.cwd());
46
- const gitzoneConfig = npmextraConfig.dataFor<any>('@git.zone/cli', {});
45
+ const smartconfigInstance = new plugins.smartconfig.Smartconfig(process.cwd());
46
+ const gitzoneConfig = smartconfigInstance.dataFor<any>('@git.zone/cli', {});
47
47
 
48
48
  // Check if services array exists
49
49
  if (!gitzoneConfig.services || !Array.isArray(gitzoneConfig.services) || gitzoneConfig.services.length === 0) {
@@ -63,7 +63,7 @@ export class ServiceManager {
63
63
 
64
64
  this.enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
65
65
 
66
- // Save to npmextra.json
66
+ // Save to .smartconfig.json
67
67
  await this.saveServiceConfiguration(this.enabledServices);
68
68
  } else {
69
69
  this.enabledServices = gitzoneConfig.services;
@@ -72,31 +72,31 @@ export class ServiceManager {
72
72
  }
73
73
 
74
74
  /**
75
- * Save service configuration to npmextra.json
75
+ * Save service configuration to .smartconfig.json
76
76
  */
77
77
  private async saveServiceConfiguration(services: string[]): Promise<void> {
78
- const npmextraPath = plugins.path.join(process.cwd(), 'npmextra.json');
79
- let npmextraData: any = {};
78
+ const smartconfigPath = plugins.path.join(process.cwd(), '.smartconfig.json');
79
+ let smartconfigData: any = {};
80
80
 
81
- // Read existing npmextra.json if it exists
82
- if (await plugins.smartfs.file(npmextraPath).exists()) {
83
- const content = await plugins.smartfs.file(npmextraPath).encoding('utf8').read();
84
- npmextraData = JSON.parse(content as string);
81
+ // Read existing .smartconfig.json if it exists
82
+ if (await plugins.smartfs.file(smartconfigPath).exists()) {
83
+ const content = await plugins.smartfs.file(smartconfigPath).encoding('utf8').read();
84
+ smartconfigData = JSON.parse(content as string);
85
85
  }
86
86
 
87
87
  // Update @git.zone/cli.services
88
- if (!npmextraData['@git.zone/cli']) {
89
- npmextraData['@git.zone/cli'] = {};
88
+ if (!smartconfigData['@git.zone/cli']) {
89
+ smartconfigData['@git.zone/cli'] = {};
90
90
  }
91
- npmextraData['@git.zone/cli'].services = services;
91
+ smartconfigData['@git.zone/cli'].services = services;
92
92
 
93
- // Write back to npmextra.json
93
+ // Write back to .smartconfig.json
94
94
  await plugins.smartfs
95
- .file(npmextraPath)
95
+ .file(smartconfigPath)
96
96
  .encoding('utf8')
97
- .write(JSON.stringify(npmextraData, null, 2));
97
+ .write(JSON.stringify(smartconfigData, null, 2));
98
98
 
99
- logger.log('ok', `✅ Saved service configuration to npmextra.json`);
99
+ logger.log('ok', `✅ Saved service configuration to .smartconfig.json`);
100
100
  logger.log('info', `🔧 Enabled services: ${services.join(', ')}`);
101
101
  }
102
102
 
@@ -904,7 +904,7 @@ export class ServiceManager {
904
904
 
905
905
  this.enabledServices = response.value || ['mongodb', 'minio', 'elasticsearch'];
906
906
 
907
- // Save to npmextra.json
907
+ // Save to .smartconfig.json
908
908
  await this.saveServiceConfiguration(this.enabledServices);
909
909
 
910
910
  logger.log('ok', '✅ Service configuration updated');
package/ts/plugins.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as smartlog from '@push.rocks/smartlog';
2
2
  import * as smartlogDestinationLocal from '@push.rocks/smartlog-destination-local';
3
- import * as npmextra from '@push.rocks/npmextra';
3
+ import * as smartconfig from '@push.rocks/smartconfig';
4
4
  import * as path from 'path';
5
5
  import * as projectinfo from '@push.rocks/projectinfo';
6
6
  import * as smartcli from '@push.rocks/smartcli';
@@ -20,7 +20,7 @@ export const smartfs = new SmartFs(new SmartFsProviderNode());
20
20
  export {
21
21
  smartlog,
22
22
  smartlogDestinationLocal,
23
- npmextra,
23
+ smartconfig,
24
24
  path,
25
25
  projectinfo,
26
26
  smartcli,
@@ -1,26 +0,0 @@
1
- export interface IFileCache {
2
- path: string;
3
- checksum: string;
4
- modified: number;
5
- size: number;
6
- }
7
- export interface ICacheManifest {
8
- version: string;
9
- lastFormat: number;
10
- files: IFileCache[];
11
- }
12
- export declare class ChangeCache {
13
- private cacheDir;
14
- private manifestPath;
15
- private cacheVersion;
16
- constructor();
17
- initialize(): Promise<void>;
18
- getManifest(): Promise<ICacheManifest>;
19
- saveManifest(manifest: ICacheManifest): Promise<void>;
20
- hasFileChanged(filePath: string): Promise<boolean>;
21
- updateFileCache(filePath: string): Promise<void>;
22
- getChangedFiles(filePaths: string[]): Promise<string[]>;
23
- clean(): Promise<void>;
24
- private calculateChecksum;
25
- private isValidManifest;
26
- }