Skip to content

Commit

Permalink
refactor(cli-utils): harmonize config format
Browse files Browse the repository at this point in the history
  • Loading branch information
soykje committed Jun 25, 2024
1 parent facd1cd commit 7f516b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 11 additions & 7 deletions packages/utils/cli/src/scan/config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export const details = false
export const sort = 'count'
export const imports = ['@spark-ui']
export const extensions = ['.tsx', '.ts']
export const directory = '.'
export const verbose = false
export const output = null
module.exports = {
adoption: {
details: false,
sort: 'count',
imports: ['@spark-ui'],
extensions: ['.tsx', '.ts'],
directory: '.',
verbose: false,
output: null,
},
}
4 changes: 3 additions & 1 deletion packages/utils/cli/src/scan/index.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable complexity */
/* eslint-disable max-lines-per-function */
import * as process from 'node:process'

import { existsSync, mkdirSync, writeFileSync } from 'fs'
Expand All @@ -10,7 +12,7 @@ import { loadConfig } from './loadConfig.mjs'
import { scanCallback } from './scanCallback.mjs'
import { scanDirectories } from './utils/index.mjs'

export async function adoption(options) {
export async function adoption(options = {}) {
const { configuration, ...optionsConfig } = options
const configFileRoute = path.join(process.cwd(), configuration || '.spark-ui.cjs')

Expand Down

0 comments on commit 7f516b7

Please sign in to comment.