Skip to content

Commit dfec3b4

Browse files
committed
fix: allow use with npm scripts
1 parent 14d6c7f commit dfec3b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/runtime/registry/npm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const NpmOptions = object({
1010
type: optional(string()),
1111
})
1212

13-
export type NpmInput = RegistryScriptInput<typeof NpmOptions>
13+
export type NpmInput = RegistryScriptInput<typeof NpmOptions, true, true>
1414

1515
export function useScriptNpm<T extends Record<string | symbol, any>>(_options: NpmInput) {
1616
// TODO support multiple providers? (e.g. jsdelivr, cdnjs, etc.) Only unpkg for now

src/runtime/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ const emptyOptions = object({})
120120

121121
export type EmptyOptionsSchema = typeof emptyOptions
122122

123-
export type RegistryScriptInput<T extends ObjectSchema<any, any> = EmptyOptionsSchema, Bundelable extends boolean = true> = InferInput<T> & {
123+
export type RegistryScriptInput<T extends ObjectSchema<any, any> = EmptyOptionsSchema, Bundelable extends boolean = true, Usable extends boolean = false> = InferInput<T> & {
124124
/**
125125
* A unique key to use for the script, this can be used to load multiple of the same script with different options.
126126
*/
127127
key?: string
128128
scriptInput?: MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>>
129-
scriptOptions?: Bundelable extends true ? Omit<NuxtUseScriptOptions, 'use'> : Omit<NuxtUseScriptOptions, 'bundle' | 'use'>
129+
scriptOptions?: Omit<NuxtUseScriptOptions, Bundelable extends true ? '' : 'bundle' | Usable extends true ? '' : 'use'>
130130
}
131131

132132
export interface RegistryScript {

0 commit comments

Comments
 (0)