diff --git a/changelog.md b/changelog.md index 75fc595..b14640d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,15 @@ # Changelog +## 2024-06-23 - 1.9.115 - fix(format) +Fixed formatting issues across multiple TypeScript files. + +- Improved code formatting in ts/00_commitinfo_data.ts +- Enhanced formatting consistency in ts/classes.gitzoneconfig.ts and ts/classes.project.ts +- Refined formatting in the gitzone SmartCLI implementation +- Updated code formatting in multiple files within the mod_format directory +- Standardized import and logging formats across project files + + ## 2024-06-23 - 1.9.114 - fix(mod_commit) Remove extra new lines in changelog @@ -68,3 +78,4 @@ fix(dependencies): Updated @git.zone/tsdoc dependency version to ^1.2.2 in packa fix(mod_commit): Fix variable reassignment issue in changelog writing step - Fixed an issue with variable reassignment in the changelog writing step. + diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 6ff04c5..05a9262 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/cli', - version: '1.9.114', + version: '1.9.115', description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.' } diff --git a/ts/classes.gitzoneconfig.ts b/ts/classes.gitzoneconfig.ts index 7c43d08..c93715b 100644 --- a/ts/classes.gitzoneconfig.ts +++ b/ts/classes.gitzoneconfig.ts @@ -17,7 +17,7 @@ export interface IGitzoneConfigData { license: string; projectDomain: string; }; - copy: {[key: string]: string} + copy: { [key: string]: string }; npmciOptions: { npmAccessLevel: 'public' | 'private'; }; diff --git a/ts/classes.project.ts b/ts/classes.project.ts index f04af36..4fc6570 100644 --- a/ts/classes.project.ts +++ b/ts/classes.project.ts @@ -1,4 +1,4 @@ -import * as plugins from './plugins.js' +import * as plugins from './plugins.js'; import * as paths from './paths.js'; import { GitzoneConfig } from './classes.gitzoneconfig.js'; diff --git a/ts/gitzone.cli.ts b/ts/gitzone.cli.ts index 9a59ee9..16e8bb2 100644 --- a/ts/gitzone.cli.ts +++ b/ts/gitzone.cli.ts @@ -15,7 +15,7 @@ export let run = async () => { await smartupdateInstance.check( 'gitzone', projectInfo.npm.version, - 'http://gitzone.gitlab.io/gitzone/changelog.html' + 'http://gitzone.gitlab.io/gitzone/changelog.html', ); console.log('---------------------------------------------'); gitzoneSmartcli.addVersion(projectInfo.npm.version); diff --git a/ts/mod_format/format.copy.ts b/ts/mod_format/format.copy.ts index ebe8b0b..b95c482 100644 --- a/ts/mod_format/format.copy.ts +++ b/ts/mod_format/format.copy.ts @@ -3,4 +3,4 @@ import * as plugins from '../plugins.js'; export const run = async (projectArg: Project) => { const gitzoneConfig = await projectArg.gitzoneConfig; -} +}; diff --git a/ts/mod_format/format.license.ts b/ts/mod_format/format.license.ts index d13ea25..fc032bc 100644 --- a/ts/mod_format/format.license.ts +++ b/ts/mod_format/format.license.ts @@ -4,20 +4,21 @@ import { Project } from '../classes.project.js'; import { logger } from '../gitzone.logging.js'; -const incompatibleLicenses: string[] = [ - "AGPL", - "GPL", - "SSPL", -]; +const incompatibleLicenses: string[] = ['AGPL', 'GPL', 'SSPL']; export const run = async (projectArg: Project) => { - const nodeModulesInstalled = await plugins.smartfile.fs.isDirectory(plugins.path.join(paths.cwd, 'node_modules')); + const nodeModulesInstalled = await plugins.smartfile.fs.isDirectory( + plugins.path.join(paths.cwd, 'node_modules'), + ); if (!nodeModulesInstalled) { logger.log('warn', 'No node_modules found. Skipping license check'); return; } const licenseChecker = await plugins.smartlegal.createLicenseChecker(); - const licenseCheckResult = await licenseChecker.excludeLicenseWithinPath(paths.cwd, incompatibleLicenses); + const licenseCheckResult = await licenseChecker.excludeLicenseWithinPath( + paths.cwd, + incompatibleLicenses, + ); if (licenseCheckResult.failingModules.length === 0) { logger.log('info', 'Success -> licenses passed!'); } else { diff --git a/ts/mod_format/format.npmextra.ts b/ts/mod_format/format.npmextra.ts index 83ae5a4..f920617 100644 --- a/ts/mod_format/format.npmextra.ts +++ b/ts/mod_format/format.npmextra.ts @@ -48,7 +48,7 @@ export const run = async (projectArg: Project) => { plugins.smartobject.smartAdd( npmextraJson.gitzone, expectedRepoInformationItem, - cliProvidedValue + cliProvidedValue, ); } } diff --git a/ts/mod_format/format.packagejson.ts b/ts/mod_format/format.packagejson.ts index d83c71f..128b9ec 100644 --- a/ts/mod_format/format.packagejson.ts +++ b/ts/mod_format/format.packagejson.ts @@ -12,7 +12,7 @@ const ensureDependency = async ( packageJsonObjectArg: any, position: 'dep' | 'devDep' | 'everywhere', constraint: 'exclude' | 'include' | 'latest', - dependencyArg: string + dependencyArg: string, ) => {}; export const run = async (projectArg: Project) => { @@ -26,14 +26,13 @@ export const run = async (projectArg: Project) => { // metadata packageJson.repository = { - "type": "git", - "url": `git+https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}.git` + type: 'git', + url: `git+https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}.git`, }; - packageJson.bugs = { - "url": `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}/issues` - }, - packageJson.homepage = `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}#readme`; - + (packageJson.bugs = { + url: `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}/issues`, + }), + (packageJson.homepage = `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}#readme`); // Check for module type if (!packageJson.type) { diff --git a/ts/mod_format/format.prettier.ts b/ts/mod_format/format.prettier.ts index 5f2d261..5c1397e 100644 --- a/ts/mod_format/format.prettier.ts +++ b/ts/mod_format/format.prettier.ts @@ -43,7 +43,7 @@ const prettierTypeScriptPipestop = plugins.through2.obj( fileArg.setContentsFromString(formatedFileString); cb(null, fileArg); } - } + }, ); export const run = async (projectArg: Project) => { diff --git a/ts/mod_format/format.readme.ts b/ts/mod_format/format.readme.ts index c628da8..261596c 100644 --- a/ts/mod_format/format.readme.ts +++ b/ts/mod_format/format.readme.ts @@ -8,7 +8,10 @@ export const run = async () => { // Check and initialize readme.md if it doesn't exist const readmeExists = await plugins.smartfile.fs.fileExists(readmePath); if (!readmeExists) { - await plugins.smartfile.fs.toFs('# Project Readme\n\nThis is the initial readme file.', readmePath); + await plugins.smartfile.fs.toFs( + '# Project Readme\n\nThis is the initial readme file.', + readmePath, + ); console.log('Initialized readme.md'); } else { console.log('readme.md already exists'); @@ -17,9 +20,12 @@ export const run = async () => { // Check and initialize readme.hints.md if it doesn't exist const readmeHintsExists = await plugins.smartfile.fs.fileExists(readmeHintsPath); if (!readmeHintsExists) { - await plugins.smartfile.fs.toFs('# Project Readme Hints\n\nThis is the initial readme hints file.', readmeHintsPath); + await plugins.smartfile.fs.toFs( + '# Project Readme Hints\n\nThis is the initial readme hints file.', + readmeHintsPath, + ); console.log('Initialized readme.hints.md'); } else { console.log('readme.hints.md already exists'); } -}; \ No newline at end of file +}; diff --git a/ts/mod_format/mod.plugins.ts b/ts/mod_format/mod.plugins.ts index 2d9efb0..3cec326 100644 --- a/ts/mod_format/mod.plugins.ts +++ b/ts/mod_format/mod.plugins.ts @@ -10,4 +10,14 @@ import * as smartnpm from '@push.rocks/smartnpm'; import * as smartstream from '@push.rocks/smartstream'; import * as through2 from 'through2'; -export { lik, smartfile, smartgulp, smartinteract, smartlegal, smartobject, smartnpm, smartstream, through2 }; +export { + lik, + smartfile, + smartgulp, + smartinteract, + smartlegal, + smartobject, + smartnpm, + smartstream, + through2, +}; diff --git a/ts/mod_meta/meta.classes.meta.ts b/ts/mod_meta/meta.classes.meta.ts index 781c7ed..71a9483 100644 --- a/ts/mod_meta/meta.classes.meta.ts +++ b/ts/mod_meta/meta.classes.meta.ts @@ -73,7 +73,7 @@ export class Meta { // write .meta.json to disk plugins.smartfile.memory.toFsSync( JSON.stringify(this.metaRepoData, null, 2), - this.filePaths.metaJson + this.filePaths.metaJson, ); // write .gitignore to disk plugins.smartfile.memory.toFsSync(await this.generateGitignore(), this.filePaths.gitIgnore); @@ -104,12 +104,12 @@ export class Meta { if ( preExistingFolderArg !== '.git' && !Object.keys(projects).find((projectFolder) => - projectFolder.startsWith(preExistingFolderArg) + projectFolder.startsWith(preExistingFolderArg), ) ) { const response = await plugins.smartinteraction.SmartInteract.getCliConfirmation( `Do you want to delete superfluous directory >>${preExistingFolderArg}<< ?`, - true + true, ); if (response) { logger.log('warn', `Deleting >>${preExistingFolderArg}< { let projectInfo = new plugins.projectinfo.ProjectInfo(paths.cwd); if (argvArg._[1] === 'ci') { plugins.smartopen.openUrl( - `https://gitlab.com/${projectInfo.git.gituser}/${projectInfo.git.gitrepo}/settings/ci_cd` + `https://gitlab.com/${projectInfo.git.gituser}/${projectInfo.git.gitrepo}/settings/ci_cd`, ); } else if (argvArg._[1] === 'pipelines') { plugins.smartopen.openUrl( - `https://gitlab.com/${projectInfo.git.gituser}/${projectInfo.git.gitrepo}/pipelines` + `https://gitlab.com/${projectInfo.git.gituser}/${projectInfo.git.gitrepo}/pipelines`, ); } }; diff --git a/ts/mod_standard/index.ts b/ts/mod_standard/index.ts index bb7bd0f..cc51bd4 100644 --- a/ts/mod_standard/index.ts +++ b/ts/mod_standard/index.ts @@ -22,7 +22,7 @@ export let run = () => { return projects; })()} * format a project with 'gitzone format' - ` + `, ); done.resolve(); return done.promise; diff --git a/ts/paths.ts b/ts/paths.ts index 482fce9..af0b264 100644 --- a/ts/paths.ts +++ b/ts/paths.ts @@ -2,7 +2,7 @@ import * as plugins from './plugins.js'; export let packageDir = plugins.path.join( plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), - '../' + '../', ); export let assetsDir = plugins.path.join(packageDir, './assets'); export let templatesDir = plugins.path.join(assetsDir, 'templates');