Compare commits
20 Commits
v1.0.2
...
5414142deb
Author | SHA1 | Date | |
---|---|---|---|
5414142deb | |||
9649b3e4a8 | |||
ac28f05a23 | |||
0f9b261f3e | |||
15fa4305b9 | |||
831e0b8933 | |||
7d808972c9 | |||
e7d7ec806e | |||
2ecc541989 | |||
22dddb0e11 | |||
38c233bf06 | |||
81f943f52a | |||
8c58df37d9 | |||
f0a4c0f7dc | |||
31cfaa69b9 | |||
0d539c34e8 | |||
069265c122 | |||
7d2891fc8c | |||
8d0b58d14f | |||
e6b47a9e86 |
@ -3,10 +3,10 @@
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "commitinfo",
|
||||
"description": "bake commitinfos into code",
|
||||
"npmPackagename": "@pushrocks/commitinfo",
|
||||
"npmPackagename": "@push.rocks/commitinfo",
|
||||
"license": "MIT",
|
||||
"projectDomain": "push.rocks"
|
||||
}
|
||||
|
698
package-lock.json
generated
698
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/commitinfo",
|
||||
"version": "1.0.2",
|
||||
"name": "@push.rocks/commitinfo",
|
||||
"version": "1.0.11",
|
||||
"private": false,
|
||||
"description": "bake commitinfos into code",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -10,16 +10,15 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)"
|
||||
"build": "(tsbuild --web --allowimplicitany)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsbundle": "^1.0.78",
|
||||
"@gitzone/tstest": "^1.0.44",
|
||||
"@pushrocks/tapbundle": "^4.0.7",
|
||||
"@types/node": "^14.11.2"
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.29"
|
||||
},
|
||||
"dependencies": {},
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
],
|
||||
@ -34,5 +33,10 @@
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@pushrocks/projectinfo": "^5.0.1",
|
||||
"@pushrocks/smartfile": "^9.0.6",
|
||||
"@pushrocks/smartversion": "^3.0.2"
|
||||
}
|
||||
}
|
6851
pnpm-lock.yaml
generated
Normal file
6851
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,8 @@ import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
|
||||
import * as commitinfo from '../ts/index.js';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(commitinfo);
|
||||
const testCommitinfo = new commitinfo.CommitInfo(process.cwd(), 'patch');
|
||||
await testCommitinfo.writeIntoPotentialDirs();
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
11
ts/00_commitinfo_data.ts
Normal file
11
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const name: string = '@pushrocks/commitinfo';
|
||||
export const version: string = '1.0.11';
|
||||
export const description: string = 'bake commitinfos into code'
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/commitinfo',
|
||||
version: '1.0.11',
|
||||
description: 'bake commitinfos into code'
|
||||
}
|
@ -1,3 +1,39 @@
|
||||
import * as plugins from './commitinfo.plugins.js';
|
||||
|
||||
export class CommitInfo {}
|
||||
export class CommitInfo {
|
||||
// Instance
|
||||
public projectDir: string;
|
||||
public plannedCommitVersionTypeArg: 'patch' | 'minor' | 'major';
|
||||
public projectinfoNpmRef: plugins.projectinfo.ProjectinfoNpm;
|
||||
public smartVersionRef: plugins.smartversion.SmartVersion;
|
||||
constructor(projectDirArg: string, plannedCommitVersionTypeArg: 'patch' | 'minor' | 'major') {
|
||||
this.projectDir = projectDirArg;
|
||||
this.plannedCommitVersionTypeArg = plannedCommitVersionTypeArg;
|
||||
this.projectinfoNpmRef = new plugins.projectinfo.ProjectinfoNpm(projectDirArg);
|
||||
this.smartVersionRef = new plugins.smartversion.SmartVersion(this.projectinfoNpmRef.version);
|
||||
}
|
||||
|
||||
public async writeIntoPotentialDirs(potentialDirs: string[] = ['ts', 'ts_web']) {
|
||||
const expectedDefinitiveVersion = this.smartVersionRef.getNewVersion(
|
||||
this.plannedCommitVersionTypeArg
|
||||
);
|
||||
for (const dir of potentialDirs) {
|
||||
const dirExists = plugins.smartfile.fs.isDirectory(plugins.path.join(this.projectDir, dir));
|
||||
if (dirExists) {
|
||||
const writePath = plugins.path.join(this.projectDir, dir, '00_commitinfo_data.ts');
|
||||
await plugins.smartfile.memory.toFs(
|
||||
`/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '${this.projectinfoNpmRef.name}',
|
||||
version: '${expectedDefinitiveVersion.versionString}',
|
||||
description: '${this.projectinfoNpmRef.packageJson.description}'
|
||||
}
|
||||
`,
|
||||
writePath
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,17 @@
|
||||
const removeme = {};
|
||||
export { removeme };
|
||||
// node native
|
||||
import * as path from 'path';
|
||||
|
||||
export {
|
||||
path
|
||||
}
|
||||
|
||||
// pushrocks scope
|
||||
import * as projectinfo from '@pushrocks/projectinfo';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartversion from '@pushrocks/smartversion';
|
||||
|
||||
export {
|
||||
projectinfo,
|
||||
smartfile,
|
||||
smartversion
|
||||
}
|
||||
|
@ -1,3 +1,2 @@
|
||||
import * as plugins from './commitinfo.plugins.js';
|
||||
|
||||
export let demoExport = 'Hi there! :) This is an exported string';
|
||||
export * from './commitinfo.classes.commitinfo.js';
|
||||
export { commitinfo } from './00_commitinfo_data.js';
|
||||
|
Reference in New Issue
Block a user