bmssp 0.4.0 → 0.5.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/.github/dependabot.yml +19 -0
- package/.github/workflows/dockerhub.yml +49 -0
- package/.github/workflows/npmjs.yml +3 -2
- package/.github/workflows/static.yml +2 -2
- package/Dockerfile +13 -0
- package/package.json +3 -3
- package/src/bmssp.mjs +5 -0
- package/tests/main.js +12 -0
- package/index.js +0 -1
|
@@ -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,49 @@
|
|
|
1
|
+
name: Build and publish Docker image
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*.*.*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
docker-build-and-publish:
|
|
10
|
+
environment:
|
|
11
|
+
name: dockerhub
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Docker meta
|
|
17
|
+
id: meta
|
|
18
|
+
uses: docker/metadata-action@v5
|
|
19
|
+
with:
|
|
20
|
+
# list of Docker images to use as base name for tags
|
|
21
|
+
images: |
|
|
22
|
+
sirivasv/bmssp-js
|
|
23
|
+
# generate Docker tags based on the following events/attributes
|
|
24
|
+
tags: |
|
|
25
|
+
type=semver,pattern={{version}}
|
|
26
|
+
type=semver,pattern={{major}}.{{minor}}
|
|
27
|
+
type=semver,pattern={{major}}
|
|
28
|
+
- name: Checkout
|
|
29
|
+
uses: actions/checkout@v5
|
|
30
|
+
|
|
31
|
+
- name: Login to Docker Hub
|
|
32
|
+
uses: docker/login-action@v3
|
|
33
|
+
with:
|
|
34
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
35
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
36
|
+
|
|
37
|
+
- name: Set up QEMU
|
|
38
|
+
uses: docker/setup-qemu-action@v3
|
|
39
|
+
|
|
40
|
+
- name: Set up Docker Buildx
|
|
41
|
+
uses: docker/setup-buildx-action@v3
|
|
42
|
+
|
|
43
|
+
- name: Build and push
|
|
44
|
+
uses: docker/build-push-action@v6
|
|
45
|
+
with:
|
|
46
|
+
context: .
|
|
47
|
+
platforms: linux/amd64,linux/arm64
|
|
48
|
+
push: true
|
|
49
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
@@ -5,18 +5,19 @@ on:
|
|
|
5
5
|
jobs:
|
|
6
6
|
build-and-publish:
|
|
7
7
|
environment:
|
|
8
|
-
name:
|
|
8
|
+
name: npm-bmssp
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
permissions:
|
|
11
11
|
contents: read
|
|
12
12
|
id-token: write
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
15
|
# Setup .npmrc file to publish to npm
|
|
16
16
|
- uses: actions/setup-node@v4
|
|
17
17
|
with:
|
|
18
18
|
node-version: '24.x'
|
|
19
19
|
registry-url: 'https://registry.npmjs.org'
|
|
20
|
+
- run: npm test
|
|
20
21
|
- run: npm ci
|
|
21
22
|
- run: npm publish --provenance --access public
|
|
22
23
|
env:
|
|
@@ -32,11 +32,11 @@ jobs:
|
|
|
32
32
|
runs-on: ubuntu-latest
|
|
33
33
|
steps:
|
|
34
34
|
- name: Checkout
|
|
35
|
-
uses: actions/checkout@
|
|
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@
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bmssp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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": "
|
|
21
|
+
"type": "module",
|
|
22
22
|
"main": "index.js",
|
|
23
23
|
"directories": {
|
|
24
24
|
"doc": "docs"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"test": "
|
|
27
|
+
"test": "node tests/main.js"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/src/bmssp.mjs
ADDED
package/tests/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();
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log("Hello, World v0.4.0!");
|