@docusaurus/theme-search-algolia 0.0.0-4277 → 0.0.0-4285

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-search-algolia",
3
- "version": "0.0.0-4277",
3
+ "version": "0.0.0-4285",
4
4
  "description": "Algolia search component for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-search-algolia.d.ts",
@@ -21,11 +21,11 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@docsearch/react": "^3.0.0-alpha.39",
24
- "@docusaurus/core": "0.0.0-4277",
25
- "@docusaurus/theme-common": "0.0.0-4277",
26
- "@docusaurus/theme-translations": "0.0.0-4277",
27
- "@docusaurus/utils": "0.0.0-4277",
28
- "@docusaurus/utils-validation": "0.0.0-4277",
24
+ "@docusaurus/core": "0.0.0-4285",
25
+ "@docusaurus/theme-common": "0.0.0-4285",
26
+ "@docusaurus/theme-translations": "0.0.0-4285",
27
+ "@docusaurus/utils": "0.0.0-4285",
28
+ "@docusaurus/utils-validation": "0.0.0-4285",
29
29
  "algoliasearch": "^4.10.5",
30
30
  "algoliasearch-helper": "^3.5.5",
31
31
  "clsx": "^1.1.1",
@@ -34,7 +34,7 @@
34
34
  "tslib": "^2.3.1"
35
35
  },
36
36
  "devDependencies": {
37
- "@docusaurus/module-type-aliases": "0.0.0-4277",
37
+ "@docusaurus/module-type-aliases": "0.0.0-4285",
38
38
  "fs-extra": "^10.0.0"
39
39
  },
40
40
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=14"
46
46
  },
47
- "gitHead": "5d129d044f44c72820d29721cb09d1264324f365"
47
+ "gitHead": "8296043e765cbf0d41e33516e8acb36a6268f922"
48
48
  }
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- const path = require('path');
9
- const fs = require('fs-extra');
10
-
11
- /**
12
- * Copy all untyped and static assets files to lib.
13
- */
14
- const srcDir = path.resolve(__dirname, 'src');
15
- const libDir = path.resolve(__dirname, 'lib');
16
- fs.copySync(srcDir, libDir, {
17
- filter(filepath) {
18
- return !/__tests__/.test(filepath) && !/\.tsx?$/.test(filepath);
19
- },
20
- });
@@ -1,135 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- const {validateThemeConfig, DEFAULT_CONFIG} = require('../validateThemeConfig');
9
-
10
- function testValidateThemeConfig(themeConfig) {
11
- function validate(schema, cfg) {
12
- const {value, error} = schema.validate(cfg, {
13
- convert: false,
14
- });
15
- if (error) {
16
- throw error;
17
- }
18
- return value;
19
- }
20
-
21
- return validateThemeConfig({themeConfig, validate});
22
- }
23
-
24
- describe('validateThemeConfig', () => {
25
- test('minimal config', () => {
26
- const algolia = {
27
- indexName: 'index',
28
- apiKey: 'apiKey',
29
- };
30
- expect(testValidateThemeConfig({algolia})).toEqual({
31
- algolia: {
32
- ...DEFAULT_CONFIG,
33
- ...algolia,
34
- },
35
- });
36
- });
37
-
38
- test('unknown attributes', () => {
39
- const algolia = {
40
- indexName: 'index',
41
- apiKey: 'apiKey',
42
- unknownKey: 'unknownKey',
43
- };
44
- expect(testValidateThemeConfig({algolia})).toEqual({
45
- algolia: {
46
- ...DEFAULT_CONFIG,
47
- ...algolia,
48
- },
49
- });
50
- });
51
-
52
- test('undefined config', () => {
53
- const algolia = undefined;
54
- expect(() =>
55
- testValidateThemeConfig({algolia}),
56
- ).toThrowErrorMatchingInlineSnapshot(
57
- `"\\"themeConfig.algolia\\" is required"`,
58
- );
59
- });
60
-
61
- test('undefined config 2', () => {
62
- expect(() =>
63
- testValidateThemeConfig({}),
64
- ).toThrowErrorMatchingInlineSnapshot(
65
- `"\\"themeConfig.algolia\\" is required"`,
66
- );
67
- });
68
-
69
- test('empty config', () => {
70
- const algolia = {};
71
- expect(() =>
72
- testValidateThemeConfig({algolia}),
73
- ).toThrowErrorMatchingInlineSnapshot(`"\\"algolia.apiKey\\" is required"`);
74
- });
75
-
76
- test('missing indexName config', () => {
77
- const algolia = {apiKey: 'apiKey'};
78
- expect(() =>
79
- testValidateThemeConfig({algolia}),
80
- ).toThrowErrorMatchingInlineSnapshot(
81
- `"\\"algolia.indexName\\" is required"`,
82
- );
83
- });
84
-
85
- test('missing apiKey config', () => {
86
- const algolia = {indexName: 'indexName'};
87
- expect(() =>
88
- testValidateThemeConfig({algolia}),
89
- ).toThrowErrorMatchingInlineSnapshot(`"\\"algolia.apiKey\\" is required"`);
90
- });
91
-
92
- test('contextualSearch config', () => {
93
- const algolia = {
94
- indexName: 'index',
95
- apiKey: 'apiKey',
96
- contextualSearch: true,
97
- };
98
- expect(testValidateThemeConfig({algolia})).toEqual({
99
- algolia: {
100
- ...DEFAULT_CONFIG,
101
- ...algolia,
102
- },
103
- });
104
- });
105
-
106
- test('externalUrlRegex config', () => {
107
- const algolia = {
108
- indexName: 'index',
109
- apiKey: 'apiKey',
110
- externalUrlRegex: 'http://external-domain.com',
111
- };
112
- expect(testValidateThemeConfig({algolia})).toEqual({
113
- algolia: {
114
- ...DEFAULT_CONFIG,
115
- ...algolia,
116
- },
117
- });
118
- });
119
-
120
- test('searchParameters.facetFilters search config', () => {
121
- const algolia = {
122
- indexName: 'index',
123
- apiKey: 'apiKey',
124
- searchParameters: {
125
- facetFilters: ['version:1.0'],
126
- },
127
- };
128
- expect(testValidateThemeConfig({algolia})).toEqual({
129
- algolia: {
130
- ...DEFAULT_CONFIG,
131
- ...algolia,
132
- },
133
- });
134
- });
135
- });
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "module": "esnext",
5
- "jsx": "react-native"
6
- },
7
- "include": ["src/theme/", "src/*.d.ts"]
8
- }
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "lib": ["DOM", "ES2019"],
5
- "rootDir": "src",
6
- "baseUrl": "src",
7
- "outDir": "lib"
8
- }
9
- }
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": ["src/*.ts", "src/templates/*.ts"]
4
- }