create-kf-component
Version:
create-kf-component is a cli tool that scaffolds Javascript based custom component projects that seamlessly integrate into Kissflow.
18 lines (15 loc) • 606 B
JavaScript
import { FRAMEWORKS } from './constants.js'
import path from 'path'
const getTemplatePath = (template) => {
const currentModuleFile = new URL(import.meta.url).pathname
const currentModuleDirectory = path.dirname(currentModuleFile)
switch (template) {
case FRAMEWORKS.REACT:
return path.resolve(currentModuleDirectory, './template/react/')
case FRAMEWORKS.VANNILA:
return path.resolve(currentModuleDirectory, './template/vannila/')
default:
throw new Error('Invalid template supplied, ', template)
}
}
export { getTemplatePath }