Skip to content

Commit 5c27c43

Browse files
committed
update version
1 parent 96afb1a commit 5c27c43

18 files changed

+59
-130
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
/deno.lock
33
/dist
44
/playground
5-
commit.sh
6-
./version.js
5+
./commit.sh
6+
./version.js
7+
./gitignore

commit.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Error handling: catch any error and show a message
5+
trap 'echo "❌ An error occurred on line $LINENO. Exiting..."; exit 1;' ERR
6+
7+
# 1. Get version and message from arguments
8+
VERSION="$1"
9+
MESSAGE="$2"
10+
11+
# 2. Validate input
12+
if [ -z "$VERSION" ]; then
13+
echo "❌ Error: Please provide a version (e.g., ./version_release.sh 1.2.3 \"your message\")"
14+
exit 1
15+
fi
16+
17+
# Check if version format is correct
18+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
19+
echo "❌ Error: Version must be in format major.minor.patch (e.g. 1.2.3)"
20+
exit 1
21+
fi
22+
23+
if [ -z "$MESSAGE" ]; then
24+
MESSAGE="release: v$VERSION"
25+
fi
26+
27+
# 3. Inject version into deno.json and .d.ts files
28+
echo "✍️ Injecting version into .d.ts files..."
29+
deno run --allow-read --allow-write version.js "$VERSION"
30+
31+
# 4. Git commit and push
32+
echo "📦 Committing and pushing changes..."
33+
git add .
34+
git commit -m "$MESSAGE"
35+
git push
36+
37+
echo "✅ Done! Version $VERSION released with commit message:"
38+
echo " \"$MESSAGE\""

deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tls/enum",
3-
"version": "0.9.6",
3+
"version": "0.9.7",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": [
@@ -27,7 +27,7 @@
2727
}
2828
},
2929
"imports": {
30-
"@aicone/byte": "jsr:@aicone/byte@^0.8.4",
30+
"@aicone/byte": "jsr:@aicone/byte@^0.8.6",
3131
"@noble/curves": "npm:@noble/curves@^1.8.2",
3232
"@noble/hashes": "jsr:@noble/hashes@^1.7.2",
3333
"@peculiar/x509": "npm:@peculiar/x509@^1.12.3",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JavaScript Enum Implementation
22

3-
A robust enumeration implementation for JavaScript/TypeScript that provides Java-style enums with additional features for TLS 1.3 protocol definitions. @version 0.9.6
3+
A robust enumeration implementation for JavaScript/TypeScript that provides Java-style enums with additional features for TLS 1.3 protocol definitions. @version 0.9.7
44

55
## Features
66

src/utils.js

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

type/alert.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Represents alert levels in the protocol
33
* @see https://datatracker.ietf.org/doc/html/rfc8446#section-6
4-
* @version 0.9.6
4+
* @version 0.9.7
55
*/
66
export class AlertLevel extends Enum {
77
/** @type {AlertLevel} warning level (1) */
@@ -23,7 +23,7 @@ export class AlertLevel extends Enum {
2323
/**
2424
* Enum class representing various TLS alert descriptions based on RFC 8446.
2525
* @see https://datatracker.ietf.org/doc/html/rfc8446#section-6
26-
* @version 0.9.6
26+
* @version 0.9.7
2727
*/
2828
export class AlertDescription extends Enum {
2929
/**
@@ -158,7 +158,7 @@ export class AlertDescription extends Enum {
158158
get byte(): Uint8;
159159
}
160160
/**
161-
* @version 0.9.6
161+
* @version 0.9.7
162162
*/
163163
export declare class Alert extends Uint8Array {
164164
/**

type/bimap.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Represents a bidirectional map where keys and values can be interchanged.
3-
* @version 0.9.6
3+
* @version 0.9.7
44
*/
55
export declare class BiMap {
66
constructor();

type/certificatetype.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Uint8 } from "../src/dep.ts";
55
* Represents TLS Certificate Types.
66
* @see https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.7
77
* @extends {Enum}
8-
* @version 0.9.6
8+
* @version 0.9.7
99
*/
1010
export class CertificateType extends Enum {
1111
/** Certificate type X.509 */

type/cipher.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Enum } from "../src/enum.js";
44
/**
55
* Represents a cipher suite used in TLS 1.3.
66
* The cipher suite includes the encryption algorithm, mode, and hash function.
7-
* @version 0.9.6
7+
* @version 0.9.7
88
*/
99
export class Cipher extends Enum {
1010
/**

type/contentype.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Enum } from "../src/enum.js";
55
* Represents the higher-level protocol used to process the enclosed fragment.
66
* Defined in RFC 8446 Section 5.1.
77
* @see https://datatracker.ietf.org/doc/html/rfc8446#section-5.1
8-
* @version 0.9.6
8+
* @version 0.9.7
99
*/
1010
export class ContentType extends Enum {
1111
/** Represents an invalid ContentType (value 0). */

0 commit comments

Comments
 (0)