From 32de77275f66f42ad59e4cc5c3d930b25da51d4a Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Mon, 11 Dec 2023 14:10:56 +0100 Subject: [PATCH] build: include readme file --- DEVELOPER.md | 2 +- README.md | 8 +++----- src/components/vite.config.ts | 4 ++-- tools/generate-component/index.mts | 2 +- vite.config.ts | 4 +++- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DEVELOPER.md b/DEVELOPER.md index 0f75ba2ffa..c7201fd74c 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -29,7 +29,7 @@ Run `yarn lint --fix` to fix any automatically fixable lint issues and report th ## Running tests -To run unit tests, run `yarn test:watch`. +To run unit tests, run `yarn test`. ## Starting showcase diff --git a/README.md b/README.md index 6dd6730f4c..e3acbb591b 100644 --- a/README.md +++ b/README.md @@ -38,17 +38,15 @@ The latest still **๐Ÿงช experimental** version of the Storybook component browse The current **๐Ÿงช experimental** build of Lyne Components can be found on [npm](https://www.npmjs.com/package/@sbb-esta/lyne-components). -## ๐Ÿš€ Getting started - -To see how to use `lyne-components` in React, Angular, Vue, Svelte or Plain Javascript, please refer to [this](https://github.com/lyne-design-system/lyne-getting-started) repo to see example implementations. - ## ๐Ÿ“š Documentation Check the [docs](docs/README.md) directory for our documentation which we will continuously enhance. +Component specific docs are available on our [storybook](https://lyne-storybook.app.sbb.ch). +General docs can be read on [digital.sbb.ch](https://digital.sbb.ch). ## ๐Ÿ™Œ Contributing -See our [contributing guide](/.github/CONTRIBUTING.md) and check also our [code of conduct](/.github/CODE_OF_CONDUCT.md) ๐Ÿ‘€. +See our [contributing guide](CONTRIBUTING.md) and check also our [code of conduct](CODE_OF_CONDUCT.md) ๐Ÿ‘€. ## ๐Ÿ“ License diff --git a/src/components/vite.config.ts b/src/components/vite.config.ts index e6370b1ff8..5b6780ba76 100644 --- a/src/components/vite.config.ts +++ b/src/components/vite.config.ts @@ -55,7 +55,7 @@ export default defineConfig((config) => .filter((v, i, a) => a.indexOf(v) === i) .sort(), }), - copyAssets(['_index.scss', 'core/styles/**/*.scss']), + copyAssets(['_index.scss', 'core/styles/**/*.scss', '../../README.md']), typography(), ] : []), @@ -71,7 +71,7 @@ export default defineConfig((config) => outDir: outDir.pathname, emptyOutDir: true, }, - assetsInclude: ['_index.scss', 'core/styles/**/*.scss'], + assetsInclude: ['_index.scss', 'core/styles/**/*.scss', 'README.md'], }), ); diff --git a/tools/generate-component/index.mts b/tools/generate-component/index.mts index 7dbc3cc0f6..3614a4d4d6 100644 --- a/tools/generate-component/index.mts +++ b/tools/generate-component/index.mts @@ -62,7 +62,7 @@ function copyFiles( const fileDataWithCorrectName: string = fileData .replace(/__name__/gu, componentName) .replace(/__noPrefixName__/gu, componentFileName) - .replace(/__nameUpperCase__/gu, convertKebabCaseToPascalCase(componentName)); + .replace(/__nameUpperCase__/gu, `${convertKebabCaseToPascalCase(componentName)}Element`); try { const relativePath: string = relative(config.boilerplateDirectory, file); diff --git a/vite.config.ts b/vite.config.ts index c690a00d73..c7e5db35cb 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -84,9 +84,11 @@ export function copyAssets(includes: string[]): PluginOption { return; } for (const file of glob.sync(includes, { cwd: viteConfig.root })) { + // Remove relative file path if file is on a more upper layer than cwd. + const fileName = file.replace(/^(\.\.\/)*/, ''); this.emitFile({ type: 'asset', - fileName: file, + fileName: fileName, source: readFileSync(join(viteConfig.root, file), 'utf8'), }); }