fix(smartconfig): migrate project metadata and config handling to .smartconfig.json
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsdoc',
|
||||
version: '2.0.1',
|
||||
version: '2.0.2',
|
||||
description: 'A comprehensive TypeScript documentation tool that leverages AI to generate and enhance project documentation, including dynamic README creation, API docs via TypeDoc, and smart commit message generation.'
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ You create project descriptions and keywords for npm packages.
|
||||
You have access to filesystem tools to explore the project.
|
||||
|
||||
IMPORTANT RULES:
|
||||
- Only READ files (package.json, npmextra.json, source files in ts/)
|
||||
- Only READ files (package.json, .smartconfig.json, source files in ts/)
|
||||
- Do NOT write, delete, or modify any files
|
||||
- Your final response must be valid JSON only
|
||||
- Description must be a clear, concise one-sentence summary
|
||||
@@ -43,7 +43,7 @@ PROJECT DIRECTORY: ${this.projectDir}
|
||||
Use the filesystem tools to explore the project and understand what it does:
|
||||
1. First, use list_directory to see the project structure
|
||||
2. Read package.json to understand the package name and current description
|
||||
3. Read npmextra.json if it exists for additional metadata
|
||||
3. Read .smartconfig.json if it exists for additional metadata
|
||||
4. Read key source files in ts/ directory to understand the implementation
|
||||
|
||||
Then generate a description and keywords based on your exploration.
|
||||
@@ -83,8 +83,8 @@ Don't wrap the JSON in \`\`\`json\`\`\` - just return the raw JSON object.
|
||||
const smartconfigJson = files.smartfilesNpmextraJSON;
|
||||
const smartconfigJsonContent = JSON.parse(smartconfigJson.contents.toString());
|
||||
|
||||
smartconfigJsonContent['@git.zone/cli'].module.description = resultObject.description;
|
||||
smartconfigJsonContent['@git.zone/cli'].module.keywords = resultObject.keywords;
|
||||
smartconfigJsonContent['gitzone'].module.description = resultObject.description;
|
||||
smartconfigJsonContent['gitzone'].module.keywords = resultObject.keywords;
|
||||
|
||||
smartconfigJson.contents = Buffer.from(JSON.stringify(smartconfigJsonContent, null, 2));
|
||||
await smartconfigJson.write();
|
||||
|
||||
@@ -27,7 +27,7 @@ export class ProjectContext {
|
||||
this.projectDir,
|
||||
);
|
||||
const smartfilesNpmextraJSON = await plugins.smartfileFactory.fromFilePath(
|
||||
plugins.path.join(this.projectDir, 'smartconfig.json'),
|
||||
plugins.path.join(this.projectDir, '.smartconfig.json'),
|
||||
this.projectDir,
|
||||
);
|
||||
const smartfilesMod = await plugins.smartfileFactory.virtualDirectoryFromPath(
|
||||
|
||||
@@ -22,9 +22,9 @@ export class Readme {
|
||||
const smartconfigJson = JSON.parse(
|
||||
(await projectContext.gatherFiles()).smartfilesNpmextraJSON.contents.toString()
|
||||
);
|
||||
const legalInfo = smartconfigJson?.['@git.zone/tsdoc']?.legal;
|
||||
const legalInfo = smartconfigJson?.['tsdoc']?.legal;
|
||||
if (!legalInfo) {
|
||||
const error = new Error(`No legal information found in smartconfig.json`);
|
||||
const error = new Error(`No legal information found in .smartconfig.json`);
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as aiDocsClasses from './aidocs_classes/index.js';
|
||||
export class AiDoc {
|
||||
private openaiToken: string;
|
||||
|
||||
public smartconfigKV: plugins.npmextra.KeyValueStore;
|
||||
public smartconfigKV: plugins.smartconfig.KeyValueStore;
|
||||
public qenvInstance: plugins.qenv.Qenv;
|
||||
public aidocInteract: plugins.smartinteract.SmartInteract;
|
||||
public model: plugins.smartai.LanguageModelV3;
|
||||
@@ -52,7 +52,7 @@ export class AiDoc {
|
||||
console.log('Migration complete: tsdoc.json -> @git.zone/tsdoc.json');
|
||||
}
|
||||
|
||||
this.smartconfigKV = new plugins.npmextra.KeyValueStore({
|
||||
this.smartconfigKV = new plugins.smartconfig.KeyValueStore({
|
||||
typeArg: 'userHomeDir',
|
||||
identityArg: '@git.zone/tsdoc',
|
||||
mandatoryKeys: ['OPENAI_TOKEN'],
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as path from 'path';
|
||||
export { path };
|
||||
|
||||
// pushrocks scope
|
||||
import * as npmextra from '@push.rocks/smartconfig';
|
||||
import * as smartconfig from '@push.rocks/smartconfig';
|
||||
import * as qenv from '@push.rocks/qenv';
|
||||
import * as smartagent from '@push.rocks/smartagent';
|
||||
import * as smartagentTools from '@push.rocks/smartagent/tools';
|
||||
@@ -22,7 +22,7 @@ import * as smartshell from '@push.rocks/smartshell';
|
||||
import * as smarttime from '@push.rocks/smarttime';
|
||||
|
||||
export {
|
||||
npmextra,
|
||||
smartconfig,
|
||||
qenv,
|
||||
smartagent,
|
||||
smartagentTools,
|
||||
|
||||
Reference in New Issue
Block a user