@createiq/htmldiff 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +71 -0
- package/.node-version +1 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/biome.json +41 -0
- package/dist/HtmlDiff.cjs +815 -0
- package/dist/HtmlDiff.cjs.map +1 -0
- package/dist/HtmlDiff.d.cts +105 -0
- package/dist/HtmlDiff.d.ts +105 -0
- package/dist/HtmlDiff.js +792 -0
- package/dist/HtmlDiff.js.map +1 -0
- package/package.json +44 -0
- package/renovate.json5 +10 -0
- package/src/Action.ts +9 -0
- package/src/HtmlDiff.ts +447 -0
- package/src/Match.ts +31 -0
- package/src/MatchFinder.ts +144 -0
- package/src/MatchOptions.ts +10 -0
- package/src/Mode.ts +8 -0
- package/src/Operation.ts +17 -0
- package/src/Utils.ts +96 -0
- package/src/WordSplitter.ts +248 -0
- package/test/HtmlDiff.bench.ts +126 -0
- package/test/HtmlDiff.spec.ts +251 -0
- package/test/MatchFinder.spec.ts +77 -0
- package/test/Utils.spec.ts +120 -0
- package/test/WordSplitter.spec.ts +27 -0
- package/tsconfig.json +16 -0
- package/tsup.config.ts +14 -0
- package/vitest.config.mts +24 -0
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- test
|
|
3
|
+
- deploy
|
|
4
|
+
|
|
5
|
+
default:
|
|
6
|
+
interruptible: true
|
|
7
|
+
|
|
8
|
+
"Run unit tests":
|
|
9
|
+
stage: test
|
|
10
|
+
image: ${CI_REGISTRY}/infra/baseimages/node:22-alpine
|
|
11
|
+
script:
|
|
12
|
+
- npm i
|
|
13
|
+
- VITEST_MAX_THREADS=4 npm run test:ci -- --coverage
|
|
14
|
+
allow_failure: false
|
|
15
|
+
needs: []
|
|
16
|
+
artifacts:
|
|
17
|
+
when: always
|
|
18
|
+
reports:
|
|
19
|
+
junit:
|
|
20
|
+
- junit.xml
|
|
21
|
+
coverage_report:
|
|
22
|
+
coverage_format: cobertura
|
|
23
|
+
path: coverage/cobertura-coverage.xml
|
|
24
|
+
coverage: /All files[^\|]*\|[^\|]*\s+([\d\.]+)/
|
|
25
|
+
rules:
|
|
26
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
27
|
+
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_TRIGGERED != "true"
|
|
28
|
+
- if: $CI_COMMIT_BRANCH == "prod" && $CI_PIPELINE_TRIGGERED != "true"
|
|
29
|
+
|
|
30
|
+
"Lint":
|
|
31
|
+
stage: test
|
|
32
|
+
image: ${CI_REGISTRY}/infra/baseimages/node:22-alpine
|
|
33
|
+
script:
|
|
34
|
+
- npm i
|
|
35
|
+
- npm run lint
|
|
36
|
+
- npm run format
|
|
37
|
+
allow_failure: false
|
|
38
|
+
needs: []
|
|
39
|
+
rules:
|
|
40
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
41
|
+
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_TRIGGERED != "true"
|
|
42
|
+
- if: $CI_COMMIT_BRANCH == "prod" && $CI_PIPELINE_TRIGGERED != "true"
|
|
43
|
+
|
|
44
|
+
"Publish to npm - dry-run":
|
|
45
|
+
stage: deploy
|
|
46
|
+
image: ${CI_REGISTRY}/infra/baseimages/node:22-alpine
|
|
47
|
+
script:
|
|
48
|
+
- npm i
|
|
49
|
+
- npm run build
|
|
50
|
+
# Use the default registry for publishing
|
|
51
|
+
- npm --verbose config --global delete registry
|
|
52
|
+
- NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt HTTPS_PROXY=$PROJENV_HTTPS_PROXY NO_PROXY=$PROJENV_NO_PROXY npm publish --access public --dry-run
|
|
53
|
+
allow_failure: false
|
|
54
|
+
# No needs, only run if the test stage passes
|
|
55
|
+
rules:
|
|
56
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
57
|
+
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_TRIGGERED != "true"
|
|
58
|
+
|
|
59
|
+
"Publish to npm":
|
|
60
|
+
stage: deploy
|
|
61
|
+
image: ${CI_REGISTRY}/infra/baseimages/node:22-alpine
|
|
62
|
+
script:
|
|
63
|
+
- npm i
|
|
64
|
+
- npm run build
|
|
65
|
+
# Use the default registry for publishing
|
|
66
|
+
- npm --verbose config --global delete registry
|
|
67
|
+
- NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt HTTPS_PROXY=$PROJENV_HTTPS_PROXY NO_PROXY=$PROJENV_NO_PROXY npm publish --access public
|
|
68
|
+
allow_failure: false
|
|
69
|
+
# No needs, only run if the test stage passes
|
|
70
|
+
rules:
|
|
71
|
+
- if: $CI_COMMIT_BRANCH == "prod" && $CI_PIPELINE_TRIGGERED != "true"
|
package/.node-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22.11.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Linklaters Business Services t/a CreateiQ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
## Project Description
|
|
2
|
+
|
|
3
|
+
A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.
|
|
4
|
+
|
|
5
|
+
This HTML Diff implementation is a TypeScript port of the C# port found [here](https://github.com/Rohland/htmldiff.net), which is a port of the ruby implementation found [here](https://github.com/myobie/htmldiff).
|
package/biome.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
|
3
|
+
"formatter": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"formatWithErrors": false,
|
|
6
|
+
"indentStyle": "space",
|
|
7
|
+
"indentWidth": 2,
|
|
8
|
+
"lineEnding": "lf",
|
|
9
|
+
"lineWidth": 120,
|
|
10
|
+
"attributePosition": "auto"
|
|
11
|
+
},
|
|
12
|
+
"organizeImports": { "enabled": true },
|
|
13
|
+
"linter": {
|
|
14
|
+
"enabled": true,
|
|
15
|
+
"rules": {
|
|
16
|
+
"recommended": true,
|
|
17
|
+
"suspicious": {
|
|
18
|
+
"noConfusingVoidType": "off"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"javascript": {
|
|
23
|
+
"formatter": {
|
|
24
|
+
"jsxQuoteStyle": "double",
|
|
25
|
+
"quoteProperties": "asNeeded",
|
|
26
|
+
"trailingCommas": "es5",
|
|
27
|
+
"semicolons": "asNeeded",
|
|
28
|
+
"arrowParentheses": "asNeeded",
|
|
29
|
+
"bracketSpacing": true,
|
|
30
|
+
"bracketSameLine": false,
|
|
31
|
+
"quoteStyle": "single",
|
|
32
|
+
"attributePosition": "auto"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"vcs": {
|
|
36
|
+
"enabled": true,
|
|
37
|
+
"clientKind": "git",
|
|
38
|
+
"useIgnoreFile": true,
|
|
39
|
+
"defaultBranch": "main"
|
|
40
|
+
}
|
|
41
|
+
}
|