Skip to content

Commit

Permalink
build: Remove unused deno tasks and refine task commands
Browse files Browse the repository at this point in the history
  • Loading branch information
takker99 committed Dec 21, 2024
1 parent d3c3cde commit 0bf2b37
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs/
coverage/
14 changes: 9 additions & 5 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "@cosense/types",
"version": "0.0.0",
"tasks": {
"check:dry": "deno fmt --check && deno lint && deno check --remote **/*.ts && deno test --parallel",
"check": "deno fmt && deno lint && deno check --remote **/*.ts && deno test --parallel",
"check:publish": "deno task check && deno publish --dry-run --allow-dirty",
"publish": "deno run --allow-env --allow-run=deno --allow-read --allow-write=deno.jsonc jsr:@david/[email protected]"
"fix": "deno fmt && deno lint --fix && deno test --allow-read --doc --parallel --shuffle && deno publish --dry-run --allow-dirty",
"check": "deno fmt --check && deno lint && deno test --allow-read --doc --parallel --shuffle && deno publish --dry-run",
"coverage": "deno test --allow-read=./ --parallel --shuffle --coverage && deno coverage --html",
"doc": "deno doc --html rest.ts userscript.ts"
},
"imports": {
"@std/testing/types": "jsr:@std/testing@0/types"
Expand All @@ -20,5 +20,9 @@
"dom.iterable",
"esnext"
]
}
},
"exclude": [
"coverage/",
"docs/"
]
}
54 changes: 27 additions & 27 deletions vendor/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface Abortable {
* For `EventTarget`s this is the only way to get the event listeners for the
* event target. This is useful for debugging and diagnostic purposes.
*
* ```js
* ```js ignore
* const { getEventListeners, EventEmitter } = require('events');
*
* {
Expand All @@ -48,7 +48,7 @@ export declare function getEventListeners(
): Function[];

/**
* ```js
* ```js ignore
* const { on, EventEmitter } = require('events');
*
* (async () => {
Expand Down Expand Up @@ -77,7 +77,7 @@ export declare function getEventListeners(
*
* An `AbortSignal` can be used to cancel waiting on events:
*
* ```js
* ```js ignore
* const { on, EventEmitter } = require('events');
* const ac = new AbortController();
*
Expand Down Expand Up @@ -120,7 +120,7 @@ export declare function on(
* This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
* semantics and does not listen to the `'error'` event.
*
* ```js
* ```js ignore
* const { once, EventEmitter } = require('events');
*
* async function run() {
Expand Down Expand Up @@ -152,7 +152,7 @@ export declare function on(
* '`error'` event itself, then it is treated as any other kind of event without
* special handling:
*
* ```js
* ```js ignore
* const { EventEmitter, once } = require('events');
*
* const ee = new EventEmitter();
Expand All @@ -168,7 +168,7 @@ export declare function on(
*
* An `AbortSignal` can be used to cancel waiting for the event:
*
* ```js
* ```js ignore
* const { EventEmitter, once } = require('events');
*
* const ee = new EventEmitter();
Expand Down Expand Up @@ -228,7 +228,7 @@ interface StaticEventEmitterOptions {
/**
* The `EventEmitter` class is defined and exposed by the `events` module:
*
* ```js
* ```js ignore
* const EventEmitter = require('events');
* ```
*
Expand All @@ -253,7 +253,7 @@ export declare class EventEmitter {
* already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
* times.
*
* ```js
* ```js ignore
* server.on('connection', (stream) => {
* console.log('someone connected!');
* });
Expand All @@ -264,7 +264,7 @@ export declare class EventEmitter {
* By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the
* event listener to the beginning of the listeners array.
*
* ```js
* ```js ignore
* const myEE = new EventEmitter();
* myEE.on('foo', () => console.log('a'));
* myEE.prependListener('foo', () => console.log('b'));
Expand All @@ -282,7 +282,7 @@ export declare class EventEmitter {
* Adds a **one-time**`listener` function for the event named `eventName`. The
* next time `eventName` is triggered, this listener is removed and then invoked.
*
* ```js
* ```js ignore
* server.once('connection', (stream) => {
* console.log('Ah, we have our first user!');
* });
Expand All @@ -293,7 +293,7 @@ export declare class EventEmitter {
* By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the
* event listener to the beginning of the listeners array.
*
* ```js
* ```js ignore
* const myEE = new EventEmitter();
* myEE.once('foo', () => console.log('a'));
* myEE.prependOnceListener('foo', () => console.log('b'));
Expand All @@ -310,7 +310,7 @@ export declare class EventEmitter {
/**
* Removes the specified `listener` from the listener array for the event named`eventName`.
*
* ```js
* ```js ignore
* const callback = (stream) => {
* console.log('someone connected!');
* };
Expand All @@ -328,7 +328,7 @@ export declare class EventEmitter {
* time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
* not remove them from`emit()` in progress. Subsequent events behave as expected.
*
* ```js
* ```js ignore
* const myEmitter = new MyEmitter();
*
* const callbackA = () => {
Expand Down Expand Up @@ -368,7 +368,7 @@ export declare class EventEmitter {
* event (as in the example below), `removeListener()` will remove the most
* recently added instance. In the example the `once('ping')`listener is removed:
*
* ```js
* ```js ignore
* const ee = new EventEmitter();
*
* function pong() {
Expand Down Expand Up @@ -425,7 +425,7 @@ export declare class EventEmitter {
/**
* Returns a copy of the array of listeners for the event named `eventName`.
*
* ```js
* ```js ignore
* server.on('connection', (stream) => {
* console.log('someone connected!');
* });
Expand All @@ -440,7 +440,7 @@ export declare class EventEmitter {
* Returns a copy of the array of listeners for the event named `eventName`,
* including any wrappers (such as those created by `.once()`).
*
* ```js
* ```js ignore
* const emitter = new EventEmitter();
* emitter.once('log', () => console.log('log once'));
*
Expand Down Expand Up @@ -473,7 +473,7 @@ export declare class EventEmitter {
*
* Returns `true` if the event had listeners, `false` otherwise.
*
* ```js
* ```js ignore
* const EventEmitter = require('events');
* const myEmitter = new EventEmitter();
*
Expand Down Expand Up @@ -520,7 +520,7 @@ export declare class EventEmitter {
* already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
* times.
*
* ```js
* ```js ignore
* server.prependListener('connection', (stream) => {
* console.log('someone connected!');
* });
Expand All @@ -539,7 +539,7 @@ export declare class EventEmitter {
* Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
* listener is removed, and then invoked.
*
* ```js
* ```js ignore
* server.prependOnceListener('connection', (stream) => {
* console.log('Ah, we have our first user!');
* });
Expand All @@ -558,7 +558,7 @@ export declare class EventEmitter {
* Returns an array listing the events for which the emitter has registered
* listeners. The values in the array are strings or `Symbol`s.
*
* ```js
* ```js ignore
* const EventEmitter = require('events');
* const myEE = new EventEmitter();
* myEE.on('foo', () => {});
Expand All @@ -584,7 +584,7 @@ export declare class EventEmitter {
* This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
* semantics and does not listen to the `'error'` event.
*
* ```js
* ```js ignore
* const { once, EventEmitter } = require('events');
*
* async function run() {
Expand Down Expand Up @@ -616,7 +616,7 @@ export declare class EventEmitter {
* '`error'` event itself, then it is treated as any other kind of event without
* special handling:
*
* ```js
* ```js ignore
* const { EventEmitter, once } = require('events');
*
* const ee = new EventEmitter();
Expand All @@ -632,7 +632,7 @@ export declare class EventEmitter {
*
* An `AbortSignal` can be used to cancel waiting for the event:
*
* ```js
* ```js ignore
* const { EventEmitter, once } = require('events');
*
* const ee = new EventEmitter();
Expand Down Expand Up @@ -668,7 +668,7 @@ export declare class EventEmitter {
options?: StaticEventEmitterOptions,
): Promise<any[]>;
/**
* ```js
* ```js ignore
* const { on, EventEmitter } = require('events');
*
* (async () => {
Expand Down Expand Up @@ -697,7 +697,7 @@ export declare class EventEmitter {
*
* An `AbortSignal` can be used to cancel waiting on events:
*
* ```js
* ```js ignore
* const { on, EventEmitter } = require('events');
* const ac = new AbortController();
*
Expand Down Expand Up @@ -729,7 +729,7 @@ export declare class EventEmitter {
/**
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
*
* ```js
* ```js ignore
* const { EventEmitter, listenerCount } = require('events');
* const myEmitter = new EventEmitter();
* myEmitter.on('event', () => {});
Expand All @@ -756,7 +756,7 @@ export declare class EventEmitter {
* For `EventTarget`s this is the only way to get the event listeners for the
* event target. This is useful for debugging and diagnostic purposes.
*
* ```js
* ```js ignore
* const { getEventListeners, EventEmitter } = require('events');
*
* {
Expand Down

0 comments on commit 0bf2b37

Please sign in to comment.