Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete create-search-index.ts #456

Merged
merged 1 commit into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}