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

feat(subcommand): add subcommand support #644

Merged
merged 8 commits into from
Jan 6, 2025
Merged

feat(subcommand): add subcommand support #644

merged 8 commits into from
Jan 6, 2025

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

resolves #62

This adds arbitrary CLI subcommand support to nuxi. (For example, @nuxt/module-builder exposes a nuxt-module-build command, which is outdated, as nuxt/module-builder#356 points out.)

Copy link

github-actions bot commented Jan 6, 2025

Bundle Stats

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
56 β†’ 54 5.66 MB β†’ 5.66 MB (-897 B) -0.02%
Changeset
File Ξ” Size
src/main.ts πŸ“ˆ +575 B (+105.70%) 544 B β†’ 1.09 kB
src/commands/index.ts πŸ“‰ -112 B (-8.66%) 1.26 kB β†’ 1.15 kB
src/commands/build-module.ts πŸ”₯ -1.33 kB (-100%) 1.33 kB β†’ 0 B
View detailed bundle breakdown

Added

Asset File Size % Changed
shared/nuxi.CMubMVZj.mjs 0 B β†’ 78.61 kB (+78.61 kB) -
shared/nuxi.5KG_sQ_H.mjs 0 B β†’ 17.69 kB (+17.69 kB) -
shared/nuxi.Dp_R8WEe.mjs 0 B β†’ 1.11 kB (+1.11 kB) -
shared/nuxi.CsFpgg26.mjs 0 B β†’ 804 B (+804 B) -
shared/nuxi.Bi12JVNs.mjs 0 B β†’ 294 B (+294 B) -

Removed

Asset File Size % Changed
shared/nuxi.vClchuwn.mjs 77.12 kB β†’ 0 B (-77.12 kB) -100%
shared/nuxi.BO0BBfd3.mjs 17.69 kB β†’ 0 B (-17.69 kB) -100%
chunks/build-module.mjs 1.33 kB β†’ 0 B (-1.33 kB) -100%
shared/nuxi.CVt1GvGe.mjs 1.11 kB β†’ 0 B (-1.11 kB) -100%
shared/nuxi.DpekDEZq.mjs 1.04 kB β†’ 0 B (-1.04 kB) -100%
shared/nuxi.CZkFAOfB.mjs 804 B β†’ 0 B (-804 B) -100%
shared/nuxi.onla3I0R.mjs 294 B β†’ 0 B (-294 B) -100%

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 188 B 0%
chunks/prompt.mjs 46.05 kB 0%
chunks/add.mjs 4.51 kB 0%
chunks/analyze.mjs 3.18 kB 0%
chunks/build.mjs 1.97 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/dev-child.mjs 1.75 kB 0%
chunks/dev.mjs 9.58 kB 0%
chunks/devtools.mjs 736 B 0%
chunks/generate.mjs 388 B 0%
chunks/info.mjs 4.39 kB 0%
chunks/init.mjs 803.88 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 984 B 0%
chunks/preview.mjs 2.81 kB 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 1.58 kB 0%
chunks/upgrade.mjs 5.69 kB 0%
chunks/satisfies.mjs 116 B 0%
chunks/index2.mjs 909.09 kB 0%
chunks/main.mjs 15.34 kB 0%
chunks/dev2.mjs 68.95 kB 0%
chunks/index3.mjs 17.11 kB 0%
chunks/xdg-open.mjs 25.32 kB 0%
chunks/node.mjs 134.34 kB 0%
chunks/index4.mjs 1.24 kB 0%
chunks/index5.mjs 6.55 kB 0%
chunks/index6.mjs 70.29 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/add2.mjs 10.6 kB 0%
chunks/search.mjs 42.99 kB 0%
chunks/index7.mjs 5.87 kB 0%
chunks/index8.mjs 882.9 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
shared/nuxi.DdI-vRyV.mjs 1.54 kB 0%
shared/nuxi.BSm0_9Hr.mjs 107 B 0%
shared/nuxi.BTNtCwAV.mjs 1.34 kB 0%
shared/nuxi.D1V6iren.mjs 20.07 kB 0%
shared/nuxi.C5KDh4qT.mjs 14.64 kB 0%
shared/nuxi.BbDL64qi.mjs 8.04 kB 0%
shared/nuxi.oF0sJJb9.mjs 2.02 MB 0%
shared/nuxi.BHLUJ6h2.mjs 5.12 kB 0%
shared/nuxi.E-ZsRS8r.mjs 943 B 0%
shared/nuxi.khUN-O-W.mjs 1.76 kB 0%
shared/nuxi.BrE13ZGm.mjs 152.11 kB 0%
shared/nuxi.CQKunj3-.mjs 285.08 kB 0%
shared/nuxi.ChFrgAY-.mjs 5.71 kB 0%
shared/nuxi.BZI8rqcO.mjs 6.13 kB 0%
shared/nuxi.BPuj-7ta.mjs 42.89 kB 0%

Copy link

pkg-pr-new bot commented Jan 6, 2025

Open in Stackblitz β€’ nuxt-cli-playground

npm i https://pkg.pr.new/nuxi@644

commit: b28931c

src/main.ts Outdated Show resolved Hide resolved
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

other than comment LGTM.

My main hope in new nuxi with external commands was to avoid executing another process but import citty-compatible modules as command and be able to pass more runtime info but seems far reach today.

@danielroe
Copy link
Member Author

oh, that would be nice. I think we can refactor to that as soon as supported. maybe expose a JSON with metadata?

@danielroe danielroe merged commit dacb6c0 into main Jan 6, 2025
7 checks passed
@danielroe danielroe deleted the feat/subcommand branch January 6, 2025 17:17
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.

CLI subcommand support
2 participants