Skip to content

Commit d2741bd

Browse files
committed
Add license and sourcemap generation
1 parent ec2430e commit d2741bd

File tree

9 files changed

+237
-3
lines changed

9 files changed

+237
-3
lines changed

.github/workflows/licensed.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This workflow checks the statuses of cached dependencies used in this action
2+
# with the help of the Licensed tool. If any licenses are invalid or missing,
3+
# this workflow will fail. See: https://github.com/licensee/licensed
4+
5+
name: Licensed
6+
7+
on:
8+
# Uncomment the below lines to run this workflow on pull requests and pushes
9+
# to the default branch. This is useful for checking licenses before merging
10+
# changes into the default branch.
11+
# pull_request:
12+
# branches:
13+
# - main
14+
# push:
15+
# branches:
16+
# - main
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: write
21+
22+
jobs:
23+
licensed:
24+
name: Check Licenses
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout
29+
id: checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
id: setup-node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version-file: .node-version
37+
cache: npm
38+
39+
- name: Install Dependencies
40+
id: npm-ci
41+
run: npm ci
42+
43+
- name: Setup Ruby
44+
id: setup-ruby
45+
uses: ruby/setup-ruby@v1
46+
with:
47+
ruby-version: ruby
48+
49+
- uses: github/setup-licensed@v1
50+
with:
51+
version: 4.x
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
54+
# If this is a workflow_dispatch event, update the cached licenses.
55+
- if: ${{ github.event_name == 'workflow_dispatch' }}
56+
name: Update Licenses
57+
id: update-licenses
58+
run: licensed cache
59+
60+
# Commit the updated licenses to the repository.
61+
- if: ${{ github.event_name == 'workflow_dispatch' }}
62+
name: Commit Licenses
63+
id: commit-licenses
64+
run: |
65+
git config --local user.email "[email protected]"
66+
git config --local user.name "licensed-ci"
67+
git add .
68+
git commit -m "Auto-update license files"
69+
git push
70+
71+
- name: Check Licenses
72+
id: check-licenses
73+
run: licensed status

.licensed.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See: https://github.com/licensee/licensed/blob/main/docs/configuration.md
2+
3+
sources:
4+
npm: true
5+
6+
allowed:
7+
- apache-2.0
8+
- bsd-2-clause
9+
- bsd-3-clause
10+
- isc
11+
- mit
12+
- cc0-1.0
13+
- other
14+
15+
ignored:
16+
npm:
17+
# Used by Rollup.js when building in GitHub Actions
18+
- '@rollup/rollup-linux-x64-gnu'

.licenses/npm/@fastify/busboy.dep.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: "@fastify/busboy"
3+
version: 2.1.1
4+
type: npm
5+
summary: A streaming parser for HTML form data for node.js
6+
homepage:
7+
license: mit
8+
licenses:
9+
- sources: LICENSE
10+
text: |-
11+
Copyright Brian White. All rights reserved.
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a copy
14+
of this software and associated documentation files (the "Software"), to
15+
deal in the Software without restriction, including without limitation the
16+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
17+
sell copies of the Software, and to permit persons to whom the Software is
18+
furnished to do so, subject to the following conditions:
19+
20+
The above copyright notice and this permission notice shall be included in
21+
all copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29+
IN THE SOFTWARE.
30+
notices: []

.licenses/npm/tunnel.dep.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: tunnel
3+
version: 0.0.6
4+
type: npm
5+
summary: Node HTTP/HTTPS Agents for tunneling proxies
6+
homepage: https://github.com/koichik/node-tunnel/
7+
license: mit
8+
licenses:
9+
- sources: LICENSE
10+
text: |
11+
The MIT License (MIT)
12+
13+
Copyright (c) 2012 Koichi Kobayashi
14+
15+
Permission is hereby granted, free of charge, to any person obtaining a copy
16+
of this software and associated documentation files (the "Software"), to deal
17+
in the Software without restriction, including without limitation the rights
18+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19+
copies of the Software, and to permit persons to whom the Software is
20+
furnished to do so, subject to the following conditions:
21+
22+
The above copyright notice and this permission notice shall be included in
23+
all copies or substantial portions of the Software.
24+
25+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31+
THE SOFTWARE.
32+
- sources: README.md
33+
text: Licensed under the [MIT](https://github.com/koichik/node-tunnel/blob/master/LICENSE)
34+
license.
35+
notices: []

.licenses/npm/undici.dep.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: undici
3+
version: 5.28.5
4+
type: npm
5+
summary: An HTTP/1.1 client, written from scratch for Node.js
6+
homepage: https://undici.nodejs.org
7+
license: mit
8+
licenses:
9+
- sources: LICENSE
10+
text: |
11+
MIT License
12+
13+
Copyright (c) Matteo Collina and Undici contributors
14+
15+
Permission is hereby granted, free of charge, to any person obtaining a copy
16+
of this software and associated documentation files (the "Software"), to deal
17+
in the Software without restriction, including without limitation the rights
18+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19+
copies of the Software, and to permit persons to whom the Software is
20+
furnished to do so, subject to the following conditions:
21+
22+
The above copyright notice and this permission notice shall be included in all
23+
copies or substantial portions of the Software.
24+
25+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31+
SOFTWARE.
32+
- sources: README.md
33+
text: MIT
34+
notices: []

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,48 @@ following steps:
259259
commits, tags and branches to the remote repository. From here, you will need
260260
to create a new release in GitHub so users can easily reference the new tags
261261
in their workflows.
262+
263+
## Dependency License Management
264+
265+
This template includes a GitHub Actions workflow,
266+
[`licensed.yml`](./.github/workflows/licensed.yml), that uses
267+
[Licensed](https://github.com/licensee/licensed) to check for dependencies with
268+
missing or non-compliant licenses. This workflow is initially disabled. To
269+
enable the workflow, follow the below steps.
270+
271+
1. Open [`licensed.yml`](./.github/workflows/licensed.yml)
272+
1. Uncomment the following lines:
273+
274+
```yaml
275+
# pull_request:
276+
# branches:
277+
# - main
278+
# push:
279+
# branches:
280+
# - main
281+
```
282+
283+
1. Save and commit the changes
284+
285+
Once complete, this workflow will run any time a pull request is created or
286+
changes pushed directly to `main`. If the workflow detects any dependencies with
287+
missing or non-compliant licenses, it will fail the workflow and provide details
288+
on the issue(s) found.
289+
290+
### Updating Licenses
291+
292+
Whenever you install or update dependencies, you can use the Licensed CLI to
293+
update the licenses database. To install Licensed, see the project's
294+
[README](https://github.com/licensee/licensed?tab=readme-ov-file#installation).
295+
296+
To update the cached licenses, run the following command:
297+
298+
```bash
299+
licensed cache
300+
```
301+
302+
To check the status of cached licenses, run the following command:
303+
304+
```bash
305+
licensed status
306+
```

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const config = {
1212
format: 'es',
1313
sourcemap: true
1414
},
15-
plugins: [typescript(), nodeResolve(), commonjs()]
15+
plugins: [typescript(), nodeResolve({ preferBuiltins: true }), commonjs()]
1616
}
1717

1818
export default config

tsconfig.base.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"noUnusedParameters": false,
1616
"pretty": true,
1717
"resolveJsonModule": true,
18-
"sourceMap": true,
1918
"strict": true,
2019
"strictNullChecks": true,
2120
"target": "ES2022"

0 commit comments

Comments
 (0)