Skip to content

Commit 040c0d6

Browse files
committed
fix: add patch for service-worker-types
1 parent d419b65 commit 040c0d6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- node_modules/@types/service-worker-mock/index.d.ts 2021-02-18 13:51:50.000000000 -0700
2+
+++ patches/service-workertypes.d.ts 2021-02-18 16:30:01.000000000 -0700
3+
@@ -3,6 +3,11 @@
4+
// Definitions by: Remco Haszing <https://github.com/remcohaszing>
5+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6+
// TypeScript Version: 2.8
7+
+// https://gist.github.com/shqld/32df51a4a4ed429f2c76e4e2cfdf6f96#gistcomment-2793376
8+
+// excludes default libs such as 'dom' conflicting with 'webworker'
9+
+/// <reference no-default-lib="true"/>
10+
+/// <reference lib="esnext" />
11+
+/// <reference lib="webworker" />
12+
13+
export = makeServiceWorkerEnv;
14+
declare function makeServiceWorkerEnv(): WorkerGlobalScope;

test/scripts/patch.sh

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ apply_service_worker_mock_patches() {
1010

1111
# This patch adds a missing import
1212
patch --forward node_modules/service-worker-mock/models/Response.js < patches/service-worker-mock-response.patch
13+
14+
# This patch fixes the types declaration file
15+
# See discussion:
16+
patch --forward node_modules/@types/service-worker-mock/index.d.ts < patches/service-worker-types.patch
1317
}
1418

1519
main() {

0 commit comments

Comments
 (0)