fix modules

This commit is contained in:
Patrick
2022-10-14 20:17:51 -07:00
parent 3d79044f5e
commit 173fd711ed
3 changed files with 28 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
src
coverage
test
tsconfig.json
tsconfig.json
build.js

View File

@@ -5,7 +5,6 @@ esbuild
entryPoints: ["./src/index.ts"],
outfile: "dist/index.js",
bundle: true,
// minify: false,
treeShaking: true,
platform: "node",
format: "esm",
@@ -13,5 +12,3 @@ esbuild
plugins: [nodeExternalsPlugin()],
})
.catch(() => process.exit(1))
// esbuild src/index.ts --bundle --outfile=dist/index.js --external:./node_modules/* --format=esm --platform=node

View File

@@ -0,0 +1,26 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`createCollectionEnum creates enum of collection names 1`] = `
"export enum Collections {
Book = "book",
Magazine = "magazine",
}"
`;
exports[`createRecordType creates type definition for a record 1`] = `
"export type BooksRecord = {
title?: string;
}"
`;
exports[`generate generates correct output given db input 1`] = `
"// Generated using pocketbase-typegen
export enum Collections {
Books = "books",
}
export type BooksRecord = {
title?: string;
}"
`;