diff --git a/src/toolbox/init/templates.ts b/src/toolbox/init/templates.ts index 7391edf..3f40bec 100644 --- a/src/toolbox/init/templates.ts +++ b/src/toolbox/init/templates.ts @@ -44,25 +44,28 @@ export async function createPackageJSON({ typescript, }: CreatePackageJSONOptions): Promise { const name = projectName.split('/').pop() + const scripts: Record = { + build: 'xs-dev build', + start: 'xs-dev run', + } + const devDependencies: Record = {} + const moddable: Record = {} const packageJSON = { name, main: typescript ? 'dist/main.js' : 'main.js', type: 'module', description: 'A starter project for embedded JS', - scripts: { - build: 'xs-dev build', - start: 'xs-dev run', - } as Record, - devDependencies: {} as Record, - moddable: {} as Record, + scripts, + devDependencies, + moddable, } if (typescript) { - packageJSON.scripts['prebuild'] = 'tsc' - packageJSON.scripts['prestart'] = packageJSON.scripts['prebuild'] + packageJSON.scripts.prebuild = 'tsc' + packageJSON.scripts.prestart = packageJSON.scripts.prebuild packageJSON.devDependencies['@moddable/typings'] = '^5.3.0' - packageJSON.devDependencies['typescript'] = '^5.7.2' + packageJSON.devDependencies.typescript = '^5.7.2' } if (io) {