style: apply prettier formatting to scripts and tests

claude/api-code-samples-plan-MEkQO
Jason Stirnaman 2026-01-14 17:31:55 -06:00
parent a864f2e28d
commit 2fb5168b2b
6 changed files with 766 additions and 671 deletions

File diff suppressed because it is too large Load Diff

View File

@ -337,10 +337,7 @@ describe('RapiDoc Mini component', () => {
* Tests that API section pages show only tags (immediate children)
*/
describe('API section page structure', () => {
const sectionPages = [
'/influxdb3/core/api/',
'/influxdb3/enterprise/api/',
];
const sectionPages = ['/influxdb3/core/api/', '/influxdb3/enterprise/api/'];
sectionPages.forEach((page) => {
describe(`Section page ${page}`, () => {
@ -417,15 +414,24 @@ describe('All endpoints page', () => {
});
it('operation cards have method badges', () => {
cy.get('.api-operation-card .api-method').should('have.length.at.least', 10);
cy.get('.api-operation-card .api-method').should(
'have.length.at.least',
10
);
});
it('operation cards have path codes', () => {
cy.get('.api-operation-card .api-path').should('have.length.at.least', 10);
cy.get('.api-operation-card .api-path').should(
'have.length.at.least',
10
);
});
it('operation cards link to operation pages', () => {
cy.get('.api-operation-card').first().should('have.attr', 'href').and('match', /\/api\//);
cy.get('.api-operation-card')
.first()
.should('have.attr', 'href')
.and('match', /\/api\//);
});
it('is accessible from navigation', () => {

View File

@ -27,9 +27,7 @@ function test(name, fn) {
function assertEquals(actual, expected, message) {
if (actual !== expected) {
throw new Error(
message || `Expected ${expected}, got ${actual}`
);
throw new Error(message || `Expected ${expected}, got ${actual}`);
}
}

View File

@ -26,9 +26,7 @@ function test(name, fn) {
function assertEquals(actual, expected, message) {
if (actual !== expected) {
throw new Error(
message || `Expected ${expected}, got ${actual}`
);
throw new Error(message || `Expected ${expected}, got ${actual}`);
}
}

View File

@ -1217,7 +1217,7 @@ async function executePhase(options) {
try {
const editorCommand = resolveEditor(options.editor);
const filePaths = result.created.map(file => join(REPO_ROOT, file));
const filePaths = result.created.map((file) => join(REPO_ROOT, file));
const wait = shouldWait(options.wait);
spawnEditor(editorCommand, filePaths, wait);
@ -1225,13 +1225,19 @@ async function executePhase(options) {
if (wait) {
log('✓ Editor closed', 'green');
} else {
log(' Editor will open in background (CLI exits immediately)', 'cyan');
log(
' Editor will open in background (CLI exits immediately)',
'cyan'
);
log(' Use --wait flag to block until editor closes', 'cyan');
log('✓ Editor launched', 'green');
}
} catch (error) {
log(`\n✗ Failed to open editor: ${error.message}`, 'red');
log('\nFiles were created successfully but could not be opened.', 'yellow');
log(
'\nFiles were created successfully but could not be opened.',
'yellow'
);
log('You can open them manually:', 'yellow');
result.created.forEach((file) => {
log(` ${file}`, 'yellow');

View File

@ -15,9 +15,8 @@ import { platform } from 'os';
*/
function commandExists(command) {
try {
const cmd = platform() === 'win32'
? `where ${command}`
: `command -v ${command}`;
const cmd =
platform() === 'win32' ? `where ${command}` : `command -v ${command}`;
execSync(cmd, { stdio: 'ignore' });
return true;
} catch {
@ -59,10 +58,10 @@ export function resolveEditor(options = {}) {
throw new Error(
'No suitable editor found. Set EDITOR environment variable or use --editor flag.\n' +
'Examples:\n' +
' export EDITOR=vim\n' +
' export EDITOR=nano\n' +
' docs edit <url> --editor vim'
'Examples:\n' +
' export EDITOR=vim\n' +
' export EDITOR=nano\n' +
' docs edit <url> --editor vim'
);
}