Skip to content

Commit 0de3dbf

Browse files
Adjusting demo folder.
1 parent b4c83c9 commit 0de3dbf

File tree

6 files changed

+199
-30
lines changed

6 files changed

+199
-30
lines changed

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
localtests/
2-
node_modules/
3-
dist/
41
.git/
5-
test_dist/
6-
tests_dist/
2+
3+
demo/
4+
dist/
5+
node_modules/
6+
77
package-lock.json

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ _A JavaScript XSLT processor without native library dependencies._
44

55
## How to
66

7-
Install xslt-processor using npm:
7+
Install xslt-processor using npm or yarn:
88

9-
```
9+
```sh
1010
npm install xslt-processor
1111
```
1212

13+
```sh
14+
yarn add xslt-processor
15+
```
16+
1317
Within your ES2015+ code, import the `Xslt` class, the `xmlParse` function and use this way:
1418

1519
```js
@@ -47,9 +51,11 @@ If you write pre-2015 JS code, make adjustments as needed.
4751
You can simply add a tag like this:
4852

4953
```html
50-
<script type="application/javascript" src="https://www.unpkg.com/xslt-processor@1.0.0/xslt-processor.js"></script>
54+
<script type="application/javascript" src="https://www.unpkg.com/xslt-processor@1.0.1/umd/xslt-processor.js"></script>
5155
```
5256

57+
All the exports will live under `globalThis.XsltProcessor`.
58+
5359
### Breaking Changes
5460

5561
Until version 0.11.7, use like the example below:

interactive-tests/xslt.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html>
33
<head>
44
<title>Simple XSLT test</title>
5-
<!-- script src="../test_dist/xslt_script.js"></script -->
65
<script type="application/javascript" src="js/xslt-processor.js"></script>
76
<script>
87
window.logging = true;

package.json

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
"name": "xslt-processor",
33
"version": "1.0.0",
44
"description": "A JavaScript XSLT Processor",
5-
"main": "dist/index.js",
6-
"module": "src/index.js",
5+
"main": "index.js",
6+
"module": "index.js",
77
"directories": {
88
"doc": "docs",
99
"test": "tests"
1010
},
1111
"scripts": {
1212
"test": "jest",
13-
"build": "tsc",
13+
"build": "yarn cjs-build && yarn rollup-build && yarn copy-files-from-to",
14+
"cjs-build": "tsc",
1415
"rollup-build": "rollup src/index.ts -c -f umd -o dist/umd/xslt-processor.js",
1516
"lint": "eslint src/**/*"
1617
},
@@ -47,6 +48,7 @@
4748
"@typescript-eslint/eslint-plugin": "^5.60.0",
4849
"@typescript-eslint/parser": "^5.60.0",
4950
"babel-jest": "^29.5.0",
51+
"copy-files-from-to": "^3.9.0",
5052
"eslint": "^5.12.1",
5153
"eslint-plugin-jest": "^27.2.2",
5254
"eslint-plugin-jsx": "^0.1.0",
@@ -66,5 +68,27 @@
6668
},
6769
"dependencies": {
6870
"he": "^1.2.0"
69-
}
71+
},
72+
"copyFiles": [
73+
{
74+
"from": "LICENSE",
75+
"to": "dist/LICENSE"
76+
},
77+
{
78+
"from": "package.json",
79+
"to": "dist/package.json"
80+
},
81+
{
82+
"from": "README.md",
83+
"to": "dist/README.md"
84+
},
85+
{
86+
"from": "interactive-tests/xslt.html",
87+
"to": "demo/xslt.html"
88+
},
89+
{
90+
"from": "dist/umd/xslt-processor.js",
91+
"to": "demo/js/xslt-processor.js"
92+
}
93+
]
7094
}

rollup.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import commonjs from 'rollup-plugin-commonjs'
2-
import resolve from 'rollup-plugin-node-resolve'
3-
import buble from 'rollup-plugin-buble'
4-
// import terser from '@rollup/plugin-terser';
1+
import commonjs from 'rollup-plugin-commonjs';
2+
import resolve from 'rollup-plugin-node-resolve';
3+
import buble from 'rollup-plugin-buble';
4+
import terser from '@rollup/plugin-terser';
55
import typescript from '@rollup/plugin-typescript';
66

77
export default {
@@ -18,8 +18,8 @@ export default {
1818
resolve(),
1919
buble({
2020
transforms: {dangerousForOf: true}
21-
})
22-
// terser()
21+
}),
22+
terser()
2323
],
2424
output: {
2525
format: 'umd',

0 commit comments

Comments
 (0)