Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
f34718bfb3 | |||
0db0b17e0d | |||
7c4dffd142 | |||
d716364cb0 | |||
53cb139277 | |||
5c0834aa48 | |||
a2df347ee3 | |||
632bdd7847 | |||
5135be478f | |||
5fc9bb0245 | |||
a3b7a33bc2 | |||
51fd699965 | |||
45020805cb | |||
c9e384567e | |||
152b436096 | |||
99f88236cb | |||
af0cb494fd | |||
dc43deece9 | |||
2361bfcad4 | |||
bb1e0a5679 | |||
5463f6e459 | |||
49729595b6 | |||
3f5a2f92d4 | |||
53eb47672c | |||
7e0a00324b | |||
bf0d6c81b2 | |||
20d34b998e | |||
6140b2b25b | |||
3524e5fa08 |
32
changelog.md
Normal file
32
changelog.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-06-23 - 1.9.111 - fix(dependencies)
|
||||||
|
Update @git.zone/tsdoc to version 1.3.4
|
||||||
|
- Updated @git.zone/tsdoc in package.json from version 1.3.2 to 1.3.4.
|
||||||
|
- Updated pnpm-lock.yaml to reflect the @git.zone/tsdoc version bump.
|
||||||
|
- Ensured all relevant dependencies and transitive dependencies reflect the new @git.zone/tsdoc version.
|
||||||
|
|
||||||
|
|
||||||
|
## 2024-06-23 - 1.9.110 - fix(changelog)
|
||||||
|
Remove outdated entries and adjust formatting in changelog
|
||||||
|
- Removed outdated entries from changelog
|
||||||
|
- Adjusted changelog formatting for clarity
|
||||||
|
|
||||||
|
|
||||||
|
## 2023-xx-xx - 1.9.109 - dependencies
|
||||||
|
Updated @git.zone/tsdoc dependency to version 1.3.2.
|
||||||
|
|
||||||
|
- Ensured compatibility with the latest version of @git.zone/tsdoc.
|
||||||
|
|
||||||
|
## 2023-xx-xx - 1.9.103 - logging
|
||||||
|
Optimized logger instantiation and configuration.
|
||||||
|
|
||||||
|
- Improved application performance by refining logger setup.
|
||||||
|
- Reduced initialization time for logging components.
|
||||||
|
|
||||||
|
## 2023-xx-xx - 1.9.102 - metadata
|
||||||
|
Ensured accurate project metadata in package.json.
|
||||||
|
|
||||||
|
- Corrected metadata fields to better reflect project details.
|
||||||
|
- Updated author and version information for consistency.
|
||||||
|
|
13
package.json
13
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@git.zone/cli",
|
"name": "@git.zone/cli",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "1.9.97",
|
"version": "1.9.111",
|
||||||
"description": "A CLI toolbelt to streamline local development cycles by using various gitzone utilities.",
|
"description": "A CLI toolbelt to streamline local development cycles by using various gitzone utilities.",
|
||||||
"main": "dist_ts/index.ts",
|
"main": "dist_ts/index.ts",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
@ -11,7 +11,7 @@
|
|||||||
"gzone": "./cli.js"
|
"gzone": "./cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npm run clean && npm run prepareTest && npm run testCli && npm run testCommit && npm run testDeprecate && npm run testVersion && npm run testReadme && npm run testFormat && npm run testUpdate && npm run testTemplateNpm && npm run testTemplateLit) && rm -rf test",
|
"test": "(npm run clean && npm run prepareTest && npm run testCli && npm run testFormat && npm run testCommit && npm run testDeprecate && npm run testVersion && npm run testReadme && npm run testUpdate && npm run testTemplateNpm && npm run testTemplateLit) && rm -rf test",
|
||||||
"build": "(tsbuild --web --allowimplicitany)",
|
"build": "(tsbuild --web --allowimplicitany)",
|
||||||
"clean": "(rm -rf test/)",
|
"clean": "(rm -rf test/)",
|
||||||
"prepareTest": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)",
|
"prepareTest": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)",
|
||||||
@ -30,7 +30,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://code.foss.global/git.zone/cli.git"
|
"url": "https://code.foss.global/git.zone/cli.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"CLI",
|
"CLI",
|
||||||
@ -48,17 +48,18 @@
|
|||||||
"author": "Task Venture Capital GmbH",
|
"author": "Task Venture Capital GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/gitzone/private/gitzone/issues"
|
"url": "https://code.foss.global/git.zone/cli/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://pages.foss.global/git.zone/cli",
|
"homepage": "https://pages.foss.global/git.zone/cli",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.80",
|
"@git.zone/tsbuild": "^2.1.80",
|
||||||
"@git.zone/tsrun": "^1.2.46",
|
"@git.zone/tsrun": "^1.2.46",
|
||||||
"@git.zone/tstest": "^1.0.90",
|
"@git.zone/tstest": "^1.0.90",
|
||||||
"@types/node": "^20.14.7"
|
"@types/node": "^20.14.8"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/commitinfo": "^1.0.11",
|
"@git.zone/tsdoc": "^1.3.4",
|
||||||
|
"@push.rocks/commitinfo": "^1.0.12",
|
||||||
"@push.rocks/early": "^4.0.4",
|
"@push.rocks/early": "^4.0.4",
|
||||||
"@push.rocks/gulp-function": "^3.0.7",
|
"@push.rocks/gulp-function": "^3.0.7",
|
||||||
"@push.rocks/lik": "^6.0.15",
|
"@push.rocks/lik": "^6.0.15",
|
||||||
|
547
pnpm-lock.yaml
generated
547
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
1
test
1
test
Submodule test deleted from 0b89443584
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* autocreated commitinfo by @pushrocks/commitinfo
|
* autocreated commitinfo by @push.rocks/commitinfo
|
||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/cli',
|
name: '@git.zone/cli',
|
||||||
version: '1.9.97',
|
version: '1.9.111',
|
||||||
description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.'
|
description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.'
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,6 @@
|
|||||||
|
import { commitinfo } from '@push.rocks/commitinfo';
|
||||||
import * as plugins from './plugins.js';
|
import * as plugins from './plugins.js';
|
||||||
|
|
||||||
export const logger = new plugins.smartlog.Smartlog({
|
export const logger = plugins.smartlog.Smartlog.createForCommitinfo(commitinfo);
|
||||||
minimumLogLevel: 'silly',
|
|
||||||
logContext: {
|
|
||||||
company: 'Task Venture Capital GmbH',
|
|
||||||
companyunit: 'Lossless Cloud',
|
|
||||||
containerName: 'local',
|
|
||||||
environment: 'local',
|
|
||||||
runtime: 'node',
|
|
||||||
zone: 'gitzone',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
||||||
|
@ -5,6 +5,19 @@ import * as paths from '../paths.js';
|
|||||||
import { logger } from '../gitzone.logging.js';
|
import { logger } from '../gitzone.logging.js';
|
||||||
|
|
||||||
export const run = async (argvArg: any) => {
|
export const run = async (argvArg: any) => {
|
||||||
|
logger.log('info', `gathering facts...`);
|
||||||
|
const aidoc = new plugins.tsdoc.AiDoc();
|
||||||
|
await aidoc.start();
|
||||||
|
|
||||||
|
const nextCommitObject = await aidoc.buildNextCommitObject(paths.cwd);
|
||||||
|
|
||||||
|
logger.log('info', `---------
|
||||||
|
Next recommended commit would be:
|
||||||
|
===========
|
||||||
|
-> ${nextCommitObject.recommendedNextVersion}:
|
||||||
|
-> ${nextCommitObject.recommendedNextVersionLevel}(${nextCommitObject.recommendedNextVersionScope}): ${nextCommitObject.recommendedNextVersionMessage}
|
||||||
|
===========
|
||||||
|
`);
|
||||||
const commitInteract = new plugins.smartinteract.SmartInteract();
|
const commitInteract = new plugins.smartinteract.SmartInteract();
|
||||||
commitInteract.addQuestions([
|
commitInteract.addQuestions([
|
||||||
{
|
{
|
||||||
@ -12,19 +25,19 @@ export const run = async (argvArg: any) => {
|
|||||||
name: `commitType`,
|
name: `commitType`,
|
||||||
message: `Choose TYPE of the commit:`,
|
message: `Choose TYPE of the commit:`,
|
||||||
choices: [`fix`, `feat`, `BREAKING CHANGE`],
|
choices: [`fix`, `feat`, `BREAKING CHANGE`],
|
||||||
default: `fix`,
|
default: nextCommitObject.recommendedNextVersionLevel,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
name: `commitScope`,
|
name: `commitScope`,
|
||||||
message: `What is the SCOPE of the commit:`,
|
message: `What is the SCOPE of the commit:`,
|
||||||
default: `core`,
|
default: nextCommitObject.recommendedNextVersionScope,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: `input`,
|
type: `input`,
|
||||||
name: `commitDescription`,
|
name: `commitDescription`,
|
||||||
message: `What is the DESCRIPTION of the commit?`,
|
message: `What is the DESCRIPTION of the commit?`,
|
||||||
default: `update`,
|
default: nextCommitObject.recommendedNextVersionMessage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
@ -52,10 +65,19 @@ export const run = async (argvArg: any) => {
|
|||||||
sourceFilePaths: [],
|
sourceFilePaths: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.log('info', `Baking commitinfo into code`);
|
logger.log('info', `Baking commitinfo into code ...`);
|
||||||
const commitInfo = new plugins.commitinfo.CommitInfo(paths.cwd, commitVersionType);
|
const commitInfo = new plugins.commitinfo.CommitInfo(paths.cwd, commitVersionType);
|
||||||
await commitInfo.writeIntoPotentialDirs();
|
await commitInfo.writeIntoPotentialDirs();
|
||||||
|
|
||||||
|
logger.log('info', `Writing changelog.md ...`);
|
||||||
|
let changelog = nextCommitObject.changelog;
|
||||||
|
changelog = changelog.replaceAll('{{nextVersion}}', (await commitInfo.getNextPlannedVersion()).versionString);
|
||||||
|
changelog = changelog.replaceAll('{{nextVersionScope}}', `${await answerBucket.getAnswerFor('commitType')}(${await answerBucket.getAnswerFor('commitScope')})`);
|
||||||
|
changelog = changelog.replaceAll('{{nextVersionMessage}}', nextCommitObject.recommendedNextVersionMessage);
|
||||||
|
changelog = changelog.replaceAll('{{nextVersionDetails}}', '- ' + nextCommitObject.recommendedNextVersionDetails.join('\n- '));
|
||||||
|
|
||||||
|
await plugins.smartfile.memory.toFs(changelog, plugins.path.join(paths.cwd, `changelog.md`));
|
||||||
|
|
||||||
logger.log('info', `Staging files for commit:`);
|
logger.log('info', `Staging files for commit:`);
|
||||||
await smartshellInstance.exec(`git add -A`);
|
await smartshellInstance.exec(`git add -A`);
|
||||||
await smartshellInstance.exec(`git commit -m "${commitString}"`);
|
await smartshellInstance.exec(`git commit -m "${commitString}"`);
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
export * from '../plugins.js';
|
export * from '../plugins.js';
|
||||||
|
|
||||||
import * as commitinfo from '@push.rocks/commitinfo';
|
import * as commitinfo from '@push.rocks/commitinfo';
|
||||||
|
import * as smartfile from '@push.rocks/smartfile';
|
||||||
import * as smartinteract from '@push.rocks/smartinteract';
|
import * as smartinteract from '@push.rocks/smartinteract';
|
||||||
import * as smartshell from '@push.rocks/smartshell';
|
import * as smartshell from '@push.rocks/smartshell';
|
||||||
|
|
||||||
export { commitinfo, smartinteract, smartshell };
|
import * as tsdoc from '@git.zone/tsdoc';
|
||||||
|
|
||||||
|
export { commitinfo, smartfile, smartinteract, smartshell, tsdoc };
|
||||||
|
@ -11,6 +11,11 @@ const incompatibleLicenses: string[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const run = async (projectArg: Project) => {
|
export const run = async (projectArg: Project) => {
|
||||||
|
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 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) {
|
if (licenseCheckResult.failingModules.length === 0) {
|
||||||
|
@ -1,47 +1,25 @@
|
|||||||
import * as plugins from './mod.plugins.js';
|
import * as plugins from './mod.plugins.js';
|
||||||
import * as paths from '../paths.js';
|
import * as paths from '../paths.js';
|
||||||
import { GitzoneConfig } from '../classes.gitzoneconfig.js';
|
|
||||||
import { Project } from '../classes.project.js';
|
|
||||||
|
|
||||||
export const run = async (projectArg: Project) => {
|
export const run = async () => {
|
||||||
const readmePath = plugins.path.join(paths.cwd, 'readme.md');
|
const readmePath = plugins.path.join(paths.cwd, 'readme.md');
|
||||||
const readmeFile = await plugins.smartfile.SmartFile.fromFilePath(readmePath);
|
const readmeHintsPath = plugins.path.join(paths.cwd, 'readme.hints.md');
|
||||||
|
|
||||||
// lets do our transformation
|
// Check and initialize readme.md if it doesn't exist
|
||||||
|
const readmeExists = await plugins.smartfile.fs.fileExists(readmePath);
|
||||||
let usageInfo: string = '';
|
if (!readmeExists) {
|
||||||
const gitzoneConfig = await GitzoneConfig.fromCwd();
|
await plugins.smartfile.fs.toFs('# Project Readme\n\nThis is the initial readme file.', readmePath);
|
||||||
|
console.log('Initialized readme.md');
|
||||||
if (readmeFile) {
|
} else {
|
||||||
const readmeFileString = readmeFile.contentBuffer.toString();
|
console.log('readme.md already exists');
|
||||||
const stringArray1 = readmeFileString.split('## Usage\n');
|
|
||||||
if (stringArray1[1]) {
|
|
||||||
const stringArray2 = stringArray1[1].split(
|
|
||||||
'\nFor further information read the linked docs at the top of this readme.'
|
|
||||||
);
|
|
||||||
const stringArray3 = stringArray2[0].split('\n\n## Contribution');
|
|
||||||
usageInfo = stringArray3[0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gitzoneConfig.data.module && gitzoneConfig.data.module.license === 'MIT') {
|
// Check and initialize readme.hints.md if it doesn't exist
|
||||||
usageInfo +=
|
const readmeHintsExists = await plugins.smartfile.fs.fileExists(readmeHintsPath);
|
||||||
'\n\n## Contribution\n\n' +
|
if (!readmeHintsExists) {
|
||||||
'We are always happy for code contributions. If you are not the code contributing type that is ok. ' +
|
await plugins.smartfile.fs.toFs('# Project Readme Hints\n\nThis is the initial readme hints file.', readmeHintsPath);
|
||||||
'Still, maintaining Open Source repositories takes considerable time and thought. ' +
|
console.log('Initialized readme.hints.md');
|
||||||
'If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: ' +
|
} else {
|
||||||
'You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)\n';
|
console.log('readme.hints.md already exists');
|
||||||
}
|
}
|
||||||
|
};
|
||||||
const templateModule = await import('../mod_template/index.js');
|
|
||||||
const readmeTemplate = await templateModule.getTemplate('readme');
|
|
||||||
console.log(gitzoneConfig.data);
|
|
||||||
await readmeTemplate.supplyVariables({
|
|
||||||
module: {
|
|
||||||
...gitzoneConfig.data.module,
|
|
||||||
},
|
|
||||||
usageInfo,
|
|
||||||
});
|
|
||||||
await readmeTemplate.askCliForMissingVariables();
|
|
||||||
await readmeTemplate.writeToDisk(paths.cwd);
|
|
||||||
};
|
|
@ -34,5 +34,5 @@ export let run = async (write: boolean = true): Promise<any> => {
|
|||||||
|
|
||||||
// format readme.md
|
// format readme.md
|
||||||
const formatReadme = await import('./format.readme.js');
|
const formatReadme = await import('./format.readme.js');
|
||||||
// await formatReadme.run();
|
await formatReadme.run();
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user