Skip to content

Commit

Permalink
🤖 Merge PR #63682 remove multiple workbox-_ DT packages, resolve ve…
Browse files Browse the repository at this point in the history
…rsions mismatch by @NivaldoFarias

* chore[next-pwa]: resolve `workbox-build` types package versions mismatch

* chore[next-pwa]: add tests to check type `WebpackConfigOptions`

* chore[next-pwa]: remove `@types/workbox-build` in favour of package types bundle

* fix[next-pwa]: bump minimum Typescript version from `4.6` to `4.9`

* chore[next-pwa]: revert minimin ts version to `4.5`

* fix[next-pwa]: remove stale `workbox-_` DT packages

* deps: remove multiple `workbox-_` DT packages

* deps: remove even MORE `workbox-_` DT packages

* Revert "fix[next-pwa]: remove stale `workbox-_` DT packages"

This reverts commit eb0d61a.

* Revert "deps: remove multiple `workbox-_` DT packages"

This reverts commit 9bcdc74.

* Revert "deps: remove even MORE `workbox-_` DT packages"

This reverts commit 1960380.

* revert: remove `workbox-sw` from not-needed packages file

* fix[customize-cra]: add module interop flag; add  lib

* deps[workbox-sw]: add workbox packages to `packages.json`

* chore[workbox-sw]: add tests

* chore: use `@types/` deps to refer to old DT packages types

* chore: remove `esModuleInterop` flag

* chore[customize-cra]: remove `webworker` lib

* fix: correct import statements
  • Loading branch information
NivaldoFarias committed Jan 2, 2023
1 parent dc9b44b commit 1dcd97e
Show file tree
Hide file tree
Showing 138 changed files with 117 additions and 4,064 deletions.
60 changes: 60 additions & 0 deletions notNeededPackages.json
Expand Up @@ -5975,6 +5975,66 @@
"libraryName": "words-to-numbers",
"asOfVersion": "1.3.0"
},
"workbox-background-sync": {
"libraryName": "workbox-background-sync",
"asOfVersion": "5.0.0"
},
"workbox-broadcast-update": {
"libraryName": "workbox-broadcast-update",
"asOfVersion": "5.0.0"
},
"workbox-build": {
"libraryName": "workbox-build",
"asOfVersion": "5.1.0"
},
"workbox-cacheable-response": {
"libraryName": "workbox-cacheable-response",
"asOfVersion": "5.0.0"
},
"workbox-core": {
"libraryName": "workbox-core",
"asOfVersion": "5.0.0"
},
"workbox-expiration": {
"libraryName": "workbox-expiration",
"asOfVersion": "5.0.0"
},
"workbox-google-analytics": {
"libraryName": "workbox-google-analytics",
"asOfVersion": "5.0.0"
},
"workbox-navigation-preload": {
"libraryName": "workbox-navigation-preload",
"asOfVersion": "5.0.0"
},
"workbox-precaching": {
"libraryName": "workbox-precaching",
"asOfVersion": "5.0.0"
},
"workbox-range-requests": {
"libraryName": "workbox-range-requests",
"asOfVersion": "5.0.0"
},
"workbox-routing": {
"libraryName": "workbox-routing",
"asOfVersion": "5.0.0"
},
"workbox-strategies": {
"libraryName": "workbox-strategies",
"asOfVersion": "5.0.0"
},
"workbox-streams": {
"libraryName": "workbox-streams",
"asOfVersion": "5.0.0"
},
"workbox-webpack-plugin": {
"libraryName": "workbox-webpack-plugin",
"asOfVersion": "6.0.0"
},
"workbox-window": {
"libraryName": "workbox-window",
"asOfVersion": "5.0.0"
},
"wouter": {
"libraryName": "wouter",
"asOfVersion": "2.2.0"
Expand Down
6 changes: 5 additions & 1 deletion types/customize-cra/customize-cra-tests.ts
Expand Up @@ -36,7 +36,11 @@ module.exports = override(
['ag-grid-react$']: path.resolve(__dirname, 'src/shared/agGridWrapper.js'),
}),

adjustWorkbox(wb => ({ ...wb, skipWaiting: true, exclude: (wb.exclude || []).concat('index.html') })),
adjustWorkbox(workbox => ({
...workbox,
skipWaiting: true,
exclude: (workbox.exclude || []).concat('index.html'),
})),
);

module.exports = {
Expand Down
6 changes: 6 additions & 0 deletions types/customize-cra/package.json
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"@types/workbox-webpack-plugin": "^5.1.8"
}
}
10 changes: 2 additions & 8 deletions types/next-pwa/index.d.ts
Expand Up @@ -2,19 +2,13 @@
// Project: https://github.com/shadowwalker/next-pwa#readme
// Definitions by: Nivaldo Farias <https://github.com/NivaldoFarias>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 4.6
// Minimum TypeScript Version: 4.5

/// <reference types="react"/>

import type { RuntimeCaching, GenerateSWOptions, InjectManifestOptions } from 'workbox-build';
import type { NextConfig } from 'next';

// match `workbox-build` ^6.5.4 types naming
import type {
RuntimeCachingEntry as RuntimeCaching,
GenerateSWConfig as GenerateSWOptions,
InjectManifestConfig as InjectManifestOptions,
} from 'workbox-build';

declare global {
interface PopStateEventInit extends EventInit {
state?: unknown;
Expand Down
9 changes: 7 additions & 2 deletions types/next-pwa/next-pwa-tests.ts
Expand Up @@ -6,11 +6,16 @@ const withPWA = nextPWA({
dest: 'public',
});

// $ExpectType NextConfig & PWAConfig
const outputConfig = withPWA({});

const errorWithPWA = nextPWA({
dest: 'public',
// @ts-expect-error
register: 'error',
});

// $ExpectType NextConfig & PWAConfig
const outputConfig = withPWA({});
const webpackConfigOptions: nextPWA.WebpackConfigOptions = {
// @ts-expect-error
swDest: true,
};
3 changes: 2 additions & 1 deletion types/next-pwa/package.json
@@ -1,6 +1,7 @@
{
"private": true,
"dependencies": {
"next": "^12.2.5"
"next": "^12.2.5",
"workbox-build": "^6.5.4"
}
}
11 changes: 0 additions & 11 deletions types/workbox-background-sync/Plugin.d.ts

This file was deleted.

29 changes: 0 additions & 29 deletions types/workbox-background-sync/Queue.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions types/workbox-background-sync/index.d.ts

This file was deleted.

24 changes: 0 additions & 24 deletions types/workbox-background-sync/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion types/workbox-background-sync/tslint.json

This file was deleted.

62 changes: 0 additions & 62 deletions types/workbox-background-sync/workbox-background-sync-tests.ts

This file was deleted.

20 changes: 0 additions & 20 deletions types/workbox-broadcast-update/BroadcastCacheUpdate.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions types/workbox-broadcast-update/Plugin.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions types/workbox-broadcast-update/broadcastUpdate.d.ts

This file was deleted.

9 changes: 0 additions & 9 deletions types/workbox-broadcast-update/index.d.ts

This file was deleted.

24 changes: 0 additions & 24 deletions types/workbox-broadcast-update/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion types/workbox-broadcast-update/tslint.json

This file was deleted.

0 comments on commit 1dcd97e

Please sign in to comment.