Skip to content

Commit b651560

Browse files
Demoting Rollup as the default build in favor of tsc.
1 parent 1d9b748 commit b651560

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
},
1111
"scripts": {
1212
"test": "jest",
13-
"build": "rollup src/index.ts -c -f cjs -o dist/xslt-processor.js",
13+
"build": "tsc",
14+
"rollup-build": "rollup index.ts -c -f cjs -o dist/xslt-processor.js",
1415
"build_test": "yarn build_tests && yarn build_xpath_script && yarn build_xslt_script",
1516
"build_xpath_script": "rollup test_src/xpath_script.js -c -f iife -o test_dist/xpath_script.js",
1617
"build_xslt_script": "rollup test_src/xslt_script.js -c -f iife -o test_dist/xslt_script.js",

rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export default {
1111
"**/__tests__",
1212
"**/*.test.ts",
1313
"jest.config.ts"
14-
]
14+
],
15+
tsconfig: './tsconfig.json'
1516
}),
1617
commonjs(),
1718
resolve(),

src/dom/xnode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export class XNode {
391391
return ret;
392392
}
393393

394-
getElementById(id) {
394+
getElementById(id): any {
395395
let ret = null;
396396
domTraverseElements(
397397
this,

tests/dom.test.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ import { dom } from 'isomorphic-jsx';
1919
console.log(dom);
2020
describe('dom parsing', () => {
2121
it('can parse xml', () => {
22-
const xml = (
23-
<page>
24-
<request>
25-
<q id="q">new york</q>
26-
</request>
27-
<location lat="100" lon="200" />
28-
</page>
29-
);
22+
const xml = "<page> " +
23+
" <request> " +
24+
" <q id=\"q\">new york</q> " +
25+
" </request> " +
26+
" <location lat=\"100\" lon=\"200\" /> " +
27+
"</page>";
3028

3129
const dom1 = xmlParse(`<?xml version="1.0"?>${xml}`);
3230
const dom2 = xmlParse(`<?xml version='1.1'?>${xml}`);
@@ -35,7 +33,7 @@ describe('dom parsing', () => {
3533
const tag = 'q';
3634
const byTag = dom1.getElementsByTagName(tag);
3735
assert.equal(1, byTag.length);
38-
assert.equal(tag, byTag[0].nodeName);
36+
assert.equal(tag, (byTag[0] as any).nodeName);
3937

4038
const id = 'q';
4139
const byId = dom1.getElementById(id);

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
},
1717
"exclude": [
1818
"babel.config.js",
19-
"dist/**/*"
19+
"jest.config.ts",
20+
"rollup.config.js",
21+
"dist/**/*",
22+
"test_src/**/*",
23+
"tests/**/*"
2024
]
2125
}

0 commit comments

Comments
 (0)