Setup
All checks were successful
QS / QS (push) Successful in 5s

This commit is contained in:
Snoweuph 2024-12-20 22:14:36 +00:00
commit b1c4f0aba6
Signed by: snoweuph
GPG key ID: BEFC41DA223CEC55
15 changed files with 125 additions and 0 deletions

2
.gitea/template Normal file
View file

@ -0,0 +1,2 @@
Readme.md
src/main.user.js

20
.gitea/workflows/qs.yml Normal file
View file

@ -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

0
.prettierignore Normal file
View file

10
.prettierrc.json Normal file
View file

@ -0,0 +1,10 @@
{
"useTabs": false,
"tabWidth": 4,
"arrowParens": "avoid",
"bracketSameLine": false,
"singleQuote": true,
"semi": true,
"trailingComma": "none",
"endOfLine": "lf"
}

8
Justfile Normal file
View file

@ -0,0 +1,8 @@
_choose:
@just --choose
lint:
@npx prettier src/ types/ test/ --write
test:
@cd test && npm run test

9
License.md Normal file
View file

@ -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.

14
Readme.md Normal file
View file

@ -0,0 +1,14 @@
# ${REPO_NAME}
![Stars Badge](https://git.euph.dev/${REPO_LINK}/badges/stars.svg?style=flat-square&label=★Stars&labelColor=gray&color=yellow)
![QS Badge](https://.git.euph.dev/${REPO_LINK}/actions/workflows/qs.yml/badge.svg?style=flat-square&label=Status&labelColor=gray)
## Installation
[![Install Userscript](https://img.shields.io/badge/Install_Userscript-${REPO_NAME}-gray?style=for-the-badge&logo=greasyfork&logoColor=black&labelColor=brown)](https://git.euph.dev/${REPO_LINK}/raw/branch/main/src/main.user.js)
## Description
<!-- description here -->
## Usage
<!-- usage explained here-->

10
jsconfig.json Normal file
View file

@ -0,0 +1,10 @@
{
"compilerOptions": {
"checkJs": true,
"target": "es6",
"lib": [
"dom",
"es6"
]
}
}

5
src/lib.js Normal file
View file

@ -0,0 +1,5 @@
function testLib() {
console.log('lib works!');
}
window.testLib = testLib;

13
src/main.user.js Normal file
View file

@ -0,0 +1,13 @@
// ==UserScript==
// @name ${REPO_NAME}
// @namespace https://git.euph.dev/${REPO_OWNER}
// @match *
// @require ${REPO_LINK}/raw/branch/main/src/lib.js
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_xmlhttpRequest
// @version 0.0.1
// @author Userscripts
// ==/UserScript==
window.testLib();

5
test/package.json Normal file
View file

@ -0,0 +1,5 @@
{
"scripts": {
"test": "node test.js"
}
}

1
test/test.js Normal file
View file

@ -0,0 +1 @@
console.log('Test Okay');

7
types/GM_getValue.d.js Normal file
View file

@ -0,0 +1,7 @@
/**
* @param {string} storageKey
* @returns {string}
*/
function GM_getValue(storageKey) {
return '';
}

5
types/GM_setValue.d.js Normal file
View file

@ -0,0 +1,5 @@
/**
* @param {string} storageKey
* @param {string} value
*/
function GM_setValue(storageKey, value) {}

View file

@ -0,0 +1,16 @@
/**
* @param {Object} request
* @param {string} request.method
* @param {string} request.url
* @param {Object<string, string>} [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.
*/