pinggy 0.2.0 → 0.2.1

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.
@@ -1,4 +1,4 @@
1
- name: Build and upload bin to S3
1
+ name: Publish Binaries to GitHub Release
2
2
 
3
3
  on:
4
4
  release:
@@ -98,13 +98,6 @@ jobs:
98
98
  - name: See bin directory
99
99
  run: ls -R ./bin
100
100
 
101
- - name: Configure AWS credentials
102
- uses: aws-actions/configure-aws-credentials@v2
103
- with:
104
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
105
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
106
- aws-region: ${{ secrets.AWS_REGION }}
107
-
108
101
  - name: Upload artifact to GitHub Release
109
102
  env:
110
103
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinggy",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Create secure, shareable tunnels to your localhost and manage them from the command line. ",
@@ -15,16 +15,18 @@
15
15
  "build": "tsup",
16
16
  "start": "node dist/index.js",
17
17
  "test": "jest --config jest.config.js",
18
- "dev": "npm link @pinggy/pinggy && npm run build && npm link"
18
+ "bump": "node scripts/bumpVersion.js --bump && npm install",
19
+ "bump:minor": "node scripts/bumpVersion.js --bump --minor && npm install",
20
+ "bump:major": "node scripts/bumpVersion.js --bump --major && npm install",
21
+ "dev": "npm link @pinggy/pinggy && npm run build && npm link "
19
22
  },
20
- "exports": {
23
+ "exports": {
21
24
  ".": {
22
25
  "types": "./dist/index.d.ts",
23
26
  "import": "./dist/index.js",
24
27
  "require": "./dist/index.cjs"
25
28
  }
26
29
  },
27
-
28
30
  "dependencies": {
29
31
  "@pinggy/pinggy": "^0.2.13",
30
32
  "chalk": "^5.6.2",
@@ -0,0 +1,35 @@
1
+ import { readFileSync, writeFileSync } from "fs";
2
+
3
+ function bumpVersion(version, type = "patch") {
4
+ const [major, minor, patch] = version.split(".").map(Number);
5
+ switch(type) {
6
+ case "major":
7
+ return `${major + 1}.0.0`;
8
+ case "minor":
9
+ return `${major}.${minor + 1}.0`;
10
+ case "patch":
11
+ default:
12
+ return `${major}.${minor}.${patch + 1}`;
13
+ }
14
+ }
15
+
16
+ // Read command line arguments
17
+ const shouldBump = process.argv.includes("--bump");
18
+ const bumpType = process.argv.includes("--major") ? "major"
19
+ : process.argv.includes("--minor") ? "minor"
20
+ : "patch";
21
+
22
+ // Read version from package.json
23
+ const pkg = JSON.parse(readFileSync("package.json", "utf8"));
24
+ let version = pkg.version;
25
+
26
+ // Bump version if requested
27
+ if (shouldBump) {
28
+ version = bumpVersion(version, bumpType);
29
+ // Update package.json
30
+ pkg.version = version;
31
+ writeFileSync("package.json", JSON.stringify(pkg, null, 2) + "\n");
32
+ }
33
+
34
+
35
+ console.log(`Version ${version} synchronized${shouldBump ? " and bumped" : ""}`);