Skip to content

Commit

Permalink
fix: allow use with npm scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jul 14, 2024
1 parent 14d6c7f commit dfec3b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/runtime/registry/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const NpmOptions = object({
type: optional(string()),
})

export type NpmInput = RegistryScriptInput<typeof NpmOptions>
export type NpmInput = RegistryScriptInput<typeof NpmOptions, true, true>

export function useScriptNpm<T extends Record<string | symbol, any>>(_options: NpmInput) {
// TODO support multiple providers? (e.g. jsdelivr, cdnjs, etc.) Only unpkg for now
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ const emptyOptions = object({})

export type EmptyOptionsSchema = typeof emptyOptions

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

export interface RegistryScript {
Expand Down

0 comments on commit dfec3b4

Please sign in to comment.