Skip to content

Commit 5e977c3

Browse files
committed
merge 'typescript-update' into 'main'
2 parents 422a30e + 4ae751f commit 5e977c3

33 files changed

+5314
-4451
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"extends": "eslint:recommended",
99
"ignorePatterns": "dist/",
1010
"parserOptions": {
11-
"ecmaVersion": 12
11+
"ecmaVersion": 12,
12+
"sourceType": "module"
1213
},
1314
"rules": {
1415
"indent": ["error", 2],

.github/workflows/build.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
test:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
fail-fast: false
20+
21+
steps:
22+
- id: checkout
23+
name: Checkout
24+
uses: actions/checkout@v3
25+
- id: setup-bun
26+
name: Setup Bun
27+
uses: oven-sh/setup-bun@v1
28+
with:
29+
bun-version: latest
30+
- id: install-deps
31+
name: Install dependencies
32+
run: |
33+
bun install
34+
- id: test
35+
name: Run test
36+
run: |
37+
bun test

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/node.js.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: "20.x"
23+
registry-url: "https://registry.npmjs.org/"
24+
25+
- uses: oven-sh/setup-bun@v2
26+
with:
27+
bun-version: latest
28+
29+
- name: Install dependencies using Bun
30+
run: bun install
31+
32+
- name: Run build script using Bun
33+
run: bun run build
34+
35+
- name: Publish to npm
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
run: npm publish --provenance --access public

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://npm.pkg.github.com/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<h1 align="center">cvss.js by <a href="https://turingpoint.eu" target="_blank">turingpoint.</a></h1>
22
<p>
3-
<img alt="Version" src="https://img.shields.io/badge/version-1.5.0-blue.svg?cacheSeconds=2592000" />
3+
<img alt="Version" src="https://img.shields.io/badge/version-2.0.0-blue.svg?cacheSeconds=2592000" />
44
<a href="#" target="_blank">
55
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
66
</a>
77
</p>
88

9-
> A tiny library to work with [CVSS vectors](https://www.first.org/cvss/v3.0/specification-document) (v3.0 and v3.1) in JavaScript. The Common Vulnerability Scoring System (CVSS) is a free and open standard. It is owned and managed by [FIRST.Org](https://first.org).
9+
> A tiny library to work with [CVSS vectors](https://www.first.org/cvss/v3.0/specification-document) (v3.0, v3.1 and v4.0) in JavaScript. The Common Vulnerability Scoring System (CVSS) is a free and open standard. It is owned and managed by [FIRST.Org](https://first.org).
1010
1111
## Installation
1212

@@ -247,5 +247,5 @@ Feel free to check out the [issues page](https://github.com/turingpointde/cvss.j
247247

248248
## License
249249

250-
Copyright © 2022 [turingpoint GmbH](https://turingpoint.eu).
250+
Copyright © 2024 [turingpoint GmbH](https://turingpoint.eu).
251251
This project is [MIT](LICENSE) licensed.

build.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import dts from "bun-plugin-dts";
2+
3+
const output = await Bun.build({
4+
entrypoints: ["index.ts"],
5+
outdir: "./dist",
6+
target: "browser",
7+
minify: false,
8+
plugins: [dts()],
9+
define: {
10+
global: "window",
11+
},
12+
});
13+
14+
if (!output.success) {
15+
for (const log of output.logs) {
16+
console.error(log);
17+
}
18+
}
19+
20+
const output2 = await Bun.build({
21+
entrypoints: ["index.ts"],
22+
outdir: "./dist_node",
23+
target: "node",
24+
minify: false,
25+
plugins: [dts()],
26+
define: {
27+
window: "undefined",
28+
},
29+
});
30+
31+
if (!output2.success) {
32+
for (const log of output2.logs) {
33+
console.error(log);
34+
}
35+
}

0 commit comments

Comments
 (0)