From 38d08a61ade580f26b50b9488c75d2e84e544163 Mon Sep 17 00:00:00 2001 From: kaan Date: Tue, 16 Jan 2024 23:06:24 +0100 Subject: [PATCH] refactor: files --- CONTRIBUTING.md | 32 +++++++++---------- README.md | 22 +++++++++---- docs/.vitepress/config.ts | 8 ++--- docs/index.md | 12 +++---- package.json | 5 +-- .../__tests__/index.test.ts | 0 .../index.ts | 0 .../style.css | 0 tsconfig-build.json | 4 +-- tsconfig.json | 2 +- vite.config.ts | 10 +++--- 11 files changed, 52 insertions(+), 43 deletions(-) rename src/{myPackagePlugin => bananaConverter}/__tests__/index.test.ts (100%) rename src/{myPackagePlugin => bananaConverter}/index.ts (100%) rename src/{myPackagePlugin => bananaConverter}/style.css (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 358e343..fa43129 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,29 +10,29 @@ These are the useful scripts that you can use while developing. You can find them in the `package.json` file. You can run them by using `npm run `. -| Script | Description | -| ---------------------- | ---------------------------------------------- | -| `dev` | Start the development environment | -| `build` | Test and build the app and the `live-demo` | -| `build:live-demo` | Only build the `live-demo` | -| `build:lib` | Only build the `library` | -| `coverage:web` | Serve the test coverage report to localhost | -| `generate:types` | Generate all the types for the project | -| `changeset` | Adds a changelog to the project after a change | -| `test` | Run the tests once | -| `test:watch` | Watch the tests | -| `test:coverage` | Create a coverage report for the tests | -| `clean` | Remove ./dist and ./live-demo directories | +| Script | Description | +| ----------------- | ---------------------------------------------- | +| `dev` | Start the development environment | +| `build` | Test and build the app and the `live-demo` | +| `build:live-demo` | Only build the `live-demo` | +| `build:lib` | Only build the `library` | +| `coverage:web` | Serve the test coverage report to localhost | +| `generate:types` | Generate all the types for the project | +| `changeset` | Adds a changelog to the project after a change | +| `test` | Run the tests once | +| `test:watch` | Watch the tests | +| `test:coverage` | Create a coverage report for the tests | +| `clean` | Remove ./dist and ./live-demo directories | When pushing your changes, always include a **changeset** file. You can do this by running the `changeset` script. It will ask you a few questions and then create a file for you. You can read more about it [here](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md). ### 🐛 **Did you find a bug?** -Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/kaandesu/ts-vite-npm-package/issues). If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/kaandesu/ts-vite-npm-package/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible demonstrating the expected behavior that is not occurring. +Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/kaandesu/banana-converter/issues). If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/kaandesu/banana-converter/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible demonstrating the expected behavior that is not occurring. ### 💡 **Do you want to add a new feature or change an existing one?** -[Open a GitHub issue](https://github.com/kaandesu/ts-vite-npm-package/issues/new) stating your feature request clearly. We can discuss it on the issue thread, then you can implement it! 🎉 +[Open a GitHub issue](https://github.com/kaandesu/banana-converter/issues/new) stating your feature request clearly. We can discuss it on the issue thread, then you can implement it! 🎉 ### ✨ **Did you write a change that fixes a bug?** @@ -66,4 +66,4 @@ Open a new GitHub pull request with the patch. Open source software is beautiful, all of your contributions are much appreciated -Thanks! \ No newline at end of file +Thanks! diff --git a/README.md b/README.md index fb2ef64..87adf32 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,7 @@ -![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white) -![Vite](https://img.shields.io/badge/vite-%23646CFF.svg?style=for-the-badge&logo=vite&logoColor=white) -![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white) +![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white) ![Vite](https://img.shields.io/badge/vite-%23646CFF.svg?style=for-the-badge&logo=vite&logoColor=white) ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)

Banana Converter

@@ -41,9 +39,19 @@ npm i banana-converter ## Usage ```typescript -import { convert } from "banana-converter"; +import { convert } from 'banana-converter' -convert(1.5, "banana", "cm"); // 26.67 -convert(24, "yard", "banana"); // 123.432 -convert(60, "kilometer", "banana"); // 337078.651685 +convert(1.5, 'banana', 'cm') // 26.67 +convert(24, 'yard', 'banana') // 123.432 +convert(60, 'kilometer', 'banana') // 337078.651685 ``` + +## Contributing + +Contributions to the project is highly appreciated. If you have any suggestions/questions/requests please consider [opening an issue](https://github.com/kaandesu/banana-converter/issues/new). If you want to contribute to the project, fixing an open issue is greatly recommended and appreciated. To see the all contribution rules please check the [contribution rules](CONTRIBUTING.md). + +### Contact + +| Maintainer | +| --------------------------------------- | +| [kaandesu](https://github.com/kaandesu) | diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b493b68..0918c4e 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -2,10 +2,10 @@ import { defineConfig } from 'vitepress' // https://vitepress.dev/reference/site-config export default defineConfig({ - title: 'TS npm template', - description: 'Vitepress documentation example for ts-vite-npm-template repository', + title: 'Banana Converter', + description: 'Convert Lengths and Distances to Bananas', lang: 'en-US', - base: '/ts-vite-npm-template/', + base: '/banana-converter/', themeConfig: { // https://vitepress.dev/reference/default-theme-config logo: '/logo.webp', @@ -24,6 +24,6 @@ export default defineConfig({ }, ], - socialLinks: [{ icon: 'github', link: 'https://github.com/kaandesu/ts-vite-npm-template' }], + socialLinks: [{ icon: 'github', link: 'https://github.com/kaandesu/banana-converter' }], }, }) diff --git a/docs/index.md b/docs/index.md index bda14a1..1e32cf8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,13 +3,13 @@ layout: home hero: - name: 'TS Vite NPM Template' - text: 'Vitepress documentation example' - tagline: My great package tagline + name: 'Banana Converter' + text: 'Convert Lengths and Distances to Bananas' + tagline: Simple, Blazingly Fast, and Free actions: - theme: brand text: Live Demo - link: https://kaandesu.github.io/ts-vite-npm-template/live-demo/index.html + link: https://kaandesu.github.io/banana-converter/live-demo/index.html - theme: alt text: Markdown Examples link: /markdown-examples @@ -17,8 +17,8 @@ hero: text: API Examples link: /api-examples image: - src: https://raw.githubusercontent.com/kaandesu/ts-vite-npm-template/main/public/logo.webp - alt: ts-vite-npm-template + src: https://raw.githubusercontent.com/kaandesu/banana-converter/main/public/logo.webp + alt: banana-converter features: - title: Feature A diff --git a/package.json b/package.json index 2acd9aa..89f1c14 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,11 @@ "keywords": [ "banana", "converter", - "lenght", + "length", "distance", "unit", - "conversion" + "conversion", + "monkey" ], "repository": { "type": "git", diff --git a/src/myPackagePlugin/__tests__/index.test.ts b/src/bananaConverter/__tests__/index.test.ts similarity index 100% rename from src/myPackagePlugin/__tests__/index.test.ts rename to src/bananaConverter/__tests__/index.test.ts diff --git a/src/myPackagePlugin/index.ts b/src/bananaConverter/index.ts similarity index 100% rename from src/myPackagePlugin/index.ts rename to src/bananaConverter/index.ts diff --git a/src/myPackagePlugin/style.css b/src/bananaConverter/style.css similarity index 100% rename from src/myPackagePlugin/style.css rename to src/bananaConverter/style.css diff --git a/tsconfig-build.json b/tsconfig-build.json index 1afdf9f..6844118 100644 --- a/tsconfig-build.json +++ b/tsconfig-build.json @@ -14,9 +14,9 @@ "types": ["node"], "baseUrl": "./", "paths": { - "~/*": ["src/myPackagePlugin/*"] + "~/*": ["src/bananaConverter/*"] } }, - "include": ["src/myPackagePlugin/*.ts", "src/myPackagePlugin/*.d.ts"], + "include": ["src/bananaConverter/*.ts", "src/bananaConverter/*.d.ts"], "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/tsconfig.json b/tsconfig.json index b40dd1b..eada1c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ "types": ["node", "vitest/globals"], "baseUrl": "./", "paths": { - "~/*": ["src/myPackagePlugin/*"] + "~/*": ["src/bananaConverter/*"] } }, "include": ["src/**/*.ts", "src/**/*.d.ts"], diff --git a/vite.config.ts b/vite.config.ts index a972bc9..adeb0bb 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig(({ mode }) => { }, resolve: { alias: { - '~': resolve(__dirname, 'src', 'myPackagePlugin'), + '~': resolve(__dirname, 'src', 'bananaConverter'), }, }, build: { @@ -28,14 +28,14 @@ export default defineConfig(({ mode }) => { }, resolve: { alias: { - '~': resolve(__dirname, 'src', 'myPackagePlugin'), + '~': resolve(__dirname, 'src', 'bananaConverter'), }, }, build: { lib: { - entry: resolve(__dirname, 'src/myPackagePlugin', 'index.ts'), - name: 'my_package_name', - fileName: 'my_package_name', + entry: resolve(__dirname, 'src/bananaConverter', 'index.ts'), + name: 'banana-converter', + fileName: 'banana-converter', }, }, }