0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix: add prepare script

This commit is contained in:
Gao Sun 2021-07-03 19:34:16 +08:00
parent b6ff5ec6ca
commit f273ad08e5
No known key found for this signature in database
GPG key ID: 0F0EFA2E36639F31
2 changed files with 3 additions and 2 deletions

View file

@ -11,7 +11,8 @@
"scripts": {
"generate": "ts-node src/gen/index.ts && xo src/db-entries --fix",
"build": "yarn generate && rm -rf lib/ && tsc --p tsconfig.build.json",
"lint": "xo src/"
"lint": "xo src/",
"prepare": "yarn build"
},
"engines": {
"node": "14",

View file

@ -205,7 +205,7 @@ const generate = async () => {
await fs.writeFile(
path.join(generatedDir, 'index.ts'),
header +
conditionalString(allTypes.length > 0 && `export * from './${generatedTypesFilename}';`) +
conditionalString(allTypes.length > 0 && `export * from './${generatedTypesFilename}';\n`) +
generated.map(([file]) => `export * from './${getOutputFileName(file)}';`).join('\n') +
'\n'
);