Skip to content

Commit

Permalink
Delete create-search-index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed May 27, 2022
1 parent a5dc30a commit 1954ce8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 117 deletions.
44 changes: 0 additions & 44 deletions packages/publisher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ npm run clean
npm run parse
npm run calculate-versions
npm run generate
npm run index
npm run publish-packages
npm run upload-blobs
```
Expand All @@ -61,7 +60,6 @@ To update the types packages, the following steps must be performed:
* Parse the definitions
* Calculate versions
* Generate packages on disk
* Create a search index
* Publish packages on disk

Importantly, each of these steps is *idempotent*.
Expand Down Expand Up @@ -189,48 +187,6 @@ This generates `versions.json` based on the last uploaded `versions.json` and by
The `--forceUpdate` argument will cause a build version bump even if the `contentHash` of the originating types folder has not changed.
This argument may be needed during development, but should not be used during routine usage.

# Create a search index

> `npm run index`
This script creates `data/search-index-min.json`, which (in the upload step) will be uploaded to Azure and used by [TypeSearch](https://github.com/microsoft/typesearch).
This step is not necessary for other steps in the process.

### Arguments to `create-search-index`

You can generate a prettier output in `data/search-index-full.json`.
This version is for human review only and is not compatible with TypeSearch.

By default, `create-search-index` fetches download counts from NPM for use in search result ranking.
The argument `--skipDownloads` disables this behavior.

### Search Entries

Each `search-*.json` file consists of an array.
An example unminified entry is:
```js
{
"projectName": "http://backgridjs.com/",
"libraryName": "Backgrid",
"globals": [
"Backgrid"
],
"typePackageName": "backgrid",
"declaredExternalModules": [
"backgrid"
],
"downloads": 532234
},
```
These fields should hopefully be self-explanatory.
`downloads` refers to the number in the past month.
If `--skipDownloads` was specified, `downloads` will be -1.
In the case where the type package name is different from the NPM package name, or no NPM package name exists, `downloads` will be 0.

In the minified files, the properties are simply renamed. See `src/lib/search-index-generator.ts` for documentation.

Empty arrays may be elided in future versions of the minified files.

# Generate packages on disk

> `npm run generate`
Expand Down
1 change: 0 additions & 1 deletion packages/publisher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"calculate-versions": "node -r source-map-support/register dist/calculate-versions.js",
"generate": "node -r source-map-support/register dist/generate-packages.js",
"validate": "node -r source-map-support/register dist/validate.js",
"index": "node -r source-map-support/register dist/create-search-index.js",
"publish-packages": "node -r source-map-support/register dist/publish-packages.js",
"publish-packages-dry": "node -r source-map-support/register dist/publish-packages.js --dry",
"publish-registry": "node -r source-map-support/register dist/publish-registry.js",
Expand Down
70 changes: 0 additions & 70 deletions packages/publisher/src/create-search-index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/publisher/src/full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as yargs from "yargs";

import calculateVersions from "./calculate-versions";
import { clean } from "./clean";
import createSearchIndex from "./create-search-index";
import generatePackages from "./generate-packages";
import publishPackages from "./publish-packages";
import publishRegistry from "./publish-registry";
Expand Down Expand Up @@ -49,7 +48,6 @@ export default async function full(
);
const changedPackages = await calculateVersions(dt, infoClient, log);
await generatePackages(dt, allPackages, changedPackages);
await createSearchIndex(allPackages, infoClient);
await publishPackages(changedPackages, dry, githubAccessToken, fetcher);
await publishRegistry(dt, allPackages, dry, infoClient);
}

0 comments on commit 1954ce8

Please sign in to comment.