diff --git a/tools/README.md.js b/tools/README.md.js new file mode 100644 index 00000000..493191d1 --- /dev/null +++ b/tools/README.md.js @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2023 Contributors to the Eclipse Foundation. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: Smart City Jena + */ + +export const readme = (config)=> { + + let goUp =''; + const parts = config.name.split('.'); + const steps = (parts.length); + for(let a=0;a<=steps;a++){ + goUp+='../' + } + return `# org.eclipse.daanse.board.app.xxx +## Description +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + +## If Lib/Core Package +How to use the Package +describe EntryPoint + +## If UI-Widget +### Widget + +![Example Widget](${goUp}tools/assets/widget.png) + +Describe what the Widget is showing in configured state. + +### Widget Settings + +![Example Widget Settings](${goUp}tools/assets/settings.png) + + + +Describe what each Setting is doing. +Describe what minimal has to setted up for a working example. + +eg: + +| Field | required | explanation | hints | +|---------|----------|------------------------------|----------------------------------| +| Name | x | Name of receiver | less than 255 unicode-characters | +| Email | x | Emailaddress of reciver | valid pattern aaa.bbb@ccc.dd | +| Subject | x | Short description of content | less than 255 unicode-characters | +| Message | x | Text to send | less than 750 unicode-characters | +| Send | |if valid trys to send the Email |triggers the validation of above marked fields| + +### Examples + +Show Widget in Wildlife +` +} diff --git a/tools/assets/settings.png b/tools/assets/settings.png new file mode 100644 index 00000000..c58a40a1 Binary files /dev/null and b/tools/assets/settings.png differ diff --git a/tools/assets/widget.png b/tools/assets/widget.png new file mode 100644 index 00000000..887241b8 Binary files /dev/null and b/tools/assets/widget.png differ diff --git a/tools/createPackage.js b/tools/createPackage.js index 1586706c..dcbc31de 100644 --- a/tools/createPackage.js +++ b/tools/createPackage.js @@ -17,6 +17,7 @@ import { fileURLToPath } from 'url'; import path,{ dirname } from 'path'; import {exec} from "node:child_process"; import {vite} from "./vite.config.js"; +import {readme} from "./README.md.js"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -102,6 +103,15 @@ try { console.log(error('couldn t vite.config.ts')); process.exit(1); } +console.log(notice('create README.md...')) +try { + fs.writeFileSync('README.md', readme(config)) + console.log(notice('[✓]')) +} catch (err) { + console.error(err) + console.log(error('couldn t create README.md')); + process.exit(1); +} if(config.withBoilerplate){ console.log(notice('copy base Code...'))