-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/574-Implement-input-label-message-tooltip
- Loading branch information
Showing
24 changed files
with
6,927 additions
and
1,336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@sit-onyx/nuxt": patch | ||
"docs": patch | ||
--- | ||
|
||
feat: add nuxt module to easily integrate onyx into nuxt projects | ||
|
||
- Add the global styles to the nuxt project | ||
- Auto imports all onyx components | ||
- Add nuxt section to the getting started guide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
outline: [2, 3] | ||
--- | ||
|
||
<script lang="ts" setup> | ||
import packageJson from "../../../../../packages/nuxt/package.json"; | ||
</script> | ||
|
||
# @sit-onyx/nuxt | ||
|
||
<div class="hide-external-link"> | ||
|
||
[![npm version](https://badge.fury.io/js/@sit-onyx%2Fnuxt.svg)](https://www.npmjs.com/package/@sit-onyx/nuxt) | ||
|
||
</div> | ||
|
||
{{ packageJson.description }}. | ||
|
||
## Changelog | ||
|
||
A full changelog can be found [here](/development/packages/changelogs/nuxt). | ||
|
||
## Features | ||
|
||
- Auto import of all onyx components | ||
- Automatic setup of global styles | ||
|
||
## Quick Setup | ||
|
||
Install the module in your [Nuxt Js](https://nuxt.com/) application with one command: | ||
|
||
```bash | ||
npx nuxi module add @sit-onyx/nuxt | ||
``` | ||
|
||
Afterwards you're able to just use all onyx components inside your app and the global styles will automatically be set up for you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# @sit-onyx/nuxt | ||
|
||
## 0.0.1-alpha.0 | ||
|
||
### Patch Changes | ||
|
||
- 25893ed: feat: add nuxt module to easily integrate onyx into nuxt projects | ||
|
||
- Add the global styles to the nuxt project | ||
- Auto imports all onyx components | ||
- Add nuxt section to the getting started guide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div align="center"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-light.svg"> | ||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg"> | ||
<img alt="onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo-dark.svg" width="160px"> | ||
</picture> | ||
</div> | ||
|
||
<br> | ||
|
||
# @sit-onyx/nuxt | ||
|
||
A Nuxt module to easily integrate onyx into [Nuxt Js](https://nuxt.com/) projects. | ||
Created by [Schwarz IT](https://it.schwarz). | ||
|
||
## Adding it to a nuxt project | ||
|
||
Install the module in your Nuxt application with one command: | ||
|
||
```bash | ||
npx nuxi module add @sit-onyx/nuxt | ||
``` | ||
|
||
## Documentation | ||
|
||
You can find our documentation [here](https://onyx.schwarz/development/packages/nuxt.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "@sit-onyx/nuxt", | ||
"version": "0.0.1-alpha.0", | ||
"description": "A Nuxt module to easily integrate onyx into Nuxt projects", | ||
"author": "Schwarz IT KG", | ||
"license": "Apache-2.0", | ||
"homepage": "https://onyx.schwarz", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SchwarzIT/onyx", | ||
"directory": "packages/nuxt" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/SchwarzIT/onyx/issues" | ||
}, | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./dist/types.d.ts", | ||
"import": "./dist/module.mjs", | ||
"require": "./dist/module.cjs" | ||
} | ||
}, | ||
"types": "./dist/types.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "nuxi dev playground", | ||
"dev:build": "nuxi build playground", | ||
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground", | ||
"build": "pnpm run dev:prepare && nuxt-module-build build", | ||
"type-check": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit", | ||
"test": "vitest", | ||
"test:coverage": "vitest run --coverage" | ||
}, | ||
"dependencies": { | ||
"@nuxt/kit": "^3.11.2" | ||
}, | ||
"devDependencies": { | ||
"@nuxt/devtools": "^1.3.3", | ||
"@nuxt/module-builder": "~0.7.0", | ||
"@nuxt/schema": "^3.11.2", | ||
"@nuxt/test-utils": "^3.13.1", | ||
"nuxt": "^3.11.2" | ||
}, | ||
"peerDependencies": { | ||
"sit-onyx": "workspace:^" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<div> | ||
<OnyxHeadline is="h1">Nuxt module playground!</OnyxHeadline> | ||
</div> | ||
</template> | ||
|
||
<script setup></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default defineNuxtConfig({ | ||
modules: ["../src/module"], | ||
devtools: { enabled: true }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"private": true, | ||
"name": "onyx-nuxt-playground", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "nuxi dev", | ||
"build": "nuxi build", | ||
"generate": "nuxi generate" | ||
}, | ||
"dependencies": { | ||
"nuxt": "^3.11.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../.nuxt/tsconfig.server.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "./.nuxt/tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { addComponent, defineNuxtModule } from "@nuxt/kit"; | ||
import * as onyx from "sit-onyx"; | ||
|
||
export interface ModuleOptions {} | ||
|
||
export default defineNuxtModule<ModuleOptions>({ | ||
meta: { | ||
name: "onyx-nuxt", | ||
configKey: "onyx", | ||
}, | ||
defaults: {}, | ||
setup(_options, nuxt) { | ||
nuxt.options.css.push("sit-onyx/style.css"); | ||
|
||
Object.keys(onyx) | ||
.filter((namedExport) => namedExport.startsWith("Onyx")) | ||
.forEach((component) => { | ||
addComponent({ | ||
filePath: "sit-onyx", | ||
name: component, | ||
export: component, | ||
}); | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { fileURLToPath } from "node:url"; | ||
import { describe, it, expect } from "vitest"; | ||
import { setup, $fetch } from "@nuxt/test-utils/e2e"; | ||
|
||
describe("auto imports", async () => { | ||
await setup({ | ||
rootDir: fileURLToPath(new URL("./fixtures/basic", import.meta.url)), | ||
}); | ||
|
||
it("renders the page containing an auto imported onyx component and it's styles", async () => { | ||
// Get response to a server-rendered page with `$fetch`. | ||
const html = await $fetch("/"); | ||
|
||
// There should be a style definition for the onyx css variable if the styles were added globally | ||
expect(html).toContain("--onyx-font-family"); | ||
|
||
// The rendered page should contain a h1 with the onyx classes if the component was auto imported correctly | ||
expect(html).toContain('<h1 class="onyx-headline onyx-headline--h1">'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<OnyxHeadline is="h1">Hello onyx</OnyxHeadline> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import MyModule from "../../../src/module"; | ||
|
||
export default defineNuxtConfig({ | ||
modules: [MyModule], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"private": true, | ||
"name": "basic", | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./.nuxt/tsconfig.json", | ||
"exclude": ["dist", "node_modules", "playground"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineVitestConfig } from "@nuxt/test-utils/config"; | ||
|
||
export default defineVitestConfig({ | ||
test: { | ||
coverage: { | ||
include: ["src"], | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.