0.0.16 • Published 8 months ago

@junobuild/config v0.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

npm license

Juno Config

Configuration options for Juno CLI.

:toolbox: Functions

:gear: defineDevConfig

FunctionType
defineDevConfig{ (config: JunoDevConfig): JunoDevConfig; (config: JunoDevConfigFn): JunoDevConfigFn; (config: JunoDevConfigFnOrObject): JunoDevConfigFnOrObject; }

:link: Source

:gear: defineDevConfig

FunctionType
defineDevConfig{ (config: JunoDevConfig): JunoDevConfig; (config: JunoDevConfigFn): JunoDevConfigFn; (config: JunoDevConfigFnOrObject): JunoDevConfigFnOrObject; }

:link: Source

:gear: defineDevConfig

FunctionType
defineDevConfig{ (config: JunoDevConfig): JunoDevConfig; (config: JunoDevConfigFn): JunoDevConfigFn; (config: JunoDevConfigFnOrObject): JunoDevConfigFnOrObject; }

:link: Source

:gear: defineDevConfig

FunctionType
defineDevConfig{ (config: JunoDevConfig): JunoDevConfig; (config: JunoDevConfigFn): JunoDevConfigFn; (config: JunoDevConfigFnOrObject): JunoDevConfigFnOrObject; }

:link: Source

:tropical_drink: Interfaces

:gear: OrbiterConfig

Represents the configuration for an orbiter.

PropertyTypeDescription
idstringThe identifier of the orbiter used in the dApp. type: {string}
orbiterIdstring or undefinedThe deprecated identifier of the orbiter. deprecated: orbiterId will be removed in the future. Use id instead.type: {string}

:gear: ModuleSettings

Settings for a module - Satellite, Mission Control or Orbiter.

These settings control various aspects of the module's behavior and resource usage.

PropertyTypeDescription
freezingThresholdbigint or undefinedThe cycle threshold below which the module will automatically stop to avoid running out of cycles. For example, if set to BigInt(1000000), the module will stop when it has fewer than 1,000,000 cycles remaining. type: {bigint}
reservedCyclesLimitbigint or undefinedThe number of cycles reserved for the module's operations to ensure it has enough cycles to function. For example, setting it to BigInt(5000000) reserves 5,000,000 cycles for the module. type: {bigint}
logVisibilityModuleLogVisibility or undefinedControls who can see the module's logs. type: {ModuleLogVisibility}
heapMemoryLimitbigint or undefinedThe maximum amount of WebAssembly (Wasm) memory the module can use on the heap. For example, setting it to BigInt(1024 * 1024 * 64) allows the module to use up to 64 MB of Wasm memory. type: {bigint}
memoryAllocationbigint or undefinedThe amount of memory explicitly allocated to the module. For example, setting it to BigInt(1024 * 1024 * 128) allocates 128 MB of memory to the module. type: {bigint}
computeAllocationbigint or undefinedThe proportion of compute capacity allocated to the module. This is a fraction of the total compute capacity of the subnet. For example, setting it to BigInt(10) allocates 10% of the compute capacity to the module. type: {bigint}

:gear: MaxMemorySizeConfig

Configuration for granting access to features only if the maximum memory size limits are not reached.

The maximum size corresponds to the overall heap or stable memory of the smart contract.

PropertyTypeDescription
heapbigint or undefinedMaximum allowed heap memory size in bytes. This field is optional. If not specified, no limit is enforced on the heap memory size. type: {bigint}
stablebigint or undefinedMaximum allowed stable memory size in bytes. This field is optional. If not specified, no limit is enforced on the stable memory size. type: {bigint}

:gear: StorageConfigHeader

Headers allow the client and the Storage to pass additional information along with a request or a response. Some sets of headers can affect how the browser handles the page and its content.

PropertyTypeDescription
sourcestringThe glob pattern used to match files within the Storage that these headers will apply to. type: {StorageConfigSourceGlob}
headers[string, string][]An array of key-value pairs representing the headers to apply. Each pair includes the header name and its value. Example: [["Cache-Control", "max-age=3600"], ["X-Custom-Header", "value"]] type: {Array<string, string>}

:gear: StorageConfigRewrite

You can utilize optional rewrites to display the same content for multiple URLs. Rewrites are especially useful when combined with pattern matching, allowing acceptance of any URL that matches the pattern.

PropertyTypeDescription
sourcestringThe glob pattern or specific path to match for incoming requests. Matches are rewritten to the specified destination. type: {StorageConfigSourceGlob}
destinationstringThe destination path or file to which matching requests should be rewritten. type: {string}

:gear: StorageConfigRedirect

Use a URL redirect to prevent broken links if you've moved a page or to shorten URLs.

PropertyTypeDescription
sourcestringThe glob pattern or specific path to match for incoming requests that should be redirected. type: {StorageConfigSourceGlob}
locationstringThe URL or path to which the request should be redirected. type: {string}
code301 or 302The HTTP status code to use for the redirect, typically 301 (permanent redirect) or 302 (temporary redirect). type: {301 or 302}

:gear: StorageConfig

Configures the hosting behavior of the Storage.

PropertyTypeDescription
headersStorageConfigHeader[] or undefinedOptional array of StorageConfigHeader objects to define custom HTTP headers for specific files or patterns. type: {StorageConfigHeader[]}optional
rewritesStorageConfigRewrite[] or undefinedOptional array of StorageConfigRewrite objects to define rewrite rules. type: {StorageConfigRewrite[]}optional
redirectsStorageConfigRedirect[] or undefinedOptional array of StorageConfigRedirect objects to define HTTP redirects. type: {StorageConfigRedirect[]}optional
iframe"deny" or "same-origin" or "allow-any" or undefinedFor security reasons and to prevent click-jacking attacks, dapps deployed with Juno are, by default, set to deny embedding in other sites. Options are: - deny: Prevents any content from being displayed in an iframe. - same-origin: Allows iframe content from the same origin as the page. - allow-any: Allows iframe content from any origin. If not specified, then deny is used as default value. type: {'deny' or 'same-origin' or 'allow-any'}optional
rawAccessboolean or undefinedOptional flag to enable access for raw URLs. ⚠️ WARNING: Enabling this option is highly discouraged due to security risks. Enabling this option allows access to raw URLs (e.g., https://satellite-id.raw.icp0.io), bypassing certificate validation. This creates a security vulnerability where a malicious node in the chain can respond to requests with malicious or invalid content. Since there is no validation on raw URLs, the client may receive and process harmful data. If not specified, the default value is false. type: {boolean}optional
maxMemorySizeMaxMemorySizeConfig or undefinedConfiguration for maximum memory size limits for the Storage. This is used to specify optional limits on heap and stable memory for the smart contract. When the limit is reached, the Storage and smart contract continue to operate normally but reject the upload of new assets. If not specified, no memory limits are enforced. type: {MaxMemorySizeConfig}optional

:gear: CliConfig

PropertyTypeDescription
sourcestring or undefinedSpecifies the directory from which to deploy to Storage. For instance, if npm run build outputs files to a dist folder, use source: 'dist'. default: 'build'type: {string}
ignorestring[] or undefinedSpecifies files or patterns to ignore during deployment, using glob patterns similar to those in .gitignore. type: {string[]}optional
gzipstring or false or undefinedControls the Gzip compression optimization for files in the source folder. By default, it targets JavaScript (js), ES Module (mjs), and CSS (css) files. You can disable this by setting it to false or customize it with a different file matching pattern using glob syntax. type: {string or false}optional
encoding[string, ENCODING_TYPE][] or undefinedCustomizes file encoding mapping for HTTP response headers Content-Encoding based on file extension: - .Z for compress, - .gz for gzip, - .br for brotli, - .zlib for deflate, - anything else defaults to identity. The "encoding" attribute allows overriding default mappings with an array of glob patterns and encoding types. type: {Array<string, ENCODING_TYPE>}optional
predeploystring[] or undefinedDefines a list of scripts or commands to be run before the deployment process begins. This can be useful for tasks such as compiling assets, running tests, or building production-ready files. Example: json { "predeploy": ["npm run build", "npm run lint"] } type: {string[]}optional
postdeploystring[] or undefinedDefines a list of scripts or commands to be run after the deployment process completes. This can be used for tasks such as notifications, cleanup, or sending confirmation messages to services or team members. Example: json { "postdeploy": ["./scripts/notify-admins.sh", "echo 'Deployment complete'"] } type: {string[]}optional

:gear: JunoConfigEnv

Represents the environment configuration for Juno.

PropertyTypeDescription
modestringThe mode of the Juno configuration. type: {JunoConfigMode}

:gear: SatelliteAssertions

Configuration for satellite assertions.

PropertyTypeDescription
heapMemorynumber or boolean or undefinedConfiguration for the heap memory size check, which can be: - true to enable the check with a default threshold of 900MB, - false to disable the heap memory size check, - A number to specify a custom threshold in MB (megabytes) for the heap memory size check. If not specified, then true is used as the default value. type: {number or boolean}

:gear: AuthenticationConfigInternetIdentity

Configure the behavior of Internet Identity.

PropertyTypeDescription
derivationOriginstring or undefinedThis setting ensures that users are recognized on your app, regardless of whether they use the default URL or any other custom domain. For example, if set to hello.com, a user signing on at https://hello.com will receive the same identifier (principal) as when signing on at https://www.hello.com. type: {string}optional

:gear: AuthenticationConfig

Configures the Authentication options of a Satellite.

PropertyTypeDescription
internetIdentityAuthenticationConfigInternetIdentity or undefinedOptional configuration of Internet Identity authentication method. type: {AuthenticationConfigInternetIdentity}optional

:gear: DatastoreConfig

Configures the behavior of the Datastore.

PropertyTypeDescription
maxMemorySizeMaxMemorySizeConfig or undefinedConfiguration for maximum memory size limits for the Datastore. This is used to specify optional limits on heap and stable memory for the smart contract. When the limit is reached, the Datastore and smart contract continue to operate normally but reject the creation or updates of documents. If not specified, no memory limits are enforced. type: {MaxMemorySizeConfig}optional

:gear: SatelliteId

Represents the unique identifier for a satellite.

PropertyTypeDescription
idstringThe unique identifier (ID) of the satellite for this application. type: {string}
satelliteIdstring or undefinedThe deprecated unique identifier (ID) of the satellite. deprecated: satelliteId will be removed in the future. Use id instead.type: {string}

:gear: SatelliteIds

Represents a mapping of satellite identifiers to different configurations based on the mode of the application.

PropertyTypeDescription
idsRecord<string, string>A mapping of satellite identifiers (IDs) to different configurations based on the mode of the application. This allows the application to use different satellite IDs, such as production, staging, etc. Example: { "production": "xo2hm-lqaaa-aaaal-ab3oa-cai", "staging": "gl6nx-5maaa-aaaaa-qaaqq-cai" } type: {Record<JunoConfigMode, string>}

:gear: SatelliteConfigOptions

SatelliteConfigOptions interface provides configuration settings that allow for fine-tuning the operational behavior of various aspects of a Satellite, such as storage, datastore, authentication, and deployment assertions.

These options affect specific modules of the Satellite and may require manual application of changes, typically through CLI commands (e.g., juno config).

PropertyTypeDescription
storageStorageConfig or undefinedOptional configuration parameters for the satellite, affecting the operational behavior of its Storage. Changes to these parameters must be applied manually afterwards, for example with the CLI using juno config commands. type: {StorageConfig}optional
datastoreDatastoreConfig or undefinedOptional configuration parameters for the satellite, affecting the operational behavior of its Datastore. Changes to these parameters must be applied manually afterwards, for example with the CLI using juno config commands. type: {DatastoreConfig}optional
authenticationAuthenticationConfig or undefinedOptional configuration parameters for the satellite, affecting the operational behavior of its Authentication. Changes to these parameters must be applied manually afterwards, for example with the CLI using juno config commands. type: {AuthenticationConfig}optional
assertionsSatelliteAssertions or undefinedOptional configurations to override default assertions made by the CLI regarding satellite deployment conditions. type: {SatelliteAssertions}optional
settingsModuleSettings or undefinedOptional configuration parameters for the Satellite. These settings control various aspects of the module's behavior and resource usage. type: {ModuleSettings}optional

:gear: JunoConfig

Represents the overall configuration for Juno.

PropertyTypeDescription
satelliteSatelliteConfigThe configuration for the satellite. type: {SatelliteConfig}
orbiterOrbiterConfig or undefinedThe optional configuration for the orbiter. type: {OrbiterConfig}optional

:gear: SatelliteDevCollections

Represents the collections configuration for a satellite in a development environment.

PropertyTypeDescription
datastoreSatelliteDevDataStoreCollection[] or undefinedThe Datastore collections configuration. type: {SatelliteDevDataStoreCollection[]}optional
dbSatelliteDevDataStoreCollection[] or undefinedThe Datastore collections configuration. This property is deprecated. Use {@link datastore} instead. deprecatedtype: {SatelliteDevDbCollection[]}
storageSatelliteDevStorageCollection[] or undefinedThe Storage collections configuration. type: {SatelliteDevStorageCollection[]}optional

:gear: SatelliteDevController

Represents a controller configuration for a satellite in a development environment.

PropertyTypeDescription
idstringThe unique identifier of the controller. type: {string}
scope"write" or "admin"The scope of the controller's permissions. type: {'write' or 'admin'}

:gear: SatelliteDevConfig

Represents the development configuration for a satellite.

PropertyTypeDescription
collectionsSatelliteDevCollectionsThe collections configuration. type: {SatelliteDevCollections}
controllersSatelliteDevController[] or undefinedThe optional controllers configuration. type: {SatelliteDevController[]}optional

:gear: JunoDevConfig

Represents the development configuration for Juno.

PropertyTypeDescription
satelliteSatelliteDevConfigThe development configuration for the satellite. type: {SatelliteDevConfig}

:cocktail: Types

:gear: ModuleLogVisibility

TypeType
ModuleLogVisibility'controllers' or 'public'

:link: Source

:gear: StorageConfigSourceGlob

TypeType
StorageConfigSourceGlob

:link: Source

:gear: ENCODING_TYPE

TypeType
ENCODING_TYPE'identity' or 'gzip' or 'compress' or 'deflate' or 'br'

:link: Source

:gear: JunoConfigMode

TypeType
JunoConfigMode'production' or string

:link: Source

:gear: SatelliteConfig

TypeType
SatelliteConfigEither<SatelliteId, SatelliteIds> and CliConfig and SatelliteConfigOptions

:link: Source

:gear: SatelliteDevDataStoreCollection

TypeType
SatelliteDevDataStoreCollectionOmit< Rule, 'createdAt' or 'updatedAt' or 'maxSize' or 'version' >

:link: Source

:gear: SatelliteDevDbCollection

TypeType
SatelliteDevDbCollectionSatelliteDevDataStoreCollection

:link: Source

:gear: SatelliteDevStorageCollection

TypeType
SatelliteDevStorageCollectionOmit< Rule, 'createdAt' or 'updatedAt' or 'maxCapacity' or 'version' >

:link: Source

:gear: JunoDevConfigFn

TypeType
JunoDevConfigFn() => JunoDevConfig

:link: Source

:gear: JunoDevConfigFnOrObject

TypeType
JunoDevConfigFnOrObjectJunoDevConfig or JunoDevConfigFn

:link: Source

License

MIT © David Dal Busco

0.0.15

8 months ago

0.0.16

8 months ago

0.0.10

1 year ago

0.0.11

11 months ago

0.0.12

11 months ago

0.0.13

11 months ago

0.0.14

11 months ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.3

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago