Skip to content

Commit acf4788

Browse files
authored
Merge pull request #76 from kit-data-manager/main
Rebase
2 parents 3e41f93 + dd7c876 commit acf4788

18 files changed

+1941
-2522
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ updates:
99
directory: "/" # Location of package manifests
1010
target-branch: "dev"
1111
schedule:
12-
interval: "monthly"
12+
interval: "weekly"
1313
- package-ecosystem: "github-actions"
1414
directory: "/"
1515
target-branch: "dev"

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# CI workflow to install, lint, build, and upload artifacts
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [ main, '**' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: 'npm'
22+
- name: Install dependencies
23+
run: npm ci
24+
- name: Lint
25+
run: npm run lint --if-present
26+
- name: Build
27+
run: npm run build
28+
- name: Upload dist artifact
29+
if: success()
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: dist
33+
path: dist/

.github/workflows/npm-publish.yml

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,77 @@
11
# Derived from: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
22

3-
name: Node.js Package
3+
name: Publish Node.js Package
44

55
on:
66
release:
77
types: [published]
88

9+
permissions:
10+
contents: read
11+
packages: write
12+
913
jobs:
10-
publish-npm:
14+
build:
1115
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
1218
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
1521
with:
16-
node-version: 19
17-
registry-url: https://registry.npmjs.org/
18-
- run: npm clean-install
22+
node-version: 20
23+
cache: 'npm' # Added caching
24+
- run: npm ci
1925
- run: npm run build
26+
- name: Upload build artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: build-output
30+
path: dist/
31+
32+
publish-gpr:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
packages: write
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: 20
43+
cache: 'npm'
44+
registry-url: 'https://npm.pkg.github.com'
45+
scope: '@kit-data-manager'
46+
- name: Download build artifacts
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: build-output
50+
path: dist/
51+
- run: npm ci
2052
- run: npm publish --access public
2153
env:
22-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
54+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
55+
56+
publish-npm:
57+
needs: build
58+
runs-on: ubuntu-latest
59+
permissions:
60+
contents: read
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-node@v4
64+
with:
65+
node-version: 20
66+
cache: 'npm'
67+
registry-url: 'https://registry.npmjs.org'
68+
scope: '@kit-data-manager'
69+
- name: Download build artifacts
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: build-output
73+
path: dist/
74+
- run: npm ci
75+
- run: npm publish --provenance --access public
76+
env:
77+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.prettierignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# Ignore artifacts:
1+
node_modules
2+
dist
3+
.dist # Ignore artifacts:
24
build
35
dist
46
coverage
5-
.vscode
7+
.vscode
8+
src/template.html

.prettierrc.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
{}
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"printWidth": 100,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"semi": true,
7+
"singleQuote": true,
8+
"trailingComma": "all",
9+
"bracketSpacing": true,
10+
"arrowParens": "always",
11+
"endOfLine": "lf",
12+
"quoteProps": "as-needed",
13+
"proseWrap": "preserve",
14+
"overrides": [
15+
{
16+
"files": ["*.yml", "*.yaml"],
17+
"options": { "singleQuote": false }
18+
}
19+
]
20+
}

CITATION.cff

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cff-version: 1.2.0
2+
message: If you use this software, please cite it using these metadata.
3+
type: software
4+
title: mapping-service-input
5+
abstract: The mapping-service-input provides a minimalistic user interface for
6+
the KIT Data Manager Mapping Service. It allows users to select an existing
7+
mapping schema and use it to map their data.
8+
version: 1.2.0
9+
keywords:
10+
- metadata
11+
- JSON
12+
- mapping
13+
- form
14+
- kit-data-manager
15+
- typescript
16+
authors:
17+
- orcid: https://orcid.org/0009-0005-2800-4833
18+
given-names: Maximilian
19+
affiliation: Karlsruhe Institute of Technology (KIT)
20+
21+
family-names: Inckmann
22+
- orcid: https://orcid.org/0000-0003-2804-688X
23+
affiliation: Karlsruhe Institute of Technology (KIT)
24+
given-names: Thomas
25+
family-names: Jejkal
26+
- orcid: https://orcid.org/0000-0001-6575-1022
27+
affiliation: Karlsruhe Institute of Technology (KIT)
28+
given-names: Andreas
29+
family-names: Pfeil
30+
31+
given-names: Ajay
32+
family-names: Kirar
33+
orcid: https://orcid.org/0009-0008-3532-7018
34+
license: Apache-2.0
35+
url: https://kit-data-manager.github.io/com_mapping-service-input
36+
repository-code: https://github.com/kit-data-manager/com_mapping-service-input

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# com_mapping-service-input
22

3-
4-
5-
Mapping Component Overview:
3+
[![Build](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/ci.yml)
4+
[![CodeQL](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/github-code-scanning/codeql)
5+
[![npm version](https://img.shields.io/npm/v/@kit-data-manager/mapping-service-input.svg)](https://www.npmjs.com/package/@kit-data-manager/mapping-service-input)
6+
[![GitHub Packages](https://img.shields.io/badge/GitHub%20Packages-published-2ea44f?logo=github)](https://github.com/kit-data-manager/com_mapping-service-input/pkgs/npm/mapping-service-input)
67

78
The Mapping component serves as a user-friendly interface to extract metadata from data generated by instruments and map it to metadata schema.Our mappings are designed to align with widely accepted community schemes, custom-tailored for various techniques.
89

@@ -15,27 +16,38 @@ To integrate the Mapping component into your project, insert the following HTML
1516

1617
```html
1718
<head>
18-
...
19-
<!-- add the below code !-->
20-
<script type="module" src="https://cdn.jsdelivr.net/npm/@kit-data-manager/mapping-service-input@latest/dist/com_mapping-service-input.es.js"></script>
19+
...
20+
<!-- add the below code !-->
21+
<script
22+
type="module"
23+
src="https://cdn.jsdelivr.net/npm/@kit-data-manager/mapping-service-input@latest/dist/com_mapping-service-input.es.js"
24+
></script>
2125
</head>
2226
<body>
23-
<!-- use the component !-->
24-
<mapping-input base-url="http://localhost:8090/" id="input-component"></mapping-input>
27+
<!-- use the component !-->
28+
<mapping-input base-url="http://localhost:8090/" id="input-component"></mapping-input>
2529
</body>
2630
```
31+
2732
**Invoke the Download Functionality**:
2833

2934
For enabling the download functionality, include the following HTML code in your page:
30-
```html
3135

32-
`<div class="ui center aligned grid">
33-
<button type="submit" class="ui primary button" id="submit" onclick="
34-
var component = document.getElementById('input-component');
35-
component.executeMapping(true)">Map document
36+
```html
37+
`
38+
<div class="ui center aligned grid">
39+
<button
40+
type="submit"
41+
class="ui primary button"
42+
id="submit"
43+
onclick="
44+
const component = document.getElementById('input-component');
45+
component.executeMapping(true)"
46+
>
47+
Map document
3648
</button>
37-
</div>`
38-
49+
</div>
50+
`
3951
```
4052

4153
The executeMapping(true) method call triggers both the mapping process and the subsequent download of the result.
@@ -45,7 +57,6 @@ The base-url attribute in the <mapping-input> element allows you to specify the
4557

4658
By following these steps, you can easily integrate the Mapping component into your project and utilize its capabilities for extracting metadata from instrument-generated data.
4759

48-
4960
## How to run - For developers
5061

5162
To start using the component clone this repo to a new directory:
@@ -67,18 +78,11 @@ npm run build
6778
npm run dev
6879
```
6980

70-
7181
## Attributes
7282

7383
- `base-url`: string, base-url to your Mapping Service instance
7484

75-
7685
## Methods
77-
- `executeMapping(true)`: To trigger the mapping process, you can include the following HTML code in your project:
78-
(true in the method argument will trigger mapping + download of the result)
79-
80-
8186

82-
83-
84-
87+
- `executeMapping(true)`: To trigger the mapping process, you can include the following HTML code in your project:
88+
(true in the method argument will trigger mapping + download of the result)

codemeta.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"@context": [
3+
"https://doi.org/10.5063/schema/codemeta-2.0",
4+
"https://w3id.org/software-iodata",
5+
"https://raw.githubusercontent.com/jantman/repostatus.org/master/badges/latest/ontology.jsonld",
6+
"https://schema.org",
7+
"https://w3id.org/software-types"
8+
],
9+
"@type": "SoftwareSourceCode",
10+
"author": [
11+
{
12+
"@type": "Person",
13+
"givenName": "Ajay",
14+
"familyName": "Kirar",
15+
"@id": "https://orcid.org/0009-0008-3532-7018",
16+
"identifier": "https://orcid.org/0009-0008-3532-7018"
17+
}
18+
],
19+
"name": "mapping-service-input",
20+
"description": "The mapping-service-input provides a minimalistic user interface for the KIT Data Manager Mapping Service. It allows users to select an existing mapping schema and use it to map their data.",
21+
"version": "1.2.0",
22+
"keywords": ["metadata", "JSON", "mapping", "form", "kit-data-manager", "typescript"],
23+
"license": ["https://spdx.org/licenses/Apache-2.0"],
24+
"softwareHelp": "https://kit-data-manager.github.io/com_mapping-service-input",
25+
"codeRepository": "https://github.com/kit-data-manager/com_mapping-service-input",
26+
"buildInstructions": "https://kit-data-manager.github.io/com_mapping-service-input",
27+
"contributor": [
28+
{
29+
"@type": "Person",
30+
"givenName": "Maximilian",
31+
"familyName": "Inckmann",
32+
"email": "[email protected]",
33+
"@id": "https://orcid.org/0009-0005-2800-4833",
34+
"identifier": "https://orcid.org/0009-0005-2800-4833",
35+
"affiliation": "Karlsruhe Institute of Technology (KIT)"
36+
},
37+
{
38+
"@type": "Person",
39+
"givenName": "Thomas",
40+
"familyName": "Jejkal",
41+
"@id": "https://orcid.org/0000-0003-2804-688X",
42+
"identifier": "https://orcid.org/0000-0003-2804-688X",
43+
"affiliation": "Karlsruhe Institute of Technology (KIT)"
44+
},
45+
{
46+
"@type": "Person",
47+
"givenName": "Andreas",
48+
"familyName": "Pfeil",
49+
"@id": "https://orcid.org/0000-0001-6575-1022",
50+
"identifier": "https://orcid.org/0000-0001-6575-1022",
51+
"affiliation": "Karlsruhe Institute of Technology (KIT)"
52+
}
53+
],
54+
"url": "https://kit-data-manager.github.io/com_mapping-service-input"
55+
}

eslint.config.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// ESLint flat config for ESLint 9
2+
import js from '@eslint/js';
3+
import tseslint from 'typescript-eslint';
4+
import globals from 'globals';
5+
6+
export default [
7+
{ ignores: ['dist/**', 'node_modules/**'] },
8+
js.configs.recommended,
9+
...tseslint.configs.recommended,
10+
{
11+
languageOptions: {
12+
parser: tseslint.parser,
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
},
17+
globals: { ...globals.browser, ...globals.es2021 },
18+
},
19+
rules: {},
20+
},
21+
];

0 commit comments

Comments
 (0)