fix(core): update
This commit is contained in:
3
ts/00_commitinfo_data.ts
Normal file
3
ts/00_commitinfo_data.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
export const version = '1.0.3';
|
||||
|
@@ -1,3 +1,33 @@
|
||||
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(
|
||||
`
|
||||
export const version = '${expectedDefinitiveVersion.versionString}';
|
||||
`,
|
||||
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 @@
|
||||
import * as plugins from './commitinfo.plugins.js';
|
||||
|
||||
export let demoExport = 'Hi there! :) This is an exported string';
|
||||
export * from './commitinfo.classes.commitinfo.js';
|
Reference in New Issue
Block a user