Skip to content

Commit afa3344

Browse files
committed
feat: initial commit
0 parents  commit afa3344

19 files changed

+29348
-0
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.nyc_output/
2+
coverage/
3+
dist/

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": [
3+
"@readme/eslint-config",
4+
"@readme/eslint-config/typescript"
5+
],
6+
"root": true
7+
}

.github/dependabot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
reviewers:
8+
- erunion
9+
labels:
10+
- dependencies
11+
commit-message:
12+
prefix: chore(deps)
13+
prefix-development: chore(deps-dev)
14+
15+
- package-ecosystem: npm
16+
directory: "/"
17+
schedule:
18+
interval: monthly
19+
open-pull-requests-limit: 10
20+
reviewers:
21+
- erunion
22+
labels:
23+
- dependencies
24+
commit-message:
25+
prefix: chore(deps)
26+
prefix-development: chore(deps-dev)
27+
ignore:
28+
# These can't be upgraded because `@jsdevtools/karma-config@3` still requires Webpack 4.
29+
- dependency-name: ts-loader
30+
versions:
31+
- "> 8"
32+
- dependency-name: webpack
33+
versions:
34+
- "> 4"

.github/workflows/ci.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
linting:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 16
14+
15+
- name: Get npm cache directory
16+
id: npm-cache-dir
17+
run: |
18+
echo "::set-output name=dir::$(npm config get cache)"
19+
20+
- uses: actions/[email protected]
21+
id: npm-cache
22+
with:
23+
path: ${{ steps.npm-cache-dir.outputs.dir }}
24+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-node-
27+
28+
- run: npm ci
29+
- run: npm run build
30+
- run: npm run lint
31+
32+
node_tests:
33+
name: Node ${{ matrix.node }} on ${{ matrix.os }}
34+
runs-on: ${{ matrix.os }}
35+
timeout-minutes: 10
36+
strategy:
37+
fail-fast: true
38+
matrix:
39+
os:
40+
- ubuntu-latest
41+
- windows-latest
42+
node:
43+
- 14
44+
- 16
45+
- 18
46+
47+
steps:
48+
- name: Checkout source
49+
uses: actions/checkout@v3
50+
51+
- name: Install Node ${{ matrix.node }}
52+
uses: actions/setup-node@v3
53+
with:
54+
node-version: ${{ matrix.node }}
55+
56+
- name: Get npm cache directory
57+
id: npm-cache-dir
58+
run: |
59+
echo "::set-output name=dir::$(npm config get cache)"
60+
61+
- uses: actions/[email protected]
62+
id: npm-cache
63+
with:
64+
path: ${{ steps.npm-cache-dir.outputs.dir }}
65+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
66+
restore-keys: |
67+
${{ runner.os }}-node-
68+
69+
# Node 14 still ships with npm@6 which doesn't install peerDeps by default.
70+
- name: Install npm@7
71+
if: matrix.node == '14'
72+
run: npm install -g npm@7
73+
74+
- run: npm ci
75+
- run: npm run build
76+
- run: npm run test --ignore-scripts
77+
78+
browser_tests:
79+
name: Browser
80+
runs-on: ${{ matrix.os }}
81+
strategy:
82+
fail-fast: true
83+
matrix:
84+
browser:
85+
- chrome
86+
- firefox
87+
os:
88+
- ubuntu-latest
89+
- windows-latest
90+
91+
steps:
92+
- name: Checkout source
93+
uses: actions/checkout@v3
94+
95+
- name: Install Node
96+
uses: actions/setup-node@v3
97+
with:
98+
node-version: 16
99+
100+
- name: Get npm cache directory
101+
id: npm-cache-dir
102+
run: |
103+
echo "::set-output name=dir::$(npm config get cache)"
104+
105+
- uses: actions/[email protected]
106+
id: npm-cache
107+
with:
108+
path: ${{ steps.npm-cache-dir.outputs.dir }}
109+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
110+
restore-keys: |
111+
${{ runner.os }}-node-
112+
113+
- run: npm ci
114+
- run: npm run build
115+
116+
# Chrome
117+
- uses: browser-actions/setup-chrome@latest
118+
if: matrix.browser == 'chrome'
119+
120+
- name: Run tests on Chrome
121+
if: matrix.browser == 'chrome'
122+
run: |
123+
npm run test:browser -- --browsers=ChromeHeadless
124+
125+
# Firefox
126+
- uses: browser-actions/setup-chrome@latest
127+
if: matrix.browser == 'firefox'
128+
129+
- name: Run tests on Firefox
130+
if: matrix.browser == 'firefox'
131+
run: |
132+
npm run test:browser -- --browsers=FirefoxHeadless
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 12 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ 'javascript' ]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v2

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.nyc_output
2+
coverage/
3+
dist/
4+
node_modules/

.mocharc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"require": [
3+
"test/helpers/init.js",
4+
"ts-node/register"
5+
],
6+
"watch-extensions": [
7+
"ts"
8+
],
9+
"watch-files": ["src/**/*.ts", "test/**/*.ts"],
10+
"recursive": true,
11+
"reporter": "spec",
12+
"timeout": 200000
13+
}

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.github/
2+
.nyc_output/
3+
coverage/
4+
test/
5+
.eslint*
6+
.mocha*
7+
.nyc*
8+
.prettier*
9+
karma.*

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.nyc_output/
2+
coverage/
3+
dist/

LICENSE

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Copyright (c) 2022, ReadMe
2+
3+
Permission to use, copy, modify, and/or distribute this software for any purpose
4+
with or without fee is hereby granted, provided that the above copyright notice
5+
and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
11+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
12+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
13+
THIS SOFTWARE.
14+
15+
---
16+
17+
## parse-data-url
18+
https://github.com/killmenot/parse-data-url
19+
20+
The MIT License (MIT)
21+
22+
Copyright (c) Alexey Kucherenko
23+
24+
Permission is hereby granted, free of charge, to any person obtaining a copy
25+
of this software and associated documentation files (the "Software"), to deal
26+
in the Software without restriction, including without limitation the rights
27+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28+
copies of the Software, and to permit persons to whom the Software is
29+
furnished to do so, subject to the following conditions:
30+
31+
The above copyright notice and this permission notice shall be included in all
32+
copies or substantial portions of the Software.
33+
34+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40+
SOFTWARE.
41+
42+
---
43+
44+
## valid-data-url
45+
https://github.com/killmenot/valid-data-url
46+
47+
The MIT License (MIT)
48+
49+
Copyright (c) Alexey Kucherenko
50+
51+
Permission is hereby granted, free of charge, to any person obtaining a copy
52+
of this software and associated documentation files (the "Software"), to deal
53+
in the Software without restriction, including without limitation the rights
54+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55+
copies of the Software, and to permit persons to whom the Software is
56+
furnished to do so, subject to the following conditions:
57+
58+
The above copyright notice and this permission notice shall be included in all
59+
copies or substantial portions of the Software.
60+
61+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67+
SOFTWARE.

0 commit comments

Comments
 (0)