diff --git a/src/commands/basemaps-github/make.cog.github.ts b/src/commands/basemaps-github/make.cog.github.ts index 643fbae2..93e3537c 100644 --- a/src/commands/basemaps-github/make.cog.github.ts +++ b/src/commands/basemaps-github/make.cog.github.ts @@ -10,7 +10,7 @@ import { TileSetConfigSchema } from '@basemaps/config/build/json/parse.tile.set. import { fsa, LogType } from '@basemaps/shared'; import { DEFAULT_PRETTIER_FORMAT } from '../../utils/config.js'; -import { prettyPrint } from '../format/format.json.js'; +import { prettyPrint } from '../format/pretty.print.js'; import { createPR, GithubApi } from './github.js'; export enum Category { diff --git a/src/commands/format/format.json.ts b/src/commands/format/pretty.print.ts similarity index 90% rename from src/commands/format/format.json.ts rename to src/commands/format/pretty.print.ts index c1c92e7b..6d950106 100644 --- a/src/commands/format/format.json.ts +++ b/src/commands/format/pretty.print.ts @@ -14,9 +14,9 @@ function isJson(x: string): boolean { return search.endsWith('.json'); } -export const commandFormatJson = command({ - name: 'format-json', - description: 'Format JSON files', +export const commandPrettyPrint = command({ + name: 'pretty-print', + description: 'Pretty-print JSON files', version: CliInfo.version, args: { config, @@ -39,9 +39,9 @@ export const commandFormatJson = command({ async handler(args) { registerCli(this, args); const startTime = performance.now(); - logger.info('FormatJson:Start'); + logger.info('PrettyPrint:Start'); if (args.target) { - logger.info({ target: args.target }, 'FormatJson:Info'); + logger.info({ target: args.target }, 'PrettyPrint:Info'); } const files = await getFiles([args.path]); @@ -53,7 +53,7 @@ export const commandFormatJson = command({ // format files await Promise.all(jsonFiles.map((f: string) => formatFile(f, args.target, args.fixContentType))); - logger.info({ fileCount: jsonFiles.length, duration: performance.now() - startTime }, 'FormatJson:Done'); + logger.info({ fileCount: jsonFiles.length, duration: performance.now() - startTime }, 'PrettyPrint:Done'); }, }); @@ -65,7 +65,7 @@ export const commandFormatJson = command({ * @param fixContentType if true will set the `contentType` with a guessed value. @see guessStacContentType */ export async function formatFile(path: string, target = '', fixContentType: boolean = false): Promise { - logger.debug({ file: path }, 'FormatJson:RunPrettier'); + logger.debug({ file: path }, 'PrettyPrint:RunPrettier'); const prettyPrinted = await prettyPrint(JSON.stringify(await fsa.readJson(path)), DEFAULT_PRETTIER_FORMAT); if (target) { // FIXME: can be duplicate files diff --git a/src/commands/index.ts b/src/commands/index.ts index 34ab0d72..8ffa4530 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -4,7 +4,7 @@ import { CliInfo } from '../cli.info.js'; import { basemapsCreatePullRequest } from './basemaps-github/create-pr.js'; import { commandCopy } from './copy/copy.js'; import { commandCreateManifest } from './create-manifest/create-manifest.js'; -import { commandFormatJson } from './format/format.json.js'; +import { commandPrettyPrint } from './format/pretty.print.js'; import { commandGroup } from './group/group.js'; import { commandLdsFetch } from './lds-cache/lds.cache.js'; import { commandList } from './list/list.js'; @@ -46,6 +46,6 @@ export const cmd = subcommands({ 'create-pr': basemapsCreatePullRequest, }, }), - 'format-json': commandFormatJson, + 'pretty-print': commandPrettyPrint, }, }); diff --git a/src/commands/stac-github-import/stac.github.import.ts b/src/commands/stac-github-import/stac.github.import.ts index bbbe255f..7372acd4 100644 --- a/src/commands/stac-github-import/stac.github.import.ts +++ b/src/commands/stac-github-import/stac.github.import.ts @@ -8,7 +8,7 @@ import * as st from 'stac-ts'; import { CliInfo } from '../../cli.info.js'; import { logger } from '../../log.js'; import { config, registerCli, verbose } from '../common.js'; -import { formatFile } from '../format/format.json.js'; +import { formatFile } from '../format/pretty.print.js'; const Url: Type = { async from(str) {