From 1209b0ad5d2265fe24aa1f0dfcfec60fe3ed7e87 Mon Sep 17 00:00:00 2001 From: Userscripts <> Date: Sat, 21 Dec 2024 14:54:19 +0000 Subject: [PATCH] Initial commit --- .gitea/workflows/qs.yml | 20 ++++++++++++++++++++ .prettierignore | 0 .prettierrc.json | 10 ++++++++++ Justfile | 8 ++++++++ License.md | 9 +++++++++ Readme.md | 14 ++++++++++++++ jsconfig.json | 10 ++++++++++ src/lib.js | 5 +++++ src/main.user.js | 13 +++++++++++++ test/package.json | 5 +++++ test/test.js | 1 + types/GM_getValue.d.js | 7 +++++++ types/GM_setValue.d.js | 5 +++++ types/GM_xmlhttpRequest.d.js | 16 ++++++++++++++++ 14 files changed, 123 insertions(+) create mode 100644 .gitea/workflows/qs.yml create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 Justfile create mode 100644 License.md create mode 100644 Readme.md create mode 100644 jsconfig.json create mode 100644 src/lib.js create mode 100644 src/main.user.js create mode 100644 test/package.json create mode 100644 test/test.js create mode 100644 types/GM_getValue.d.js create mode 100644 types/GM_setValue.d.js create mode 100644 types/GM_xmlhttpRequest.d.js diff --git a/.gitea/workflows/qs.yml b/.gitea/workflows/qs.yml new file mode 100644 index 0000000..817a8bc --- /dev/null +++ b/.gitea/workflows/qs.yml @@ -0,0 +1,20 @@ +name: "QS" + +on: + push: + branches: + - main + +jobs: + qs: + name: "QS" + runs-on: "ubuntu-latest" + container: + image: "git.euph.dev/actions/runner-js-latest:latest" + steps: + - name: "Checkout" + uses: "https://git.euph.dev/actions/checkout@v3" + - name: "Prettier" + run: npm_config_yes=true npx prettier src/ types/ --check --log-level=error + - name: "Run Tests" + run: cd test && npm i --no-fund && npm run test diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..e69de29 diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..37ddf7a --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,10 @@ +{ + "useTabs": false, + "tabWidth": 4, + "arrowParens": "avoid", + "bracketSameLine": false, + "singleQuote": true, + "semi": true, + "trailingComma": "none", + "endOfLine": "lf" +} diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..28f1f51 --- /dev/null +++ b/Justfile @@ -0,0 +1,8 @@ +_choose: + @just --choose + +lint: + @npx prettier src/ types/ test/ --write + +test: + @cd test && npm run test diff --git a/License.md b/License.md new file mode 100644 index 0000000..fa5fb63 --- /dev/null +++ b/License.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2024 Userscripts + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..55516ea --- /dev/null +++ b/Readme.md @@ -0,0 +1,14 @@ +# CCNA_Autofill + +![Stars Badge](https://git.euph.dev/Userscripts/CCNA_Autofill/badges/stars.svg?style=flat-square&label=★Stars&labelColor=gray&color=yellow) +![QS Badge](https://git.euph.dev/Userscripts/CCNA_Autofill/actions/workflows/qs.yml/badge.svg?style=flat-square&label=Status&labelColor=gray) + +## Installation + +[![Install Userscript](https://img.shields.io/badge/Install_Userscript-CCNA_Autofill-gray?style=for-the-badge&logo=greasyfork&logoColor=black&labelColor=brown)](https://git.euph.dev/Userscripts/CCNA_Autofill/raw/branch/main/src/main.user.js) + +## Description + + +## Usage + diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..d2b27d9 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "checkJs": true, + "target": "es6", + "lib": [ + "dom", + "es6" + ] + } +} diff --git a/src/lib.js b/src/lib.js new file mode 100644 index 0000000..ada0ad5 --- /dev/null +++ b/src/lib.js @@ -0,0 +1,5 @@ +function testLib() { + console.log('lib works!'); +} + +window.testLib = testLib; diff --git a/src/main.user.js b/src/main.user.js new file mode 100644 index 0000000..4d06ae4 --- /dev/null +++ b/src/main.user.js @@ -0,0 +1,13 @@ +// ==UserScript== +// @name CCNA_Autofill +// @namespace https://git.euph.dev/Userscripts +// @match * +// @require https://git.euph.dev/Userscripts/CCNA_Autofill/raw/branch/main/src/lib.js +// @grant GM_setValue +// @grant GM_getValue +// @grant GM_xmlhttpRequest +// @version 0.0.1 +// @author Userscripts +// ==/UserScript== + +window.testLib(); diff --git a/test/package.json b/test/package.json new file mode 100644 index 0000000..2c44c11 --- /dev/null +++ b/test/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "test": "node test.js" + } +} diff --git a/test/test.js b/test/test.js new file mode 100644 index 0000000..e67afbc --- /dev/null +++ b/test/test.js @@ -0,0 +1 @@ +console.log('Test Okay'); diff --git a/types/GM_getValue.d.js b/types/GM_getValue.d.js new file mode 100644 index 0000000..60a8662 --- /dev/null +++ b/types/GM_getValue.d.js @@ -0,0 +1,7 @@ +/** + * @param {string} storageKey + * @returns {string} + */ +function GM_getValue(storageKey) { + return ''; +} diff --git a/types/GM_setValue.d.js b/types/GM_setValue.d.js new file mode 100644 index 0000000..a003dd5 --- /dev/null +++ b/types/GM_setValue.d.js @@ -0,0 +1,5 @@ +/** + * @param {string} storageKey + * @param {string} value + */ +function GM_setValue(storageKey, value) {} diff --git a/types/GM_xmlhttpRequest.d.js b/types/GM_xmlhttpRequest.d.js new file mode 100644 index 0000000..9d09b8f --- /dev/null +++ b/types/GM_xmlhttpRequest.d.js @@ -0,0 +1,16 @@ +/** + * @param {Object} request + * @param {string} request.method + * @param {string} request.url + * @param {Object} [request.headers] + * @param {function(GMXMLHttpRequestResponse):void} [request.onload] + * @param {Function} [request.onerror] + * @returns {void} + */ +function GM_xmlhttpRequest(request) {} + +/** + * Response object for the HTTP request. + * @typedef {Object} GMXMLHttpRequestResponse + * @property {string} responseText - The response body as text. + */