diff --git a/.github/DISCUSSION_TEMPLATE/ideas.yml b/.github/DISCUSSION_TEMPLATE/ideas.yml new file mode 100644 index 0000000000..0e7db94209 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/ideas.yml @@ -0,0 +1,39 @@ +title: '🚀 Feature: ' +labels: ['feature'] +body: + - type: textarea + attributes: + label: Goals + description: | + Short list of what the feature request aims to address? + value: | + 1. + 2. + 3. + validations: + required: true + - type: textarea + attributes: + label: Non-Goals + description: | + Short list of what the feature request **does not** aim to address? + value: | + 1. + 2. + 3. + validations: + required: false + - type: textarea + attributes: + label: Background + description: | + Discuss prior art, why do you think this feature is needed? Are there current alternatives? + validations: + required: true + - type: textarea + attributes: + label: Proposal + description: | + How should this feature be implemented? Are you interested in contributing? + validations: + required: true \ No newline at end of file diff --git a/.github/DISCUSSION_TEMPLATE/q-a.yml b/.github/DISCUSSION_TEMPLATE/q-a.yml new file mode 100644 index 0000000000..5c7a878405 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/q-a.yml @@ -0,0 +1,25 @@ +title: '🙏 Help: ' +labels: ['help wanted'] +body: + - type: textarea + attributes: + label: Summary + description: | + What do you need help with? + validations: + required: true + - type: textarea + attributes: + label: Additional information + description: | + Any code snippets, error messages, or dependency details that may be related? (`Please run `npx @public-ui/kolibri-cli info` and paste the result`) + render: js + validations: + required: false + - type: input + attributes: + label: Example + description: | + A link to a minimal reproduction is helpful for collaborative debugging! + validations: + required: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml new file mode 100644 index 0000000000..9c0ddc697b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -0,0 +1,171 @@ +name: Report a bug +description: All relevant bugs, e.g. faulty components or examples +title: '🐞 Bug: ' +labels: ['bug'] +body: + - type: markdown + attributes: + value: | + This template is to report KoliBri bugs. Documentation related bug should be reported using [this](https://github.com/public-ui/kolibri/issues/new/choose) issue template instead. + Feature requests should be opened as [discussions](https://github.com/public-ui/kolibri/discussions/new?category=ideas). + + Before opening a new issue, please do a [search](https://github.com/public-ui/kolibri/issues) of existing issues and :+1: upvote the existing issue instead. This will result in a quicker resolution. + + If you need help with your own project, you can start a discussion in the ["Q&A" section](https://github.com/public-ui/kolibri/discussions/new?category=q-a) + + Please fill out the form: + ------------------------------------------------------------------------------------------------------ + - type: checkboxes + id: verify_release + attributes: + label: Verify current release + options: + - label: I verified that the issue exists in the latest KoliBri v1 or v2 release + required: true + - type: input + id: reproduction_url + attributes: + label: Link to the code that reproduces this issue + description: | + A link to a **public** GitHub repository or a StackBlitz minimal reproduction. Minimal reproductions should be created from our actual released versions (e.g. v1, v2, ...) and should include only changes that contribute to the issue. StackBlitz templates can be found under the followjng url's: + + - [KoliBri (v1)](https://stackblitz.com/edit/vitejs-vite-dcg6xo) + - [KoliBri (v2)](https://stackblitz.com/edit/vitejs-vite-kkfhk5) + placeholder: 'https://github.com/user/my-minimal-kolibri-issue-reproduction or https://stackblitz.com/edit/XXXXXX' + validations: + required: false + - type: dropdown + id: affected_themes + attributes: + label: Which theme(s) are affected? + description: | + If you are not sure select "Not sure". If you see the bug in all themes select "All" or select theme by theme were the bug occurs. + multiple: true + options: + - 'Not sure' + - 'All' + - 'Bundesministerium der Finanzen' + - 'Default' + - 'European Comission' + - 'European Union' + - 'Informationstechnikzentrum Bund' + - 'Unstyled' + validations: + required: true + - type: input + id: error_category + attributes: + label: Can you categorise where the error occurs? (If known) + placeholder: Native (Web Component), React, Angular, ... + validations: + required: false + - type: input + id: browser_info + attributes: + label: Which browser or operating system do you used to test KoliBri? (If available) + placeholder: Firefox, Chrome, iOS 12.4, ... + validations: + required: false + - type: dropdown + id: affected_components + attributes: + label: Which component/area(s) are affected? (Select all that apply) + multiple: true + options: + - 'Not sure' + - 'Abbr' + - 'Accordion' + - 'Alert' + - 'Avatar' + - 'Badge' + - 'Breadcrumb' + - 'Button-Link' + - 'Button' + - 'Card' + - 'Combobox' + - 'Details' + - 'Form' + - 'Heading' + - 'Icon' + - 'Image' + - 'Input-Checkbox' + - 'Input-Color' + - 'Input-Date' + - 'Input-Email' + - 'Input-File' + - 'Input-Number' + - 'Input-Password' + - 'Input-Radio' + - 'Input-Range' + - 'Input-Text' + - 'Link-Button' + - 'Link' + - 'Modal' + - 'Nav' + - 'Pagination' + - 'Progress' + - 'Quote' + - 'Select' + - 'Spin' + - 'Split-Button' + - 'Table' + - 'Tabs' + - 'Textarea' + - 'Toast' + - 'Toolbar' + - 'Tree' + - 'Version' + validations: + required: true + - type: textarea + id: reproduction_steps + attributes: + label: To Reproduce + description: | + A step-by-step description of how to reproduce the issue. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken. + placeholder: | + 1. Click X + 2. Y will happen + 3. Z throws a bug + validations: + required: true + - type: textarea + id: current_vs_expected_behavior + attributes: + label: Current vs. Expected behavior + description: | + A clear and concise description of what the bug is, and what you expected to happen. + placeholder: 'Following the steps from the previous section, I expected A to happen, but I observed B instead' + validations: + required: true + - type: textarea + id: environment_info + attributes: + label: Provide environment information + description: | + Please run `npx @public-ui/kolibri-cli info` in the root directory of your project and paste the results. + render: bash + placeholder: | + { + "Operating System": { + "platform": "darwin", + "arch": "arm64", + "version": "23.2.0" + }, + "Binaries": { + "node": "v20.9.0", + "npm": "10.1.0", + "yarn": "3.2.4", + "pnpm": "9.1.3" + }, + "Relevant Packages": { + "@public-ui/core": "N/A", + "@public-ui/react": "^2.1.1", + "@public-ui/...": "N/A", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "typescript": "N/A" + } + } + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/2.doc_report.yml b/.github/ISSUE_TEMPLATE/2.doc_report.yml new file mode 100644 index 0000000000..8a4b662215 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2.doc_report.yml @@ -0,0 +1,28 @@ +name: Report a documentation issue +description: Create a report for KoliBri documentation +title: '📖 Docs: ' +labels: ['doc'] +body: + - type: textarea + id: update + attributes: + label: What is the update you wish to see? + description: | + Example: I would like to fix an example using the `` component. Or, the `` component docs are missing information. + validations: + required: true + - type: textarea + id: context + attributes: + label: Is there any context that might help us understand? + description: | + A clear description of any added context that might help us understand. + validations: + required: true + - type: input + id: link + attributes: + label: Does the docs page already exist? Please link to it. + description: 'Example: https://public-ui.github.io/docs/components/abbr' + validations: + required: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..01df3fefec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - name: Report a feature request + url: https://github.com/public-ui/kolibri/discussions/new?category=ideas + about: Feature or docs requests should be opened as discussions. + - name: Ask a question + url: https://github.com/public-ui/kolibri/discussions/new?category=q-a + about: Ask questions and discuss with other community members. \ No newline at end of file diff --git a/.github/actions/pnpm-setup/action.yml b/.github/actions/pnpm-setup/action.yml new file mode 100644 index 0000000000..b68760376b --- /dev/null +++ b/.github/actions/pnpm-setup/action.yml @@ -0,0 +1,21 @@ +# References: +# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data +# - https://github.com/pnpm/action-setup + +name: pnpm Setup +description: Install Node and pnpm, install dependencies +runs: + using: "composite" + steps: + - uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: false + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'pnpm' + + - run: pnpm install + shell: bash diff --git a/.github/dod.yml b/.github/dod.yml index dfd4fedd81..ed9e2149d2 100644 --- a/.github/dod.yml +++ b/.github/dod.yml @@ -1,6 +1,6 @@ dod: - - Meaningful title for the release notes - - Pull request is linked to a problem - - All changes relate to the problem - - A11y tests performed successfully or not relevant - - Manual test performed successfully (by reviewer) or not relevant + - Meaningful pull request title for the release notes + - Pull request is linked to an issue and all changes relate to the issue + - Tests to protect this code implemented (if applicable) + - Manual test performed successfully (if applicable) + - Documentation or migration has been updated (if applicable) diff --git a/.github/test.txt b/.github/test.txt new file mode 100644 index 0000000000..9daeafb986 --- /dev/null +++ b/.github/test.txt @@ -0,0 +1 @@ +test diff --git a/.github/workflows/auto-dependency-updater.yml b/.github/workflows/auto-dependency-updater.yml index 724a5388c7..37514df57c 100644 --- a/.github/workflows/auto-dependency-updater.yml +++ b/.github/workflows/auto-dependency-updater.yml @@ -1,8 +1,12 @@ name: Auto dependency updater +env: + issue: 6350 + version: v2 + on: - schedule: - - cron: '0 2 * * *' + # schedule: + # - cron: '0 2 * * *' workflow_dispatch: jobs: @@ -13,9 +17,8 @@ jobs: with: fetch-depth: 0 persist-credentials: false - ref: 'develop' - # - uses: pnpm/action-setup@v3 + # - uses: pnpm/action-setup@v4 # with: # run_install: false # version: 8 @@ -25,48 +28,44 @@ jobs: # node-version: 20 # https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time - - name: Install Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: # cache: pnpm node-version: 20 - - uses: pnpm/action-setup@v3 - name: Install pnpm + - uses: pnpm/action-setup@v4 id: pnpm-install with: - version: 8 + version: 9 run_install: false - name: Get pnpm store directory id: pnpm-cache shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - uses: actions/cache@v4 - name: Setup pnpm cache with: path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store # -${{ hashFiles('**/pnpm-lock.yaml') }} + key: ${{ runner.os }}-pnpm-store restore-keys: | ${{ runner.os }}-pnpm-store - - name: Create new branch - run: git checkout -b chore-v2/auto-update-deps + - name: Create update branch + run: git checkout -b ${{env.issue}}-${{env.version}}/auto-update-deps - name: Install - run: pnpm i --workspace-root + run: pnpm i --no-frozen-lockfile - name: Update dependencies - run: pnpm run update + run: pnpm ncu:minor - name: Reinstall dependencies - run: pnpm i + run: pnpm i --no-frozen-lockfile - name: Commit changed files run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add **/package.json pnpm-lock.yaml git status - git commit -m "chore: update dependencies and lock file" + HUSKY=0 git commit -m "chore: update dependencies and lock file" - uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} - branch: chore-v2/auto-update-deps + branch: ${{env.issue}}-${{env.version}}/auto-update-deps force: true diff --git a/.github/workflows/auto-file-generator.yml b/.github/workflows/auto-file-generator.yml deleted file mode 100644 index 4b4d6610ce..0000000000 --- a/.github/workflows/auto-file-generator.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Auto file generator - -on: - schedule: - - cron: '0 2 * * *' - workflow_dispatch: - -jobs: - update: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - ref: 'develop' - - # - uses: pnpm/action-setup@v3 - # with: - # run_install: false - # version: 8 - # - uses: actions/setup-node@v4 - # with: - # cache: pnpm - # node-version: 20 - - # https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time - - name: Install Node.js - uses: actions/setup-node@v4 - with: - # cache: pnpm - node-version: 20 - - uses: pnpm/action-setup@v3 - name: Install pnpm - id: pnpm-install - with: - version: 8 - run_install: false - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store # -${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store - - - name: Create new branch - run: git checkout -b chore/auto-file-gen - - name: Install dependencies - run: pnpm i - - name: Build all packages - run: npm run pack - - name: Commit changed files - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git status - git commit -m "chore: auto file generate" - - - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 'chore/auto-file-gen' - force: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb04e5a7f1..e6cf188fd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,68 +10,89 @@ on: workflow_dispatch: jobs: - build: + build-and-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false + - uses: ./.github/actions/pnpm-setup - # - uses: pnpm/action-setup@v3 - # with: - # run_install: false - # version: 8 - # - uses: actions/setup-node@v4 - # with: - # cache: pnpm - # node-version: 20 - - # https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time - - name: Install Node.js - uses: actions/setup-node@v4 + - name: Build + run: pnpm -r build + + - name: Unused + run: pnpm -r --parallel unused + + - name: Lint + run: pnpm -r --parallel lint + + - name: Format + run: pnpm -r --parallel format + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 with: - # cache: pnpm - node-version: 20 - - name: Install pnpm - uses: pnpm/action-setup@v3 - id: pnpm-install + fetch-depth: 0 + persist-credentials: false + - uses: ./.github/actions/pnpm-setup + + - name: Install Playwright Browsers + run: pnpm --filter @public-ui/components exec playwright install --with-deps + + - name: Build + run: pnpm --filter @public-ui/sample-react^... build + + - name: Unit Tests + run: pnpm -r test:unit + + # Tests in sample app are currently failing and hence disabled. + # Remove `--filter @public-ui/components` after tests have been fixed in #7003. + - name: E2E Test + run: pnpm --filter @public-ui/components test:e2e + + - uses: actions/upload-artifact@v4 + if: failure() + name: Upload test reports with: - version: 8 - run_install: false - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - name: Setup pnpm cache + name: reports + path: | + packages/themes/**/test-results/**/*.png + packages/test-tag-name-transformer/test-results/**/*.png + packages/components/playwright-report/ + !**/node_modules + + test-visual: + runs-on: ubuntu-latest + strategy: + matrix: + package: ['@public-ui/test-tag-name-transformer', '@public-ui/theme-default'] + steps: + - uses: actions/checkout@v4 with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store - restore-keys: | - ${{ runner.os }}-pnpm-store + fetch-depth: 0 + persist-credentials: false + - uses: ./.github/actions/pnpm-setup + + - name: Install Playwright Browsers + run: pnpm --filter @public-ui/components exec playwright install --with-deps - - name: Install - run: pnpm i --no-frozen-lockfile - - name: Unused - run: pnpm -r unused - - name: Depcheck - run: pnpm -r depcheck - - name: Format - run: pnpm -r format - name: Build run: pnpm -r build - - name: Lint - run: pnpm -r lint - - name: Test - run: pnpm -r --workspace-concurrency=1 test # https://pnpm.io/configuring + + - name: Visual Tests + run: pnpm --filter=${{ matrix.package }} test:visual - uses: actions/upload-artifact@v4 if: failure() - name: Upload theme test reports + name: Upload test reports with: name: reports path: | packages/themes/**/test-results/**/*.png packages/test-tag-name-transformer/test-results/**/*.png + packages/components/playwright-report/ !**/node_modules diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 55c3b8ea25..22217dc94a 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -14,7 +14,7 @@ jobs: - name: 'CLA Assistant' if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' # Beta Release - uses: contributor-assistant/github-action@v2.3.2 + uses: contributor-assistant/github-action@v2.6.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # the below token should have repo scope and must be manually added by you in the repository's secret diff --git a/.github/workflows/dod-checker.yml b/.github/workflows/dod-checker.yml index 42e34f5e5f..73b9975eff 100644 --- a/.github/workflows/dod-checker.yml +++ b/.github/workflows/dod-checker.yml @@ -1,21 +1,24 @@ name: Definition of Done on: pull_request: - types: [opened, edited] + types: [opened, edited, synchronize] concurrency: - group: ci-pr-{{ github.event.number }} + group: 'pr-${{ github.event.pull_request.number }}' cancel-in-progress: true jobs: check-dod: - if: contains(github.actor, 'dependabot') == false runs-on: ubuntu-20.04 steps: + - name: Print Pull Request ID + run: | + echo "Pull Request Number: ${{ github.event.pull_request.number }}" - name: Clone Repo uses: actions/checkout@v3 - name: Check DoD uses: platisd/definition-of-done@master with: dod_yaml: '.github/dod.yml' + message_header: 'The A11y and PO reviews will only take place after all other DoD steps have been completed by the Developer:' github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/draft-deploy.yml b/.github/workflows/draft-deploy.yml index a3f433f376..38d803469a 100644 --- a/.github/workflows/draft-deploy.yml +++ b/.github/workflows/draft-deploy.yml @@ -20,10 +20,10 @@ jobs: with: node-version: 20 - name: Install pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@v4 id: pnpm-install with: - version: 8 + version: 9 - name: Get pnpm store directory id: pnpm-cache shell: bash diff --git a/.github/workflows/issue-validation.yml b/.github/workflows/issue-validation.yml new file mode 100644 index 0000000000..6cd419f42b --- /dev/null +++ b/.github/workflows/issue-validation.yml @@ -0,0 +1,158 @@ +name: Validate Issue + +on: + issues: + types: [opened] + +jobs: + process-issue: + if: contains(join(github.event.issue.labels.*.name, ','), 'bug') || contains(join(github.event.issue.labels.*.name, ','), 'doc') + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v2 + + - name: View the GitHub context + run: echo "$GITHUB_CONTEXT" + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + + - name: Set labels in a global environment variable + id: set_labels + run: echo "LABELS=${{ join(github.event.issue.labels.*.name, ',') }}" >> $GITHUB_ENV + + - uses: stefanbuck/github-issue-parser@v3 + if: contains(env.LABELS, 'bug') + id: issue-parser + + - run: cat ${HOME}/issue-parser-result.json + if: contains(env.LABELS, 'bug') + + - name: Extract issue details + if: contains(env.LABELS, 'bug') + id: extract + run: | + echo "Extracting issue details..." + + echo "Processing as a bug report..." + + reproduction_url=$(echo $REPRODUCTION_URL || echo "Not defined") + themes=$(echo $THEMES || echo "") + themes_short_forms=$(echo "${THEMES}" | sed 's/Not sure//; s/All/theme: All/; s/Bundesministerium der Finanzen/theme: BMF/; s/Default/theme: Default/; s/European Comission/theme: EC/; s/European Union/theme: EU/; s/Informationstechnikzentrum Bund/theme: ITZ/; s/Unstyled/theme: Unstyled/' | sed 's/^,*//;s/,*$//') + IFS=',' read -r -a themes_array <<< "$themes_short_forms" + for theme in "${themes_array[@]}"; do + theme_no_spaces="${theme// /}" + echo "THEME_LABEL_$theme_no_spaces=$theme_no_spaces" >> $GITHUB_ENV + done + + error_category=$(echo $CATEGORY || echo "Not defined") + browser_info=$(echo $BROWSER || echo "Not defined") + reproduction=$(echo $REPRODUCTION || echo "Not defined") + expacted_behavior=$(echo $EXPACTED_BEHAVIOR || echo "Not defined") + components=$(echo $COMPONENTS || echo "") + components_label=$(echo "${components}" | sed 's/\n/,/g' | sed 's/^,*//;s/,*$//' || echo "") + IFS=',' read -r -a components_array <<< "$components_label" + for component in "${components_array[@]}"; do + component_no_spaces="${component// /}" + echo "COMPONENT_LABEL_$component_no_spaces=$component_no_spaces" >> $GITHUB_ENV + done + + system_info=$(echo $SYSTEM || echo "Not defined") + kolibri_version=$(echo "$system_info" | grep -oP '"@public-ui/components": "\K[^"]+' | sed 's/[^0-9.]//g' || echo "N/A") + kolibri_major_version=$(echo "$kolibri_version" | cut -d '.' -f 1) + kolibri_version_label="v$kolibri_major_version" + echo "KOLIBRI_VERSION_LABEL=$kolibri_version_label" >> $GITHUB_ENV + + NEW_ISSUE_BODY=$(cat <> $GITHUB_ENV + echo "$NEW_ISSUE_BODY" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + env: + REPRODUCTION_URL: ${{ steps.issue-parser.outputs.issueparser_link_to_the_code_that_reproduces_this_issue }} + THEMES: ${{ steps.issue-parser.outputs.issueparser_which_themes_are_affected }} + CATEGORY: ${{ steps.issue-parser.outputs.issueparser_can_you_categorise_where_the_error_occurs_if_known }} + BROWSER: ${{ steps.issue-parser.outputs.issueparser_which_browser_or_operating_system_do_you_used_to_test_kolibri_if_available }} + COMPONENTS: ${{ steps.issue-parser.outputs.issueparser_which_componentareas_are_affected_select_all_that_apply }} + REPRODUCTION: ${{ steps.issue-parser.outputs.issueparser_to_reproduce }} + EXPACTED_BEHAVIOR: ${{ steps.issue-parser.outputs.issueparser_current_vs_expected_behavior }} + SYSTEM: ${{ steps.issue-parser.outputs.issueparser_provide_environment_information }} + + - name: Check if user is a team member + id: check-team + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + script: | + try { + + const result = await github.rest.teams.getMembershipForUserInOrg({ + org: context.repo.owner, + team_slug: 'specteam', + username: context.payload.sender.login + }); + + if (result.data.state === 'active') { + core.setOutput('team_member', 'true'); + } else { + core.setOutput('team_member', 'false'); + } + } catch (error) { + core.error(`${error}`); + core.setOutput('team_member', 'false'); + } + return + + - name: Update issue + uses: actions/github-script@v7 + with: + script: | + const labelsToAdd = ['${{ env.LABELS }}']; + const isBug = labelsToAdd.includes('bug'); + if ('${{ steps.check-team.outputs.team_member }}' === 'true') { + labelsToAdd.push('created-by: kolibri-team'); + } + + if (isBug == true) { + if ('${{ env.KOLIBRI_VERSION_LABEL }}') { + labelsToAdd.push('${{ env.KOLIBRI_VERSION_LABEL }}'); + } + + for (const key of Object.keys(process.env)) { + if ((key.startsWith('THEME_LABEL_') || key.startsWith('COMPONENT_LABEL_')) && process.env[key]) { + labelsToAdd.push(process.env[key]); + } + } + core.info(`Labels to add: ${labelsToAdd.join(', ')}`); + await github.rest.issues.update({ + ...context.repo, + issue_number: context.issue.number, + body: process.env.NEW_ISSUE_BODY, + labels: labelsToAdd + }); + } else { + await github.rest.issues.update({ + ...context.repo, + issue_number: context.issue.number, + labels: labelsToAdd + }); + } \ No newline at end of file diff --git a/.github/workflows/publish-page.yml b/.github/workflows/publish-page.yml deleted file mode 100644 index 3ee35aeb06..0000000000 --- a/.github/workflows/publish-page.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: 02 - Publish Page - -env: - access: public - github-registry: https://npm.pkg.github.com - github-token: ${{ secrets.GITHUB_TOKEN }} - npmjs-registry: https://registry.npmjs.org - scope: '@public-ui' - -on: - workflow_call: - workflow_dispatch: - -jobs: - publish: - if: github.repository == 'public-ui/kolibri' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: '${{env.npmjs-registry}}' - scope: '${{env.scope}}' - - name: Build designer - run: | - npm i --legacy-peer-deps - npm run build - working-directory: packages/designer - - name: Build sample react - run: | - npm i --legacy-peer-deps - npm run build - working-directory: packages/samples/react - # - name: Build storybook - # run: npm i --legacy-peer-deps - # working-directory: packages/storybook - - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: '${{env.github-registry}}' - scope: '${{env.scope}}' - - name: Publish designer - run: npm publish --access restricted || true - working-directory: packages/designer - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish sample react - run: npm publish --access restricted || true - working-directory: packages/samples/react - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Publish storybook - # run: npm publish --access restricted || true - # working-directory: packages/storybook - # env: - # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 68e765aca9..a18485593e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,8 +2,8 @@ name: 01 - Publish env: access: public - registry: https://registry.npmjs.org - token: ${{ secrets.NPMJS_GRANULAR_TOKEN }} + npmjs-registry: https://registry.npmjs.org + github-registry: https://npm.pkg.github.com on: workflow_dispatch: @@ -12,35 +12,72 @@ on: type: choice description: Which NPM tag should be assigned? options: + - dev - next - latest + - lts + version: # see https://github.com/lerna/lerna/tree/main/libs/commands/version#semver-bump + type: choice + description: SemVer keyword for version bump + options: + - prerelease + - prepatch + - patch + - preminor + - minor + - premajor + - major + label: # see https://github.com/lerna/lerna/tree/main/libs/commands/version#--preid + type: choice + description: SemVer pre release label (optional) + options: + - rc + - beta + - alpha jobs: publish: if: github.repository == 'public-ui/kolibri' runs-on: ubuntu-latest + permissions: + id-token: write + packages: write steps: + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + + - name: Get GitHub App User ID + id: get-user-id + run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + - uses: actions/checkout@v4 with: fetch-depth: 0 - persist-credentials: false + token: ${{ steps.app-token.outputs.token }} # https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time - name: Install Node.js uses: actions/setup-node@v4 with: node-version: 20 - registry-url: '${{env.registry}}' - scope: '@public-ui' + registry-url: '${{env.npmjs-registry}}' + - name: Install pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@v4 id: pnpm-install with: - version: 8 + version: 9 + - name: Get pnpm store directory id: pnpm-cache shell: bash run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + - uses: actions/cache@v4 name: Setup pnpm cache with: @@ -52,136 +89,133 @@ jobs: - name: Install run: pnpm i --no-frozen-lockfile --no-verify-store-integrity + - name: Configure Git user + run: | + git config --local user.email "${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" + git config --local user.name "${{ steps.app-token.outputs.app-slug }}[bot]" + + - name: Bump Versions non-dev + if: github.event.inputs.tag != 'dev' + run: 'HUSKY=0 npx lerna version ${{github.event.inputs.version}} --preid=${{github.event.inputs.label}} --no-private --tag-version-prefix="" -m "chore: release %v" -y --force-publish' + + - name: Bump Versions dev and do not push + if: github.event.inputs.tag == 'dev' + run: 'HUSKY=0 npx lerna version prerelease --preid=$GITHUB_SHA --no-private --tag-version-prefix="" -m "chore: release %v" -y --force-publish --no-push' + - name: Build run: pnpm -r build - - name: Build and publish schema - continue-on-error: true - run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} - working-directory: packages/schema - env: - NODE_AUTH_TOKEN: ${{env.token}} - name: Build and publish components - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/components env: - NODE_AUTH_TOKEN: ${{env.token}} - - name: Build and publish adapter angular v11 - continue-on-error: true - run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} - working-directory: packages/adapters/angular/v11 - env: - NODE_AUTH_TOKEN: ${{env.token}} - - name: Build and publish adapter angular v12 - continue-on-error: true - run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} - working-directory: packages/adapters/angular/v12 - env: - NODE_AUTH_TOKEN: ${{env.token}} - - name: Build and publish adapter angular v13 - continue-on-error: true - run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} - working-directory: packages/adapters/angular/v13 - env: - NODE_AUTH_TOKEN: ${{env.token}} - - name: Build and publish adapter angular v14 - continue-on-error: true - run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} - working-directory: packages/adapters/angular/v14 - env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter angular v15 - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/angular/v15 env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter angular v16 - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/angular/v16 env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter angular v17 - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/angular/v17 env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true + - name: Build and publish adapter angular v18 + run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} + working-directory: packages/adapters/angular/v18 + env: + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter react - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/react env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter react-standalone - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/react-standalone env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter solid - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/solid env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter vue - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/vue env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter preact - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/preact env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish adapter hydrate - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/adapters/hydrate env: - NODE_AUTH_TOKEN: ${{env.token}} - - name: Build and publish create-kolibri - continue-on-error: true - run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} - working-directory: packages/create-kolibri - env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish tools kolibri-cli - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/tools/kolibri-cli env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish theme default - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/themes/default env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish themes - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/themes env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish sample react - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/samples/react env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true - name: Build and publish tools visual-tests - continue-on-error: true run: pnpm publish --access ${{env.access}} --no-git-checks --tag ${{github.event.inputs.tag}} working-directory: packages/tools/visual-tests env: - NODE_AUTH_TOKEN: ${{env.token}} + NODE_AUTH_TOKEN: ${{secrets.NPMJS_GRANULAR_TOKEN}} + NPM_CONFIG_PROVENANCE: true + + # Publish packages on GitHub packages + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: '${{env.github-registry}}' + + - name: Publish designer + run: npm publish --access restricted + working-directory: packages/designer + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish-page: - needs: publish - uses: public-ui/kolibri/.github/workflows/publish-page.yml@develop + - name: Publish sample react + run: npm publish --access restricted + working-directory: packages/samples/react + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 80838e13ee..f054377247 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -21,10 +21,10 @@ jobs: with: node-version: 20 - name: Install pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@v4 id: pnpm-install with: - version: 8 + version: 9 - name: Get pnpm store directory id: pnpm-cache shell: bash diff --git a/.github/workflows/update-snapshots.yml b/.github/workflows/update-snapshots.yml index 33634717ad..10d7f10143 100644 --- a/.github/workflows/update-snapshots.yml +++ b/.github/workflows/update-snapshots.yml @@ -2,28 +2,29 @@ name: 03 - Update Snapshots on: workflow_dispatch: - inputs: - target_branch: - description: 'Target branch' - required: true - purge_snapshots: - description: 'Delete all snapshots before regenerating them' - type: boolean - default: false jobs: update-snapshots: runs-on: ubuntu-latest - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push the - # added or changed files to the repository. - contents: write steps: + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + + - name: Get GitHub App User ID + id: get-user-id + run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + - name: Checkout branch uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.target_branch }} + ref: ${{ github.ref_name }} fetch-depth: 0 + token: ${{ steps.app-token.outputs.token }} # https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time - name: Install Node.js @@ -32,10 +33,10 @@ jobs: node-version: 20 - name: Install pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@v4 id: pnpm-install with: - version: 8 + version: 9 run_install: false - name: Get pnpm store directory @@ -58,8 +59,7 @@ jobs: run: pnpm -r build - name: Purge existing snapshots - if: ${{ github.event.inputs.purge_snapshots == 'true' }} - run: rm packages/themes/**/snapshots/**/*.png + run: find packages -name '*.png' -path '*/snapshots/*' | grep -v 'node_modules' | xargs rm # Remove any existing snapshots, except those in node_modules - name: Display git status (before test-update) run: git status @@ -75,3 +75,5 @@ jobs: with: commit_message: Update all snapshots file_pattern: 'packages/themes/**/snapshots/* packages/test-tag-name-transformer/snapshots/*' + commit_user_name: '${{ steps.app-token.outputs.app-slug }}[bot]' + commit_user_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com' diff --git a/.gitignore b/.gitignore index b7352f17ab..9a3724ffbe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,8 @@ dist/ node_modules/ *.log *.tgz + +/packages/components/src/components/*/readme.md +# Diese Readme's wurde nicht in die Doku übernommen. +!/packages/components/src/components/logo/readme.md +!/packages/components/src/components/symbol/readme.md diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000000..e02c24e2b5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm lint-staged \ No newline at end of file diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg index 3c9c8c71bb..ff52967685 100644 --- a/.husky/prepare-commit-msg +++ b/.husky/prepare-commit-msg @@ -22,11 +22,6 @@ branchName=$(git symbolic-ref --short HEAD) # Get the last part of the branch name. feature/foo/42-bugfix -> 42-bugfix normalizedBranchName=$(echo "$branchName" | awk -F'/' '{print $NF}') -# Message already starts with a ticket ID -if echo "$message" | grep -qE '^#[0-9]+'; then - exit 0 -fi - # Branch name starts with a ticket ID if echo "$normalizedBranchName" | grep -qE '^[0-9]+[-_]'; then # Get ticketID from branch name. Works with `-` or `_` as separator. 123-foobar -> 123 @@ -37,7 +32,12 @@ if echo "$normalizedBranchName" | grep -qE '^[0-9]+[-_]'; then exit 1 fi - output="(#$ticketID) $message" + # Message already contains the ticket ID + if echo "$message" | grep -qE '#[0-9]+'; then + exit 0 + fi + + output="$message"$'\n'$'\n'"Refs: #$ticketID" echo "$output" > "$1" else diff --git a/.npmrc b/.npmrc index 610b4252ff..409d666d6d 100644 --- a/.npmrc +++ b/.npmrc @@ -1,4 +1,5 @@ # - npm +engine-strict=true save-exact=true # - pnpm diff --git a/CODE_OF_CONDUCT.de.md b/CODE_OF_CONDUCT.de.md new file mode 100644 index 0000000000..210fea2f97 --- /dev/null +++ b/CODE_OF_CONDUCT.de.md @@ -0,0 +1,82 @@ +```markdown +# Code of Conduct Agreement for Contributors + +## Our Commitment + +We, as members, participants, and leaders of our community, are committed to providing a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender characteristics, identity, and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +- Demonstrating empathy and kindness toward others +- Respecting differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Taking responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language, imagery, or symbolism, and unwelcome sexual attention or advances +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as physical or electronic addresses, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior they deem inappropriate, threatening, or offensive. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, support tickets, and other contributions that are not aligned to this Code of Conduct and will communicate reasons for moderation decisions when appropriate. + +## **Scope** + +This Code of Conduct applies within all community spaces and also applies when an individual is officially representing the community in public spaces. Examples include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leadership responsible for enforcement at [kolibri@itzbund.de](mailto:kolibri@itzbund.de). All complaints will be reviewed and investigated promptly and fairly. + +All community leadership is obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leadership, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period. This includes avoiding interactions in community spaces and external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any form of interaction or public communication with the community. During this time, no public or private interaction with the people involved is allowed, including unsolicited interaction with those enforcing the Code of Conduct. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violating community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of groups of people. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at . + +Community Impact Guidelines were inspired by [Mozilla's Code of Conduct Enforcement Ladder][mozilla]. + +For answers to common questions about this Code of Conduct, see the FAQ at (in English). Translations are available at . + +[homepage]: https://www.contributor-covenant.org +[mozilla]: https://github.com/mozilla/inclusion +``` diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index eab9a4ede1..210fea2f97 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,141 +1,82 @@ -# Vereinbarung über Verhaltenskodex für Mitwirkende - -## Unsere Verpflichtung - -Wir als Mitglieder, Teilnehmende und Verantwortliche unserer Gemeinschaft -verpflichten uns, allen Teilnehmenden an dem Projekt und unserer Gemeinschaft -eine belästigungsfreie Beteiligung, unabhängig von Alter, Körpergröße, -Behinderung, ethnischer Zuordnung, Geschlechtermerkmalen, -identität und -ausdruck, -Grad der Erfahrung, Bildung, sozialem Status, Nationalität, persönlicher -Erscheinung, Rasse, Religion oder sexueller Identität und Orientierung -zu ermöglichen. - -Wir verpflichten uns, in einer Weise zu handeln und zu interagieren, die zu -einer offenen, einladenden, vielfältigen, inklusiven und gesunden Gemeinschaft -beiträgt. - -## Unsere Standards +```markdown +# Code of Conduct Agreement for Contributors -Beispiele für Verhaltensweisen, die zu einem positiven Umfeld für unsere -Gemeinschaft beitragen, sind: - -- Einfühlungsvermögen und Freundlichkeit gegenüber anderen Menschen zeigen -- Unterschiedliche Meinungen, Standpunkte und Erfahrungen respektieren -- Konstruktives Feedback geben und würdevoll annehmen -- Verantwortung übernehmen und uns bei denjenigen entschuldigen, die von unseren - Fehlern betroffen sind, und aus den Erfahrungen lernen -- Konzentration auf das, was nicht nur für uns als Individuen, sondern für die - gesamte Gemeinschaft das Beste ist +## Our Commitment -Beispiele für inakzeptables Verhalten sind: +We, as members, participants, and leaders of our community, are committed to providing a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender characteristics, identity, and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. -- Die Verwendung sexualisierter Sprache, Bilder oder Symbolik sowie unerwünschte - Versuche sexueller Annäherung -- Beleidigende oder abwertende Kommentare, persönliche oder politische Angriffe - und Trollen -- Öffentliche oder private Belästigungen -- Das Veröffentlichen von privaten Informationen Anderer, wie zum Beispiel - physische oder elektronische Adressen, ohne deren ausdrückliche Erlaubnis -- Anderes Verhalten, welches in einem professionellen Umfeld begründet als - unangemessen betrachtet werden kann +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. -## Verantwortlichkeiten bei der Durchsetzung +## Our Standards -Die Gemeinschaftsleitung ist verantwortlich dafür, unsere Standards für ein -akzeptables Verhalten klarzustellen und wird angemessen und fair -korrigierende Maßnahmen ergreifen um auf jegliches Verhalten, das sie für -unangemessen, bedrohlich oder beleidigend hält, zu reagieren. +Examples of behavior that contributes to a positive environment for our community include: -Die Gemeinschaftsleitung hat das Recht und die Verantwortung, Kommentare, -Commits, Code, Wiki-Bearbeitungen, Support-Tickets und andere Beiträge, die -nicht mit diesem Verhaltenskodex vereinbar sind, zu entfernen, zu bearbeiten -oder abzulehnen, und wird die Gründe für eine Mäßigung mitteilen, wenn es -angebracht ist. +- Demonstrating empathy and kindness toward others +- Respecting differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Taking responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community -## **Geltungsbereich** +Examples of unacceptable behavior include: -Dieser Verhaltenskodex gilt für alle Gemeinschaftsbereiche und gilt auch, wenn -eine Einzelperson die Gemeinschaft offiziell in öffentlichen Bereichen vertritt. -Beispiele für die Repräsentation unserer Gemeinschaft sind die Verwendung einer -offiziellen E-Mail-Adresse, das Posten über ein offizielles Social-Media-Konto -oder das Auftreten als ernannte Vertretung bei einer Online- oder -Offline-Veranstaltung. +- The use of sexualized language, imagery, or symbolism, and unwelcome sexual attention or advances +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as physical or electronic addresses, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting -## Durchsetzung +## Enforcement Responsibilities -Fälle von missbräuchlichem, belästigendem oder anderweitig inakzeptablem -Verhalten können unter [kolibri@itzbund.de](kolibri@itzbund.de) der für die Durchsetzung -zuständigen Gemeinschaftsleitung gemeldet werden. Alle Beschwerden werden -zeitnah und fair geprüft und ermittelt. +Community leaders are responsible for clarifying and enforcing standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior they deem inappropriate, threatening, or offensive. -Die gesamte Gemeinschaftsleitung ist verpflichtet, die Privatsphäre und die -Sicherheit derjenigen, die einen Vorfall gemeldet haben, zu respektieren. +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, support tickets, and other contributions that are not aligned to this Code of Conduct and will communicate reasons for moderation decisions when appropriate. -## Durchsetzungsrichtlinien +## **Scope** -Die Gemeinschaftsleitung wird sich bei der Bestimmung der Konsequenzen für -jede Handlung, die ihrer Ansicht nach gegen diesen Verhaltenskodex verstößt, an -diese Richtlinien über die Auswirkungen in der Gemeinschaft halten: +This Code of Conduct applies within all community spaces and also applies when an individual is officially representing the community in public spaces. Examples include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. -### 1. Berichtigung +## Enforcement -**Auswirkungen in der Gemeinschaft**: Verwendung unangemessener Sprache oder -anderes Verhalten, das in der Gemeinschaft als unprofessionell oder unwillkommen -gilt. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leadership responsible for enforcement at [kolibri@itzbund.de](mailto:kolibri@itzbund.de). All complaints will be reviewed and investigated promptly and fairly. -**Folge**: Eine private, schriftliche Verwarnung der Gemeinschaftsleitung, -die Klarheit über die Art des Verstoßes und eine Erklärung dafür bietet, warum -das Verhalten unangemessen war. Eine öffentliche Entschuldigung kann verlangt -werden. +All community leadership is obligated to respect the privacy and security of the reporter of any incident. -### 2. Verwarnung +## Enforcement Guidelines -**Auswirkungen in der Gemeinschaft**: Eine Verletzung durch einen einzelnen -Vorfall oder eine Reihe von Handlungen. +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: -**Folge**: Eine Warnung mit Konsequenzen bei wiederholtem Fehlverhalten. Keine -Interaktion mit den beteiligten Personen, einschließlich unaufgeforderter -Interaktion mit denjenigen, die den Verhaltenskodex durchsetzen, für einen -bestimmten Zeitraum. Dazu gehört die Vermeidung von Interaktionen in -Gemeinschaftsräumen sowie in externen Kanälen wie sozialen Medien. Ein Verstoß -gegen diese Bedingungen kann zu einem vorübergehenden oder dauerhaften Verbot -führen. +### 1. Correction -### 3. Vorübergehender Ausschluss +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. -**Auswirkungen in der Gemeinschaft**: Eine schwerwiegende Verletzung von -Gemeinschaftsstandards, einschließlich anhaltend unangemessenen Verhaltens. +**Consequence**: A private, written warning from community leadership, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. -**Folge**: Ein zeitlich begrenztes Verbot jeglicher Art von Interaktion oder -öffentlicher Kommunikation mit der Gemeinschaft. Während dieses Zeitraums ist -keine öffentliche oder private Interaktion mit den beteiligten Personen erlaubt. -Auch keine unaufgeforderte Interaktion mit denjenigen, die den Verhaltenskodex -durchsetzen. Ein Verstoß gegen diese Bedingungen kann zu einem dauerhaften -Verbot führen. +### 2. Warning -### 4. Dauerhafter Ausschluss +**Community Impact**: A violation through a single incident or series of actions. -**Auswirkungen in der Gemeinschaft**: Aufzeigen eines Musters von Verletzungen -der Gemeinschaftsstandards, einschließlich anhaltend unangemessenen Verhaltens, -Belästigung einer Person oder Aggression gegen oder Herabsetzung von Gruppen von -Personen. +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period. This includes avoiding interactions in community spaces and external channels like social media. Violating these terms may lead to a temporary or permanent ban. -**Folge**: Ein dauerhaftes Verbot jeglicher Art von öffentlicher Interaktion -innerhalb der Gemeinschaft. +### 3. Temporary Ban -## Bezug +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. -Dieser Verhaltenskodex basiert auf dem [Contributor Covenant][homepage], -Version 2.0, verfügbar unter - +**Consequence**: A temporary ban from any form of interaction or public communication with the community. During this time, no public or private interaction with the people involved is allowed, including unsolicited interaction with those enforcing the Code of Conduct. Violating these terms may lead to a permanent ban. -Community Impact Guidelines wurden von -[Mozillas Code of Conduct Enforcement Ladder][mozilla] inspiriert. +### 4. Permanent Ban -Antworten auf häufig gestellte Fragen zu diesem Verhaltenskodex finden Sie in -den häufig gestellten Fragen unter -(in Englisch). Andere Übersetzungen sind verfügbar unter -. +**Community Impact**: Demonstrating a pattern of violating community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of groups of people. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at . + +Community Impact Guidelines were inspired by [Mozilla's Code of Conduct Enforcement Ladder][mozilla]. + +For answers to common questions about this Code of Conduct, see the FAQ at (in English). Translations are available at . [homepage]: https://www.contributor-covenant.org [mozilla]: https://github.com/mozilla/inclusion +``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32cb52c8b0..3f1398ba24 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,9 +4,16 @@ We would love for you to contribute to **KoliBri**and help make it even better t - [Contributing](#contributing) - [Code of Conduct](#code-of-conduct) - - [Questions and Problems](#questions-and-problems) - - [Report bug](#report-bug) + - [Questions and problems](#questions-and-problems) + - [Report an error](#report-an-error) - [Further development](#further-development) + - [Git flow](#git-flow) + - [Developing](#developing) + - [Develop new component](#develop-new-component) + - [Switching between branches](#switching-between-branches) + - [Back porting to older Major-Versions](#back-porting-to-older-major-versions) + - [Snapshot Testing for Visual Changes](#snapshot-testing-for-visual-changes) + - [How to Update Snapshots](#how-to-update-snapshots) ## Code of Conduct @@ -51,7 +58,8 @@ We work according to the Git flow: https://medium.com/android-news/gitflow-with- 8. Install all packages with `pnpm i` 9. Build all packages within the mono repository `pnpm -r build` 10. Navigate to the desired package in our monorepo -11. When you want to start the project navigate to `packages/components/` and run pnpm start +11. When you want to start the project navigate to `packages/components/` and run `pnpm dev` +12. To watch for changes navigate to `packages/samples/react/` and execute `pnpm start`. `http://localhost:8080/` will open automatically ### Develop new component @@ -70,38 +78,40 @@ If it is also necessary to edit dependent packages such as `@public-ui/component ### Back porting to older Major-Versions -By default, development is carried out in the `development` branch for the following version. However, if it becomes necessary to provide an issue for an older major release, such as version 1.7.x, the code change must also be merged into the corresponding release branch. In this case, it would be the `release/1.7` branch. It is important that the branch that was created from the `develop` is not merged into the release branch, as otherwise the next patch version will receive all the changes from the current development status. -The simplest procedure is therefore to create a new branch from the release branch (e.g. `release/1.7`) and transfer the individual commits of the feature branch from the `develop` to the new branch using cherry-picking. This branch can then be merged into the release branch as normal with a new pull request. +By default, development is carried out in the `development` branch for the following version. However, if it becomes necessary to provide an issue for an older major release, such as version 1.x.x, the code change must also be merged into the corresponding release branch. In this case, it would be the `release/1` branch. It is important that the branch that was created from the `develop` is not merged into the release branch, as otherwise the next patch version will receive all the changes from the current development status. +The simplest procedure is therefore to create a new branch from the release branch (e.g. `release/1`) and transfer the individual commits of the feature branch from the `develop` to the new branch using cherry-picking. This branch can then be merged into the release branch as normal with a new pull request. ### Snapshot Testing for Visual Changes The Continuous Integration (CI) pipeline incorporates automated visual regression testing using the React sample app across all available themes. When introducing visual modifications to components, themes, or the React sample app, initial test failures are expected. To address this, the -`update-snapshots` action on GitHub should be executed, followed by a **careful review** of the changes. +`update-snapshots.yml` action on GitHub should be executed, followed by a **careful review** of the changes. #### How to Update Snapshots -1. **GitHub website:** - - - Execute the `update-snapshots` action on GitHub. - - The action prompts for a branch selection. - - It checks out the specified branch, updates all snapshot files, and commits the changes to that branch. - -2. **Terminal Command:** - - - For terminal convenience, the [GitHub CLI (gh)](https://cli.github.com/) needs to be installed. - - Run the following command within the project directory: - - ```bash - # Replace $YOUR_BRANCH with the desired branch name - gh workflow run update-snapshots.yml -f target_branch=$YOUR_BRANCH - ``` - - Alternatively, to run the action on the current branch: - - ```bash - gh workflow run update-snapshots.yml -f target_branch=`git rev-parse --abbrev-ref HEAD` - ``` +The following methods can be used to update the snapshots. + +1. **GitHub website:** Update the snapshots directly on the GitHub website by following these steps. + +- Navigate to the `Actions` tab in the `kolibri` repository. +- Execute the `03 - Update Snapshots` action. +- Select the desired branch in which you want to update the snapshots. +- The workflow checks out the branch, updates all snapshot files, and commits the changes to that branch. + +2. **Terminal Command:** Use the [GitHub CLI (gh)](https://cli.github.com/) to run the `update-snapshots.yml` action from the local terminal. This method is recommended for updating snapshots on the current branch without navigating to the GitHub website. For terminal convenience, the [GitHub CLI (gh)](https://cli.github.com/) needs to be installed. + +- Run the following command within the project directory to update the snapshots in your checked-out branch: + ```bash + gh workflow run update-snapshots.yml -r `git rev-parse --abbrev-ref HEAD` + ``` +- If your want to delete all snapshots before regenerating them add `-f purge_snapshots=true` to the command: + ```bash + gh workflow run update-snapshots.yml -r `git rev-parse --abbrev-ref HEAD` -f purge_snapshots=true + ``` +- You can also run the action on a different branch by specifying the another target branch with the `-r ` flag. For example, to update snapshots on the `main` branch: + ```bash + gh workflow run update-snapshots.yml -r main + ``` These steps ensure that visual snapshots are updated systematically, maintaining the integrity of the testing process. diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index 6a595b29e2..4be56fa28b 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -1,4 +1,4 @@ - + # Known Issues @@ -31,3 +31,59 @@ When focusing the element, it's expected that the `readonly` attribute is announ [🐞 GitHub issue #5554](https://github.com/public-ui/kolibri/issues/5554) (For number) [🐞 GitHub issue #5749](https://github.com/public-ui/kolibri/issues/5749) (For date) [🐞 NVDA issue #13672](https://github.com/nvaccess/nvda/issues/13672) + +## Toaster + +Toasts are rendered in a container that's appended as first element of `` and elevated using a high `z-index`. + +When using [modal Dialogs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog) these are rendered above toasts on the +[top layer](https://developer.mozilla.org/en-US/docs/Glossary/Top_layer). Hence, toast messages are always blocked by Modal Dialogs. We recommend completely +avoiding Toasts in Modals and giving feedback within the modal directly. + +## input text + +The `search` of this component is highly browser-dependent. For example, the close button is either shown or hidden depending on the browser. Accessibility is therefore not achieved. +[🐞 GitHub issue #6307](https://github.com/public-ui/kolibri/issues/6307) + +## Screen reader only reads last selected in Select + +KolSelect is using native HTML `` may cause problems with screen readers. +Often the entire selection is not read out, but only the last one. Therefore, the KolSelect has no full accessibility. + +## Limited Styling Capabilities for `` element and its `