Skip to content

Commit

Permalink
feat: align with the upstream and update the package JSON (#4)
Browse files Browse the repository at this point in the history
Integrate all the upstream changes and update the name of the package JSON to distinguish this being a fork.
Removes the CJS export.
  • Loading branch information
danieleloscozzese authored Jan 12, 2025
1 parent d92469b commit ab3a1ed
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 30 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
index.cjs
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# post-task
# @dagher/post-task

A pre-configured progressively-enhancement utility function based on the
[Scheduler API](https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API).
Expand Down Expand Up @@ -38,15 +38,10 @@ web vital and of course the smooth interaction which it tries to measure.
## Use

```js
import postTask from "post-task";
import postTask from "@dagher/post-task";

// ...
postTask(() => {
trackEvent("something-happened");
}, "background");
```

## Formats

This package is equally available as ESM and CJS and has a single, default
export.
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
// Copyright © 2024 Adevinta
// Copyright © 2025 Daniel Arthur Gallagher

declare module "post-task" {
declare module "@dagher/post-task" {
/**
* Queues an arbitrary task to be scheduled for execution with the given
* priority.
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"name": "post-task",
"version": "1.2.0",
"description": "A polyfill for the Scheduler API with a pre-configured progressively-enhanced function helps to split long-running tasks into chunks.",
"name": "@dagher/post-task",
"license": "MIT",
"type": "module",
"description": "A polyfill for the Scheduler API with a pre-configured progressively-enhanced function helps to split long-running tasks into chunks.",
"version": "1.0.0-dev.1",
"exports": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.cjs"
"import": "./index.mjs"
},
"scripts": {
"pretest": "node --check index.mjs",
"test": "node --disable-warning=ExperimentalWarning ./index.spec.mjs",
"prepublishOnly": "sed 's/export default/module.exports =/g' ./index.mjs > index.cjs"
"test": "node --disable-warning=ExperimentalWarning ./index.spec.mjs"
},
"devDependencies": {
"prettier": "3.4.2"
},
"packageManager": "[email protected]+sha512.11dff29565d2297c74e7c594a9762581bde969f0aa5cbe6f5b3644bf008a16c065ece61094d9ffbb81125be38df8e1ba43eb8244b3d30c61eb797e9a2440e3ec",
"repository": {
"type": "git",
"url": "git+https://github.com/adevinta/post-task.git"
"url": "git+https://github.com/danieleloscozzese/post-task.git"
},
"homepage": "https://github.com/danieleloscozzese/post-task#readme",
"bugs": {
"url": "https://github.com/danieleloscozzese/post-task/issues"
},
"keywords": [
"scheduler",
Expand All @@ -25,14 +32,7 @@
],
"author": {
"name": "Daniel Arthur Gallagher",
"email": "[email protected]"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/adevinta/post-task/issues"
},
"homepage": "https://github.com/adevinta/post-task#readme",
"devDependencies": {
"prettier": "3.4.2"
"email": "[email protected]",
"url": "https://danielarthurgallagher.dev"
}
}

0 comments on commit ab3a1ed

Please sign in to comment.