Skip to content

Commit

Permalink
feat: enhanced messaging in doc:generate:atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
catalandres committed Jan 3, 2024
1 parent c3e6281 commit a0dd00f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
13 changes: 3 additions & 10 deletions messages/doc.generate.atlas.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# summary

Summary of a command.
Generate documentation from the contents of your local project.

# description

More information about a command. Don't repeat the summary.

# flags.name.summary

Description of a flag.

# flags.name.description

More information about a flag. Don't repeat the summary.
You must run this command from within a project.
Note that the default behavior is to create an XLSX spreadsheet with a sheet for each supported metadata type. This will change in an upcoming release.

# examples

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.1.0",
"dependencies": {
"@oclif/core": "^3.15.1",
"@salesforce/core": "^6",
"@salesforce/core": "^6.1.3",
"@salesforce/sf-plugins-core": "^5.0.5",
"@types/shelljs": "^0.8.15",
"@types/xml2js": "^0.4.14",
Expand Down Expand Up @@ -71,9 +71,9 @@
"docs": "sf-docs",
"format": "wireit",
"lint": "wireit",
"prepare": "sf-install && yarn build",
"postpack": "shx rm -f oclif.manifest.json oclif.lock",
"prepack": "sf-prepack",
"prepare": "sf-install && yarn build",
"test": "wireit",
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
"test:only": "wireit",
Expand Down Expand Up @@ -155,7 +155,7 @@
"output": []
},
"test:command-reference": {
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
"command": "ts-node \"./bin/dev.js\" commandreference:generate --erroronwarnings",
"files": [
"src/**/*.ts",
"messages/**",
Expand All @@ -166,7 +166,7 @@
]
},
"test:deprecation-policy": {
"command": "\"./bin/dev\" snapshot:compare",
"command": "ts-node \"./bin/dev.js\" snapshot:compare",
"files": [
"src/**/*.ts"
],
Expand All @@ -176,7 +176,7 @@
]
},
"test:json-schema": {
"command": "\"./bin/dev\" schema:compare",
"command": "ts-node \"./bin/dev.js\" schema:compare",
"files": [
"src/**/*.ts",
"schemas"
Expand Down
9 changes: 6 additions & 3 deletions src/commands/doc/generate/atlas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { readdir } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import { SfCommand } from '@salesforce/sf-plugins-core';
import { SfProject, Messages, NamedPackageDir } from '@salesforce/core';
import { ExcelWriter } from '../../../shared/xlsx/ExcelWriter.js';
import { XlsxWriter } from '../../../shared/xlsx/XlsxWriter.js';

import { Atlas } from '../../../shared/metadata/Atlas.js';

Expand Down Expand Up @@ -36,8 +36,11 @@ export default class DocGenerateAtlas extends SfCommand<DocGenerateAtlasResult>
const projectPath = SfProject.getInstance().getPath();
const allProjectFiles = await getAllProjectFiles(projectPath);
const atlas = new Atlas(allProjectFiles);
const xlWriter = new ExcelWriter(atlas.album, projectPath);
const xlsxFilename = await xlWriter.writeXlsx();
const xlsxWriter = new XlsxWriter(atlas.album, projectPath);
const xlsxFilename = await xlsxWriter.writeXlsx();

// TODO - move this text to the messages file
this.info('Output written to ' + xlsxFilename);

return {
path: xlsxFilename,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as ExcelJS from 'exceljs';
import { Extended, Album } from '../metadata/file/index.js';
import { ALL_TABLES } from './index.js';

export class ExcelWriter {
export class XlsxWriter {
private album: Album;
private projectPath: string;

Expand Down

0 comments on commit a0dd00f

Please sign in to comment.