Skip to content

[add] Type Writer, Copy Overlay & Command Line components#11

Merged
TechQuery merged 7 commits into
mainfrom
copilot/command-line-shadcn-ui
Jul 6, 2026
Merged

[add] Type Writer, Copy Overlay & Command Line components#11
TechQuery merged 7 commits into
mainfrom
copilot/command-line-shadcn-ui

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

PR-11 PR-11 PR-11 Powered by Pull Request Badge

This PR ports the CommandLine prompt UI into this repository as a public Shadcn registry component, and applies it to the showcase so each component card displays its install command on the second row.

  • New public component: command-line

    • Added registry/new-york/blocks/command-line/index.tsx as a class-based MobX component.
    • Preserves core behavior from source: progressive typing effect, focus-state feedback, click-to-copy command text.
    • Added registry/new-york/blocks/command-line/example.tsx for demo usage.
  • Registry integration

    • Added a new command-line entry in registry.json so it is distributable via shadcn-helper.
  • Demo card upgrade (all components)

    • Updated components/example/component-card.tsx to render a second-row command prompt:
      <CommandLine text={`npx shadcn-helper add @mobx-restful-shadcn/${name}`} />
    • This automatically applies to every showcased component card.
  • Showcase inclusion

    • Updated app/page.tsx to include a dedicated command-line component card and example.

Human changes

  1. [refactor] add independent Type Writer & Copy Overlay components
  2. [fix] PNPM patch installation
  3. [optimize] update Upstream packages

Copilot AI linked an issue Jul 3, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] 移植命令行提示组件到 Shadcn UI feat: add command-line public component and surface per-card install commands in demo page Jul 3, 2026
Copilot AI requested a review from TechQuery July 3, 2026 02:23

@TechQuery TechQuery left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Read Me 也要做相应更新

Comment thread registry/new-york/blocks/command-line/index.tsx Outdated

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Read Me 也要做相应更新

README 已更新并补充 Command Line 组件条目(含 command-line.json 链接),对应提交:c3a5245

Copilot AI requested a review from TechQuery July 3, 2026 02:37
@TechQuery TechQuery marked this pull request as ready for review July 3, 2026 02:43
Copilot AI review requested due to automatic review settings July 3, 2026 02:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports a new command-line registry component into the Shadcn registry and wires it into the demo so every showcased component card surfaces an install command prompt.

Changes:

  • Added a new CommandLine MobX-powered client component (with typing + copy affordances) and a local example.
  • Registered command-line in registry.json for distribution via the registry.
  • Updated the demo UI (ComponentCard + homepage) to display per-card install commands and include a dedicated command-line showcase entry.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
registry/new-york/blocks/command-line/index.tsx Introduces the public CommandLine component (typing effect + copy UI).
registry/new-york/blocks/command-line/example.tsx Adds a demo usage snippet for the new component.
registry.json Registers command-line as a distributable registry item.
README.md Adds command-line to the published registry links list.
components/example/component-card.tsx Adds CommandLine to every component card, surfacing install commands.
app/page.tsx Adds a dedicated command-line card/example to the homepage showcase.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +65 to +70
autoCopy = async () => {
const { text } = this.props;

if (text)
await navigator.clipboard.writeText(text);
};
Comment on lines +110 to +117
<small
className={cn(
"rounded bg-primary px-1.5 py-0.5 text-[10px] font-semibold text-primary-foreground transition-opacity",
active ? "opacity-100" : "opacity-0",
)}
>
Copied!
</small>
{...props}
>
<span className="select-none text-muted-foreground">$</span>
<kbd className="max-w-full overflow-x-auto whitespace-nowrap bg-transparent">
Comment on lines +85 to +105
<button
className={cn(
"inline-flex max-w-full items-center gap-2 rounded-md border px-3 py-2 font-mono text-sm",
className,
)}
type="button"
tabIndex={0}
onClick={(event: MouseEvent<HTMLButtonElement>) => {
void this.autoCopy();
onClick?.(event);
}}
onFocus={(event) => {
this.active = true;
onFocus?.(event);
}}
onBlur={(event) => {
this.active = false;
onBlur?.(event);
}}
{...props}
>

@TechQuery TechQuery left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot 打补丁来开启 SWC 对最新版装饰器语法的编译,并移除 Babel 依赖包和配置,以提高性能,参考:
orch-js/orch-js@47b28ee

Copilot AI commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot 打补丁来开启 SWC 对最新版装饰器语法的编译,并移除 Babel 依赖包和配置,以提高性能,参考:
orch-js/orch-js@47b28ee

Done in commit 33a7989. Here's a summary of what was applied:

Patch (patches/next@16.2.9.patch) – modifies dist/build/swc/options.js and dist/esm/build/swc/options.js in next@16.2.9:

  • Forces decorators: true in the SWC parser unconditionally (instead of requiring experimentalDecorators in tsconfig.json)
  • Adds decoratorVersion: "2022-03" to the transform options, enabling TC39 stage-3 decorator semantics (including the accessor keyword used by MobX)

pnpm-workspace.yamlpatchedDependencies was moved here (pnpm 11 no longer reads the pnpm key from package.json)

package.json – removed @babel/plugin-proposal-decorators, @babel/plugin-transform-typescript, @babel/preset-react from devDependencies; --webpack is retained on next build because Next.js 16 now defaults to Turbopack for production, and Turbopack's bundled SWC (version 37.0.0) panics on ClassMember::AutoAccessor — so the patch targets the webpack+SWC path, which fully supports it

babel.config.js – deleted

Copilot AI requested a review from TechQuery July 4, 2026 23:59
@TechQuery TechQuery force-pushed the copilot/command-line-shadcn-ui branch 2 times, most recently from 2f6d8b5 to 9889d1b Compare July 6, 2026 02:59
[optimize] update Upstream packages
@TechQuery TechQuery force-pushed the copilot/command-line-shadcn-ui branch from 9889d1b to 4f094d6 Compare July 6, 2026 03:07
@TechQuery TechQuery added the feature New feature or request label Jul 6, 2026
@TechQuery TechQuery changed the title feat: add command-line public component and surface per-card install commands in demo page [add] Type Writer, Copy Overlay & Command Line components Jul 6, 2026
@TechQuery TechQuery merged commit 22cf2b7 into main Jul 6, 2026
1 check passed
@TechQuery TechQuery deleted the copilot/command-line-shadcn-ui branch July 6, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

移植【命令行提示】组件到 Shadcn UI

3 participants