Compare commits

...

43 Commits

Author SHA1 Message Date
fe30629ff9 1.9.116
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 23:07:31 +02:00
05bf7aa9d6 fix(dependencies): Update @git.zone/tsdoc to version 1.3.5 2024-06-23 23:07:30 +02:00
847798e9c9 1.9.115
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 22:57:10 +02:00
b797fca1fc fix(format): Fixed formatting issues across multiple TypeScript files. 2024-06-23 22:57:09 +02:00
ae46afdee6 1.9.114
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 22:54:46 +02:00
ceddc23423 fix(mod_commit): Remove extra new lines in changelog 2024-06-23 22:54:45 +02:00
4f8ca3fe5e 1.9.113
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 22:54:12 +02:00
947fe781d8 fix(core): Update changelog formatting and remove outdated entries 2024-06-23 22:54:11 +02:00
1c7fbb073d 1.9.112
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 22:52:41 +02:00
9b05252045 fix(changelog): Remove outdated changelog entries and update formatting 2024-06-23 22:52:40 +02:00
f34718bfb3 1.9.111
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 22:49:13 +02:00
0db0b17e0d fix(dependencies): Update @git.zone/tsdoc to version 1.3.4 2024-06-23 22:49:12 +02:00
7c4dffd142 1.9.110
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 20:00:55 +02:00
d716364cb0 fix(changelog): Remove outdated entries and adjust formatting in changelog 2024-06-23 20:00:55 +02:00
53cb139277 1.9.109
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 19:58:19 +02:00
5c0834aa48 fix(dependencies): Update @git.zone/tsdoc dependency to version 1.3.2 2024-06-23 19:58:18 +02:00
a2df347ee3 1.9.108
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 19:53:30 +02:00
632bdd7847 fix(changelog): Remove placeholder entries and adjust formatting in changelog. 2024-06-23 19:53:29 +02:00
5135be478f 1.9.107
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 19:51:18 +02:00
5fc9bb0245 fix(dependencies): Updated @git.zone/tsdoc from version 1.3.0 to 1.3.1 2024-06-23 19:51:17 +02:00
a3b7a33bc2 1.9.106
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 18:41:16 +02:00
51fd699965 fix(dependencies): Updated @git.zone/tsdoc dependency from 1.2.2 to 1.3.0 in package.json and pnpm-lock.yaml. 2024-06-23 18:41:15 +02:00
45020805cb 1.9.105
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 17:45:06 +02:00
c9e384567e fix(changelog): Remove placeholder entries and adjust formatting in changelog. 2024-06-23 17:45:05 +02:00
152b436096 1.9.104
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 17:43:27 +02:00
99f88236cb fix(changelog): Fix changelog to remove placeholder entries and adjust formatting 2024-06-23 17:43:26 +02:00
af0cb494fd 1.9.103
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 17:41:51 +02:00
dc43deece9 fix(logging): Optimize logger instantiation and configuration. 2024-06-23 17:41:51 +02:00
2361bfcad4 1.9.102
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 17:13:41 +02:00
bb1e0a5679 fix(metadata): Ensure accurate project metadata in package.json 2024-06-23 17:13:40 +02:00
5463f6e459 1.9.101
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 16:48:03 +02:00
49729595b6 fix(dependencies): Updated @git.zone/tsdoc dependency version to ^1.2.2 in package.json and pnpm-lock.yaml 2024-06-23 16:48:02 +02:00
3f5a2f92d4 1.9.100
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 13:35:28 +02:00
53eb47672c fix(mod_commit): Fix variable reassignment issue in changelog writing step 2024-06-23 13:35:28 +02:00
7e0a00324b 1.9.99
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 13:30:03 +02:00
bf0d6c81b2 fix(core): update 2024-06-23 13:30:02 +02:00
20d34b998e fix(core): update 2024-06-23 13:26:51 +02:00
6140b2b25b 1.9.98
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 09:25:28 +02:00
3524e5fa08 fix(core): update 2024-06-23 09:25:27 +02:00
2a56dbcba1 1.9.97
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-23 09:22:43 +02:00
41361bab44 fix(core): update 2024-06-23 09:22:42 +02:00
eec728054c 1.9.96
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-06-22 13:11:31 +02:00
4ea69ec740 fix(core): update 2024-06-22 13:11:30 +02:00
25 changed files with 745 additions and 265 deletions

View File

@ -0,0 +1,66 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
IMAGE: code.foss.global/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build

View File

@ -0,0 +1,124 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
IMAGE: code.foss.global/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

58
changelog.md Normal file
View File

@ -0,0 +1,58 @@
# Changelog
## 2024-06-23 - 1.9.116 - fix(dependencies)
Update @git.zone/tsdoc to version 1.3.5
- Updated the @git.zone/tsdoc dependency in package.json and pnpm-lock.yaml from version 1.3.4 to 1.3.5
- Removed the outdated changelog.md file.
```
## 2024-06-23 - 1.9.114 - fix(format)
Fixed formatting issues across multiple TypeScript files.
## 2024-06-23 - 1.9.113 - fix(mod_commit)
Remove extra new lines in changelog.
## 2024-06-23 - 1.9.112 - fix(core)
Update changelog formatting and remove outdated entries.
## 2024-06-23 - 1.9.111 - fix(changelog)
Remove outdated changelog entries and update formatting.
## 2024-06-23 - 1.9.110 - fix(dependencies)
Update @git.zone/tsdoc to version 1.3.4.
## 2024-06-23 - 1.9.109 - fix(changelog)
Remove outdated entries and adjust formatting in changelog.
## 2024-06-23 - 1.9.108 - fix(dependencies)
Update @git.zone/tsdoc dependency to version 1.3.2.
## 2024-06-23 - 1.9.107 - fix(changelog)
Remove placeholder entries and adjust formatting in changelog.
## 2024-06-23 - 1.9.106 - fix(dependencies)
Updated @git.zone/tsdoc from version 1.3.0 to 1.3.1.
## 2024-06-23 - 1.9.105 - fix(dependencies)
Updated @git.zone/tsdoc dependency from 1.2.2 to 1.3.0 in package.json and pnpm-lock.yaml.
## 2024-06-23 - 1.9.104 - fix(changelog)
Remove placeholder entries and adjust formatting in changelog.
## 2024-06-23 - 1.9.103 - fix(changelog)
Fix changelog to remove placeholder entries and adjust formatting.
## 2024-06-23 - 1.9.102 - fix(logging)
Optimize logger instantiation and configuration.
## 2024-06-23 - 1.9.101 - fix(metadata)
Ensure accurate project metadata in package.json.
## 2024-06-23 - 1.9.100 - fix(dependencies)
Updated @git.zone/tsdoc dependency version to ^1.2.2 in package.json and pnpm-lock.yaml.
## 2024-06-23 - 1.9.99 - fix(mod_commit)
Fix variable reassignment issue in changelog writing step.
```

View File

@ -1,7 +1,7 @@
{ {
"name": "@git.zone/cli", "name": "@git.zone/cli",
"private": false, "private": false,
"version": "1.9.95", "version": "1.9.116",
"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://gitlab.com/gitzone/private/gitzone.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://gitlab.com/gitzone/private/gitzone#readme", "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.5",
"@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

File diff suppressed because it is too large Load Diff

1
test

Submodule test deleted from 0b89443584

View File

@ -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.95', version: '1.9.116',
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.'
} }

View File

@ -17,7 +17,7 @@ export interface IGitzoneConfigData {
license: string; license: string;
projectDomain: string; projectDomain: string;
}; };
copy: {[key: string]: string} copy: { [key: string]: string };
npmciOptions: { npmciOptions: {
npmAccessLevel: 'public' | 'private'; npmAccessLevel: 'public' | 'private';
}; };

View File

@ -1,4 +1,4 @@
import * as plugins from './plugins.js' import * as plugins from './plugins.js';
import * as paths from './paths.js'; import * as paths from './paths.js';
import { GitzoneConfig } from './classes.gitzoneconfig.js'; import { GitzoneConfig } from './classes.gitzoneconfig.js';

View File

@ -15,7 +15,7 @@ export let run = async () => {
await smartupdateInstance.check( await smartupdateInstance.check(
'gitzone', 'gitzone',
projectInfo.npm.version, projectInfo.npm.version,
'http://gitzone.gitlab.io/gitzone/changelog.html' 'http://gitzone.gitlab.io/gitzone/changelog.html',
); );
console.log('---------------------------------------------'); console.log('---------------------------------------------');
gitzoneSmartcli.addVersion(projectInfo.npm.version); gitzoneSmartcli.addVersion(projectInfo.npm.version);

View File

@ -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());

View File

@ -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}"`);

View File

@ -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 };

View File

@ -3,4 +3,4 @@ import * as plugins from '../plugins.js';
export const run = async (projectArg: Project) => { export const run = async (projectArg: Project) => {
const gitzoneConfig = await projectArg.gitzoneConfig; const gitzoneConfig = await projectArg.gitzoneConfig;
} };

View File

@ -4,15 +4,21 @@ import { Project } from '../classes.project.js';
import { logger } from '../gitzone.logging.js'; import { logger } from '../gitzone.logging.js';
const incompatibleLicenses: string[] = [ const incompatibleLicenses: string[] = ['AGPL', 'GPL', 'SSPL'];
"AGPL",
"GPL",
"SSPL",
];
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) {
logger.log('info', 'Success -> licenses passed!'); logger.log('info', 'Success -> licenses passed!');
} else { } else {

View File

@ -48,7 +48,7 @@ export const run = async (projectArg: Project) => {
plugins.smartobject.smartAdd( plugins.smartobject.smartAdd(
npmextraJson.gitzone, npmextraJson.gitzone,
expectedRepoInformationItem, expectedRepoInformationItem,
cliProvidedValue cliProvidedValue,
); );
} }
} }

View File

@ -12,7 +12,7 @@ const ensureDependency = async (
packageJsonObjectArg: any, packageJsonObjectArg: any,
position: 'dep' | 'devDep' | 'everywhere', position: 'dep' | 'devDep' | 'everywhere',
constraint: 'exclude' | 'include' | 'latest', constraint: 'exclude' | 'include' | 'latest',
dependencyArg: string dependencyArg: string,
) => {}; ) => {};
export const run = async (projectArg: Project) => { export const run = async (projectArg: Project) => {
@ -26,14 +26,13 @@ export const run = async (projectArg: Project) => {
// metadata // metadata
packageJson.repository = { packageJson.repository = {
"type": "git", type: 'git',
"url": `git+https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}.git` url: `git+https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}.git`,
}; };
packageJson.bugs = { (packageJson.bugs = {
"url": `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}/issues` 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.homepage = `https://${gitzoneData.module.githost}/${gitzoneData.module.gitscope}/${gitzoneData.module.gitrepo}#readme`);
// Check for module type // Check for module type
if (!packageJson.type) { if (!packageJson.type) {

View File

@ -33,7 +33,7 @@ const prettierTypeScriptPipestop = plugins.through2.obj(
async (fileArg: plugins.smartfile.SmartFile, enc, cb) => { async (fileArg: plugins.smartfile.SmartFile, enc, cb) => {
const fileString = fileArg.contentBuffer.toString(); const fileString = fileArg.contentBuffer.toString();
const chosenConfig = choosePrettierConfig(fileArg); const chosenConfig = choosePrettierConfig(fileArg);
const filePasses = prettier.check(fileString, chosenConfig); const filePasses = await prettier.check(fileString, chosenConfig);
if (filePasses) { if (filePasses) {
logger.log('info', `OK! -> ${fileArg.path} passes!`); logger.log('info', `OK! -> ${fileArg.path} passes!`);
cb(null); cb(null);
@ -43,7 +43,7 @@ const prettierTypeScriptPipestop = plugins.through2.obj(
fileArg.setContentsFromString(formatedFileString); fileArg.setContentsFromString(formatedFileString);
cb(null, fileArg); cb(null, fileArg);
} }
} },
); );
export const run = async (projectArg: Project) => { export const run = async (projectArg: Project) => {

View File

@ -1,47 +1,31 @@
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.',
if (readmeFile) { readmePath,
const readmeFileString = readmeFile.contentBuffer.toString(); );
const stringArray1 = readmeFileString.split('## Usage\n'); console.log('Initialized readme.md');
if (stringArray1[1]) { } else {
const stringArray2 = stringArray1[1].split( console.log('readme.md already exists');
'\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(
'Still, maintaining Open Source repositories takes considerable time and thought. ' + '# Project Readme Hints\n\nThis is the initial readme hints file.',
'If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: ' + readmeHintsPath,
'You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)\n'; );
console.log('Initialized readme.hints.md');
} else {
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);
}; };

View File

@ -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();
}; };

View File

@ -10,4 +10,14 @@ import * as smartnpm from '@push.rocks/smartnpm';
import * as smartstream from '@push.rocks/smartstream'; import * as smartstream from '@push.rocks/smartstream';
import * as through2 from 'through2'; 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,
};

View File

@ -73,7 +73,7 @@ export class Meta {
// write .meta.json to disk // write .meta.json to disk
plugins.smartfile.memory.toFsSync( plugins.smartfile.memory.toFsSync(
JSON.stringify(this.metaRepoData, null, 2), JSON.stringify(this.metaRepoData, null, 2),
this.filePaths.metaJson this.filePaths.metaJson,
); );
// write .gitignore to disk // write .gitignore to disk
plugins.smartfile.memory.toFsSync(await this.generateGitignore(), this.filePaths.gitIgnore); plugins.smartfile.memory.toFsSync(await this.generateGitignore(), this.filePaths.gitIgnore);
@ -104,12 +104,12 @@ export class Meta {
if ( if (
preExistingFolderArg !== '.git' && preExistingFolderArg !== '.git' &&
!Object.keys(projects).find((projectFolder) => !Object.keys(projects).find((projectFolder) =>
projectFolder.startsWith(preExistingFolderArg) projectFolder.startsWith(preExistingFolderArg),
) )
) { ) {
const response = await plugins.smartinteraction.SmartInteract.getCliConfirmation( const response = await plugins.smartinteraction.SmartInteract.getCliConfirmation(
`Do you want to delete superfluous directory >>${preExistingFolderArg}<< ?`, `Do you want to delete superfluous directory >>${preExistingFolderArg}<< ?`,
true true,
); );
if (response) { if (response) {
logger.log('warn', `Deleting >>${preExistingFolderArg}<<!`); logger.log('warn', `Deleting >>${preExistingFolderArg}<<!`);
@ -131,7 +131,7 @@ export class Meta {
logger.log('info', `found ${missingRepos.length} missing repos`); logger.log('info', `found ${missingRepos.length} missing repos`);
for (const missingRepo of missingRepos) { for (const missingRepo of missingRepos) {
await this.smartshellInstance.exec( await this.smartshellInstance.exec(
`cd ${this.cwd} && git clone ${this.metaRepoData.projects[missingRepo]} ${missingRepo}` `cd ${this.cwd} && git clone ${this.metaRepoData.projects[missingRepo]} ${missingRepo}`,
); );
} }
@ -140,7 +140,7 @@ export class Meta {
logger.log('info', `persist changes with a git commit`); logger.log('info', `persist changes with a git commit`);
await this.smartshellInstance.exec( await this.smartshellInstance.exec(
`cd ${this.cwd} && git add -A && git commit -m "updated structure"` `cd ${this.cwd} && git add -A && git commit -m "updated structure"`,
); );
await this.syncToRemote(); await this.syncToRemote();
@ -166,7 +166,7 @@ export class Meta {
JSON.stringify({ JSON.stringify({
projects: {}, projects: {},
}), }),
this.filePaths.metaJson this.filePaths.metaJson,
); );
logger.log(`success`, `created a new .meta.json in directory ${this.cwd}`); logger.log(`success`, `created a new .meta.json in directory ${this.cwd}`);
await plugins.smartfile.memory.toFs( await plugins.smartfile.memory.toFs(
@ -174,14 +174,14 @@ export class Meta {
name: this.dirName, name: this.dirName,
version: '1.0.0', version: '1.0.0',
}), }),
this.filePaths.packageJson this.filePaths.packageJson,
); );
logger.log(`success`, `created a new package.json in directory ${this.cwd}`); logger.log(`success`, `created a new package.json in directory ${this.cwd}`);
} else { } else {
logger.log(`error`, `directory ${this.cwd} already has a .metaJson file. Doing nothing.`); logger.log(`error`, `directory ${this.cwd} already has a .metaJson file. Doing nothing.`);
} }
await this.smartshellInstance.exec( await this.smartshellInstance.exec(
`cd ${this.cwd} && git add -A && git commit -m "feat(project): init meta project for ${this.dirName}"` `cd ${this.cwd} && git add -A && git commit -m "feat(project): init meta project for ${this.dirName}"`,
); );
await this.updateLocalRepos(); await this.updateLocalRepos();
} }
@ -203,7 +203,7 @@ export class Meta {
await this.sortMetaRepoData(); await this.sortMetaRepoData();
await this.writeToDisk(); await this.writeToDisk();
await this.smartshellInstance.exec( await this.smartshellInstance.exec(
`cd ${this.cwd} && git add -A && git commit -m "feat(project): add ${projectNameArg}"` `cd ${this.cwd} && git add -A && git commit -m "feat(project): add ${projectNameArg}"`,
); );
await this.updateLocalRepos(); await this.updateLocalRepos();
} }

View File

@ -5,11 +5,11 @@ export let run = (argvArg) => {
let projectInfo = new plugins.projectinfo.ProjectInfo(paths.cwd); let projectInfo = new plugins.projectinfo.ProjectInfo(paths.cwd);
if (argvArg._[1] === 'ci') { if (argvArg._[1] === 'ci') {
plugins.smartopen.openUrl( 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') { } else if (argvArg._[1] === 'pipelines') {
plugins.smartopen.openUrl( plugins.smartopen.openUrl(
`https://gitlab.com/${projectInfo.git.gituser}/${projectInfo.git.gitrepo}/pipelines` `https://gitlab.com/${projectInfo.git.gituser}/${projectInfo.git.gitrepo}/pipelines`,
); );
} }
}; };

View File

@ -22,7 +22,7 @@ export let run = () => {
return projects; return projects;
})()} })()}
* format a project with 'gitzone format' * format a project with 'gitzone format'
` `,
); );
done.resolve(); done.resolve();
return done.promise; return done.promise;

View File

@ -2,7 +2,7 @@ import * as plugins from './plugins.js';
export let packageDir = plugins.path.join( export let packageDir = plugins.path.join(
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
'../' '../',
); );
export let assetsDir = plugins.path.join(packageDir, './assets'); export let assetsDir = plugins.path.join(packageDir, './assets');
export let templatesDir = plugins.path.join(assetsDir, 'templates'); export let templatesDir = plugins.path.join(assetsDir, 'templates');