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

Mitch/info clikit #4134

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Mitch/info clikit #4134

wants to merge 4 commits into from

Conversation

MitchDickinson
Copy link
Contributor

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

How to test your changes?

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-management

Copy link
Contributor

Differences in type declarations

We 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:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

packages/cli-kit/dist/public/node/ui/Table/Column.d.ts
export interface Column<T> {
    name: keyof T;
    width: number;
    color?: string;
}
packages/cli-kit/dist/public/node/ui/Table/Row.d.ts
/// <reference types="react" />
import ScalarDict from './ScalarDict.js';
import { Column } from './Column.js';
interface RowProps<T extends ScalarDict> {
    fillerChar: string;
    rowKey: string;
    data: Partial<T>;
    columns: Column<T>[];
    ignoreColumnColor?: boolean;
}
declare const Row: <T extends ScalarDict>({ rowKey, columns, data, fillerChar, ignoreColumnColor }: RowProps<T>) => JSX.Element;
export { Row };
packages/cli-kit/dist/public/node/ui/Table/ScalarDict.d.ts
type Scalar = string | number | boolean | null | undefined;
export default interface ScalarDict {
    [key: string]: Scalar;
}
export {};
packages/cli-kit/dist/public/node/ui/Table/Table.d.ts
/// <reference types="react" />
import ScalarDict from './ScalarDict.js';
import { ForegroundColor } from 'chalk';
export type TableColumn<T> = {
    [column in keyof T]: {
        header?: string;
        color?: ForegroundColor | 'dim';
    };
};
export interface TableProps<T extends ScalarDict> {
    rows: T[];
    columns: TableColumn<T>;
}
declare function Table<T extends ScalarDict>({ rows, columns: columnsConfiguration }: TableProps<T>): JSX.Element;
export { Table };

Existing type declarations

packages/cli-kit/dist/public/node/ui.d.ts
@@ -1,12 +1,12 @@
 /// <reference types="node" resolution-mode="require"/>
 import { FatalError as Fatal } from './error.js';
 import { Logger, LogLevel } from './output.js';
+import ScalarDict from './ui/Table/ScalarDict.js';
+import { TableColumn, TableProps } from './ui/Table/Table.js';
 import { ConcurrentOutputProps } from '../../private/node/ui/components/ConcurrentOutput.js';
 import { handleCtrlC, render } from '../../private/node/ui.js';
 import { AlertOptions } from '../../private/node/ui/alert.js';
 import { CustomSection } from '../../private/node/ui/components/Alert.js';
-import ScalarDict from '../../private/node/ui/components/Table/ScalarDict.js';
-import { TableColumn, TableProps } from '../../private/node/ui/components/Table/Table.js';
 import { InlineToken, LinkToken, ListToken, TokenItem } from '../../private/node/ui/components/TokenizedText.js';
 import { DangerousConfirmationPromptProps } from '../../private/node/ui/components/DangerousConfirmationPrompt.js';
 import { SelectPromptProps } from '../../private/node/ui/components/SelectPrompt.js';
@@ -309,7 +309,7 @@ export interface RenderAutocompleteOptions<T> extends PartialBy<Omit<Autocomplet
  *
  */
 export declare function renderAutocompletePrompt<T>({ renderOptions, ...props }: RenderAutocompleteOptions<T>, uiDebugOptions?: UIDebugOptions): Promise<T>;
-interface RenderTableOptions<T extends ScalarDict> extends TableProps<T> {
+export interface RenderTableOptions<T extends ScalarDict> extends TableProps<T> {
     renderOptions?: RenderOptions;
 }
 /**
@@ -394,4 +394,4 @@ interface IsTTYOptions {
 export declare function isTTY({ stdin, uiDebugOptions }: IsTTYOptions): boolean;
 export type Key = InkKey;
 export type InfoMessage = InfoMessageProps['message'];
-export { Task, TokenItem, InlineToken, LinkToken, TableColumn, InfoTableSection, ListToken, render, handleCtrlC };
\ No newline at end of file
+export { Task, TokenItem, InlineToken, LinkToken, TableColumn, InfoTableSection, ListToken, render, handleCtrlC, ScalarDict, };
\ No newline at end of file

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
72.59% (-0.04% 🔻)
7478/10301
🟡 Branches
69.17% (-0.07% 🔻)
3675/5313
🟡 Functions
71.57% (-0.06% 🔻)
1976/2761
🟡 Lines
72.94% (-0.04% 🔻)
7064/9685
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / Row.tsx
100% 100% 100% 100%
🟢
... / Table.tsx
92.31% 87.5% 100% 92.31%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / info.ts
90% (-0.76% 🔻)
75.86%
90.63% (-2.92% 🔻)
91.89% (-0.84% 🔻)

Test suite run success

1720 tests passing in 794 suites.

Report generated by 🧪jest coverage report action from 1fcf0bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant