@hackthedev/socket-tools 1.0.1 → 1.0.3

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.
@@ -0,0 +1,43 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ persist-credentials: true
19
+
20
+ - name: Skip version bump commits
21
+ run: |
22
+ if git log -1 --pretty=%B | grep -q "chore: bump version"; then
23
+ echo "Version bump commit detected, skipping."
24
+ exit 0
25
+ fi
26
+
27
+ - uses: actions/setup-node@v4
28
+ with:
29
+ node-version: 20
30
+ registry-url: https://registry.npmjs.org/
31
+
32
+ - run: npm ci
33
+
34
+ - run: |
35
+ git config user.name "github-actions"
36
+ git config user.email "actions@github.com"
37
+ npm version patch -m "chore: bump version %s"
38
+ git push
39
+
40
+ - run: npm publish --access public
41
+ env:
42
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43
+
package/index.mjs CHANGED
@@ -18,7 +18,7 @@ export default class SocketTools {
18
18
  if (!maxHttpBufferSize) maxHttpBufferSize = 1e8;
19
19
  if (!pingInterval) pingInterval = 25000;
20
20
  if (!pingTimeout) pingTimeout = 60000;
21
- if (!modulesDir) modulesDir = path.join(process.cwd(), "modules/sockets");
21
+ if (!modulesDir) this.modulesDir = path.join(process.cwd(), "modules/sockets");
22
22
 
23
23
  if (!cors?.origin) cors.origin = "*";
24
24
  if (!cors?.methods) cors.methods = ["GET", "POST"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackthedev/socket-tools",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "This small and awesome library was made to simplify a basic socket.io setup by using an existing express server. In this example the express server will be setup with the [express-starter](#) library. The library will scan a directory for files that include socket.io handlers to keep everything modular without pain. Files inside the scanned directory that do not have the required socket handler block will fail to load and cause an error.",
5
5
  "license": "ISC",
6
6
  "author": "",