Skip to content

Commit 260bab0

Browse files
committed
debug can now be run without manual recompile
Debug tsconfig can be run in watch mode to allow faster iteration of prototyping changes
1 parent 03ae969 commit 260bab0

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build/tests
55
.rpt2_cache
66
dist/
77
.env
8+
debug/lib
89

910
# Created by https://www.gitignore.io/api/node
1011

debug/test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
var soqlParserJs = require('../dist');
1+
var soqlParserJs = require('./lib');
22

33
const query = `
4-
SELECT Id, c.FirstName, c.LastName
5-
FROM Contact c
6-
LIMIT 1
4+
SELECT Id, Name, Foo, Bar, Baz, Bax, aaa, bbb, ccc, ddd, Id, Name, Foo, Bar, Baz, Bax, aaa, bbb, ccc, ddd, Id, Name, Foo, Bar, Baz, Bax, aaa, bbb, ccc, ddd, Account.Name, (SELECT Id, Name, Foo, Bar, Baz, Bax, aaa, bbb, ccc, ddd, Id, Name, Foo, Bar, Baz, Bax, aaa, bbb, ccc, ddd, Contact.LastName FROM Account.Contacts) FROM Account
75
`;
86

97
const parsedQuery = soqlParserJs.parseQuery(query, { logging: true });

debug/tsconfig-debug.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"experimentalDecorators": true,
4+
"emitDecoratorMetadata": true,
5+
"lib": [
6+
"dom",
7+
"es2017"
8+
],
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"noImplicitAny": true,
12+
"outDir": "./lib",
13+
"sourceMap": true,
14+
"target": "es2017"
15+
},
16+
"include": [
17+
"../lib"
18+
]
19+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"scripts": {
1212
"clean": "rm -rf ./dist/*",
1313
"test": "TS_NODE_PROJECT=\"test/tsconfig.test.json\" mocha -r ts-node/register test/**/*.spec.ts -P test/tsconfig.test.json",
14+
"debug": "TS_NODE_PROJECT=\"tsconfig.json\" ts-node ./debug/test.ts -P tsconfig.json",
1415
"prebuild2": "npm run antlr; npm run clean",
1516
"prebuild": "npm run clean",
1617
"build:old": "npm run tsc",

0 commit comments

Comments
 (0)