cad | ts config base

This commit is contained in:
Code 2025-02-17 18:21:08 +01:00
parent 83332c3cb3
commit a19de93f0e
4 changed files with 11 additions and 26 deletions

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@ import pMap from 'p-map'
import pkg from 'which';
const { sync: which } = pkg;
import { resolve, OSR_CACHE } from '@polymech/commons'
import { equalFiles, swProcMessage } from './sw-util.js'
import { dirname,equalFiles, swProcMessage } from './sw-util.js'
import { reportCSV } from '../report/csv.js'
import { logger, substitute } from '../index.js'
import { removeEmpty } from '../lib/index.js'
@ -210,7 +210,7 @@ export const convertFile = async (
const bin = path.resolve(`${cwd}/${exe}`)
if (!exists(bin)) {
logger.error(`${bin} doesnt exists in ${cwd}`)
logger.error('dirname:' + import.meta.dirname)
logger.error('__dirname:' + dirname())
logger.error('options.sw ' + options.sw)
return
}

View File

@ -3,26 +3,11 @@ import { logger } from '../index.js'
import { SolidworkOptions } from '../types.js'
import { defaultOptions, sanitize } from '../sw_argv.js'
import { convert } from '../cad/sw-convert.js'
export const options = (yargs: CLI.Argv) => defaultOptions(yargs)
/*
export const register = (cli: CLI.Argv) => {
return cli.command('sw', 'Convert CAD files via Solidworks Interop API', options, async (argv: CLI.Arguments) => {
if (argv.help) { return }
const options = sanitize(argv) as SolidworkOptions
logger.setSettings({ minLevel: options.logLevel as any })
logger.info("options " + argv.dst, options)
return convert(options) as any
})
}
*/
export const builder = options
export const handler = (argv) => {
if (argv.help) { return }
const options = sanitize(argv) as SolidworkOptions
logger.setSettings({ minLevel: options.logLevel as any })
logger.info("options " + argv.dst, options)
return convert(options) as any
};
}

View File

@ -4,7 +4,7 @@
"declaration": true,
"strict": false,
"moduleResolution": "nodenext",
"target": "es2022",
"target": "ESNext",
"module": "NodeNext",
"esModuleInterop": true,
"skipLibCheck": true,