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

fix(types): fix missing type exports #1086

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

"ae-missing-release-tag": {
"logLevel": "none"
},

"ae-forgotten-export": {
"logLevel": "error"
}
},

Expand Down
39 changes: 39 additions & 0 deletions packages/algoliasearch/src/builds/browserLite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,45 @@ import { createUserAgent, RequestOptions } from '@algolia/transporter';

import { AlgoliaSearchOptions } from '../types';

export {
nunomaduro marked this conversation as resolved.
Show resolved Hide resolved
MultipleQueriesOptions,
MultipleQueriesQuery,
MultipleQueriesResponse,
SearchClient as BaseSearchClient,
SearchClientOptions,
SearchForFacetValuesResponse,
SearchForFacetValuesQueryParams,
SearchIndex as BaseSearchIndex,
SearchOptions,
SearchResponse,
StrategyType,
ObjectWithObjectID,
FacetHit,
} from '@algolia/client-search';
export { AuthModeType, ClientTransporterOptions } from '@algolia/client-common';
export {
Headers,
HostOptions,
CallType,
QueryParameters,
Transporter,
TransporterOptions,
RequestOptions,
Timeouts,
UserAgent,
UserAgentOptions,
StatelessHost,
Request as TransporterRequest,
} from '@algolia/transporter';
export {
Request as RequesterRequest,
Response as RequesterResponse,
Requester,
MethodType,
} from '@algolia/requester-common';
export { Logger } from '@algolia/logger-common';
export { Cache, CacheEvents } from '@algolia/cache-common';

export default function algoliasearch(
appId: string,
apiKey: string,
Expand Down
142 changes: 142 additions & 0 deletions packages/algoliasearch/src/builds/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,148 @@ import { createUserAgent, RequestOptions } from '@algolia/transporter';

import { AlgoliaSearchOptions, InitAnalyticsOptions, InitRecommendationOptions } from '../types';

export {
nunomaduro marked this conversation as resolved.
Show resolved Hide resolved
GetPersonalizationStrategyResponse,
PersonalizationStrategy,
RecommendationClient as BaseRecommendationClient,
RecommendationClientOptions,
SetPersonalizationStrategyResponse,
} from '@algolia/client-recommendation';

export {
ABTest,
AnalyticsClient as BaseAnalyticsClient,
AnalyticsClientOptions,
AddABTestResponse,
GetABTestResponse,
GetABTestsOptions,
GetABTestsResponse,
StopABTestResponse,
DeleteABTestResponse,
Variant,
VariantResponse,
} from '@algolia/client-analytics';

export {
RequestOptions,
Transporter,
TransporterOptions,
HostOptions,
Headers,
QueryParameters,
CallType,
Timeouts,
UserAgent,
UserAgentOptions,
StatelessHost,
Request as TransporterRequest,
} from '@algolia/transporter';

export {
SearchIndex as BaseSearchIndex,
SearchResponse,
BatchRequest,
BatchResponse,
DeleteResponse,
GetObjectOptions,
ObjectWithObjectID,
GetObjectsOptions,
GetObjectsResponse,
ChunkOptions,
SaveObjectsOptions,
SaveObjectResponse,
ChunkedBatchResponse,
Settings,
SetSettingsResponse,
PartialUpdateObjectsOptions,
PartialUpdateObjectResponse,
DeleteByFiltersOptions,
BrowseOptions,
FindObjectOptions,
FindObjectResponse,
Synonym,
SaveSynonymsOptions,
SaveSynonymResponse,
SaveSynonymsResponse,
SearchSynonymsOptions,
SearchSynonymsResponse,
DeleteSynonymOptions,
ClearSynonymsOptions,
ReplaceAllObjectsOptions,
SearchRulesOptions,
Rule,
SaveRulesOptions,
SaveRuleResponse,
SaveRulesResponse,
ClearRulesOptions,
SearchClient as BaseSearchClient,
MultipleQueriesQuery,
MultipleQueriesOptions,
MultipleQueriesResponse,
SearchForFacetValuesResponse,
SearchForFacetValuesQueryParams,
SearchOptions,
MultipleBatchRequest,
MultipleBatchResponse,
MultipleGetObject,
MultipleGetObjectsResponse,
CopyIndexOptions,
IndexOperationResponse,
ListIndicesResponse,
GetLogsResponse,
ListClustersResponse,
GetApiKeyResponse,
AddApiKeyOptions,
AddApiKeyResponse,
ListApiKeysResponse,
UpdateApiKeyOptions,
UpdateApiKeyResponse,
DeleteApiKeyResponse,
RestoreApiKeyResponse,
AssignUserIDResponse,
AssignUserIDsResponse,
UserIDResponse,
SearchUserIDsOptions,
SearchUserIDsResponse,
ListUserIDsOptions,
ListUserIDsResponse,
GetTopUserIDsResponse,
RemoveUserIDResponse,
HasPendingMappingsOptions,
ScopeType,
Log,
Cluster,
Indice,
HasPendingMappingsResponse,
SecuredApiKeyRestrictions,
BatchActionType,
StrategyType,
Condition,
Consequence,
TimeRange,
FacetHit,
SynonymType,
ConsequenceParams,
ConsequencePromote,
ConsequenceQuery,
AutomaticFacetFilter,
SearchClientOptions,
} from '@algolia/client-search';

export { ClientTransporterOptions, AuthModeType, WaitablePromise } from '@algolia/client-common';

export {
Destroyable,
Requester,
Request as RequesterRequest,
Response as RequesterResponse,
MethodType,
} from '@algolia/requester-common';

export { Cache, CacheEvents } from '@algolia/cache-common';

export { Logger } from '@algolia/logger-common';

export default function algoliasearch(
appId: string,
apiKey: string,
Expand Down
9 changes: 8 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const execa = require('execa');

const targets = fs.readdirSync('packages').filter(f => fs.statSync(`packages/${f}`).isDirectory());

const bundledPackages = targets.map(target => `@algolia/${target}`);

run();

async function run() {
Expand Down Expand Up @@ -49,7 +51,12 @@ async function buildDefinition(target, config = '') {
pkgDir,
`api-extractor${config ? `-${config}` : ''}.json`
);
const extractorConfig = ExtractorConfig.loadFileAndPrepare(extractorConfigPath);

const extractorConfig = {
...ExtractorConfig.loadFileAndPrepare(extractorConfigPath),
bundledPackages: target === 'algoliasearch' ? bundledPackages : [],
};

const result = Extractor.invoke(extractorConfig, {
localBuild: true,
showVerboseMessages: true,
Expand Down