bmssp 0.4.0 → 0.6.0

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.
package/.editorconfig ADDED
@@ -0,0 +1,7 @@
1
+ [*]
2
+ charset = utf-8
3
+ end_of_line = lf
4
+ indent_size = 2
5
+ indent_style = space
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
@@ -0,0 +1,19 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "docker"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ - package-ecosystem: "npm" # See documentation for possible values
13
+ directory: "/" # Location of package manifests
14
+ schedule:
15
+ interval: "weekly"
16
+ - package-ecosystem: "github-actions"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "weekly"
@@ -0,0 +1,51 @@
1
+ name: Build and publish Docker image
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ docker-build-and-publish:
9
+ environment:
10
+ name: dockerhub
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ steps:
18
+ - name: Docker meta
19
+ id: meta
20
+ uses: docker/metadata-action@v5
21
+ with:
22
+ # list of Docker images to use as base name for tags
23
+ images: |
24
+ sirivasv/bmssp-js
25
+ # generate Docker tags based on the following events/attributes
26
+ tags: |
27
+ type=semver,pattern={{version}}
28
+ type=semver,pattern={{major}}.{{minor}}
29
+ type=semver,pattern={{major}}
30
+ - name: Checkout code
31
+ uses: actions/checkout@v5
32
+
33
+ - name: Login to Docker Hub
34
+ uses: docker/login-action@v3
35
+ with:
36
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
37
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
38
+
39
+ - name: Set up QEMU
40
+ uses: docker/setup-qemu-action@v3
41
+
42
+ - name: Set up Docker Buildx
43
+ uses: docker/setup-buildx-action@v3
44
+
45
+ - name: Build and push
46
+ uses: docker/build-push-action@v6
47
+ with:
48
+ context: .
49
+ platforms: linux/amd64,linux/arm64
50
+ push: true
51
+ tags: ${{ steps.meta.outputs.tags }}
@@ -0,0 +1,34 @@
1
+ name: Build npm package
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ push:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ npm-build:
11
+ runs-on: ubuntu-latest
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ strategy:
17
+ matrix:
18
+ node-version: [24.x]
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v5
23
+
24
+ - name: Setup Node.js ${{ matrix.node-version }}
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: ${{ matrix.node-version }}
28
+ cache: 'npm'
29
+
30
+ - name: Install dependencies
31
+ run: npm ci
32
+
33
+ - name: Run tests
34
+ run: npm test
@@ -0,0 +1,37 @@
1
+ name: Publish npm package
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ npm-publish:
7
+ environment:
8
+ name: npm-bmssp
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ strategy:
13
+ matrix:
14
+ node-version: [24.x]
15
+
16
+ permissions:
17
+ contents: read
18
+ id-token: write
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v5
23
+
24
+ - name: Setup Node.js ${{ matrix.node-version }}
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: ${{ matrix.node-version }}
28
+ cache: 'npm'
29
+ registry-url: 'https://registry.npmjs.org'
30
+
31
+ - name: Install dependencies
32
+ run: npm ci
33
+
34
+ - name: Publish package
35
+ run: npm publish --provenance --access public
36
+ env:
37
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -32,11 +32,11 @@ jobs:
32
32
  runs-on: ubuntu-latest
33
33
  steps:
34
34
  - name: Checkout
35
- uses: actions/checkout@v4
35
+ uses: actions/checkout@v5
36
36
  - name: Setup Pages
37
37
  uses: actions/configure-pages@v5
38
38
  - name: Upload artifact
39
- uses: actions/upload-pages-artifact@v3
39
+ uses: actions/upload-pages-artifact@v4
40
40
  with:
41
41
  # Upload entire repository
42
42
  path: 'docs/'
package/Dockerfile ADDED
@@ -0,0 +1,13 @@
1
+ FROM node:24-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ # Copy package files and install dependencies
6
+ COPY package*.json ./
7
+ RUN npm install
8
+
9
+ # Mount src/ directory as a volume
10
+ VOLUME ["src/", "tests/"]
11
+
12
+ # Default command (can be overridden)
13
+ CMD ["node", "tests/main.js"]
package/docs/index.html CHANGED
@@ -72,7 +72,7 @@
72
72
  Implementation of the Single Source Shortest Path (SSSP) algorithm - Bounded Multiple Source Shortest Paths (BMSSP), originally published by Tsinghua University's research.
73
73
  </p>
74
74
  <p>
75
- Read the original paper:
75
+ Read the original paper:
76
76
  <a href="https://dl.acm.org/doi/10.1145/3717823.3718179" target="_blank">
77
77
  Tsinghua SSSP Paper
78
78
  </a>
@@ -93,4 +93,4 @@
93
93
  <a class="btn" href="https://github.com/sirivasv/tsinghua-sssp" target="_blank">View on GitHub</a>
94
94
  </div>
95
95
  </body>
96
- </html></svg>
96
+ </html></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmssp",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Javascript package implementation of the bmssp algorithm.",
5
5
  "keywords": [
6
6
  "shortest-paths",
@@ -18,12 +18,12 @@
18
18
  },
19
19
  "license": "MPL-2.0",
20
20
  "author": "Saul Ivan Rivas Vega",
21
- "type": "commonjs",
21
+ "type": "module",
22
22
  "main": "index.js",
23
23
  "directories": {
24
24
  "doc": "docs"
25
25
  },
26
26
  "scripts": {
27
- "test": "echo \"Error: no test specified\" && exit 1"
27
+ "test": "node test/main.js"
28
28
  }
29
29
  }
package/src/bmssp.mjs ADDED
@@ -0,0 +1,5 @@
1
+ function printMessage(message) {
2
+ console.log(message);
3
+ }
4
+
5
+ export { printMessage };
package/test/main.js ADDED
@@ -0,0 +1,12 @@
1
+ import { printMessage } from "../src/bmssp.mjs";
2
+
3
+ function testFunction() {
4
+ try {
5
+ const result = printMessage("Hello, World!");
6
+ console.log('Test passed:', result);
7
+ } catch (error) {
8
+ console.error('Test failed:', error.message);
9
+ }
10
+ }
11
+
12
+ testFunction();
@@ -1,23 +0,0 @@
1
- name: Publish Package to npmjs
2
- on:
3
- release:
4
- types: [published]
5
- jobs:
6
- build-and-publish:
7
- environment:
8
- name: npmjs-publish
9
- runs-on: ubuntu-latest
10
- permissions:
11
- contents: read
12
- id-token: write
13
- steps:
14
- - uses: actions/checkout@v4
15
- # Setup .npmrc file to publish to npm
16
- - uses: actions/setup-node@v4
17
- with:
18
- node-version: '24.x'
19
- registry-url: 'https://registry.npmjs.org'
20
- - run: npm ci
21
- - run: npm publish --provenance --access public
22
- env:
23
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/index.js DELETED
@@ -1 +0,0 @@
1
- console.log("Hello, World v0.4.0!");