From 848b1c1d42274a560db38f6b2064b928d12d2492 Mon Sep 17 00:00:00 2001 From: Lucemans Date: Thu, 2 Feb 2023 17:41:10 +0000 Subject: [PATCH] Basic Project Setup --- .eslintrc.json | 16 +++++++ .github/ISSUE_TEMPLATE/bug-report.md | 29 +++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++ .github/workflows/pr_build.yml | 36 ++++++++++++++++ .github/workflows/publish.yml | 51 +++++++++++++++++++++++ .gitignore | 5 +++ .npmignore | 6 +++ .npmrc | 1 + .prettierrc | 5 +++ .vscode/settings.json | 8 ++++ LICENSE | 13 ++++++ README.md | 41 ++++++++++++++++++ package.json | 38 +++++++++++++++++ src/index.ts | 3 ++ tsconfig.json | 17 ++++++++ 15 files changed, 289 insertions(+) create mode 100644 .eslintrc.json create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/pr_build.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 .npmrc create mode 100644 .prettierrc create mode 100644 .vscode/settings.json create mode 100644 LICENSE create mode 100644 README.md create mode 100644 package.json create mode 100644 src/index.ts create mode 100644 tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..f21e8e6 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,16 @@ +{ + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2021 + }, + "extends": [ + "plugin:lvksh/recommended" + ], + "ignorePatterns": ["!**/*"], + "plugins": ["lvksh"], + "env": { + "node": true, + "jest/globals": true + }, + "rules": {} +} \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..00eb68e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[Bug]" +labels: bug +assignees: robiot + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment** + - Node: [e.g. v16.9.1] + - OS: [e.g. Arch Linux] + - Typescript [e.g. v.5.4.5] + - Version [e.g. v1.0.0] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..1a6cea8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest improvements +title: "[Feature]" +labels: enhancement +assignees: robiot + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml new file mode 100644 index 0000000..0a865c8 --- /dev/null +++ b/.github/workflows/pr_build.yml @@ -0,0 +1,36 @@ +name: PR Build +on: [pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - uses: pnpm/action-setup@v2.0.1 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install dependencies + run: pnpm install + - name: Lint + run: pnpm lint + - name: Build + run: pnpm build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..be4e771 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,51 @@ +name: Node.js Package +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - uses: pnpm/action-setup@v2.2.2 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build + + - name: Version + run: pnpm version --new-version "${GITHUB_REF:11}" --allow-same-version --no-git-tag-version + + - run: pnpm pub --tag next + # if github release tag contains - then its a prerelease + if: ${{ contains(github.ref, '-') }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - run: pnpm pub + # if github release tag doesn't contains - then its a normal release + if: ${{ !contains(github.ref, '-') }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..506c670 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/coverage +/lib +/logs +/node_modules +/yarn-error.log \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..2e8ae82 --- /dev/null +++ b/.npmignore @@ -0,0 +1,6 @@ +node_modules +yarn-error.log +/lib +coverage +LICENSE +README.md diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..f3b1a9f --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..97313f1 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "tabWidth": 4, + "useTabs": false, + "singleQuote": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..dbecacd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "files.exclude": { + "yarn.lock": true, + "yarn-error.log": true, + "node_modules": true, + "coverage": true + } +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5c16065 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +node-fullykiosk - a typescript wrapper and react hooks for the Fully Kiosk API +Copyright (C) 2023 Luc van Kampen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU Lesser General Public License at diff --git a/README.md b/README.md new file mode 100644 index 0000000..519b9e6 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +![node fullykiosk](./assets/banner.png) + +[![MINIFIED SIZE](https://img.shields.io/bundlephobia/min/fullykiosk.svg)]() +[![COVERAGE](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)]() +[![LANGUAGES](https://img.shields.io/github/languages/top/v3xlabs/fullykiosk)]() +[![DEPENDENCIRES](https://img.shields.io/badge/dependencies-0-brightgreen.svg)]() +[![NPM](https://img.shields.io/npm/dt/fullykiosk)]() + +Typescript Friendly React Hooks for the Fully Kiosk Browser App + +This library exposes multiple react hooks that you can use to interface with your Fully Kiosk Browser App. By default the fully kiosk API is globally injected into the window object, so you could use it directly. However, this library provides a more typescript friendly interface. + +## How it works + +## Installation + +Using `npm`: + +```sh +npm install fullykiosk +``` + +or if you prefer to use the `yarn` package manager: + +```sh +yarn add fullykiosk +``` + +## Usage + +```ts + +``` + +## Contributors + +[![](https://contrib.rocks/image?repo=v3xlabs/node-fullykiosk)](https://github.com/v3xlabs/node-fullykiosk/graphs/contributors) + +## LICENSE + +This package is licensed under the [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl-3.0). diff --git a/package.json b/package.json new file mode 100644 index 0000000..e77d5c1 --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "fullykiosk", + "description": "Typescript friendly React Hooks for the Fully Kiosk API", + "repository": "https://github.com/v3xlabs/node-fullykiosk", + "author": "v3xlabs", + "license": "LGPL-3.0", + "types": "./lib/index.d.ts", + "main": "./lib/index.js", + "files": [ + "lib" + ], + "keywords": [ + "fullykiosk", + "fully", + "kiosk", + "react", + "hooks", + "typescript" + ], + "devDependencies": { + "@types/jest": "^28.1.3", + "@types/node": "^18.0.0", + "@jest/types": "^28.1.1", + "@typescript-eslint/parser": "^5.29.0", + "eslint": "^8.18.0", + "eslint-plugin-lvksh": "^1.4.1", + "jest": "^28.1.1", + "ts-jest": "^28.0.5", + "ts-node": "^10.8.1", + "typescript": "^4.7.4" + }, + "scripts": { + "build": "tsc", + "test": "jest --verbose --coverage", + "lint": "eslint -c .eslintrc.json --ext .ts ./src ./tests", + "pub": "pnpm publish --no-git-checks" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..9d1bd3d --- /dev/null +++ b/src/index.ts @@ -0,0 +1,3 @@ +export const useCurrentLocale = () => { + +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f978d72 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "ES5", + "module": "commonjs", + "lib": ["es2015", "es2016", "es2017", "es2020"], + "strict": true, + "declaration": true, + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "outDir": "lib", + "esModuleInterop": true + }, + "include": ["src"], + "exclude": ["node_modules", "tests", "lib"] +} \ No newline at end of file