Skip to content

Commit 3d77a04

Browse files
committed
[types] Search typing
1 parent d45b4b9 commit 3d77a04

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

gulpfile.mjs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ import {basename, dirname, join, resolve} from 'path';
1111
import {gzipSync} from 'zlib';
1212

1313
const UTF8 = 'utf-8';
14-
const TEST_MODULES = [
14+
const ALL_MODULES = [
1515
'',
16+
'store',
17+
'indexes',
18+
'metrics',
19+
'relationships',
20+
'queries',
21+
'checkpoints',
22+
'mergeable-store',
23+
'common',
1624
'ui-react',
1725
'ui-react-dom',
1826
'ui-react-inspector',
@@ -44,17 +52,6 @@ const TEST_MODULES = [
4452
'synchronizers/synchronizer-ws-server-durable-object',
4553
'synchronizers/synchronizer-broadcast-channel',
4654
];
47-
const ALL_MODULES = [
48-
...TEST_MODULES,
49-
'store',
50-
'metrics',
51-
'indexes',
52-
'relationships',
53-
'queries',
54-
'checkpoints',
55-
'mergeable-store',
56-
'common',
57-
];
5855
const ALL_DEFINITIONS = [
5956
...ALL_MODULES,
6057
'_internal/store',
@@ -84,7 +81,6 @@ const getPrettierConfig = async () => ({
8481
});
8582

8683
const allOf = (array, cb) => Promise.all(array.map(cb));
87-
const testModules = (cb) => allOf(TEST_MODULES, cb);
8884
const allModules = (cb) => allOf(ALL_MODULES, cb);
8985
const allDefinitions = (cb) => allOf(ALL_DEFINITIONS, cb);
9086

@@ -141,7 +137,6 @@ const gzipFile = async (fileName) =>
141137

142138
const copyPackageFiles = async (forProd = false) => {
143139
const mins = forProd ? [null, 'min'] : [null];
144-
const modules = forProd ? ALL_MODULES : TEST_MODULES;
145140
const schemas = [null, 'with-schemas'];
146141

147142
const json = JSON.parse(await promises.readFile('package.json', UTF8));
@@ -156,7 +151,7 @@ const copyPackageFiles = async (forProd = false) => {
156151
json.typesVersions = {'*': {}};
157152
json.exports = {};
158153
mins.forEach((min) => {
159-
modules.forEach((module) => {
154+
ALL_MODULES.forEach((module) => {
160155
schemas.forEach((withSchemas) => {
161156
const path = [min, module, withSchemas]
162157
.filter((part) => part)
@@ -446,7 +441,7 @@ const tsCheck = async (dir) => {
446441
'--excludeDeclarationFiles',
447442
'--excludePathsFromReport=' +
448443
'jest/reporter.js;jest/environment.js;build.ts;ui-react/common.ts;' +
449-
TEST_MODULES.map((module) => `${module}.ts`).join(';'),
444+
ALL_MODULES.map((module) => `${module}.ts`).join(';'),
450445
]).unusedExports,
451446
)
452447
.map(
@@ -669,7 +664,7 @@ export const compileForTest = async () => {
669664
await clearDir(DIST_DIR);
670665
await copyPackageFiles();
671666
await copyDefinitions(DIST_DIR);
672-
await testModules(async (module) => {
667+
await allModules(async (module) => {
673668
await compileModule(module, DIST_DIR);
674669
});
675670
};

site/js/common/search.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export const searchLoad = (isHome = false) => {
5050
undefined,
5151
// Rank by the density of early location of the slice in the text
5252
(words1, words2, sliceId) =>
53-
getWeighting(words2, sliceId) - getWeighting(words1, sliceId),
53+
getWeighting(words2 as string, sliceId) -
54+
getWeighting(words1 as string, sliceId),
5455
);
5556

5657
// Tokenize text for each path, name, and summary

0 commit comments

Comments
 (0)