sveltekit_helpers.ts

Declarations
#

8 declarations

view source

has_sveltekit_app
#

sveltekit_helpers.ts view source

(svelte_config_path?: string): Promise<Result<object, { message: string; }>>

svelte_config_path

type string
default SVELTE_CONFIG_FILENAME

returns

Promise<Result<object, { message: string; }>>

has_sveltekit_library
#

sveltekit_helpers.ts view source

(package_json: { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }, svelte_config?: ParsedSvelteConfig, dep_name?: string): Promise<...>

package_json

type { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }

svelte_config

default default_svelte_config

dep_name

type string
default SVELTE_PACKAGE_DEP_NAME

returns

Promise<Result<object, { message: string; }>>

map_sveltekit_aliases
#

sveltekit_helpers.ts view source

(specifier: string, aliases: [string, string][]): string

Map an import specifier with the SvelteKit aliases.

specifier

type string

aliases

type [string, string][]

returns

string

run_svelte_package
#

sveltekit_helpers.ts view source

(package_json: { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }, options: SveltePackageOptions | undefined, cli: string | Cli, log: Logger, pm_cli: string): Promise<...>

package_json

type { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }

options

type SveltePackageOptions | undefined

cli

type string | Cli

log

type Logger

pm_cli

type string

returns

Promise<void>

sveltekit_sync
#

sveltekit_helpers.ts view source

(sveltekit_cli?: string | Cli, pm_cli?: string): Promise<void>

sveltekit_cli

type string | Cli
default SVELTEKIT_CLI

pm_cli

type string
default PM_CLI_DEFAULT

returns

Promise<void>

sveltekit_sync_if_available
#

sveltekit_helpers.ts view source

(sveltekit_cli?: string | Cli): Promise<void>

If the SvelteKit CLI is found and its .svelte-kit directory is not, run svelte-kit sync.

sveltekit_cli

type string | Cli
default SVELTEKIT_CLI

returns

Promise<void>

sveltekit_sync_if_obviously_needed
#

sveltekit_helpers.ts view source

(sveltekit_cli?: string | Cli): Promise<void>

If the SvelteKit CLI is found and its .svelte-kit directory is not, run svelte-kit sync.

sveltekit_cli

type string | Cli
default SVELTEKIT_CLI

returns

Promise<void>

SveltePackageOptions
#

sveltekit_helpers.ts view source

SveltePackageOptions

Options to the SvelteKit packaging CLI.

see also

watch

Watch files in src/lib for changes and rebuild the package

type boolean

w

Alias for watch.

type boolean

input

The input directory which contains all the files of the package. Defaults to src/lib

type string

i

Alias for input.

type string

output

The output directory where the processed files are written to. Your package.json's exports should point to files inside there, and the files array should include that folder. Defaults to dist

type string

o

Alias for output.

type string

types

Whether or not to create type definitions (d.ts files). We strongly recommend doing this as it fosters ecosystem library quality. Defaults to true

type boolean

t

Alias for types.

type boolean

tsconfig

The path to a tsconfig or jsconfig. When not provided, searches for the next upper tsconfig/jsconfig in the workspace path.

type string

Depends on
#

Imported by
#