Closed
Conversation
3f1905b to
1e0daa2
Compare
fba5233 to
c8574b4
Compare
a3d582a to
3233390
Compare
Contributor
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3718 tests passing in 1438 suites. Report generated by 🧪jest coverage report action from 0a85c6e |
3233390 to
76ef3d7
Compare
76ef3d7 to
0a85c6e
Compare
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/private/node/conf-store.d.ts@@ -123,12 +123,10 @@ interface RunWithRateLimitOptions {
* @returns true, or undefined if the task was not run.
*/
export declare function runWithRateLimit(options: RunWithRateLimitOptions, config?: LocalStorage<ConfSchema>): Promise<boolean>;
-export declare function getConfigStoreForPartnerStatus(): LocalStorage<{
- [partnerToken: string]: {
- status: true;
- checkedAt: string;
- };
-}>;
+export declare function getConfigStoreForPartnerStatus(): LocalStorage<Record<string, {
+ status: true;
+ checkedAt: string;
+}>>;
export declare function getCachedPartnerAccountStatus(partnersToken: string): true | null;
export declare function setCachedPartnerAccountStatus(partnersToken: string): void;
export {};
\ No newline at end of file
packages/cli-kit/dist/public/common/collection.d.ts@@ -8,9 +8,7 @@ import type { List, ValueIteratee } from 'lodash';
* @param iteratee - The function invoked per iteration.
* @returns Returns the composed aggregate object.
*/
-export declare function groupBy<T>(collection: ArrayLike<T> | null | undefined, iteratee?: ValueIteratee<T>): {
- [index: string]: T[];
-};
+export declare function groupBy<T>(collection: ArrayLike<T> | null | undefined, iteratee?: ValueIteratee<T>): Record<string, T[]>;
/**
* Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for,
* while the second of which contains elements predicate returns falsey for.
packages/cli-kit/dist/public/node/dot-env.d.ts@@ -9,9 +9,7 @@ export interface DotEnvFile {
/**
* Variables of the .env file.
*/
- variables: {
- [name: string]: string;
- };
+ variables: Record<string, string>;
}
/**
* Reads and parses a .env file.
@@ -30,7 +28,5 @@ export declare function writeDotEnv(file: DotEnvFile): Promise<void>;
* @param envFileContent - .env file contents.
* @param updatedValues - object containing new env variables values.
*/
-export declare function patchEnvFile(envFileContent: string | null, updatedValues: {
- [key: string]: string | undefined;
-}): string;
+export declare function patchEnvFile(envFileContent: string | null, updatedValues: Record<string, string | undefined>): string;
export declare function createDotEnvFileLine(key: string, value?: string, quote?: string): string;
\ No newline at end of file
packages/cli-kit/dist/public/node/environments.d.ts@@ -1,7 +1,5 @@
import { JsonMap } from '../../private/common/json.js';
-export interface Environments {
- [name: string]: JsonMap;
-}
+export type Environments = Record<string, JsonMap>;
interface LoadEnvironmentOptions {
from?: string;
silent?: boolean;
packages/cli-kit/dist/public/node/error.d.ts@@ -1,5 +1,5 @@
import { AlertCustomSection } from './ui.js';
-import { OutputMessage } from '../../public/node/output.js';
+import { OutputMessage } from './output.js';
import { InlineToken, TokenItem } from '../../private/node/ui/components/TokenizedText.js';
export { ExtendableError } from 'ts-error';
export declare enum FatalErrorType {
packages/cli-kit/dist/public/node/fs.d.ts@@ -1,5 +1,5 @@
-import { RandomNameFamily } from '../common/string.js';
import { OverloadParameters } from '../../private/common/ts/overloaded-parameters.js';
+import { RandomNameFamily } from '../common/string.js';
import { findUp as internalFindUp } from 'find-up';
import { ReadStream, WriteStream } from 'fs';
import type { Pattern, Options as GlobOptions } from 'fast-glob';
packages/cli-kit/dist/public/node/git.d.ts@@ -17,9 +17,7 @@ export declare function initializeGitRepository(directory: string, initialBranch
* @returns Files ignored by the lockfile.
*/
export declare function checkIfIgnoredInGitRepository(directory: string, files: string[]): Promise<string[]>;
-export interface GitIgnoreTemplate {
- [section: string]: string[];
-}
+export type GitIgnoreTemplate = Record<string, string[]>;
/**
* Create a .gitignore file in the given directory.
*
packages/cli-kit/dist/public/node/json-schema.d.ts@@ -1,9 +1,7 @@
import { ParseConfigurationResult } from './schema.js';
import { ErrorObject, SchemaObject } from 'ajv';
export type HandleInvalidAdditionalProperties = 'strip' | 'fail';
-type AjvError = ErrorObject<string, {
- [key: string]: unknown;
-}>;
+type AjvError = ErrorObject<string, Record<string, unknown>>;
/**
* Normalises a JSON Schema by standardising it's internal implementation.
*
packages/cli-kit/dist/public/node/local-storage.d.ts@@ -2,9 +2,7 @@
* A wrapper around the package that provides a strongly-typed interface
* for accessing the local storage.
*/
-export declare class LocalStorage<T extends {
- [key: string]: any;
-}> {
+export declare class LocalStorage<T extends Record<string, any>> {
private readonly config;
constructor(options: {
projectName?: string;
packages/cli-kit/dist/public/node/metadata.d.ts@@ -33,9 +33,7 @@ export type SensitiveSchema<T> = T extends RuntimeMetadataManager<infer _TPublic
* @param defaultPublicMetadata - Optional, default data for the container.
* @returns A container for the metadata.
*/
-export declare function createRuntimeMetadataContainer<TPublic extends AnyJson, TSensitive extends AnyJson = {
- [key: string]: never;
-}>(defaultPublicMetadata?: Partial<TPublic>): RuntimeMetadataManager<TPublic, TSensitive>;
+export declare function createRuntimeMetadataContainer<TPublic extends AnyJson, TSensitive extends AnyJson = Record<string, never>>(defaultPublicMetadata?: Partial<TPublic>): RuntimeMetadataManager<TPublic, TSensitive>;
type CmdFieldsFromMonorail = PickByPrefix<MonorailEventPublic, 'cmd_all_'> & PickByPrefix<MonorailEventPublic, 'cmd_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_create_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_theme_'> & PickByPrefix<MonorailEventPublic, 'store_'>;
declare const coreData: RuntimeMetadataManager<CmdFieldsFromMonorail, {
commandStartOptions: {
packages/cli-kit/dist/public/node/mimes.d.ts@@ -10,6 +10,4 @@ export declare function lookupMimeType(fileName: string): string;
*
* @param newTypes - Object of key-values where key is extension and value is mime type.
*/
-export declare function setMimeTypes(newTypes: {
- [key: string]: string;
-}): void;
\ No newline at end of file
+export declare function setMimeTypes(newTypes: Record<string, string>): void;
\ No newline at end of file
packages/cli-kit/dist/public/node/multiple-installation-warning.d.ts@@ -5,6 +5,4 @@
* @param directory - The directory of the project.
* @param dependencies - The dependencies of the project.
*/
-export declare function showMultipleCLIWarningIfNeeded(directory: string, dependencies: {
- [key: string]: string;
-}): Promise<void>;
\ No newline at end of file
+export declare function showMultipleCLIWarningIfNeeded(directory: string, dependencies: Record<string, string>): Promise<void>;
\ No newline at end of file
packages/cli-kit/dist/public/node/node-package-manager.d.ts@@ -13,9 +13,7 @@ export declare const bunLockfile = "bun.lockb";
export declare const pnpmWorkspaceFile = "pnpm-workspace.yaml";
/** An array containing the lockfiles from all the package managers */
export declare const lockfiles: Lockfile[];
-export declare const lockfilesByManager: {
- [key in PackageManager]: Lockfile | undefined;
-};
+export declare const lockfilesByManager: Record<PackageManager, Lockfile | undefined>;
export type Lockfile = 'yarn.lock' | 'package-lock.json' | 'pnpm-lock.yaml' | 'bun.lockb';
/**
* A union type that represents the type of dependencies in the package.json
@@ -113,9 +111,7 @@ export declare function getPackageVersion(packageJsonPath: string): Promise<stri
* @param packageJsonPath - Path to the package.json file
* @returns A promise that resolves with the list of dependencies.
*/
-export declare function getDependencies(packageJsonPath: string): Promise<{
- [key: string]: string;
-}>;
+export declare function getDependencies(packageJsonPath: string): Promise<Record<string, string>>;
/**
* Returns true if the app uses workspaces, false otherwise.
* @param packageJsonPath - Path to the package.json file
@@ -167,27 +163,19 @@ export interface PackageJson {
/**
* The scripts attribute of the package.json
*/
- scripts?: {
- [key: string]: string;
- };
+ scripts?: Record<string, string>;
/**
* The dependencies attribute of the package.json
*/
- dependencies?: {
- [key: string]: string;
- };
+ dependencies?: Record<string, string>;
/**
* The devDependencies attribute of the package.json
*/
- devDependencies?: {
- [key: string]: string;
- };
+ devDependencies?: Record<string, string>;
/**
* The peerDependencies attribute of the package.json
*/
- peerDependencies?: {
- [key: string]: string;
- };
+ peerDependencies?: Record<string, string>;
/**
* The optional oclif settings attribute of the package.json
*/
@@ -201,15 +189,11 @@ export interface PackageJson {
/**
* The resolutions attribute of the package.json. Only useful when using yarn as package manager
*/
- resolutions?: {
- [key: string]: string;
- };
+ resolutions?: Record<string, string>;
/**
* The overrides attribute of the package.json. Only useful when using npm o npmn as package managers
*/
- overrides?: {
- [key: string]: string;
- };
+ overrides?: Record<string, string>;
/**
* The prettier attribute of the package.json
*/
@@ -284,9 +268,7 @@ export declare function findUpAndReadPackageJson(fromDirectory: string): Promise
path: string;
content: PackageJson;
}>;
-export declare function addResolutionOrOverride(directory: string, dependencies: {
- [key: string]: string;
-}): Promise<void>;
+export declare function addResolutionOrOverride(directory: string, dependencies: Record<string, string>): Promise<void>;
/**
* Writes the package.json file to the given directory.
*
packages/cli-kit/dist/public/node/output.d.ts@@ -49,9 +49,7 @@ export declare function formatPackageManagerCommand(packageManager: PackageManag
export declare function outputContent(strings: TemplateStringsArray, ...keys: (ContentToken<unknown> | string)[]): TokenizedString;
/** Log levels. */
export type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
-export declare let collectedLogs: {
- [key: string]: string[];
-};
+export declare let collectedLogs: Record<string, string[]>;
/**
* This is only used during UnitTesting.
* If we are in a testing context, instead of printing the logs to the console,
packages/cli-kit/dist/public/node/plugins.d.ts@@ -20,30 +20,22 @@ type AppSpecificMonorailFields = PickByPrefix<MonorailEventPublic, 'app_', 'proj
type AppSpecificSensitiveMonorailFields = PickByPrefix<MonorailEventSensitive, 'app_'>;
export interface HookReturnsPerPlugin extends HookReturnPerTunnelPlugin {
public_command_metadata: {
- options: {
- [key: string]: never;
- };
+ options: Record<string, never>;
pluginReturns: {
'@shopify/app': Partial<AppSpecificMonorailFields>;
[pluginName: string]: JsonMap;
};
};
sensitive_command_metadata: {
- options: {
- [key: string]: never;
- };
+ options: Record<string, never>;
pluginReturns: {
'@shopify/app': Partial<AppSpecificSensitiveMonorailFields>;
[pluginName: string]: JsonMap;
};
};
[hookName: string]: {
- options: {
- [key: string]: unknown;
- };
- pluginReturns: {
- [key: string]: unknown;
- };
+ options: Record<string, unknown>;
+ pluginReturns: Record<string, unknown>;
};
}
export type PluginReturnsForHook<TEvent extends keyof TPluginMap, TPluginName extends keyof TPluginMap[TEvent]['pluginReturns'], TPluginMap extends HookReturnsPerPlugin = HookReturnsPerPlugin> = TPluginMap[TEvent]['pluginReturns'][TPluginName];
packages/cli-kit/dist/public/node/system.d.ts@@ -2,9 +2,7 @@ import { AbortSignal } from './abort.js';
import type { Writable, Readable } from 'stream';
export interface ExecOptions {
cwd?: string;
- env?: {
- [key: string]: string | undefined;
- };
+ env?: Record<string, string | undefined>;
stdin?: Readable | 'inherit';
stdout?: Writable | 'inherit';
stderr?: Writable | 'inherit';
packages/cli-kit/dist/private/node/analytics/bounded-collections.d.ts@@ -38,8 +38,6 @@ export declare class BMap<TKey, TValue> extends Map<TKey, TValue> {
set(key: TKey, value: TValue): this;
delete(key: TKey): boolean;
clear(): void;
- toObject(): {
- [key: string]: TValue;
- };
+ toObject(): Record<string, TValue>;
private enforceLimit;
}
\ No newline at end of file
packages/cli-kit/dist/private/node/api/graphql.d.ts@@ -1,6 +1,4 @@
import { Variables } from 'graphql-request';
-export declare function debugLogRequestInfo(api: string, query: string, url: string, variables?: Variables, headers?: {
- [key: string]: string;
-}): void;
+export declare function debugLogRequestInfo(api: string, query: string, url: string, variables?: Variables, headers?: Record<string, string>): void;
export declare function sanitizeVariables(variables: Variables): string;
export declare function errorHandler(api: string): (error: unknown, requestId?: string) => unknown;
\ No newline at end of file
packages/cli-kit/dist/private/node/api/headers.d.ts@@ -13,12 +13,8 @@ export declare class GraphQLClientError extends RequestClientError {
* @param headers - HTTP headers.
* @returns A sanitized version of the headers as a string.
*/
-export declare function sanitizedHeadersOutput(headers: {
- [key: string]: string;
-}): string;
-export declare function buildHeaders(token?: string): {
- [key: string]: string;
-};
+export declare function sanitizedHeadersOutput(headers: Record<string, string>): string;
+export declare function buildHeaders(token?: string): Record<string, string>;
/**
* This utility function returns the https.Agent to use for a given service.
*/
packages/cli-kit/dist/private/node/api/rest.d.ts@@ -1,9 +1,5 @@
import { AdminSession } from '../../../public/node/session.js';
export declare function restRequestBody<T>(requestBody?: T): string | undefined;
-export declare function restRequestUrl(session: AdminSession, apiVersion: string, path: string, searchParams?: {
- [name: string]: string;
-}): string;
-export declare function restRequestHeaders(session: AdminSession): {
- [key: string]: string;
-};
+export declare function restRequestUrl(session: AdminSession, apiVersion: string, path: string, searchParams?: Record<string, string>): string;
+export declare function restRequestHeaders(session: AdminSession): Record<string, string>;
export declare function isThemeAccessSession(session: AdminSession): boolean;
\ No newline at end of file
packages/cli-kit/dist/private/node/session/exchange.d.ts@@ -19,9 +19,7 @@ export interface ExchangeScopes {
* @param store - the store to use, only needed for admin API
* @returns An array with the application access tokens.
*/
-export declare function exchangeAccessForApplicationTokens(identityToken: IdentityToken, scopes: ExchangeScopes, store?: string): Promise<{
- [x: string]: ApplicationToken;
-}>;
+export declare function exchangeAccessForApplicationTokens(identityToken: IdentityToken, scopes: ExchangeScopes, store?: string): Promise<Record<string, ApplicationToken>>;
/**
* Given an expired access token, refresh it to get a new one.
*/
@@ -62,7 +60,5 @@ type IdentityDeviceError = 'authorization_pending' | 'access_denied' | 'expired_
* @returns An instance with the identity access tokens.
*/
export declare function exchangeDeviceCodeForAccessToken(deviceCode: string): Promise<Result<IdentityToken, IdentityDeviceError>>;
-export declare function requestAppToken(api: API, token: string, scopes?: string[], store?: string): Promise<{
- [x: string]: ApplicationToken;
-}>;
+export declare function requestAppToken(api: API, token: string, scopes?: string[], store?: string): Promise<Record<string, ApplicationToken>>;
export {};
\ No newline at end of file
packages/cli-kit/dist/public/common/ts/json-narrowing.d.ts@@ -4,6 +4,4 @@
* @param unknownBlob - The unknown object to validate.
* @throws BugError - Thrown if the unknownBlob is not a string map.
*/
-export declare function assertStringMap(unknownBlob: unknown): asserts unknownBlob is {
- [key: string]: string;
-};
\ No newline at end of file
+export declare function assertStringMap(unknownBlob: unknown): asserts unknownBlob is Record<string, string>;
\ No newline at end of file
packages/cli-kit/dist/public/node/api/admin.d.ts@@ -73,9 +73,7 @@ interface ApiVersion {
* @param apiVersion - Admin API version.
* @returns - The {@link RestResponse}.
*/
-export declare function restRequest<T>(method: string, path: string, session: AdminSession, requestBody?: T, searchParams?: {
- [name: string]: string;
-}, apiVersion?: string): Promise<RestResponse>;
+export declare function restRequest<T>(method: string, path: string, session: AdminSession, requestBody?: T, searchParams?: Record<string, string>, apiVersion?: string): Promise<RestResponse>;
/**
* Respose of a REST request.
*/
@@ -91,8 +89,6 @@ export interface RestResponse {
/**
* HTTP response headers.
*/
- headers: {
- [key: string]: string[];
- };
+ headers: Record<string, string[]>;
}
export {};
\ No newline at end of file
packages/cli-kit/dist/public/node/api/app-dev.d.ts@@ -1,5 +1,5 @@
-import { UnauthorizedHandler } from './graphql.js';
import { RequestOptions } from './app-management.js';
+import { UnauthorizedHandler } from './graphql.js';
import { Variables } from 'graphql-request';
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
/**
packages/cli-kit/dist/public/node/api/app-management.d.ts@@ -2,9 +2,7 @@ import { CacheOptions, GraphQLResponse, UnauthorizedHandler } from './graphql.js
import { RequestModeInput } from '../http.js';
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
import { Variables } from 'graphql-request';
-export declare const appManagementHeaders: (token: string) => {
- [key: string]: string;
-};
+export declare const appManagementHeaders: (token: string) => Record<string, string>;
export declare const appManagementAppLogsUrl: (organizationId: string, cursor?: string, filters?: {
status?: string;
source?: string;
packages/cli-kit/dist/public/node/api/graphql.d.ts@@ -3,14 +3,10 @@ import { LocalStorage } from '../local-storage.js';
import { RequestModeInput } from '../http.js';
import { rawRequest, RequestDocument, Variables } from 'graphql-request';
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
-export type Exact<T extends {
- [key: string]: unknown;
-}> = {
+export type Exact<T extends Record<string, unknown>> = {
[K in keyof T]: T[K];
};
-export interface GraphQLVariables {
- [key: string]: any;
-}
+export type GraphQLVariables = Record<string, any>;
export type GraphQLResponse<T> = Awaited<ReturnType<typeof rawRequest<T>>>;
export interface CacheOptions {
cacheTTL: TimeInterval;
@@ -29,9 +25,7 @@ interface GraphQLRequestBaseOptions<TResult> {
api: string;
url: string;
token?: string;
- addedHeaders?: {
- [header: string]: string;
- };
+ addedHeaders?: Record<string, string>;
responseOptions?: GraphQLResponseOptions<TResult>;
cacheOptions?: CacheOptions;
preferredBehaviour?: RequestModeInput;
@@ -42,9 +36,7 @@ export type GraphQLRequestOptions<T> = GraphQLRequestBaseOptions<T> & {
unauthorizedHandler?: UnauthorizedHandler;
};
export type GraphQLRequestDocOptions<TResult, TVariables> = GraphQLRequestBaseOptions<TResult> & {
- query: TypedDocumentNode<TResult, TVariables> | TypedDocumentNode<TResult, Exact<{
- [key: string]: never;
- }>>;
+ query: TypedDocumentNode<TResult, TVariables> | TypedDocumentNode<TResult, Exact<Record<string, never>>>;
variables?: TVariables;
unauthorizedHandler?: UnauthorizedHandler;
autoRateLimitRestore?: boolean;
packages/cli-kit/dist/public/node/plugins/tunnel.d.ts@@ -37,19 +37,13 @@ export interface HookReturnPerTunnelPlugin {
port: number;
provider: string;
};
- pluginReturns: {
- [key: string]: Result<TunnelClient, TunnelError>;
- };
+ pluginReturns: Record<string, Result<TunnelClient, TunnelError>>;
};
tunnel_provider: {
- options: {
- [key: string]: never;
- };
- pluginReturns: {
- [pluginName: string]: {
- name: string;
- };
- };
+ options: Record<string, never>;
+ pluginReturns: Record<string, {
+ name: string;
+ }>;
};
}
export type TunnelProviderFunction = FanoutHookFunction<'tunnel_provider', ''>;
packages/cli-kit/dist/public/node/themes/conf.d.ts@@ -2,9 +2,7 @@ import { LocalStorage } from '../local-storage.js';
import { AdminSession } from '../session.js';
type HostThemeId = string;
type StoreFqdn = AdminSession['storeFqdn'];
-interface HostThemeLocalStorageSchema {
- [themeStore: StoreFqdn]: HostThemeId;
-}
+type HostThemeLocalStorageSchema = Record<StoreFqdn, HostThemeId>;
export declare function hostThemeLocalStorage(): LocalStorage<HostThemeLocalStorageSchema>;
export declare function getHostTheme(storeFqdn: StoreFqdn): string | undefined;
export declare function setHostTheme(storeFqdn: StoreFqdn, themeId: HostThemeId): void;
packages/cli-kit/dist/private/node/ui/contexts/LinksContext.d.ts@@ -4,9 +4,7 @@ export interface Link {
url: string;
}
export interface ContextValue {
- links: React.RefObject<{
- [key: string]: Link;
- }>;
+ links: React.RefObject<Record<string, Link>>;
addLink: (label: string | undefined, url: string) => string;
}
export declare const LinksContext: React.Context<ContextValue | null>;
\ No newline at end of file
packages/cli-kit/dist/private/node/ui/components/SelectInput.d.ts@@ -1,7 +1,7 @@
import React from 'react';
import { DOMElement } from 'ink';
declare module 'react' {
- function forwardRef<T, P>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
+ function forwardRef<T, TProps>(render: (props: TProps, ref: React.Ref<T>) => React.ReactElement | null): (props: TProps & React.RefAttributes<T>) => React.ReactElement | null;
}
export interface SelectInputProps<T> {
items: Item<T>[];
packages/cli-kit/dist/public/node/vendor/dev_server/dev-server-2016.d.ts@@ -1,9 +1,17 @@
import { HostOptions } from './types.js';
+/**
+ *
+ * @param projectName
+ */
export declare function createServer(projectName: string): {
host: (options?: HostOptions) => string;
url: (options?: HostOptions) => string;
};
declare function assertRunning2016(projectName: string): void;
declare let assertRunningOverride: typeof assertRunning2016 | undefined;
+/**
+ *
+ * @param override
+ */
export declare function setAssertRunning(override: typeof assertRunningOverride): void;
export {};
\ No newline at end of file
packages/cli-kit/dist/public/node/vendor/dev_server/dev-server-2024.d.ts@@ -1,9 +1,17 @@
import type { HostOptions } from './types.js';
+/**
+ *
+ * @param projectName
+ */
export declare function createServer(projectName: string): {
host: (options?: HostOptions) => string;
url: (options?: HostOptions) => string;
};
declare function assertRunning2024(projectName: string): void;
declare let assertRunningOverride: typeof assertRunning2024 | undefined;
+/**
+ *
+ * @param override
+ */
export declare function setAssertRunning(override: typeof assertRunningOverride): void;
export {};
\ No newline at end of file
packages/cli-kit/dist/public/node/vendor/dev_server/env.d.ts@@ -1,2 +1,5 @@
export declare const isDevServerEnvironment: boolean;
+/**
+ *
+ */
export declare function assertCompatibleEnvironment(): void;
\ No newline at end of file
packages/cli-kit/dist/private/node/ui/components/Prompts/InfoTable.d.ts@@ -12,9 +12,7 @@ export interface InfoTableSection {
emptyItemsText?: string;
}
export interface InfoTableProps {
- table: {
- [header: string]: Items;
- } | InfoTableSection[];
+ table: Record<string, Items> | InfoTableSection[];
}
declare const InfoTable: FunctionComponent<InfoTableProps>;
export { InfoTable };
\ No newline at end of file
packages/cli-kit/dist/private/node/ui/components/Prompts/PromptLayout.d.ts@@ -1,5 +1,5 @@
-import { InfoMessageProps } from './InfoMessage.js';
import { InfoTableProps } from './InfoTable.js';
+import { InfoMessageProps } from './InfoMessage.js';
import { InlineToken, LinkToken, TokenItem } from '../TokenizedText.js';
import { AbortSignal } from '../../../../../public/node/abort.js';
import { PromptState } from '../../hooks/use-prompt.js';
packages/cli-kit/dist/private/node/ui/components/Table/ScalarDict.d.ts@@ -1,5 +1,3 @@
type Scalar = string | number | boolean | null | undefined;
-export default interface ScalarDict {
- [key: string]: Scalar;
-}
-export {};
\ No newline at end of file
+type ScalarDict = Record<string, Scalar>;
+export default ScalarDict;
\ No newline at end of file
packages/cli-kit/dist/public/node/vendor/dev_server/network/host.d.ts@@ -1,2 +1,9 @@
+/**
+ *
+ * @param hostname
+ */
export declare function getIpFromHosts(hostname: string): string;
+/**
+ *
+ */
export declare function TEST_ClearCache(): void;
\ No newline at end of file
packages/cli-kit/dist/public/node/vendor/dev_server/network/index.d.ts@@ -5,5 +5,12 @@ export interface ConnectionArguments {
port: number;
timeout?: number;
}
+/**
+ *
+ * @param options
+ */
export declare function assertConnectable(options: ConnectionArguments): void;
+/**
+ *
+ */
export declare function TEST_testResetCheckPort(): void;
\ No newline at end of file
packages/cli-kit/dist/public/node/vendor/otel-js/export/InstantaneousMetricReader.d.ts@@ -1,5 +1,5 @@
-import type { PushMetricExporter } from '@opentelemetry/sdk-metrics';
import { MetricReader } from '@opentelemetry/sdk-metrics';
+import type { PushMetricExporter } from '@opentelemetry/sdk-metrics';
export interface InstantaneousMetricReaderOptions {
/**
* The backing exporter for the metric reader.
packages/cli-kit/dist/public/node/vendor/otel-js/service/types.d.ts@@ -1,13 +1,11 @@
import type { Counter, Histogram, MeterProvider, MetricAttributes, MetricOptions, UpDownCounter } from '@opentelemetry/api';
import type { ViewOptions } from '@opentelemetry/sdk-metrics';
-export type CustomMetricLabels<TLabels extends {
- [key in TKeys]: MetricAttributes;
-}, TKeys extends string = keyof TLabels & string> = {
+export type CustomMetricLabels<TLabels extends Record<TKeys, MetricAttributes>, TKeys extends string = keyof TLabels & string> = {
[P in TKeys]: TLabels[P] extends MetricAttributes ? TLabels[P] : never;
};
-export type MetricRecording<TAttributes extends MetricAttributes = any> = [value: number, labels?: TAttributes];
-export type RecordMetricFunction<TAttributes extends MetricAttributes = any> = (...args: MetricRecording<TAttributes>) => void;
-export type OnRecordCallback<TAttributes extends MetricAttributes = any> = (metricName: string, ...args: MetricRecording<TAttributes>) => MetricRecording<TAttributes> | void;
+export type MetricRecording<TAttributes extends MetricAttributes = MetricAttributes> = [value: number, labels?: TAttributes];
+export type RecordMetricFunction<TAttributes extends MetricAttributes = MetricAttributes> = (...args: MetricRecording<TAttributes>) => void;
+export type OnRecordCallback<TAttributes extends MetricAttributes = MetricAttributes> = (metricName: string, ...args: MetricRecording<TAttributes>) => MetricRecording<TAttributes> | void;
export type MetricInstrument = Histogram | Counter | UpDownCounter;
export declare enum MetricInstrumentType {
Histogram = "Histogram",
@@ -23,14 +21,12 @@ export type MetricDescriptor = MetricOptions & ({
} | {
type: MetricInstrumentType.Counter | MetricInstrumentType.UpDownCounter;
});
-export interface MetricsConfig {
- [key: string]: MetricDescriptor;
-}
+export type MetricsConfig = Record<string, MetricDescriptor>;
export interface OtelService {
readonly serviceName: string;
getMeterProvider(): MeterProvider;
addView(viewOptions: ViewOptions): void;
- record<TAttributes extends MetricAttributes = any>(...args: Parameters<OnRecordCallback<TAttributes>>): void;
+ record<TAttributes extends MetricAttributes = MetricAttributes>(...args: Parameters<OnRecordCallback<TAttributes>>): void;
/**
* callback is called when a metric is recorded.
* Returns a function to unsubscribe.
packages/cli-kit/dist/public/node/vendor/otel-js/utils/throttle.d.ts@@ -1,7 +1,15 @@
-type ThrottledFunction<T extends (...args: any) => any> = (...args: Parameters<T>) => ReturnType<T>;
+type ThrottledFunction<T extends (...args: unknown[]) => unknown> = (...args: Parameters<T>) => ReturnType<T>;
interface ThrottleOptions {
leading?: boolean;
trailing?: boolean;
}
-export declare function throttle<T extends (...args: any) => any>(func: T, wait: number, { leading, trailing }?: ThrottleOptions): ThrottledFunction<T>;
+/**
+ *
+ * @param func
+ * @param wait
+ * @param root0
+ * @param root0.leading
+ * @param root0.trailing
+ */
+export declare function throttle<T extends (...args: unknown[]) => unknown>(func: T, wait: number, { leading, trailing }?: ThrottleOptions): ThrottledFunction<T>;
export {};
\ No newline at end of file
packages/cli-kit/dist/public/node/vendor/otel-js/utils/validators.d.ts@@ -1 +1,5 @@
+/**
+ *
+ * @param value
+ */
export declare function isValidMetricName(value: string): boolean;
\ No newline at end of file
packages/cli-kit/dist/public/node/vendor/otel-js/service/BaseOtelService/BaseOtelService.d.ts@@ -32,6 +32,13 @@ export declare class BaseOtelService implements OtelService {
protected readonly recordListeners: Set<OnRecordCallback>;
/**
* Bootstraps an Otel exporter which can send Otel metrics to a dedicated Shopify supported collector endpoint.
+ *
+ * @param root0
+ * @param root0.serviceName
+ * @param root0.prefixMetric
+ * @param root0.metrics
+ * @param root0.onRecord
+ * @param root0.meterProvider
*/
constructor({ serviceName, prefixMetric, metrics, onRecord, meterProvider }: BaseOtelServiceOptions);
getMeterProvider(): MeterProvider;
packages/cli-kit/dist/public/node/vendor/otel-js/service/DefaultOtelService/DefaultOtelService.d.ts@@ -2,7 +2,7 @@ import { BaseOtelService } from '../BaseOtelService/BaseOtelService.js';
import type { BaseOtelServiceOptions } from '../BaseOtelService/BaseOtelService.js';
export interface DefaultOtelServiceOptions extends BaseOtelServiceOptions {
/**
- * What environment is being deployed (production, staging)
+ * What environment is being deployed (production, staging).
*/
env?: string;
/**
@@ -18,6 +18,17 @@ export interface DefaultOtelServiceOptions extends BaseOtelServiceOptions {
export declare class DefaultOtelService extends BaseOtelService {
/**
* Bootstraps an Otel exporter which can send Otel metrics to a dedicated Shopify supported collector endpoint.
+ *
+ * @param root0
+ * @param root0.throttleLimit
+ * @param root0.env
+ * @param root0.serviceName
+ * @param root0.prefixMetric
+ * @param root0.metrics
+ * @param root0.onRecord
+ * @param root0.meterProvider
+ * @param root0.useXhr
+ * @param root0.otelEndpoint
*/
constructor({ throttleLimit, env, serviceName, prefixMetric, metrics, onRecord, meterProvider, useXhr, otelEndpoint, }: DefaultOtelServiceOptions);
shutdown(): Promise<void>;
|
Contributor
Author
|
Closing in favor of #6822 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
ESLint 8 has reached end of life and the ecosystem has moved to ESLint 9 with its new "flat config" format. More info here: https://eslint.org/docs/latest/use/migrate-to-9.0.0
This migration is necessary to:
.eslintrc.*configuration@typescript-eslintv8 which includes improved type checking and drops deprecated rules likeban-typesWHAT is this pull request doing?
Configuration Migration:
.eslintrc.cjstoeslint.config.js(flat config format).eslintignore(ignores are now defined inline in the config)@shopify/eslint-plugin-clito export flat configPlugin Updates:
eslint: 8.x → 9.x@typescript-eslint/*: 7.x → 8.x@shopify/eslint-plugin: → 50.0.0 (flat config compatible)eslint-plugin-import→eslint-plugin-import-x(ESM compatible replacement)eslint-plugin-node→eslint-plugin-n(maintained fork,node/→n/prefix)eslint-plugin-vitest→@vitest/eslint-pluginRule Changes:
@typescript-eslint/ban-typesreferences (deprecated in v8, replaced byno-restricted-types)import/rule prefix toimport-x/node/rule prefix ton/@shopify/strict-component-boundaries(incompatible with import-x resolver)eslint-disablecomments for rules that no longer existType Fixes:
ui-extensions-server-kitandui-extensions-test-utilsuncovered by stricter type checkingGraphQLVariablestype to be compatible with generated GraphQL interfacesHow to test your changes?
CI
Measuring impact
How do we know this change was effective? Please choose one:
Checklist