Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b8af8ed
refactoring
maximiliani Sep 10, 2024
8703d65
added indexedDB
maximiliani Sep 11, 2024
901cbd6
extracted color-generated text from HandleType
maximiliani Sep 11, 2024
e9fbefb
extracted copy-button from pid-component
maximiliani Sep 11, 2024
f4a25b0
added caching of preprocessed data in indexedDB
maximiliani Sep 12, 2024
6d14fa2
added caching of preprocessed data in indexedDB for HandleType
maximiliani Sep 13, 2024
4c01481
refactoring
maximiliani Sep 13, 2024
5b99eac
optimized caching
maximiliani Sep 13, 2024
dbb271e
refactoring
maximiliani Oct 24, 2024
86b9290
changed idb to @tempfix/idb
maximiliani Oct 28, 2024
eb42358
updated storybook upload action
maximiliani Oct 28, 2024
8aea795
prettier
maximiliani Oct 28, 2024
dbf2207
eslint and prettier
maximiliani Oct 28, 2024
f0fc7b2
prettier
maximiliani Oct 28, 2024
3cba07f
prettier and eslint
maximiliani Oct 28, 2024
ac94e09
bugfix
maximiliani Oct 29, 2024
a45e616
bugfix
maximiliani Oct 29, 2024
60ce8d5
minor improvements
maximiliani Oct 31, 2024
d97c0f4
comments
maximiliani Oct 31, 2024
e5bb0cd
Merge pull request #283 from kit-data-manager/indexedDB-integration
maximiliani Oct 31, 2024
3f95fd6
bugfix
maximiliani Nov 11, 2024
dec2258
Restructure to monorepo to include react wrapper
craquet Feb 14, 2025
a647216
Merge branch 'kit-data-manager:main' into react-wrapper
craquet Feb 14, 2025
746d447
Switch from connectedCallback to componentWillLoad to fix react issues
craquet Feb 14, 2025
5fefece
Cleanup monorepo structure and fix CI
craquet Feb 17, 2025
8bf09a9
Update readme of react-wrapper to be more helpful
craquet Feb 17, 2025
c0e2b50
Try to publish to registries via lerna
craquet Feb 17, 2025
c58c009
Revive pre-commit and fix npm publish token
craquet Feb 17, 2025
e1dbe90
Merge pull request #311 from craquet/react-wrapper
maximiliani Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@ on:

jobs:
build-component:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Build
run: npm ci

deploy-storybook:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write

steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: npm ci
run: npm ci
- name: Build component
run: npm run build
working-directory: packages/stencil-library
- name: Build Storybook
run: npm run build-storybook
working-directory: packages/stencil-library
- name: Upload Storybook to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: "packages/stencil-library/storybook-static"

- name: Deploy Storybook to GitHub Pages
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
with:
path: storybook-static
build_command: |
npm run build
npm run build-storybook
token: ${{ github.token }}
11 changes: 6 additions & 5 deletions .github/workflows/github-npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci

publish-gpr:
Expand All @@ -24,12 +24,13 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
- run: npx lerna run build
- run: npx lerna publish from-package
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 1 addition & 0 deletions .github/workflows/npm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npx lerna run build
8 changes: 4 additions & 4 deletions .github/workflows/real-npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 19
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm clean-install
- run: npm run build
- run: npm publish --access public
- run: npx lerna run build
- run: npx lerna publish from-package
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
hydrate/
dist/
www/
loader/
Expand Down Expand Up @@ -155,3 +156,5 @@ fabric.properties
!.idea/runConfigurations

# End of https://www.toptal.com/developers/gitignore/api/macos,webstorm+all,storybookjs

.nx
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/Materials-Data-Science-and-Informatics/somesy
rev: "v0.4.2"
hooks:
- id: somesy
# - repo: https://github.com/Materials-Data-Science-and-Informatics/somesy
# rev: "v0.4.2"
# hooks:
# - id: somesy
14 changes: 8 additions & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Ignore artifacts:
.stencil
.storybook
dist
loader
node_modules
www
/src/index.html
/www/
/node_modules/
/dist/
/loader/
/.storybook/
/.stencil/
/storybook-static/
14 changes: 0 additions & 14 deletions .storybook/main.ts

This file was deleted.

12 changes: 0 additions & 12 deletions .storybook/preview-head.html

This file was deleted.

26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
Expand All @@ -14,21 +14,21 @@ religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
Expand Down Expand Up @@ -56,8 +56,8 @@ further defined and clarified by project maintainers.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at {{ email }}. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
complaints will be reviewed and investigated and will result in a response deemed necessary and appropriate to the
circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Please note we have a code of conduct, please follow it in all your interactions
## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
2. State in the Pull Request details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
2. State in the Pull Request details of changes to the interface, this includes new environment variables, exposed
ports, useful file locations and container parameters.
3. Pull Requests are merged after successful review of at least one of the project owners.

## Code of Conduct
Expand Down Expand Up @@ -81,4 +82,5 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org

[version]: http://contributor-covenant.org/version/1/4/
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The `pid-component` is an easily extensible web component that can be used to di
identifiers in a user-friendly way.
It is easily extensible to support other identifier types.

> A [React wrapper]() is also available

The `pid-component` dynamically renders a component based on the value of the `value` property.
Depending on the value, it decides which component to render, what priority to give it, and what props to pass to it.
It also renders itself recursively for all its children when unfolded.
Expand All @@ -14,12 +16,12 @@ By default, it is set to 1, which means that it will only render the first level
You can prohibit unfolding of the component by setting the `current-level-of-subcomponents` to the same value as
the `level-of-subcomponents` property.

To use the component, import the [npm-package](https://www.npmjs.com/package/@kit-data-manager/pid-component) via [unpkg](https://unpkg.com/):
To use the component, import the [npm-package](https://www.npmjs.com/package/@kit-data-manager/pid-component)
via [unpkg](https://unpkg.com/):

```html

<head>
<script type='module' src='https://unpkg.com/@kit-data-manager/pid-component'></script>
<script type="module" src="https://unpkg.com/@kit-data-manager/pid-component"></script>
</head>
```

Expand All @@ -33,7 +35,7 @@ Then, you can use this component like this:

```html

<pid-component value='21.T11981/be908bd1-e049-4d35-975e-8e27d40117e6'></pid-component>
<pid-component value="21.T11981/be908bd1-e049-4d35-975e-8e27d40117e6"></pid-component>
```

You can try this web component in the [demo](https://kit-data-manager.github.io/pid-component).
Expand All @@ -42,24 +44,41 @@ You can try this web component in the [demo](https://kit-data-manager.github.io/

There are detailed docs for the `pid-component` component
available [in the Storybook](https://kit-data-manager.github.io/pid-component) and in
the [source code](src/components/pid-component/readme.md).
the [source code](packages/stencil-library/src/components/pid-component/readme.md).

**Please notice that you must use the hyphenated version of an attribute when using the component directly in HTML (
e.g. `currentLevelOfSubcomponents` -> `current-level-of-subcomponents`).
When using inside Stencil or with JSX/TSX syntax, you must use the camelCase version.**

## Monorepo

This is a monorepo containing the following packages:

- stencil-library (@kit-data-manager/pid-component)
- react-library (@kit-data-manager/react-pid-component)

[Lerna](https://lerna.js.org) is used for managing and building the packages (but you can also do it manually). To use, install Lerna:

npm install --global lerna

and then use it to build the packages:

lerna run build

It will make sure to build the packages in the correct order.

## How to run when developing

1. Clone the repo
2. Run `npm install`

For running storybook in dev mode, run these commands in separate terminals:
For running storybook in dev mode, navigate to `packages/stencil-library` and run these commands in separate terminals:

- `npm run buildWatch`
- `npm run storybook`

Attention: Do **NOT** run `npm run start`. It will cause the storybook to not work properly.
If you did run `npm run start`, delete the following folders and run `npm install` again:
If you did run `npm run start`, delete the following folders (in `packages/stencil-library`) and run `npm install` again:

- `node_modules`
- `www`
Expand Down
4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent"
}
Loading
Loading