@git.zone/cli 1.9.95

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 (190) hide show
  1. package/assets/templates/ci_default/.gitea/workflows/default_nottags.yaml +66 -0
  2. package/assets/templates/ci_default/.gitea/workflows/default_tags.yaml +124 -0
  3. package/assets/templates/ci_default_gitlab/.gitlab-ci.yml +128 -0
  4. package/assets/templates/ci_default_private/.gitea/workflows/default_nottags.yaml +66 -0
  5. package/assets/templates/ci_default_private/.gitea/workflows/default_tags.yaml +124 -0
  6. package/assets/templates/ci_default_private_gitlab/.gitlab-ci.yml +133 -0
  7. package/assets/templates/ci_docker/.gitea/workflows/docker_nottags.yaml +71 -0
  8. package/assets/templates/ci_docker/.gitea/workflows/docker_tags.yaml +106 -0
  9. package/assets/templates/ci_docker_gitlab/.gitlab-ci.yml +107 -0
  10. package/assets/templates/cli/cli.child.ts +4 -0
  11. package/assets/templates/cli/cli.js +4 -0
  12. package/assets/templates/cli/cli.ts.js +5 -0
  13. package/assets/templates/dockerfile_service/Dockerfile +46 -0
  14. package/assets/templates/dockerfile_service/dockerignore +4 -0
  15. package/assets/templates/gitignore/_gitignore +23 -0
  16. package/assets/templates/license_mit/license +19 -0
  17. package/assets/templates/meta/.meta.json +3 -0
  18. package/assets/templates/meta/.smartscaf.yml +5 -0
  19. package/assets/templates/meta/package.json +11 -0
  20. package/assets/templates/npm/.package.json +28 -0
  21. package/assets/templates/npm/.smartscaf.yml +24 -0
  22. package/assets/templates/npm/test/test.ts +8 -0
  23. package/assets/templates/npm/ts/index.ts +3 -0
  24. package/assets/templates/npm/ts/some.plugins.ts +7 -0
  25. package/assets/templates/npmextra/npmextra.json +18 -0
  26. package/assets/templates/readme/readme.md +5 -0
  27. package/assets/templates/service/.package.json +34 -0
  28. package/assets/templates/service/.smartscaf.yml +21 -0
  29. package/assets/templates/service/npmextra.json +24 -0
  30. package/assets/templates/service/ts/00_commitinfo_data.ts +8 -0
  31. package/assets/templates/service/ts/index.ts +4 -0
  32. package/assets/templates/service/ts/some.classes.some.db.ts +30 -0
  33. package/assets/templates/service/ts/some.classes.some.ts +27 -0
  34. package/assets/templates/service/ts/some.paths.ts +9 -0
  35. package/assets/templates/service/ts/some.plugins.ts +25 -0
  36. package/assets/templates/tsconfig_update/tsconfig.json +14 -0
  37. package/assets/templates/vscode/.vscode/launch.json +11 -0
  38. package/assets/templates/vscode/.vscode/settings.json +26 -0
  39. package/assets/templates/wcc/.package.json +47 -0
  40. package/assets/templates/wcc/.smartscaf.yml +20 -0
  41. package/assets/templates/wcc/ts_web/elements/first-element.ts +47 -0
  42. package/assets/templates/wcc/ts_web/elements/index.ts +1 -0
  43. package/assets/templates/wcc/ts_web/index.ts +1 -0
  44. package/assets/templates/wcc/ts_web/pages/index.ts +2 -0
  45. package/assets/templates/wcc/ts_web/pages/page1.ts +5 -0
  46. package/assets/templates/wcc/ts_web/pages/page2.ts +5 -0
  47. package/assets/templates/wcc_update/html/index.html +25 -0
  48. package/assets/templates/wcc_update/html/index.ts +10 -0
  49. package/assets/templates/website/.package.json +40 -0
  50. package/assets/templates/website/.smartscaf.yml +17 -0
  51. package/assets/templates/website/Dockerfile +3 -0
  52. package/assets/templates/website/npmextra.json +24 -0
  53. package/assets/templates/website/qenv.yml +1 -0
  54. package/assets/templates/website/readme.md +1 -0
  55. package/assets/templates/website/ts/ffb.paths.ts +7 -0
  56. package/assets/templates/website/ts/ffb.plugins.ts +14 -0
  57. package/assets/templates/website/ts/index.ts +12 -0
  58. package/assets/templates/website/ts_web/elements/header.ts +62 -0
  59. package/assets/templates/website/ts_web/index.ts +63 -0
  60. package/assets/templates/website_update/html/index.html +110 -0
  61. package/cli.js +4 -0
  62. package/dist_ts/00_commitinfo_data.d.ts +8 -0
  63. package/dist_ts/00_commitinfo_data.js +9 -0
  64. package/dist_ts/classes.gitzoneconfig.d.ts +31 -0
  65. package/dist_ts/classes.gitzoneconfig.js +21 -0
  66. package/dist_ts/classes.project.d.ts +11 -0
  67. package/dist_ts/classes.project.js +23 -0
  68. package/dist_ts/gitzone.cli.d.ts +1 -0
  69. package/dist_ts/gitzone.cli.js +82 -0
  70. package/dist_ts/gitzone.config.d.ts +28 -0
  71. package/dist_ts/gitzone.config.js +21 -0
  72. package/dist_ts/gitzone.logging.d.ts +2 -0
  73. package/dist_ts/gitzone.logging.js +14 -0
  74. package/dist_ts/gitzone.monitor.d.ts +1 -0
  75. package/dist_ts/gitzone.monitor.js +2 -0
  76. package/dist_ts/gitzone.paths.d.ts +4 -0
  77. package/dist_ts/gitzone.paths.js +6 -0
  78. package/dist_ts/gitzone.plugins.d.ts +10 -0
  79. package/dist_ts/gitzone.plugins.js +11 -0
  80. package/dist_ts/index.d.ts +1 -0
  81. package/dist_ts/index.js +10 -0
  82. package/dist_ts/mod_audit/index.d.ts +1 -0
  83. package/dist_ts/mod_audit/index.js +2 -0
  84. package/dist_ts/mod_commit/index.d.ts +1 -0
  85. package/dist_ts/mod_commit/index.js +68 -0
  86. package/dist_ts/mod_commit/mod.plugins.d.ts +5 -0
  87. package/dist_ts/mod_commit/mod.plugins.js +6 -0
  88. package/dist_ts/mod_deprecate/index.d.ts +1 -0
  89. package/dist_ts/mod_deprecate/index.js +34 -0
  90. package/dist_ts/mod_deprecate/mod.plugins.d.ts +4 -0
  91. package/dist_ts/mod_deprecate/mod.plugins.js +5 -0
  92. package/dist_ts/mod_format/format.classes.project.d.ts +8 -0
  93. package/dist_ts/mod_format/format.classes.project.js +20 -0
  94. package/dist_ts/mod_format/format.cleanup.d.ts +2 -0
  95. package/dist_ts/mod_format/format.cleanup.js +18 -0
  96. package/dist_ts/mod_format/format.copy.d.ts +2 -0
  97. package/dist_ts/mod_format/format.copy.js +5 -0
  98. package/dist_ts/mod_format/format.gitignore.d.ts +2 -0
  99. package/dist_ts/mod_format/format.gitignore.js +19 -0
  100. package/dist_ts/mod_format/format.license.d.ts +2 -0
  101. package/dist_ts/mod_format/format.license.js +23 -0
  102. package/dist_ts/mod_format/format.npmextra.d.ts +5 -0
  103. package/dist_ts/mod_format/format.npmextra.js +59 -0
  104. package/dist_ts/mod_format/format.packagejson.d.ts +2 -0
  105. package/dist_ts/mod_format/format.packagejson.js +104 -0
  106. package/dist_ts/mod_format/format.prettier.d.ts +2 -0
  107. package/dist_ts/mod_format/format.prettier.js +51 -0
  108. package/dist_ts/mod_format/format.readme.d.ts +2 -0
  109. package/dist_ts/mod_format/format.readme.js +40 -0
  110. package/dist_ts/mod_format/format.templates.d.ts +5 -0
  111. package/dist_ts/mod_format/format.templates.js +67 -0
  112. package/dist_ts/mod_format/index.d.ts +1 -0
  113. package/dist_ts/mod_format/index.js +30 -0
  114. package/dist_ts/mod_format/mod.plugins.d.ts +11 -0
  115. package/dist_ts/mod_format/mod.plugins.js +12 -0
  116. package/dist_ts/mod_helpers/index.d.ts +1 -0
  117. package/dist_ts/mod_helpers/index.js +10 -0
  118. package/dist_ts/mod_helpers/mod.plugins.d.ts +3 -0
  119. package/dist_ts/mod_helpers/mod.plugins.js +4 -0
  120. package/dist_ts/mod_meta/index.d.ts +1 -0
  121. package/dist_ts/mod_meta/index.js +25 -0
  122. package/dist_ts/mod_meta/meta.classes.meta.d.ts +53 -0
  123. package/dist_ts/mod_meta/meta.classes.meta.js +174 -0
  124. package/dist_ts/mod_meta/meta.interfaces.d.ts +5 -0
  125. package/dist_ts/mod_meta/meta.interfaces.js +2 -0
  126. package/dist_ts/mod_meta/meta.plugins.d.ts +6 -0
  127. package/dist_ts/mod_meta/meta.plugins.js +7 -0
  128. package/dist_ts/mod_open/index.d.ts +1 -0
  129. package/dist_ts/mod_open/index.js +12 -0
  130. package/dist_ts/mod_open/mod.plugins.d.ts +4 -0
  131. package/dist_ts/mod_open/mod.plugins.js +5 -0
  132. package/dist_ts/mod_standard/index.d.ts +1 -0
  133. package/dist_ts/mod_standard/index.js +25 -0
  134. package/dist_ts/mod_standard/mod.plugins.d.ts +3 -0
  135. package/dist_ts/mod_standard/mod.plugins.js +4 -0
  136. package/dist_ts/mod_start/index.d.ts +6 -0
  137. package/dist_ts/mod_start/index.js +22 -0
  138. package/dist_ts/mod_start/mod.plugins.d.ts +3 -0
  139. package/dist_ts/mod_start/mod.plugins.js +5 -0
  140. package/dist_ts/mod_template/index.d.ts +8 -0
  141. package/dist_ts/mod_template/index.js +47 -0
  142. package/dist_ts/mod_template/mod.plugins.d.ts +5 -0
  143. package/dist_ts/mod_template/mod.plugins.js +6 -0
  144. package/dist_ts/paths.d.ts +4 -0
  145. package/dist_ts/paths.js +6 -0
  146. package/dist_ts/plugins.d.ts +11 -0
  147. package/dist_ts/plugins.js +11 -0
  148. package/license +19 -0
  149. package/npmextra.json +34 -0
  150. package/package.json +107 -0
  151. package/readme.hints.md +1 -0
  152. package/readme.md +207 -0
  153. package/ts/00_commitinfo_data.ts +8 -0
  154. package/ts/classes.gitzoneconfig.ts +47 -0
  155. package/ts/classes.project.ts +28 -0
  156. package/ts/gitzone.cli.ts +101 -0
  157. package/ts/gitzone.logging.ts +15 -0
  158. package/ts/index.ts +9 -0
  159. package/ts/mod_audit/index.ts +1 -0
  160. package/ts/mod_commit/index.ts +73 -0
  161. package/ts/mod_commit/mod.plugins.ts +7 -0
  162. package/ts/mod_deprecate/index.ts +37 -0
  163. package/ts/mod_deprecate/mod.plugins.ts +6 -0
  164. package/ts/mod_format/format.cleanup.ts +19 -0
  165. package/ts/mod_format/format.copy.ts +6 -0
  166. package/ts/mod_format/format.gitignore.ts +21 -0
  167. package/ts/mod_format/format.license.ts +24 -0
  168. package/ts/mod_format/format.npmextra.ts +70 -0
  169. package/ts/mod_format/format.packagejson.ts +120 -0
  170. package/ts/mod_format/format.prettier.ts +58 -0
  171. package/ts/mod_format/format.readme.ts +47 -0
  172. package/ts/mod_format/format.templates.ts +71 -0
  173. package/ts/mod_format/index.ts +38 -0
  174. package/ts/mod_format/mod.plugins.ts +13 -0
  175. package/ts/mod_helpers/index.ts +10 -0
  176. package/ts/mod_helpers/mod.plugins.ts +5 -0
  177. package/ts/mod_meta/index.ts +26 -0
  178. package/ts/mod_meta/meta.classes.meta.ts +234 -0
  179. package/ts/mod_meta/meta.interfaces.ts +3 -0
  180. package/ts/mod_meta/meta.plugins.ts +8 -0
  181. package/ts/mod_open/index.ts +15 -0
  182. package/ts/mod_open/mod.plugins.ts +5 -0
  183. package/ts/mod_standard/index.ts +29 -0
  184. package/ts/mod_standard/mod.plugins.ts +4 -0
  185. package/ts/mod_start/index.ts +26 -0
  186. package/ts/mod_start/mod.plugins.ts +6 -0
  187. package/ts/mod_template/index.ts +52 -0
  188. package/ts/mod_template/mod.plugins.ts +7 -0
  189. package/ts/paths.ts +9 -0
  190. package/ts/plugins.ts +21 -0
@@ -0,0 +1,70 @@
1
+ import * as plugins from './mod.plugins.js';
2
+ import * as paths from '../paths.js';
3
+ import * as gulpFunction from '@push.rocks/gulp-function';
4
+ import { Project } from '../classes.project.js';
5
+
6
+ /**
7
+ * runs the npmextra file checking
8
+ */
9
+ export const run = async (projectArg: Project) => {
10
+ const formatSmartstream = new plugins.smartstream.StreamWrapper([
11
+ plugins.smartgulp.src([`npmextra.json`]),
12
+ gulpFunction.forEach(async (fileArg: plugins.smartfile.SmartFile) => {
13
+ const fileString = fileArg.contents.toString();
14
+ const npmextraJson = JSON.parse(fileString);
15
+
16
+ if (!npmextraJson.gitzone) {
17
+ npmextraJson.gitzone = {};
18
+ }
19
+
20
+ const expectedRepoInformation: string[] = [
21
+ 'projectType',
22
+ 'module.githost',
23
+ 'module.gitscope',
24
+ 'module.gitrepo',
25
+ 'module.description',
26
+ 'module.npmPackagename',
27
+ 'module.license',
28
+ ];
29
+
30
+ const interactInstance = new plugins.smartinteract.SmartInteract();
31
+ for (const expectedRepoInformationItem of expectedRepoInformation) {
32
+ if (!plugins.smartobject.smartGet(npmextraJson.gitzone, expectedRepoInformationItem)) {
33
+ interactInstance.addQuestions([
34
+ {
35
+ message: `What is the value of ${expectedRepoInformationItem}`,
36
+ name: expectedRepoInformationItem,
37
+ type: 'input',
38
+ default: 'undefined variable',
39
+ },
40
+ ]);
41
+ }
42
+ }
43
+
44
+ const answerbucket = await interactInstance.runQueue();
45
+ for (const expectedRepoInformationItem of expectedRepoInformation) {
46
+ const cliProvidedValue = answerbucket.getAnswerFor(expectedRepoInformationItem);
47
+ if (cliProvidedValue) {
48
+ plugins.smartobject.smartAdd(
49
+ npmextraJson.gitzone,
50
+ expectedRepoInformationItem,
51
+ cliProvidedValue
52
+ );
53
+ }
54
+ }
55
+
56
+ // delete obsolete
57
+ // tbd
58
+
59
+ if (!npmextraJson.npmci) {
60
+ npmextraJson.npmci = {};
61
+ }
62
+
63
+ fileArg.setContentsFromString(JSON.stringify(npmextraJson, null, 2));
64
+ }),
65
+ plugins.smartgulp.replace(),
66
+ ]);
67
+ await formatSmartstream.run().catch((error) => {
68
+ console.log(error);
69
+ });
70
+ };
@@ -0,0 +1,120 @@
1
+ import * as plugins from './mod.plugins.js';
2
+ import * as paths from '../paths.js';
3
+ import * as gulpFunction from '@push.rocks/gulp-function';
4
+ import { Project } from '../classes.project.js';
5
+
6
+ import { logger } from '../gitzone.logging.js';
7
+
8
+ /**
9
+ * ensures a certain dependency
10
+ */
11
+ const ensureDependency = async (
12
+ packageJsonObjectArg: any,
13
+ position: 'dep' | 'devDep' | 'everywhere',
14
+ constraint: 'exclude' | 'include' | 'latest',
15
+ dependencyArg: string
16
+ ) => {};
17
+
18
+ export const run = async (projectArg: Project) => {
19
+ const formatStreamWrapper = new plugins.smartstream.StreamWrapper([
20
+ plugins.smartgulp.src([`package.json`]),
21
+ gulpFunction.forEach(async (fileArg: plugins.smartfile.SmartFile) => {
22
+ const npmextraConfig = new plugins.npmextra.Npmextra(paths.cwd);
23
+ const gitzoneData: any = npmextraConfig.dataFor('gitzone', {});
24
+ const fileString = fileArg.contents.toString();
25
+ const packageJson = JSON.parse(fileString);
26
+
27
+ // metadata
28
+ packageJson.repository = {
29
+ "type": "git",
30
+ "url": `git+https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}.git`
31
+ };
32
+ packageJson.bugs = {
33
+ "url": `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}/issues`
34
+ },
35
+ packageJson.homepage = `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}#readme`;
36
+
37
+
38
+ // Check for module type
39
+ if (!packageJson.type) {
40
+ logger.log('info', `setting packageJson.type to "module"`);
41
+ packageJson.type = 'module';
42
+ }
43
+
44
+ // Check for private or public
45
+ if (packageJson.private !== undefined) {
46
+ logger.log('info', 'Success -> found private/public info in package.json!');
47
+ } else {
48
+ logger.log('error', 'found no private boolean! Setting it to private for now!');
49
+ packageJson.private = true;
50
+ }
51
+
52
+ // Check for license
53
+ if (packageJson.license) {
54
+ logger.log('info', 'Success -> found license in package.json!');
55
+ } else {
56
+ logger.log('error', 'found no license! Setting it to UNLICENSED for now!');
57
+ packageJson.license = 'UNLICENSED';
58
+ }
59
+
60
+ // Check for build script
61
+ if (packageJson.scripts.build) {
62
+ logger.log('info', 'Success -> found build script in package.json!');
63
+ } else {
64
+ logger.log('error', 'found no build script! Putting a placeholder there for now!');
65
+ packageJson.scripts.build = `echo "Not needed for now"`;
66
+ }
67
+
68
+ // Check for buildDocs script
69
+ if (!packageJson.scripts.buildDocs) {
70
+ logger.log('info', 'found no buildDocs script! Putting tsdoc script there now.');
71
+ packageJson.scripts.buildDocs = `tsdoc`;
72
+ }
73
+
74
+ // check package.json
75
+ if (!packageJson.main) {
76
+ logger.log('error', 'no "main" property');
77
+ process.exit(0);
78
+ }
79
+ if (!packageJson.typings) {
80
+ logger.log('error', 'no "typings" property');
81
+ process.exit(0);
82
+ }
83
+ if (!packageJson.browserslist) {
84
+ packageJson.browserslist = ['last 1 chrome versions'];
85
+ }
86
+ if (!packageJson.main.includes('dist_') || !packageJson.typings.includes('dist_')) {
87
+ logger.log('error', 'check packagesJson main and typings');
88
+ process.exit(0);
89
+ }
90
+
91
+ // check for files
92
+ packageJson.files = [
93
+ 'ts/**/*',
94
+ 'ts_web/**/*',
95
+ 'dist/**/*',
96
+ 'dist_*/**/*',
97
+ 'dist_ts/**/*',
98
+ 'dist_ts_web/**/*',
99
+ 'assets/**/*',
100
+ 'cli.js',
101
+ 'npmextra.json',
102
+ 'readme.md',
103
+ ];
104
+
105
+ // check for dependencies
106
+ await ensureDependency(packageJson, 'devDep', 'latest', '@push.rocks/tapbundle');
107
+ await ensureDependency(packageJson, 'devDep', 'latest', '@git.zone/tstest');
108
+ await ensureDependency(packageJson, 'devDep', 'latest', '@git.zone/tsbuild');
109
+
110
+ // exclude
111
+ // TODO
112
+
113
+ fileArg.setContentsFromString(JSON.stringify(packageJson, null, 2));
114
+ }),
115
+ plugins.smartgulp.replace(),
116
+ ]);
117
+ await formatStreamWrapper.run().catch((error) => {
118
+ console.log(error);
119
+ });
120
+ };
@@ -0,0 +1,58 @@
1
+ import * as plugins from './mod.plugins.js';
2
+ import prettier from 'prettier';
3
+ import { Project } from '../classes.project.js';
4
+
5
+ import { logger } from '../gitzone.logging.js';
6
+
7
+ const prettierDefaultTypeScriptConfig: prettier.Options = {
8
+ printWidth: 100,
9
+ parser: 'typescript',
10
+ singleQuote: true,
11
+ };
12
+
13
+ const prettierDefaultMarkdownConfig: prettier.Options = {
14
+ singleQuote: true,
15
+ printWidth: 100,
16
+ parser: 'markdown',
17
+ };
18
+
19
+ const filesToFormat = [`ts/**/*.ts`, `test/**/*.ts`, `readme.md`, `docs/**/*.md`];
20
+
21
+ const choosePrettierConfig = (fileArg: plugins.smartfile.SmartFile) => {
22
+ switch (fileArg.parsedPath.ext) {
23
+ case '.ts':
24
+ return prettierDefaultTypeScriptConfig;
25
+ case '.md':
26
+ return prettierDefaultMarkdownConfig;
27
+ default:
28
+ return {};
29
+ }
30
+ };
31
+
32
+ const prettierTypeScriptPipestop = plugins.through2.obj(
33
+ async (fileArg: plugins.smartfile.SmartFile, enc, cb) => {
34
+ const fileString = fileArg.contentBuffer.toString();
35
+ const chosenConfig = choosePrettierConfig(fileArg);
36
+ const filePasses = prettier.check(fileString, chosenConfig);
37
+ if (filePasses) {
38
+ logger.log('info', `OK! -> ${fileArg.path} passes!`);
39
+ cb(null);
40
+ } else {
41
+ logger.log('info', `${fileArg.path} is being reformated!`);
42
+ const formatedFileString = await prettier.format(fileString, chosenConfig);
43
+ fileArg.setContentsFromString(formatedFileString);
44
+ cb(null, fileArg);
45
+ }
46
+ }
47
+ );
48
+
49
+ export const run = async (projectArg: Project) => {
50
+ const formatStreamWrapper = new plugins.smartstream.StreamWrapper([
51
+ plugins.smartgulp.src(filesToFormat),
52
+ prettierTypeScriptPipestop,
53
+ plugins.smartgulp.replace(),
54
+ ]);
55
+ await formatStreamWrapper.run().catch((error) => {
56
+ console.log(error);
57
+ });
58
+ };
@@ -0,0 +1,47 @@
1
+ import * as plugins from './mod.plugins.js';
2
+ import * as paths from '../paths.js';
3
+ import { GitzoneConfig } from '../classes.gitzoneconfig.js';
4
+ import { Project } from '../classes.project.js';
5
+
6
+ export const run = async (projectArg: Project) => {
7
+ const readmePath = plugins.path.join(paths.cwd, 'readme.md');
8
+ const readmeFile = await plugins.smartfile.SmartFile.fromFilePath(readmePath);
9
+
10
+ // lets do our transformation
11
+
12
+ let usageInfo: string = '';
13
+ const gitzoneConfig = await GitzoneConfig.fromCwd();
14
+
15
+ if (readmeFile) {
16
+ const readmeFileString = readmeFile.contentBuffer.toString();
17
+ const stringArray1 = readmeFileString.split('## Usage\n');
18
+ if (stringArray1[1]) {
19
+ const stringArray2 = stringArray1[1].split(
20
+ '\nFor further information read the linked docs at the top of this readme.'
21
+ );
22
+ const stringArray3 = stringArray2[0].split('\n\n## Contribution');
23
+ usageInfo = stringArray3[0];
24
+ }
25
+ }
26
+
27
+ if (gitzoneConfig.data.module && gitzoneConfig.data.module.license === 'MIT') {
28
+ usageInfo +=
29
+ '\n\n## Contribution\n\n' +
30
+ 'We are always happy for code contributions. If you are not the code contributing type that is ok. ' +
31
+ 'Still, maintaining Open Source repositories takes considerable time and thought. ' +
32
+ 'If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: ' +
33
+ 'You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)\n';
34
+ }
35
+
36
+ const templateModule = await import('../mod_template/index.js');
37
+ const readmeTemplate = await templateModule.getTemplate('readme');
38
+ console.log(gitzoneConfig.data);
39
+ await readmeTemplate.supplyVariables({
40
+ module: {
41
+ ...gitzoneConfig.data.module,
42
+ },
43
+ usageInfo,
44
+ });
45
+ await readmeTemplate.askCliForMissingVariables();
46
+ await readmeTemplate.writeToDisk(paths.cwd);
47
+ };
@@ -0,0 +1,71 @@
1
+ import * as plugins from './mod.plugins.js';
2
+ import * as paths from '../paths.js';
3
+
4
+ import { logger } from '../gitzone.logging.js';
5
+ import { Project } from '../classes.project.js';
6
+
7
+ /**
8
+ * takes care of updating files from templates
9
+ */
10
+ export const run = async (project: Project) => {
11
+ const templateModule = await import('../mod_template/index.js');
12
+
13
+ // update tslint
14
+ // getting template
15
+ const tslintTemplate = await templateModule.getTemplate('tslint');
16
+ await tslintTemplate.writeToDisk(paths.cwd);
17
+ logger.log('info', 'Updated tslint.json!');
18
+
19
+ // update vscode
20
+ const vscodeTemplate = await templateModule.getTemplate('vscode');
21
+ await vscodeTemplate.writeToDisk(paths.cwd);
22
+ logger.log('info', `Updated vscode template!`);
23
+
24
+ // update gitlab ci and Dockerfile
25
+ switch (project.gitzoneConfig.data.projectType) {
26
+ case 'npm':
27
+ case 'wcc':
28
+ if (project.gitzoneConfig.data.npmciOptions.npmAccessLevel === 'public') {
29
+ const ciTemplateDefault = await templateModule.getTemplate('ci_default');
30
+ ciTemplateDefault.writeToDisk(paths.cwd);
31
+ } else {
32
+ const ciTemplateDefault = await templateModule.getTemplate('ci_default_private');
33
+ ciTemplateDefault.writeToDisk(paths.cwd);
34
+ }
35
+ logger.log('info', 'Updated .gitlabci.yml!');
36
+ break;
37
+ case 'service':
38
+ case 'website':
39
+ const ciTemplateDocker = await templateModule.getTemplate('ci_docker');
40
+ await ciTemplateDocker.writeToDisk(paths.cwd);
41
+ logger.log('info', 'Updated .gitlabci.yml!');
42
+
43
+ // lets care about docker
44
+ const dockerTemplate = await templateModule.getTemplate('dockerfile_service');
45
+ dockerTemplate.writeToDisk(paths.cwd);
46
+ logger.log('info', 'Updated Dockerfile!');
47
+
48
+ // lets care about cli
49
+ const cliTemplate = await templateModule.getTemplate('cli');
50
+ await cliTemplate.writeToDisk(paths.cwd);
51
+ logger.log('info', 'Updated cli.ts.js and cli.js!');
52
+ break;
53
+ default:
54
+ break;
55
+ }
56
+
57
+ // update html
58
+ if (project.gitzoneConfig.data.projectType === 'website') {
59
+ const websiteUpdateTemplate = await templateModule.getTemplate('website_update');
60
+ await websiteUpdateTemplate.writeToDisk(paths.cwd);
61
+ logger.log('info', `Updated html for website!`);
62
+ } else if (project.gitzoneConfig.data.projectType === 'service') {
63
+ const websiteUpdateTemplate = await templateModule.getTemplate('service_update');
64
+ await websiteUpdateTemplate.writeToDisk(paths.cwd);
65
+ logger.log('info', `Updated html for element template!`);
66
+ } else if (project.gitzoneConfig.data.projectType === 'wcc') {
67
+ const wccUpdateTemplate = await templateModule.getTemplate('wcc_update');
68
+ await wccUpdateTemplate.writeToDisk(paths.cwd);
69
+ logger.log('info', `Updated html for wcc template!`);
70
+ }
71
+ };
@@ -0,0 +1,38 @@
1
+ import * as plugins from './mod.plugins.js';
2
+ import { Project } from '../classes.project.js';
3
+
4
+ export let run = async (write: boolean = true): Promise<any> => {
5
+ const project = await Project.fromCwd();
6
+
7
+ // cleanup
8
+ const formatCleanup = await import('./format.cleanup.js');
9
+ await formatCleanup.run(project);
10
+
11
+ // npmextra
12
+ const formatNpmextra = await import('./format.npmextra.js');
13
+ await formatNpmextra.run(project);
14
+
15
+ // license
16
+ const formatLicense = await import('./format.license.js');
17
+ await formatLicense.run(project);
18
+
19
+ // format package.json
20
+ const formatPackageJson = await import('./format.packagejson.js');
21
+ await formatPackageJson.run(project);
22
+
23
+ // format .gitlab-ci.yml
24
+ const formatTemplates = await import('./format.templates.js');
25
+ await formatTemplates.run(project);
26
+
27
+ // format .gitignore
28
+ const formatGitignore = await import('./format.gitignore.js');
29
+ await formatGitignore.run(project);
30
+
31
+ // format TypeScript
32
+ const formatPrettier = await import('./format.prettier.js');
33
+ await formatPrettier.run(project);
34
+
35
+ // format readme.md
36
+ const formatReadme = await import('./format.readme.js');
37
+ // await formatReadme.run();
38
+ };
@@ -0,0 +1,13 @@
1
+ export * from '../plugins.js';
2
+
3
+ import * as lik from '@push.rocks/lik';
4
+ import * as smartfile from '@push.rocks/smartfile';
5
+ import * as smartgulp from '@push.rocks/smartgulp';
6
+ import * as smartinteract from '@push.rocks/smartinteract';
7
+ import * as smartlegal from '@push.rocks/smartlegal';
8
+ import * as smartobject from '@push.rocks/smartobject';
9
+ import * as smartnpm from '@push.rocks/smartnpm';
10
+ import * as smartstream from '@push.rocks/smartstream';
11
+ import * as through2 from 'through2';
12
+
13
+ export { lik, smartfile, smartgulp, smartinteract, smartlegal, smartobject, smartnpm, smartstream, through2 };
@@ -0,0 +1,10 @@
1
+ import * as plugins from './mod.plugins.js';
2
+
3
+ export const run = async (argvArg) => {
4
+ const command = argvArg._[1];
5
+ switch (command) {
6
+ case 'shortid':
7
+ console.log('Here is new shortid');
8
+ console.log(plugins.smartunique.shortId());
9
+ }
10
+ };
@@ -0,0 +1,5 @@
1
+ export * from '../plugins.js';
2
+
3
+ import * as smartunique from '@push.rocks/smartunique';
4
+
5
+ export { smartunique };
@@ -0,0 +1,26 @@
1
+ import * as plugins from './meta.plugins.js';
2
+ import * as paths from '../paths.js';
3
+ import { Meta } from './meta.classes.meta.js';
4
+ import { logger } from '../gitzone.logging.js';
5
+
6
+ export const run = async (argvArg) => {
7
+ const command = argvArg._[1];
8
+ const metaInstance = new Meta(paths.cwd);
9
+
10
+ switch (true) {
11
+ case command === 'update':
12
+ await metaInstance.updateLocalRepos();
13
+ break;
14
+ case command === 'add':
15
+ await metaInstance.addProject(argvArg._[2], argvArg._[3]);
16
+ break;
17
+ case command === 'remove':
18
+ await metaInstance.removeProject(argvArg._[2]);
19
+ break;
20
+ case command === 'init':
21
+ await metaInstance.initProject();
22
+ break;
23
+ default:
24
+ logger.log('error', `You have to specify a command!`);
25
+ }
26
+ };