@git.zone/cli 1.16.6 → 1.16.8

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 (79) hide show
  1. package/dist_ts/00_commitinfo_data.js +1 -1
  2. package/dist_ts/classes.gitzoneconfig.js +1 -1
  3. package/dist_ts/gitzone.cli.js +1 -1
  4. package/dist_ts/gitzone.logging.js +1 -1
  5. package/dist_ts/mod_commit/index.js +3 -2
  6. package/dist_ts/mod_deprecate/index.js +1 -1
  7. package/dist_ts/mod_format/classes.baseformatter.d.ts +0 -2
  8. package/dist_ts/mod_format/classes.baseformatter.js +3 -22
  9. package/dist_ts/mod_format/classes.changecache.js +14 -29
  10. package/dist_ts/mod_format/classes.dependency-analyzer.js +24 -18
  11. package/dist_ts/mod_format/classes.diffreporter.js +4 -4
  12. package/dist_ts/mod_format/classes.formatcontext.d.ts +0 -13
  13. package/dist_ts/mod_format/classes.formatcontext.js +1 -41
  14. package/dist_ts/mod_format/classes.formatplanner.js +25 -45
  15. package/dist_ts/mod_format/classes.formatstats.js +22 -20
  16. package/dist_ts/mod_format/classes.rollbackmanager.d.ts +1 -0
  17. package/dist_ts/mod_format/classes.rollbackmanager.js +79 -16
  18. package/dist_ts/mod_format/format.cleanup.js +7 -2
  19. package/dist_ts/mod_format/format.copy.d.ts +1 -1
  20. package/dist_ts/mod_format/format.copy.js +3 -3
  21. package/dist_ts/mod_format/format.gitignore.js +1 -1
  22. package/dist_ts/mod_format/format.license.js +1 -1
  23. package/dist_ts/mod_format/format.npmextra.js +1 -1
  24. package/dist_ts/mod_format/format.packagejson.js +5 -3
  25. package/dist_ts/mod_format/format.prettier.js +7 -2
  26. package/dist_ts/mod_format/format.readme.js +1 -1
  27. package/dist_ts/mod_format/format.templates.js +1 -1
  28. package/dist_ts/mod_format/format.tsconfig.js +4 -2
  29. package/dist_ts/mod_format/formatters/cleanup.formatter.js +8 -3
  30. package/dist_ts/mod_format/formatters/legacy.formatter.js +6 -4
  31. package/dist_ts/mod_format/formatters/prettier.formatter.js +9 -16
  32. package/dist_ts/mod_format/formatters/readme.formatter.js +6 -4
  33. package/dist_ts/mod_format/index.js +13 -71
  34. package/dist_ts/mod_meta/meta.classes.meta.js +1 -1
  35. package/dist_ts/mod_standard/index.js +1 -1
  36. package/dist_ts/mod_start/index.js +1 -1
  37. package/dist_ts/mod_template/index.js +1 -1
  38. package/package.json +1 -1
  39. package/ts/00_commitinfo_data.ts +1 -1
  40. package/ts/classes.gitzoneconfig.ts +3 -1
  41. package/ts/gitzone.cli.ts +5 -5
  42. package/ts/gitzone.logging.ts +2 -1
  43. package/ts/mod_commit/index.ts +36 -11
  44. package/ts/mod_deprecate/index.ts +4 -1
  45. package/ts/mod_format/classes.baseformatter.ts +15 -38
  46. package/ts/mod_format/classes.changecache.ts +74 -80
  47. package/ts/mod_format/classes.dependency-analyzer.ts +46 -36
  48. package/ts/mod_format/classes.diffreporter.ts +44 -28
  49. package/ts/mod_format/classes.formatcontext.ts +3 -54
  50. package/ts/mod_format/classes.formatplanner.ts +56 -70
  51. package/ts/mod_format/classes.formatstats.ts +69 -49
  52. package/ts/mod_format/classes.rollbackmanager.ts +170 -70
  53. package/ts/mod_format/format.cleanup.ts +9 -2
  54. package/ts/mod_format/format.copy.ts +17 -14
  55. package/ts/mod_format/format.gitignore.ts +2 -1
  56. package/ts/mod_format/format.license.ts +3 -1
  57. package/ts/mod_format/format.npmextra.ts +9 -2
  58. package/ts/mod_format/format.packagejson.ts +47 -12
  59. package/ts/mod_format/format.prettier.ts +10 -2
  60. package/ts/mod_format/format.readme.ts +2 -1
  61. package/ts/mod_format/format.templates.ts +15 -7
  62. package/ts/mod_format/format.tsconfig.ts +6 -2
  63. package/ts/mod_format/formatters/cleanup.formatter.ts +13 -8
  64. package/ts/mod_format/formatters/copy.formatter.ts +1 -1
  65. package/ts/mod_format/formatters/gitignore.formatter.ts +1 -1
  66. package/ts/mod_format/formatters/legacy.formatter.ts +19 -12
  67. package/ts/mod_format/formatters/license.formatter.ts +1 -1
  68. package/ts/mod_format/formatters/npmextra.formatter.ts +1 -1
  69. package/ts/mod_format/formatters/packagejson.formatter.ts +1 -1
  70. package/ts/mod_format/formatters/prettier.formatter.ts +50 -47
  71. package/ts/mod_format/formatters/readme.formatter.ts +11 -9
  72. package/ts/mod_format/formatters/templates.formatter.ts +1 -1
  73. package/ts/mod_format/formatters/tsconfig.formatter.ts +1 -1
  74. package/ts/mod_format/index.ts +54 -113
  75. package/ts/mod_format/interfaces.format.ts +3 -3
  76. package/ts/mod_meta/meta.classes.meta.ts +57 -19
  77. package/ts/mod_standard/index.ts +3 -1
  78. package/ts/mod_start/index.ts +3 -1
  79. package/ts/mod_template/index.ts +5 -2
@@ -35,7 +35,10 @@ export class Meta {
35
35
  * sorts the metaRepoData
36
36
  */
37
37
  public async sortMetaRepoData() {
38
- const stringifiedMetadata = plugins.smartjson.stringify(this.metaRepoData, []);
38
+ const stringifiedMetadata = plugins.smartjson.stringify(
39
+ this.metaRepoData,
40
+ [],
41
+ );
39
42
  this.metaRepoData = plugins.smartjson.parse(stringifiedMetadata);
40
43
  }
41
44
 
@@ -45,11 +48,15 @@ export class Meta {
45
48
  public async readDirectory() {
46
49
  await this.syncToRemote(true);
47
50
  logger.log('info', `reading directory`);
48
- const metaFileExists = plugins.smartfile.fs.fileExistsSync(this.filePaths.metaJson);
51
+ const metaFileExists = plugins.smartfile.fs.fileExistsSync(
52
+ this.filePaths.metaJson,
53
+ );
49
54
  if (!metaFileExists) {
50
55
  throw new Error(`meta file does not exist at ${this.filePaths.metaJson}`);
51
56
  }
52
- this.metaRepoData = plugins.smartfile.fs.toObjectSync(this.filePaths.metaJson);
57
+ this.metaRepoData = plugins.smartfile.fs.toObjectSync(
58
+ this.filePaths.metaJson,
59
+ );
53
60
  }
54
61
 
55
62
  /**
@@ -76,7 +83,10 @@ export class Meta {
76
83
  this.filePaths.metaJson,
77
84
  );
78
85
  // write .gitignore to disk
79
- plugins.smartfile.memory.toFsSync(await this.generateGitignore(), this.filePaths.gitIgnore);
86
+ plugins.smartfile.memory.toFsSync(
87
+ await this.generateGitignore(),
88
+ this.filePaths.gitIgnore,
89
+ );
80
90
  }
81
91
 
82
92
  /**
@@ -84,13 +94,17 @@ export class Meta {
84
94
  */
85
95
  public async syncToRemote(gitCleanArg = false) {
86
96
  logger.log('info', `syncing from origin master`);
87
- await this.smartshellInstance.exec(`cd ${this.cwd} && git pull origin master`);
97
+ await this.smartshellInstance.exec(
98
+ `cd ${this.cwd} && git pull origin master`,
99
+ );
88
100
  if (gitCleanArg) {
89
101
  logger.log('info', `cleaning the repository from old directories`);
90
102
  await this.smartshellInstance.exec(`cd ${this.cwd} && git clean -fd`);
91
103
  }
92
104
  logger.log('info', `syncing to remote origin master`);
93
- await this.smartshellInstance.exec(`cd ${this.cwd} && git push origin master`);
105
+ await this.smartshellInstance.exec(
106
+ `cd ${this.cwd} && git push origin master`,
107
+ );
94
108
  }
95
109
 
96
110
  /**
@@ -98,7 +112,9 @@ export class Meta {
98
112
  */
99
113
  public async updateLocalRepos() {
100
114
  await this.syncToRemote();
101
- const projects = plugins.smartfile.fs.toObjectSync(this.filePaths.metaJson).projects;
115
+ const projects = plugins.smartfile.fs.toObjectSync(
116
+ this.filePaths.metaJson,
117
+ ).projects;
102
118
  const preExistingFolders = plugins.smartfile.fs.listFoldersSync(this.cwd);
103
119
  for (const preExistingFolderArg of preExistingFolders) {
104
120
  if (
@@ -107,14 +123,18 @@ export class Meta {
107
123
  projectFolder.startsWith(preExistingFolderArg),
108
124
  )
109
125
  ) {
110
- const response = await plugins.smartinteraction.SmartInteract.getCliConfirmation(
111
- `Do you want to delete superfluous directory >>${preExistingFolderArg}<< ?`,
112
- true,
113
- );
126
+ const response =
127
+ await plugins.smartinteraction.SmartInteract.getCliConfirmation(
128
+ `Do you want to delete superfluous directory >>${preExistingFolderArg}<< ?`,
129
+ true,
130
+ );
114
131
  if (response) {
115
132
  logger.log('warn', `Deleting >>${preExistingFolderArg}<<!`);
116
133
  } else {
117
- logger.log('warn', `Not deleting ${preExistingFolderArg} by request!`);
134
+ logger.log(
135
+ 'warn',
136
+ `Not deleting ${preExistingFolderArg} by request!`,
137
+ );
118
138
  }
119
139
  }
120
140
  }
@@ -160,7 +180,9 @@ export class Meta {
160
180
  */
161
181
  public async initProject() {
162
182
  await this.syncToRemote(true);
163
- const fileExists = await plugins.smartfile.fs.fileExists(this.filePaths.metaJson);
183
+ const fileExists = await plugins.smartfile.fs.fileExists(
184
+ this.filePaths.metaJson,
185
+ );
164
186
  if (!fileExists) {
165
187
  await plugins.smartfile.memory.toFs(
166
188
  JSON.stringify({
@@ -168,7 +190,10 @@ export class Meta {
168
190
  }),
169
191
  this.filePaths.metaJson,
170
192
  );
171
- logger.log(`success`, `created a new .meta.json in directory ${this.cwd}`);
193
+ logger.log(
194
+ `success`,
195
+ `created a new .meta.json in directory ${this.cwd}`,
196
+ );
172
197
  await plugins.smartfile.memory.toFs(
173
198
  JSON.stringify({
174
199
  name: this.dirName,
@@ -176,9 +201,15 @@ export class Meta {
176
201
  }),
177
202
  this.filePaths.packageJson,
178
203
  );
179
- logger.log(`success`, `created a new package.json in directory ${this.cwd}`);
204
+ logger.log(
205
+ `success`,
206
+ `created a new package.json in directory ${this.cwd}`,
207
+ );
180
208
  } else {
181
- logger.log(`error`, `directory ${this.cwd} already has a .metaJson file. Doing nothing.`);
209
+ logger.log(
210
+ `error`,
211
+ `directory ${this.cwd} already has a .metaJson file. Doing nothing.`,
212
+ );
182
213
  }
183
214
  await this.smartshellInstance.exec(
184
215
  `cd ${this.cwd} && git add -A && git commit -m "feat(project): init meta project for ${this.dirName}"`,
@@ -195,7 +226,9 @@ export class Meta {
195
226
  const existingProject = this.metaRepoData.projects[projectNameArg];
196
227
 
197
228
  if (existingProject) {
198
- throw new Error('Project already exists! Please remove it first before adding it again.');
229
+ throw new Error(
230
+ 'Project already exists! Please remove it first before adding it again.',
231
+ );
199
232
  }
200
233
 
201
234
  this.metaRepoData.projects[projectNameArg] = gitUrlArg;
@@ -217,7 +250,10 @@ export class Meta {
217
250
  const existingProject = this.metaRepoData.projects[projectNameArg];
218
251
 
219
252
  if (!existingProject) {
220
- logger.log('error', `Project ${projectNameArg} does not exist! So it cannot be removed`);
253
+ logger.log(
254
+ 'error',
255
+ `Project ${projectNameArg} does not exist! So it cannot be removed`,
256
+ );
221
257
  return;
222
258
  }
223
259
 
@@ -228,7 +264,9 @@ export class Meta {
228
264
  await this.writeToDisk();
229
265
 
230
266
  logger.log('info', 'removing directory from cwd');
231
- await plugins.smartfile.fs.remove(plugins.path.join(paths.cwd, projectNameArg));
267
+ await plugins.smartfile.fs.remove(
268
+ plugins.path.join(paths.cwd, projectNameArg),
269
+ );
232
270
  await this.updateLocalRepos();
233
271
  }
234
272
  }
@@ -16,7 +16,9 @@ export let run = () => {
16
16
  * create a new project with 'gitzone template [template]'
17
17
  the following templates exist: ${(() => {
18
18
  let projects = `\n`;
19
- for (const template of plugins.smartfile.fs.listFoldersSync(paths.templatesDir)) {
19
+ for (const template of plugins.smartfile.fs.listFoldersSync(
20
+ paths.templatesDir,
21
+ )) {
20
22
  projects += ` - ${template}\n`;
21
23
  }
22
24
  return projects;
@@ -15,7 +15,9 @@ export const run = async (argvArg: any) => {
15
15
  });
16
16
 
17
17
  await smartshellInstance.execStrict(`cd ${paths.cwd} && git checkout master`);
18
- await smartshellInstance.execStrict(`cd ${paths.cwd} && git pull origin master`);
18
+ await smartshellInstance.execStrict(
19
+ `cd ${paths.cwd} && git pull origin master`,
20
+ );
19
21
  await smartshellInstance.execStrict(`cd ${paths.cwd} && npm ci`);
20
22
 
21
23
  await provideNoGitFiles();
@@ -16,7 +16,9 @@ export const isTemplate = async (templateNameArg: string) => {
16
16
 
17
17
  export const getTemplate = async (templateNameArg: string) => {
18
18
  if (isTemplate(templateNameArg)) {
19
- const localScafTemplate = new plugins.smartscaf.ScafTemplate(getTemplatePath(templateNameArg));
19
+ const localScafTemplate = new plugins.smartscaf.ScafTemplate(
20
+ getTemplatePath(templateNameArg),
21
+ );
20
22
  await localScafTemplate.readTemplateFromDir();
21
23
  return localScafTemplate;
22
24
  } else {
@@ -32,7 +34,8 @@ export const run = async (argvArg: any) => {
32
34
  const answerBucket = await smartinteract.askQuestion({
33
35
  type: 'list',
34
36
  default: 'npm',
35
- message: 'What template do you want to scaffold? (Only showing mpost common options)',
37
+ message:
38
+ 'What template do you want to scaffold? (Only showing mpost common options)',
36
39
  name: 'templateName',
37
40
  choices: ['npm', 'service', 'wcc', 'website'],
38
41
  });