@docusaurus/plugin-pwa 0.0.0-4752 → 0.0.0-4753
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/options.d.ts +2 -4
- package/lib/options.js +3 -3
- package/package.json +8 -8
- package/src/options.ts +3 -7
package/lib/options.d.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import type { ThemeConfig, ValidationResult, OptionValidationContext } from '@docusaurus/types';
|
|
7
|
+
import type { OptionValidationContext } from '@docusaurus/types';
|
|
9
8
|
import type { PluginOptions } from '@docusaurus/plugin-pwa';
|
|
10
|
-
export declare
|
|
11
|
-
export declare function validateOptions({ validate, options, }: OptionValidationContext<PluginOptions>): ValidationResult<ThemeConfig>;
|
|
9
|
+
export declare function validateOptions({ validate, options, }: OptionValidationContext<PluginOptions, PluginOptions>): PluginOptions;
|
package/lib/options.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.validateOptions =
|
|
9
|
+
exports.validateOptions = void 0;
|
|
10
10
|
const utils_validation_1 = require("@docusaurus/utils-validation");
|
|
11
11
|
const DEFAULT_OPTIONS = {
|
|
12
12
|
debug: false,
|
|
@@ -21,7 +21,7 @@ const DEFAULT_OPTIONS = {
|
|
|
21
21
|
swRegister: './registerSw.js',
|
|
22
22
|
reloadPopup: '@theme/PwaReloadPopup',
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
const Schema = utils_validation_1.Joi.object({
|
|
25
25
|
debug: utils_validation_1.Joi.bool().default(DEFAULT_OPTIONS.debug),
|
|
26
26
|
offlineModeActivationStrategies: utils_validation_1.Joi.array()
|
|
27
27
|
.items(utils_validation_1.Joi.string()
|
|
@@ -41,6 +41,6 @@ exports.Schema = utils_validation_1.Joi.object({
|
|
|
41
41
|
.default(DEFAULT_OPTIONS.reloadPopup),
|
|
42
42
|
});
|
|
43
43
|
function validateOptions({ validate, options, }) {
|
|
44
|
-
return validate(
|
|
44
|
+
return validate(Schema, options);
|
|
45
45
|
}
|
|
46
46
|
exports.validateOptions = validateOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-pwa",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4753",
|
|
4
4
|
"description": "Docusaurus Plugin to add PWA support.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-pwa.d.ts",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/core": "^7.17.8",
|
|
24
24
|
"@babel/preset-env": "^7.16.11",
|
|
25
|
-
"@docusaurus/core": "0.0.0-
|
|
26
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
27
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
28
|
-
"@docusaurus/utils": "0.0.0-
|
|
29
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
25
|
+
"@docusaurus/core": "0.0.0-4753",
|
|
26
|
+
"@docusaurus/theme-common": "0.0.0-4753",
|
|
27
|
+
"@docusaurus/theme-translations": "0.0.0-4753",
|
|
28
|
+
"@docusaurus/utils": "0.0.0-4753",
|
|
29
|
+
"@docusaurus/utils-validation": "0.0.0-4753",
|
|
30
30
|
"babel-loader": "^8.2.3",
|
|
31
31
|
"clsx": "^1.1.1",
|
|
32
32
|
"core-js": "^3.21.1",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"workbox-window": "^6.5.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
42
|
+
"@docusaurus/module-type-aliases": "0.0.0-4753",
|
|
43
43
|
"fs-extra": "^10.0.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^16.8.4 || ^17.0.0",
|
|
47
47
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "61ef11a14262b1821e65c45bb703698bffc891e5"
|
|
50
50
|
}
|
package/src/options.ts
CHANGED
|
@@ -6,11 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {Joi} from '@docusaurus/utils-validation';
|
|
9
|
-
import type {
|
|
10
|
-
ThemeConfig,
|
|
11
|
-
ValidationResult,
|
|
12
|
-
OptionValidationContext,
|
|
13
|
-
} from '@docusaurus/types';
|
|
9
|
+
import type {OptionValidationContext} from '@docusaurus/types';
|
|
14
10
|
import type {PluginOptions} from '@docusaurus/plugin-pwa';
|
|
15
11
|
|
|
16
12
|
const DEFAULT_OPTIONS = {
|
|
@@ -27,7 +23,7 @@ const DEFAULT_OPTIONS = {
|
|
|
27
23
|
reloadPopup: '@theme/PwaReloadPopup',
|
|
28
24
|
};
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
const Schema = Joi.object({
|
|
31
27
|
debug: Joi.bool().default(DEFAULT_OPTIONS.debug),
|
|
32
28
|
offlineModeActivationStrategies: Joi.array()
|
|
33
29
|
.items(
|
|
@@ -61,6 +57,6 @@ export const Schema = Joi.object({
|
|
|
61
57
|
export function validateOptions({
|
|
62
58
|
validate,
|
|
63
59
|
options,
|
|
64
|
-
}: OptionValidationContext<PluginOptions>):
|
|
60
|
+
}: OptionValidationContext<PluginOptions, PluginOptions>): PluginOptions {
|
|
65
61
|
return validate(Schema, options);
|
|
66
62
|
}
|