mirror of
https://github.com/zhigang1992/pocketbase-typegen.git
synced 2026-01-12 09:14:16 +08:00
fix modules
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
src
|
||||
coverage
|
||||
test
|
||||
tsconfig.json
|
||||
tsconfig.json
|
||||
build.js
|
||||
3
build.js
3
build.js
@@ -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
|
||||
|
||||
26
test/__snapshots__/lib.test.js.snap
Normal file
26
test/__snapshots__/lib.test.js.snap
Normal 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;
|
||||
}"
|
||||
`;
|
||||
Reference in New Issue
Block a user