Skip to content

Commit

Permalink
Merge branch 'main' into chore/deploy-after-release
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrickert authored Jan 16, 2024
2 parents e0bd15f + d75747e commit e669af3
Show file tree
Hide file tree
Showing 9 changed files with 910 additions and 924 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
versioning-strategy: "increase"
schedule:
interval: "daily"
groups:
minor:
update-types:
- "minor"
- "patch"
major:
update-types:
- "major"
19 changes: 13 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
# Onyx Contributing Guide

When contributing to Onyx, please respect the [Schwarz IT Code of Conduct](https://github.com/SchwarzIT/.github/blob/main/CODE_OF_CONDUCT.md).

## Prerequisites / Technical setup

- Node.js with version as defined in [`.node-version`](.node-version) file. We recommend using [fnm](https://github.com/Schniz/fnm) for managing your node versions
- pnpm with version as defined in `packageManager` field of the [`package.json`](package.json)
- Use Node.js with version as defined in the [`.node-version`](.node-version) file. We recommend using [fnm](https://github.com/Schniz/fnm) for managing your node versions
- Use pnpm with version as defined in the `packageManager` field of the [`package.json`](package.json)

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar).

### Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default. In VS Code, make sure to enable Volar's [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) the first time you work with this repository by following the below steps:
TypeScript cannot handle type information for `.vue` imports by default. In VSCode, make sure to enable Volar's [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) the first time you work with this repository by following the below steps:

1. Disable the built-in TypeScript Extension

1. Open the extensions tab and search for `@builtin typescript`
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`

2. Restart VS Code.
2. Restart VSCode.

<br />

## Creating a Pull Request

Pull Requests are very welcome!
Pull Requests are very welcome!
Please consider our [Technical Guidelines](https://github.com/SchwarzIT/onyx/wiki/Technical-Vision-&-Guidelines) when contributing to Onyx.

1. You will need to [create a fork](https://github.com/SchwarzIT/onyx/fork) to commit and push your changes to.
2. When your changes affect the user you need to [add a changeset](./.changeset/README.md).
2. When your changes affect the user, you need to [add a changeset](./.changeset/README.md).
3. Then [create a PR](https://github.com/SchwarzIT/onyx/compare) to merge your changes back into our repository.

When your PR gets accepted, you can expect an alpha release immediately after it is merged. Production releases are planned to be published every 2 weeks after the release of 1.0.0.

## Scripts

### Monorepo root
Expand Down Expand Up @@ -107,6 +112,8 @@ pnpm run test:components tests/example.spec.ts
pnpm run test:components --debug
```

_Info: Screenshot tests will only be performed in our Workflows to ensure consistency of the resulting images which vary on different operating systems. You can use [this Workflow](https://github.com/SchwarzIT/onyx/actions/workflows/playwright-screenshots.yml) to update the screenshots._

<br />

### Documentation
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Onyx

A design system and Vue.js component library created by [Schwarz IT](https://it.schwarz).
A design system and Vue.js component library for enterprise grade applications created by [Schwarz IT](https://it.schwarz).

> **Work in progress**: This library is currently in early / active development. <br />
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"devDependencies": {
"@sit-onyx/vitepress-theme": "workspace:^",
"vitepress": "^1.0.0-rc.36"
"vitepress": "^1.0.0-rc.39",
"vue": "^3.4.14"
}
}
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"packageManager": "pnpm@8.13.1",
"packageManager": "pnpm@8.14.1",
"author": "Schwarz IT KG",
"license": "Apache-2.0",
"scripts": {
Expand All @@ -21,26 +21,26 @@
"@rushstack/eslint-patch": "^1.6.1",
"@tsconfig/node20": "^20.1.2",
"@types/jsdom": "^21.1.6",
"@types/node": "^20.10.6",
"@vitejs/plugin-vue": "^5.0.2",
"@vitest/coverage-v8": "^1.1.1",
"@types/node": "^20.11.4",
"@vitejs/plugin-vue": "^5.0.3",
"@vitest/coverage-v8": "^1.2.0",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "~0.5.1",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.19.2",
"jsdom": "^23.0.1",
"eslint-plugin-vue": "^9.20.1",
"jsdom": "^23.2.0",
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"prettier": "^3.2.2",
"publint": "^0.2.7",
"rimraf": "^5.0.5",
"sass": "^1.69.6",
"sass": "^1.69.7",
"simple-git-hooks": "^2.9.0",
"typescript": "~5.3.3",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.7.0",
"vitest": "^1.1.1",
"vue": "^3.4.3",
"vite": "^5.0.11",
"vite-plugin-dts": "^3.7.1",
"vitest": "^1.2.0",
"vue": "^3.4.14",
"vue-tsc": "^1.8.27"
},
"simple-git-hooks": {
Expand Down
12 changes: 6 additions & 6 deletions packages/sit-onyx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"@playwright/experimental-ct-vue": "^1.40.1",
"@playwright/test": "^1.40.1",
"@sit-onyx/storybook-utils": "workspace:^",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/blocks": "^7.6.7",
"@storybook/vue3": "^7.6.7",
"@storybook/vue3-vite": "^7.6.7",
"@vue/compiler-dom": "^3.4.5",
"@storybook/addon-essentials": "^7.6.8",
"@storybook/blocks": "^7.6.8",
"@storybook/vue3": "^7.6.8",
"@storybook/vue3-vite": "^7.6.8",
"@vue/compiler-dom": "^3.4.14",
"eslint-plugin-playwright": "~0.21.0",
"react": "^18.2.0",
"storybook": "^7.6.7"
"storybook": "^7.6.8"
}
}
33 changes: 17 additions & 16 deletions packages/storybook-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ import type { ComponentPropsAndSlots, Meta } from "@storybook/vue3";
* type InputEvents = ExtractVueEventNames<typeof Input>; // e.g. "input" | "change"
* ```
*/
export type ExtractVueEventNames<VueComponent> = Extract<
// extract all props/events of the vue component that are functions
ExtractKeysByValueType<
// this generic type will extract ALL props and events from the given Vue component
ComponentPropsAndSlots<VueComponent>,
// emits are declared as functions, so we only take props/events that are functions and ignore the rest
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- We must use any here to match the type defined by Vue
((...args: any) => any) | undefined
>,
// filter out potential function properties by just picking events that start with "on"
`on${string}`
> extends `on${infer EventName}`
? // until now the extracted event names still start with "on" but we want to have the plain event name
// so we will remove the "on" prefix and uncapitalized the first letter so e.g. "onClick" becomes "click"
Uncapitalize<EventName>
: never;
export type ExtractVueEventNames<VueComponent> =
Extract<
// extract all props/events of the vue component that are functions
ExtractKeysByValueType<
// this generic type will extract ALL props and events from the given Vue component
ComponentPropsAndSlots<VueComponent>,
// emits are declared as functions, so we only take props/events that are functions and ignore the rest
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- We must use any here to match the type defined by Vue
((...args: any) => any) | undefined
>,
// filter out potential function properties by just picking events that start with "on"
`on${string}`
> extends `on${infer EventName}`
? // until now the extracted event names still start with "on" but we want to have the plain event name
// so we will remove the "on" prefix and uncapitalized the first letter so e.g. "onClick" becomes "click"
Uncapitalize<EventName>
: never;

/**
* Extracts only the keys from T whose value type satisfies U.
Expand Down
9 changes: 0 additions & 9 deletions packages/vitepress-theme/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@
var(--onyx-color-brand-primary-500),
var(--onyx-color-text-info-500)
);

// remove the following lines when this VitePress PR is merged:
// https://github.com/vuejs/vitepress/pull/3434
--vp-badge-tip-text: var(--vp-c-tip-1);
--vp-badge-tip-bg: var(--vp-c-tip-soft);
--vp-custom-block-tip-bg: var(--vp-c-tip-soft);
--vp-custom-block-tip-code-bg: var(--vp-c-tip-soft);
--vp-code-line-warning-color: var(--vp-c-warning-soft);
--vp-code-line-error-color: var(--vp-c-danger-soft);
}

.dark {
Expand Down
Loading

0 comments on commit e669af3

Please sign in to comment.