Skip to content

Version 10.0.0 #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/silly-foxes-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@sv443-network/userutils": major
---

**BREAKING:** Moved a majority of the general-purpose code to `@sv443-network/coreutils`
The features are still available in the same way, but some of them needed to be modified so they were more generic and consistent with the new package's codebase.
TODO: list changes
5 changes: 5 additions & 0 deletions .changeset/ten-otters-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sv443-network/userutils": major
---

Increased library target to ES2018
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish-jsr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
env:
CI: "true"
STORE_PATH: ""
PNPM_VERSION: 9
PNPM_VERSION: 10
RETENTION_DAYS: 2

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
env:
CI: "true"
STORE_PATH: ""
PNPM_VERSION: 9
PNPM_VERSION: 10
RETENTION_DAYS: 2

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
env:
CI: "true"
STORE_PATH: ""
PNPM_VERSION: 9
PNPM_VERSION: 10
RETENTION_DAYS: 2

steps:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Sven Fehler (Sv443)
Copyright (c) 2023 Sv443 Network and Sven Fehler (Sv443)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 4 additions & 1 deletion README-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Shameless plug: I made a [template for userscripts in TypeScript](https://github
<br>

- Then, access the functions on the global variable `UserUtils`:

```ts
UserUtils.addGlobalStyle("body { background-color: red; }");

Expand All @@ -183,6 +184,7 @@ Shameless plug: I made a [template for userscripts in TypeScript](https://github
<br>

- If you're using TypeScript and it complains about the missing global variable `UserUtils`, install the library using the package manager of your choice and add the following inside any `.ts` file that is included in the final build:

```ts
declare const UserUtils: typeof import("@sv443-network/userutils");

Expand All @@ -195,7 +197,8 @@ Shameless plug: I made a [template for userscripts in TypeScript](https://github

<br>

- If you're using a linter like ESLint, it might complain about the global variable `UserUtils` not being defined. To fix this, add the following to your ESLint configuration file:
- If you're using a linter like ESLint, it might complain about the global variable `UserUtils` not being defined. To fix this, add the following to your ESLint configuration file:

```json
"globals": {
"UserUtils": "readonly"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ Shameless plug: I made a [template for userscripts in TypeScript](https://github

<br>

- If you're using a linter like ESLint, it might complain about the global variable `UserUtils` not being defined. To fix this, add the following to your ESLint configuration file:
- If you're using a linter like ESLint, it might complain about the global variable `UserUtils` not being defined. To fix this, add the following to your ESLint configuration file:

```json
"globals": {
"UserUtils": "readonly"
Expand Down
12 changes: 9 additions & 3 deletions docs.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# UserUtils Documentation
General purpose DOM/GreaseMonkey library that allows you to register listeners for when CSS selectors exist, intercept events, create persistent & synchronous data stores, modify the DOM more easily and much more.
Contains builtin TypeScript declarations. Supports ESM and CJS imports via a bundler and global declaration via `@require` or `<script>`
The library works in any DOM environment with or without the [GreaseMonkey API](https://wiki.greasespot.net/Greasemonkey_Manual:API), but some features will be unavailable or limited.

You may want to check out my [template for userscripts in TypeScript](https://github.com/Sv443/Userscript.ts) that you can use to get started quickly. It also includes this library by default.
If you like using this library, please consider [supporting the development ❤️](https://github.com/sponsors/Sv443)

<br>

<!-- #region Preamble -->
## Preamble:
This library is written in TypeScript and contains builtin TypeScript declarations, but it will also work in plain JavaScript after removing the `: type` annotations.
This library is written in TypeScript and contains builtin TypeScript declarations, but it will also work in plain JavaScript after removing the `: type` annotations in the example code snippets.

Each feature has example code that can be expanded by clicking on the text "Example - click to view".
Each feature's example code snippet can be expanded by clicking on the text "Example - click to view".
The signatures and examples are written in TypeScript and use ESM import syntax to show you which types need to be provided and will be returned.
The library itself supports importing an ESM, CommonJS or global variable definition bundle, depending on your use case.

Expand Down Expand Up @@ -2329,7 +2335,7 @@ Returns an array of all registered listener functions.

<br>

#### `Debouncer.setTimeout()`
#### `Debouncer.setTimeout()`
Signature: `setTimeout(timeout: number): void`
Changes the timeout for the debouncer.

Expand Down
28 changes: 15 additions & 13 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@sv443-network/userutils",
"version": "0.0.1-invalid",
"exports": "./lib/index.ts",
"version": "10.0.0-alpha.0",
"exports": {
".": "./lib/index.ts"
},
"publish": {
"include": [
"lib/**/*.ts",
"dist/index.js",
"dist/index.mjs",
"dist/index.cjs",
"dist/index.global.js",
"dist/index.umd.js",
"dist/lib/*.d.ts",
"package.json",
"README.md",
"CHANGELOG.md",
"LICENSE.txt"
"./dist/index.cjs",
"./dist/index.global.js",
"./dist/index.js",
"./dist/index.mjs",
"./dist/index.umd.js",
"./dist/lib/*.d.ts",
"./lib/**/*.ts",
"./CHANGELOG.md",
"./LICENSE.txt",
"./package.json",
"./README.md"
],
"exclude": [
"**/*.spec.ts"
Expand Down
222 changes: 0 additions & 222 deletions lib/DataStore.spec.ts

This file was deleted.

Loading