Skip to content

Commit c540a72

Browse files
authored
Merge pull request #9 from aaronzi/main
Adds action for releasing to https://registry.npmjs.org
2 parents f5b52f0 + 81bdc9b commit c540a72

File tree

5 files changed

+114
-187
lines changed

5 files changed

+114
-187
lines changed

.github/workflows/publish.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
19+
registry-url: 'https://registry.npmjs.org/'
20+
21+
- name: Install Yarn
22+
run: npm install -g yarn
23+
24+
- name: Install dependencies
25+
run: yarn install
26+
27+
- name: Lint code
28+
run: yarn lint:check
29+
30+
- name: Run tests
31+
run: yarn test
32+
33+
- name: Update package.json version
34+
id: version
35+
run: |
36+
# Extract the version from the release tag
37+
TAG_VERSION=${GITHUB_REF#refs/tags/}
38+
VERSION=${TAG_VERSION#v} # Remove 'v' prefix if present
39+
40+
# Update package.json version
41+
yarn version --new-version $VERSION --no-git-tag-version
42+
43+
# Output the version for later steps
44+
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
45+
env:
46+
GITHUB_REF: ${{ github.ref }}
47+
48+
- name: Commit updated package.json
49+
run: |
50+
git config user.name "github-actions[bot]"
51+
git config user.email "github-actions[bot]@users.noreply.github.com"
52+
git add package.json yarn.lock
53+
git commit -m "chore: update package.json to version $PACKAGE_VERSION" || echo "No changes to commit"
54+
git push origin ${{ github.ref }} || echo "Nothing to push"
55+
56+
# 8. Build the project
57+
- name: Build project
58+
run: yarn build
59+
60+
# 9. Publish to npm
61+
- name: Publish to npm
62+
run: yarn publish
63+
env:
64+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,44 @@
11
# basyx-typescript-sdk
2+
23
BaSyx TypeScript SDK for developing applications and components for the Asset Administration Shell (AAS)
4+
5+
## Features
6+
7+
Clients for the AAS API components:
8+
- AAS Repository
9+
- Submodel Repository (coming soon)
10+
- Concept Description Repository (coming soon)
11+
- AAS Registry (coming soon)
12+
- Submodel Registry (coming soon)
13+
- AAS Discovery Service (coming soon)
14+
- AASX File Service (coming soon)
15+
16+
Utility functions for working with AAS data:
17+
- Coming soon
18+
19+
## Installation
20+
21+
```bash
22+
npm install basyx-typescript-sdk
23+
```
24+
25+
## Usage
26+
27+
```typescript
28+
import { AasRepositoryClient } from 'basyx-typescript-sdk';
29+
30+
async function getAllShells() {
31+
const baseURL = 'http://localhost:8081';
32+
const client = new AasRepositoryClient();
33+
34+
try {
35+
const response = await client.getAllAssetAdministrationShells(baseURL);
36+
console.log('Asset Administration Shells fetched successfully:', response);
37+
// You can now use the response as needed
38+
} catch (error) {
39+
console.error('Error fetching Asset Administration Shells:', error);
40+
}
41+
}
42+
43+
getAllShells();
44+
```

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{
22
"name": "basyx-typescript-sdk",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "BaSyx TypeScript SDK for developing applications and components for the Asset Administration Shell (AAS)",
5-
"main": "index.ts",
5+
"main": "dist/index.js",
66
"repository": "https://github.com/eclipse-basyx/basyx-typescript-sdk.git",
77
"author": "Aaron Zielstorff <aaron.zielstorff@iese.fraunhofer.de>",
88
"license": "MIT",
9+
"files": [
10+
"dist",
11+
"src",
12+
"README.md",
13+
"LICENSE"
14+
],
915
"scripts": {
1016
"gen:aasrepository": "openapi-ts -c @hey-api/client-fetch -i ./openapi/Plattform_i40-AssetAdministrationShellRepositoryServiceSpecification-V3.0.3_SSP-001-resolved.json -o ./src/generated/aas-repository",
1117
"build": "tsc",

src/PoweredByBaSyx.svg

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

src/testFunctions.ts

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

0 commit comments

Comments
 (0)