Skip to content

Commit d7e34eb

Browse files
committed
feat: add nub package manager support
Adds nub (https://github.com/nubjs/nub) as a selectable package manager across the install/execute command builders, the PM dropdown, and the terminal install/execute displays. Refs #3013
1 parent 4f3c588 commit d7e34eb

7 files changed

Lines changed: 33 additions & 4 deletions

File tree

app/components/Package/ManagerSelect.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ function handleKeydown(event: KeyboardEvent) {
192192
:root[data-pm='bun'] [data-pm-select='bun'],
193193
:root[data-pm='deno'] [data-pm-select='deno'],
194194
:root[data-pm='vlt'] [data-pm-select='vlt'],
195-
:root[data-pm='vp'] [data-pm-select='vp'] {
195+
:root[data-pm='vp'] [data-pm-select='vp'],
196+
:root[data-pm='nub'] [data-pm-select='nub'] {
196197
display: inline-block;
197198
}
198199

app/components/Terminal/Execute.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ const copyExecuteCommand = () => copyExecute(getFullExecuteCommand())
9595
:root[data-pm='bun'] [data-pm-cmd='bun'],
9696
:root[data-pm='deno'] [data-pm-cmd='deno'],
9797
:root[data-pm='vlt'] [data-pm-cmd='vlt'],
98-
:root[data-pm='vp'] [data-pm-cmd='vp'] {
98+
:root[data-pm='vp'] [data-pm-cmd='vp'],
99+
:root[data-pm='nub'] [data-pm-cmd='nub'] {
99100
display: flex;
100101
}
101102

app/components/Terminal/Install.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ useCommandPaletteContextCommands(
413413
:root[data-pm='bun'] [data-pm-cmd='bun'],
414414
:root[data-pm='deno'] [data-pm-cmd='deno'],
415415
:root[data-pm='vlt'] [data-pm-cmd='vlt'],
416-
:root[data-pm='vp'] [data-pm-cmd='vp'] {
416+
:root[data-pm='vp'] [data-pm-cmd='vp'],
417+
:root[data-pm='nub'] [data-pm-cmd='nub'] {
417418
display: flex;
418419
}
419420

app/utils/install-command.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ export const packageManagers = [
6868
create: 'vp create',
6969
icon: 'i-simple-icons:vite',
7070
},
71+
{
72+
id: 'nub',
73+
label: 'nub',
74+
action: 'add',
75+
executeLocal: 'nubx',
76+
executeRemote: 'nubx',
77+
create: 'nub create',
78+
icon: 'i-custom-nub',
79+
},
7180
] as const
7281

7382
export type PackageManagerId = (typeof packageManagers)[number]['id']

app/utils/prehydrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function initPreferencesOnPrehydrate() {
2121
] satisfies typeof ACCENT_COLOR_IDS)
2222

2323
// Valid package manager IDs
24-
const validPMs = new Set(['npm', 'pnpm', 'yarn', 'bun', 'deno', 'vlt', 'vp'])
24+
const validPMs = new Set(['npm', 'pnpm', 'yarn', 'bun', 'deno', 'vlt', 'vp', 'nub'])
2525

2626
// Read settings from localStorage
2727
const settings = JSON.parse(

assets/media/custom-icons.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"width": 24,
2020
"height": 24
2121
},
22+
"nub": {
23+
"body": "<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='5 4 23 23'><path d='M10.977334851936218 11.698405466970385V20.64145785876993L13.050227790432801 21.337357630979497V21.9H6.106036446469248V21.337357630979497L8.223348519362187 20.611845102505693V12.03895216400911Q7.956833712984054 11.728018223234622 7.4904328018223225 11.468906605922548Q7.024031890660591 11.209794988610476 6.106036446469248 10.89886104783599V10.469476082004554L10.074145785876993 8.899999999999999H10.429498861047836ZM14.708542141230067 21.337357630979497 16.79624145785877 20.64145785876993V13.638041002277902Q16.79624145785877 12.882915717539861 16.485307517084284 12.342482915717538Q16.174373576309797 11.802050113895215 15.567312072892939 11.520728929384964Q14.960250569476083 11.239407744874713 14.071867881548975 11.239407744874713Q12.97619589977221 11.239407744874713 12.058200455580867 11.616970387243732Q11.140205011389522 11.994533029612754 10.740432801822323 12.542369020501138L10.162984054669703 12.024145785876991Q10.992141230068338 11.120956719817766 11.717653758542141 10.521298405466968Q12.443166287015945 9.92164009111617 13.109453302961274 9.566287015945328Q13.775740318906605 9.210933940774485 14.471640091116171 9.055466970387242Q15.16753986332574 8.899999999999999 15.922665148063782 8.899999999999999Q17.77346241457859 8.899999999999999 18.661845102505694 10.062300683371298Q19.5502277904328 11.224601366742595 19.5502277904328 13.712072892938494V20.611845102505693L21.69715261958998 21.337357630979497V21.9H14.708542141230067Z' fill='currentColor'/><circle cx='25.295' cy='20.175' r='2.3' fill='currentColor'/></svg>",
24+
"width": 32,
25+
"height": 32
26+
},
2227
"license-minified": {
2328
"body": "<svg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M9.9732 16.695C10.9737 18.4278 12.6877 19.4989 14.553 19.7648L14.8871 20.7614L15.3994 20.6191L18.4885 29.8189L19.1237 30.2027L20.6026 29.7899L20.7383 29.2897C20.7383 29.2897 21.821 28.314 21.8917 28.2485L21.7888 27.9428L21.2221 27.9805L21.0069 27.3405L21.5004 27.084L21.2065 26.2073L20.6097 26.1575L20.4209 25.5945L20.8852 25.2498L20.7511 24.8506L20.1681 24.8412L19.889 24.009L20.3669 23.7047L20.3066 23.525C20.1579 23.4992 20.0253 23.4436 19.9178 23.362C19.8103 23.2804 19.7305 23.1746 19.6838 23.0519C19.6435 22.943 19.6433 22.8185 19.6833 22.693C19.7233 22.5674 19.8019 22.4459 19.9098 22.3426L19.7369 21.8344C19.5364 21.787 19.359 21.7019 19.2149 21.5839C19.0708 21.4659 18.9629 21.3176 18.8978 21.1475C18.8425 20.9962 18.8383 20.825 18.8858 20.6507C18.9333 20.4764 19.0307 20.3052 19.1683 20.154L18.9884 19.6188L19.7044 19.42L19.4052 18.5273C22.0253 16.5943 22.8594 13.0146 21.2315 10.195C19.4794 7.16029 15.5388 6.15527 12.4299 7.9502C9.32104 9.74512 8.22112 13.6603 9.9732 16.695ZM13.6196 10.0107C12.8424 10.4595 12.5674 11.4383 13.0054 12.1969C13.4434 12.9556 14.4286 13.2069 15.2058 12.7581C15.983 12.3094 16.258 11.3306 15.82 10.5719C15.382 9.81326 14.3968 9.56201 13.6196 10.0107Z' fill='#E3B234'/><path d='M12.4798 8.03646C15.5428 6.26802 19.4219 7.25987 21.1452 10.2447C22.7464 13.018 21.9268 16.5421 19.3458 18.4463L19.2876 18.4901L19.3105 18.5592L19.5756 19.3522L18.9615 19.523L18.8604 19.5509L18.8935 19.6513L19.0559 20.1338C18.9297 20.2839 18.8365 20.4513 18.7892 20.6249C18.7372 20.8163 18.7407 21.0086 18.8038 21.1814L18.8048 21.1831C18.8763 21.3698 18.9948 21.5328 19.152 21.6615C19.295 21.7785 19.4673 21.8625 19.6581 21.9151L19.7952 22.3185C19.7001 22.4214 19.6274 22.5385 19.5879 22.6626C19.5421 22.8064 19.5411 22.9539 19.5902 23.0864L19.5907 23.0873C19.6442 23.2279 19.7355 23.3492 19.8574 23.4418C19.9634 23.5223 20.0898 23.5771 20.2279 23.6091L20.2465 23.6626L19.8352 23.9249L19.769 23.9665L19.794 24.0411L20.0737 24.8731L20.0957 24.9405L20.1662 24.9415L20.6781 24.9493L20.7661 25.2131L20.3615 25.5143L20.3029 25.5572L20.3258 25.6263L20.5145 26.1894L20.5357 26.2516L20.6013 26.2577L21.1316 26.3011L21.3782 27.0349L20.9611 27.252L20.8847 27.2916L20.9124 27.3726L21.1271 28.0121L21.1516 28.0859L21.2287 28.0808L21.7181 28.0475L21.7755 28.2173C21.6761 28.3074 21.4473 28.5164 21.222 28.7195C21.0823 28.8456 20.944 28.9697 20.8414 29.0622C20.7904 29.1082 20.7478 29.1461 20.7181 29.1729C20.7032 29.1863 20.6912 29.1971 20.6832 29.2043C20.6793 29.2078 20.6766 29.2108 20.6745 29.2127C20.6736 29.2135 20.673 29.2145 20.6725 29.215L20.6716 29.2155L20.6492 29.2352L20.6417 29.2632L20.5193 29.7094L19.1888 30.0806L15.6784 19.3774L15.4887 19.4396L18.9446 29.978L18.5705 29.752L15.4942 20.5877L15.4643 20.4968L15.373 20.5224L14.9513 20.6396L14.648 19.7333L14.6287 19.6745L14.5673 19.666C12.7306 19.4042 11.0436 18.3498 10.0594 16.6451C8.33615 13.6602 9.41672 9.8049 12.4798 8.03646ZM13.5696 9.92412C12.7465 10.3993 12.4525 11.4385 12.9193 12.247C13.3861 13.0553 14.4326 13.3196 15.2556 12.8444C16.0786 12.3693 16.373 11.3308 15.9064 10.5224C15.4396 9.71393 14.3927 9.44892 13.5696 9.92412Z' stroke='#212121' stroke-width='0.2'/><path fill-rule='evenodd' clip-rule='evenodd' d='M7.99805 13.3448C7.99805 15.3458 8.94693 17.1303 10.4294 18.2932L10.2204 19.3235L10.7353 19.4563L8.81055 28.9682L9.16876 29.6181L10.6559 30L11.0235 29.6347C11.0235 29.6347 12.449 29.3311 12.543 29.3097L12.6067 28.9935L12.0971 28.7428L12.2308 28.081L12.7864 28.1055L12.9702 27.1994L12.4783 26.8578L12.5963 26.2759L13.1707 26.2095L13.2542 25.7968L12.754 25.4971L12.9284 24.6368L13.4944 24.6123L13.532 24.4265C13.4161 24.3298 13.3291 24.2154 13.2768 24.0909C13.2246 23.9665 13.2083 23.835 13.2292 23.7054C13.2487 23.5909 13.3108 23.4831 13.4083 23.3943C13.5057 23.3055 13.6345 23.2396 13.7795 23.2041L13.884 22.6775C13.734 22.5363 13.6229 22.3738 13.5571 22.1996C13.4913 22.0254 13.4721 21.843 13.5007 21.6631C13.5284 21.5045 13.6105 21.3541 13.7387 21.2269C13.867 21.0997 14.0369 21.0001 14.2317 20.938L14.3435 20.3846L15.063 20.5704L15.2502 19.6476C18.4858 19.2837 20.998 16.6006 20.998 13.3448C20.998 9.84068 18.0879 7 14.498 7C10.9082 7 7.99805 9.84068 7.99805 13.3448ZM14.498 9.37931C13.6006 9.37931 12.873 10.0895 12.873 10.9655C12.873 11.8416 13.6006 12.5517 14.498 12.5517C15.3955 12.5517 16.123 11.8416 16.123 10.9655C16.123 10.0895 15.3955 9.37931 14.498 9.37931Z' fill='#E3B234'/><path d='M14.498 7.09961C18.0349 7.09961 20.8984 9.89811 20.8984 13.3447C20.8984 16.5471 18.4266 19.1892 15.2393 19.5479L15.167 19.5566L15.1523 19.6279L14.9854 20.4473L14.3682 20.2881L14.2666 20.2617L14.2451 20.3652L14.1445 20.8643C13.9602 20.9312 13.7957 21.0295 13.668 21.1562C13.5272 21.296 13.4341 21.4643 13.4023 21.6455V21.6475C13.371 21.8449 13.392 22.0453 13.4639 22.2354C13.5292 22.4082 13.6364 22.5671 13.7754 22.708L13.6924 23.126C13.5586 23.1675 13.4371 23.2326 13.3408 23.3203C13.2293 23.4219 13.1547 23.5492 13.1309 23.6885V23.6895C13.1069 23.8381 13.1253 23.9887 13.1846 24.1299C13.2361 24.2525 13.3182 24.3632 13.4219 24.46L13.4111 24.5156L12.9238 24.5371L12.8457 24.54L12.8301 24.6172L12.6562 25.4775L12.6416 25.5469L12.7021 25.583L13.1416 25.8457L13.0859 26.1182L12.585 26.1768L12.5127 26.1846L12.498 26.2559L12.3799 26.8379L12.3672 26.9023L12.4209 26.9404L12.8584 27.2432L12.7051 28.002L12.2354 27.9814L12.1494 27.9775L12.1328 28.0615L11.999 28.7227L11.9834 28.7988L12.0527 28.833L12.4932 29.0488L12.458 29.2246C12.3268 29.253 12.0242 29.3195 11.7275 29.3828C11.5435 29.4221 11.3617 29.4605 11.2266 29.4893C11.1594 29.5036 11.1035 29.5151 11.0645 29.5234C11.0449 29.5276 11.029 29.531 11.0186 29.5332C11.0134 29.5343 11.0095 29.5356 11.0068 29.5361C11.0055 29.5364 11.0046 29.537 11.0039 29.5371H11.0029L10.9736 29.543L10.9531 29.5635L10.624 29.8887L9.28613 29.5449L11.5977 18.5205L11.4023 18.4795L9.12598 29.334L8.91504 28.9512L10.833 19.4766L10.8525 19.3828L10.7607 19.3594L10.3369 19.25L10.5273 18.3135L10.54 18.2529L10.4912 18.2148C9.03142 17.0697 8.09766 15.3131 8.09766 13.3447C8.09771 9.89811 10.9612 7.09961 14.498 7.09961ZM14.498 9.2793C13.5476 9.2793 12.7734 10.0323 12.7734 10.9658C12.7736 11.8992 13.5478 12.6514 14.498 12.6514C15.4483 12.6514 16.2225 11.8992 16.2227 10.9658C16.2227 10.0323 15.4484 9.2793 14.498 9.2793Z' stroke='#212121' stroke-width='0.2'/><path d='M16.5 1.59961C19.4823 1.59961 21.9004 4.01766 21.9004 7C21.9004 8.11634 21.5606 9.15284 20.9805 10.0137C20.6262 9.46909 20.2023 8.99435 19.7256 8.5957C19.9641 8.11445 20.0996 7.57321 20.0996 7C20.0996 5.01177 18.4882 3.40039 16.5 3.40039C14.5118 3.40039 12.9004 5.01177 12.9004 7C12.9004 7.05794 12.9016 7.11556 12.9043 7.17285C12.9137 7.37202 12.9389 7.56734 12.9795 7.75684C13.1251 8.43693 13.4627 9.04652 13.9326 9.52441C14.0952 9.68974 14.274 9.8391 14.4658 9.9707C14.7832 10.1885 15.1379 10.3554 15.5176 10.4629C15.5895 10.5412 15.6554 10.6275 15.7109 10.7236C15.858 10.9784 15.9195 11.2589 15.9062 11.5322C15.7767 11.8375 15.5462 12.0907 15.2539 12.2539C14.4976 12.0752 13.8023 11.739 13.2061 11.2793L12.9531 11.0723C12.2728 10.4779 11.7386 9.71165 11.4238 8.84668C11.3167 8.55215 11.2345 8.24561 11.1797 7.92969C11.1273 7.62785 11.0996 7.31695 11.0996 7C11.0996 4.01766 13.5177 1.59961 16.5 1.59961Z' fill='#E3B234' stroke='#212121' stroke-width='0.2'/></svg>",
2429
"width": 32,

test/unit/app/utils/install-command.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ describe('install command generation', () => {
3636
['deno', 'npm:lodash'],
3737
['vlt', 'lodash'],
3838
['vp', 'lodash'],
39+
['nub', 'lodash'],
3940
] as const)('%s → %s', (pm, expected) => {
4041
expect(
4142
getPackageSpecifier({
@@ -56,6 +57,7 @@ describe('install command generation', () => {
5657
['deno', 'jsr:@trpc/server'], // Native JSR specifier preferred
5758
['vlt', '@trpc/server'],
5859
['vp', '@trpc/server'],
60+
['nub', '@trpc/server'],
5961
] as const)('%s → %s', (pm, expected) => {
6062
expect(
6163
getPackageSpecifier({
@@ -76,6 +78,7 @@ describe('install command generation', () => {
7678
['deno', 'npm:@vue/shared'], // Falls back to npm: compat
7779
['vlt', '@vue/shared'],
7880
['vp', '@vue/shared'],
81+
['nub', '@vue/shared'],
7982
] as const)('%s → %s', (pm, expected) => {
8083
expect(
8184
getPackageSpecifier({
@@ -98,6 +101,7 @@ describe('install command generation', () => {
98101
['deno', 'deno add npm:lodash'],
99102
['vlt', 'vlt install lodash'],
100103
['vp', 'vp add lodash'],
104+
['nub', 'nub add lodash'],
101105
] as const)('%s → %s', (pm, expected) => {
102106
expect(
103107
getInstallCommand({
@@ -118,6 +122,7 @@ describe('install command generation', () => {
118122
['deno', 'deno add npm:lodash@4.17.21'],
119123
['vlt', 'vlt install lodash@4.17.21'],
120124
['vp', 'vp add lodash@4.17.21'],
125+
['nub', 'nub add lodash@4.17.21'],
121126
] as const)('%s → %s', (pm, expected) => {
122127
expect(
123128
getInstallCommand({
@@ -139,6 +144,7 @@ describe('install command generation', () => {
139144
['deno', 'deno add -D npm:eslint'],
140145
['vlt', 'vlt install -D eslint'],
141146
['vp', 'vp add -D eslint'],
147+
['nub', 'nub add -D eslint'],
142148
] as const)('%s → %s', (pm, expected) => {
143149
expect(
144150
getInstallCommand({
@@ -160,6 +166,7 @@ describe('install command generation', () => {
160166
['deno', 'deno add jsr:@trpc/server'], // Native JSR preferred
161167
['vlt', 'vlt install @trpc/server'],
162168
['vp', 'vp add @trpc/server'],
169+
['nub', 'nub add @trpc/server'],
163170
] as const)('%s → %s', (pm, expected) => {
164171
expect(
165172
getInstallCommand({
@@ -180,6 +187,7 @@ describe('install command generation', () => {
180187
['deno', 'deno add jsr:@trpc/server@10.0.0'], // Native JSR with version
181188
['vlt', 'vlt install @trpc/server@10.0.0'],
182189
['vp', 'vp add @trpc/server@10.0.0'],
190+
['nub', 'nub add @trpc/server@10.0.0'],
183191
] as const)('%s → %s', (pm, expected) => {
184192
expect(
185193
getInstallCommand({
@@ -201,6 +209,7 @@ describe('install command generation', () => {
201209
['deno', 'deno add npm:@vue/shared'], // Falls back to npm: compat
202210
['vlt', 'vlt install @vue/shared'],
203211
['vp', 'vp add @vue/shared'],
212+
['nub', 'nub add @vue/shared'],
204213
] as const)('%s → %s', (pm, expected) => {
205214
expect(
206215
getInstallCommand({
@@ -355,6 +364,7 @@ describe('install command generation', () => {
355364
['deno', ['deno', 'run', 'npm:eslint']],
356365
['vlt', ['vlx', 'eslint']],
357366
['vp', ['vp', 'exec', 'eslint']],
367+
['nub', ['nubx', 'eslint']],
358368
] as const)('%s → %s', (pm, expected) => {
359369
expect(
360370
getExecuteCommandParts({
@@ -375,6 +385,7 @@ describe('install command generation', () => {
375385
['deno', ['deno', 'run', 'npm:degit']],
376386
['vlt', ['vlx', 'degit']],
377387
['vp', ['vp', 'dlx', 'degit']],
388+
['nub', ['nubx', 'degit']],
378389
] as const)('%s → %s', (pm, expected) => {
379390
expect(
380391
getExecuteCommandParts({
@@ -395,6 +406,7 @@ describe('install command generation', () => {
395406
['deno', ['deno', 'create', 'npm:vite']],
396407
['vlt', ['vlx', 'vite']],
397408
['vp', ['vp', 'create', 'vite']],
409+
['nub', ['nub', 'create', 'vite']],
398410
] as const)('%s → %s', (pm, expected) => {
399411
expect(
400412
getExecuteCommandParts({

0 commit comments

Comments
 (0)