Skip to content

Commit 2777583

Browse files
authored
Simplify exports (#11)
* simplify exports * fix bugs * update test imports
1 parent 4936b57 commit 2777583

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
node_modules
22
coverage
3-
4-
*.d.ts
5-
*.js
3+
dist

pg.ts renamed to lib/pg.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import _sql = require('./sql')
12
import {
23
IPGQueryable,
34
IPGQueryConfig,
45
IPGQueryResult,
56
TemplateLiteralFunc
6-
} from './lib/utils'
7-
import _sql = require('./sql')
7+
} from './utils'
88

99
type PGSql = TemplateLiteralFunc<IPGQueryConfig> & {
1010
query: <T extends IPGQueryResult>(

sql.ts renamed to lib/sql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IPGQueryConfig, SqlContainer, TemplateLiteralFunc } from './lib/utils'
1+
import { IPGQueryConfig, SqlContainer, TemplateLiteralFunc } from './utils'
22

33
function sqlText(
44
count: number,

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@sequencework/sql",
33
"version": "2.1.1",
4-
"main": "sql.js",
5-
"types": "sql.d.ts",
4+
"main": "dist/sql.js",
5+
"types": "dist/sql.d.ts",
66
"license": "MIT",
77
"description": "Javascript tag to format SQL template literals",
88
"keywords": [
@@ -12,16 +12,11 @@
1212
"pg"
1313
],
1414
"files": [
15-
"sql.js",
16-
"sql.d.ts",
17-
"pg.js",
18-
"pg.d.ts",
19-
"lib/**/*.js",
20-
"lib/**/*.d.ts"
15+
"dist"
2116
],
2217
"scripts": {
2318
"build": "tsc",
24-
"clean": "rimraf pg.js pg.d.ts sql.js sql.d.ts lib/**/*.js lib/**/*.d.ts coverage",
19+
"clean": "rimraf dist coverage",
2520
"test": "jest",
2621
"prettier": "prettier --write '**/*.{ts,js,json,css,md}' --ignore-path .gitignore",
2722
"lint": "tslint -c tslint.json -p tsconfig.json -t stylish"

pg/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@sequencework/sql/pg",
3+
"private": true,
4+
"main": "../dist/pg.js",
5+
"types": "../dist/pg.d.ts"
6+
}

test/pg.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sql = require('../pg')
1+
import sql = require('../lib/pg')
22

33
const sampleBooks = ['book1', 'book2']
44
const db = {

test/sql.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sql = require('../sql')
1+
import sql = require('../lib/sql')
22

33
const trimSpaces = str => str.trim().replace(/\s+/g, ' ')
44

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"compilerOptions": {
33
"target": "es5",
44
"module": "commonjs",
5-
"declaration": true
5+
"declaration": true,
6+
"outDir": "dist"
67
},
7-
"files": ["sql.ts", "pg.ts", "lib/utils.ts"]
8+
"include": ["lib"]
89
}

0 commit comments

Comments
 (0)