Skip to content

Commit 1f4faee

Browse files
committed
Stop adding version number to generated files
It doesn't really add any value, and is just annoying because it changes on each sqltyper release.
1 parent 120d212 commit 1f4faee

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

src/codegen.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ type GeneratorOptions = {
9090
}
9191
type Generator = (opts: GeneratorOptions) => string
9292

93+
const topComment = (sourceFileName: string) => `\
94+
// Generated by ${pkginfo.name} from ${sourceFileName}.
95+
// Do not edit directly. Instead, edit ${sourceFileName} and re-run ${pkginfo.name}.
96+
`
97+
9398
const generators: Record<CodegenTarget, Generator> = {
9499
pg({
95100
sourceFileName,
@@ -102,8 +107,7 @@ const generators: Record<CodegenTarget, Generator> = {
102107
outputValue,
103108
}: GeneratorOptions) {
104109
return `\
105-
// Generated by ${pkginfo.name} ${pkginfo.version} from ${sourceFileName}.
106-
// Do not edit directly. Instead, edit ${sourceFileName} and re-run ${pkginfo.name}.
110+
${topComment(sourceFileName)}
107111
108112
import { ClientBase, Pool } from '${module}'
109113
@@ -127,8 +131,7 @@ ${sql}\`${queryValues})
127131
outputValue,
128132
}: GeneratorOptions) {
129133
return `\
130-
// Generated by ${pkginfo.name} ${pkginfo.version} from ${sourceFileName}.
131-
// Do not edit directly. Instead, edit ${sourceFileName} and re-run ${pkginfo.name}.
134+
${topComment(sourceFileName)}
132135
133136
import * as postgres from '${module}'
134137

src/sql/arrayTypes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by sqltyper 1.0.1 from arrayTypes.sql.
1+
// Generated by sqltyper from arrayTypes.sql.
22
// Do not edit directly. Instead, edit arrayTypes.sql and re-run sqltyper.
33

44
import * as postgres from '../postgres'

src/sql/enums.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by sqltyper 1.0.1 from enums.sql.
1+
// Generated by sqltyper from enums.sql.
22
// Do not edit directly. Instead, edit enums.sql and re-run sqltyper.
33

44
import * as postgres from '../postgres'

src/sql/functions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by sqltyper 1.0.1 from functions.sql.
1+
// Generated by sqltyper from functions.sql.
22
// Do not edit directly. Instead, edit functions.sql and re-run sqltyper.
33

44
import * as postgres from '../postgres'

src/sql/tableColumns.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by sqltyper 1.0.1 from tableColumns.sql.
1+
// Generated by sqltyper from tableColumns.sql.
22
// Do not edit directly. Instead, edit tableColumns.sql and re-run sqltyper.
33

44
import * as postgres from '../postgres'

0 commit comments

Comments
 (0)