@gigadrive/network-config 5.3.1 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ interface NormalizedImagePolicy {
32
32
  variants: Record<string, NormalizedImageVariant>;
33
33
  }
34
34
 
35
- declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node-22", "node-20", "node-18", "node-16", "bun-1"];
35
+ declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "ruby-40", "ruby-34", "ruby-33", "node-22", "node-20", "node-18", "node-16", "bun-1"];
36
36
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
37
37
 
38
38
  type UpstashAWSRegion = 'us-east-1' | 'us-east-2' | 'us-west-1' | 'us-west-2' | 'eu-central-1' | 'eu-west-1' | 'eu-west-2' | 'sa-east-1' | 'ap-south-1' | 'ap-northeast-1' | 'ap-southeast-1' | 'ap-southeast-2';
@@ -32,7 +32,7 @@ interface NormalizedImagePolicy {
32
32
  variants: Record<string, NormalizedImageVariant>;
33
33
  }
34
34
 
35
- declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node-22", "node-20", "node-18", "node-16", "bun-1"];
35
+ declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "ruby-40", "ruby-34", "ruby-33", "node-22", "node-20", "node-18", "node-16", "bun-1"];
36
36
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
37
37
 
38
38
  type UpstashAWSRegion = 'us-east-1' | 'us-east-2' | 'us-west-1' | 'us-west-2' | 'eu-central-1' | 'eu-west-1' | 'eu-west-2' | 'sa-east-1' | 'ap-south-1' | 'ap-northeast-1' | 'ap-southeast-1' | 'ap-southeast-2';
package/dist/index.d.mts CHANGED
@@ -693,7 +693,7 @@ declare const REGION_DEFINITIONS: readonly ["us-east-1", "us-east-2", "us-west-1
693
693
  type Region = (typeof REGION_DEFINITIONS)[number];
694
694
  declare const AVAILABLE_REGIONS: Region[];
695
695
 
696
- declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node-22", "node-20", "node-18", "node-16", "bun-1"];
696
+ declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "ruby-40", "ruby-34", "ruby-33", "node-22", "node-20", "node-18", "node-16", "bun-1"];
697
697
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
698
698
  declare const AVAILABLE_RUNTIMES: Runtime[];
699
699
 
@@ -1735,15 +1735,19 @@ declare const FrameworkNotDetectedError_base: Schema.TaggedErrorClass<FrameworkN
1735
1735
  declare class FrameworkNotDetectedError extends FrameworkNotDetectedError_base {
1736
1736
  }
1737
1737
  interface FrameworkDetectionItem {
1738
- /** Check manifest dependencies for this package (routed by framework language) */
1738
+ /**
1739
+ * Check manifest dependencies for this package (routed by framework language):
1740
+ * `package.json` for Node, `composer.json` for PHP, and `Gemfile.lock` (or
1741
+ * `Gemfile` without a lockfile) for Ruby.
1742
+ */
1739
1743
  matchPackage?: string;
1740
1744
  /** Check if this file exists (relative to project root) */
1741
1745
  path?: string;
1742
1746
  /** If path is set, also check file content matches this regex */
1743
1747
  matchContent?: string;
1744
1748
  }
1745
- type FrameworkLanguage = 'node' | 'php';
1746
- type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'composer';
1749
+ type FrameworkLanguage = 'node' | 'php' | 'ruby';
1750
+ type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'composer' | 'bundler';
1747
1751
  interface FrameworkDefinition {
1748
1752
  slug: string;
1749
1753
  name: string;
@@ -1841,9 +1845,93 @@ declare const detectFramework: (projectFolder: string) => Effect.Effect<{
1841
1845
  */
1842
1846
  declare const detectPackageManager: (projectFolder: string) => Effect.Effect<PackageManager, never, FileSystem.FileSystem | Path.Path>;
1843
1847
 
1848
+ /**
1849
+ * The runtime every Ruby preset declares until the project names a Ruby
1850
+ * version: Ruby 3.4, which more gems support today than Ruby 4.0.
1851
+ */
1852
+ declare const DEFAULT_RUBY_RUNTIME: Runtime;
1853
+ /**
1854
+ * Picks the Ruby runtime for a concrete version, such as the contents of
1855
+ * `.ruby-version`: the runtime of the same minor series, otherwise the newest
1856
+ * runtime older than the version. A version older than every runtime (`3.2.2`)
1857
+ * gets the oldest one, `ruby-33`, and one newer than every runtime gets
1858
+ * `ruby-40`.
1859
+ *
1860
+ * @param version - The version, e.g. `3.3.6`, `ruby-3.4.1` or `3.3.6p108`.
1861
+ * @returns The runtime, or `undefined` when the version cannot be parsed.
1862
+ *
1863
+ * @example
1864
+ * ```ts
1865
+ * rubyRuntimeForVersion('3.3.6'); // 'ruby-33'
1866
+ * rubyRuntimeForVersion('3.2.2'); // 'ruby-33'
1867
+ * rubyRuntimeForVersion('4.1.0'); // 'ruby-40'
1868
+ * ```
1869
+ */
1870
+ declare const rubyRuntimeForVersion: (version: string) => Runtime | undefined;
1871
+ /**
1872
+ * Picks the Ruby runtime for a RubyGems requirement, such as a Gemfile `ruby`
1873
+ * directive. An exact version (`3.3.6` or `= 3.3.6`) is a concrete version
1874
+ * ({@link rubyRuntimeForVersion}); any other requirement picks the newest
1875
+ * runtime whose newest patch release it allows, so `~> 3.3` picks `ruby-34`
1876
+ * and `>= 3.2` picks `ruby-40`.
1877
+ *
1878
+ * @param requirement - The requirement, e.g. `~> 3.3` or `>= 3.2, < 3.4`.
1879
+ * @returns The runtime, or `undefined` when the requirement cannot be parsed
1880
+ * or allows no runtime.
1881
+ */
1882
+ declare const rubyRuntimeForRequirement: (requirement: string) => Runtime | undefined;
1883
+ /**
1884
+ * Picks the Ruby runtime a project asks for, from file contents the caller
1885
+ * supplies. Pure and synchronous, so a build can choose its Ruby with exactly
1886
+ * the rules the presets use; {@link detectRubyRuntime} is the same function
1887
+ * over the Effect file system. The first of these that names a usable version
1888
+ * wins:
1889
+ *
1890
+ * 1. `.ruby-version` (`3.3.6`, `ruby-3.3.6`, `3.3`; trailing whitespace and
1891
+ * anything after a space ignored)
1892
+ * 2. `.tool-versions` (`ruby 3.3.6`)
1893
+ * 3. the Gemfile `ruby` directive (`ruby "3.3.6"`, `ruby "~> 3.3"`,
1894
+ * `ruby ">= 3.2", "< 4.0"`, or `ruby file: ".ruby-version"`, whose file is
1895
+ * read through `readFile`)
1896
+ * 4. the `RUBY VERSION` a `Gemfile.lock` records (`ruby 3.3.6p108`)
1897
+ *
1898
+ * Concrete versions map with {@link rubyRuntimeForVersion} and requirements
1899
+ * with {@link rubyRuntimeForRequirement}. A source naming no usable version is
1900
+ * skipped.
1901
+ *
1902
+ * @param readFile - Returns the content of a project-relative file, or
1903
+ * `undefined` when it is missing or unreadable.
1904
+ * @returns The runtime, or `undefined` when the project names no usable
1905
+ * version, in which case callers use {@link DEFAULT_RUBY_RUNTIME}.
1906
+ *
1907
+ * @example
1908
+ * ```ts
1909
+ * const runtime =
1910
+ * rubyRuntimeFromProjectFiles((file) => files.get(file)) ?? DEFAULT_RUBY_RUNTIME;
1911
+ * ```
1912
+ */
1913
+ declare const rubyRuntimeFromProjectFiles: (readFile: (relativePath: string) => string | undefined) => Runtime | undefined;
1914
+ /**
1915
+ * Picks the Ruby runtime a project asks for by reading its files with the
1916
+ * Effect file system and handing them to {@link rubyRuntimeFromProjectFiles},
1917
+ * so presets and builds share one implementation. Missing or unreadable files
1918
+ * are skipped, never an error.
1919
+ *
1920
+ * The runtime of a static Ruby preset (Jekyll, Bridgetown) appears nowhere in
1921
+ * the generated config, since it has no function, so a build that needs to
1922
+ * choose its Ruby calls this (or {@link rubyRuntimeFromProjectFiles}) directly.
1923
+ *
1924
+ * @param projectFolder - Absolute path to the project root
1925
+ * @returns The runtime, or `undefined` when the project names no usable version.
1926
+ */
1927
+ declare const detectRubyRuntime: (projectFolder: string) => Effect.Effect<"php-84" | "php-83" | "php-81" | "ruby-40" | "ruby-34" | "ruby-33" | "node-22" | "node-20" | "node-18" | "node-16" | "bun-1" | undefined, never, FileSystem.FileSystem | Path.Path>;
1928
+
1844
1929
  /**
1845
1930
  * All supported framework definitions, sorted by priority descending.
1846
- * Higher priority frameworks are checked first during detection.
1931
+ * Higher priority frameworks are checked first during detection. Every PHP
1932
+ * preset picks its runtime from `composer.json` `require.php`
1933
+ * ({@link withComposerPhpRuntime}), and every Ruby preset from the project's
1934
+ * Ruby version ({@link withRubyRuntime}).
1847
1935
  */
1848
1936
  declare const FRAMEWORK_DEFINITIONS: FrameworkDefinition[];
1849
1937
 
@@ -1900,7 +1988,9 @@ declare const mergeWithFrameworkDefaults: (userConfig: NormalizedConfig, framewo
1900
1988
 
1901
1989
  /**
1902
1990
  * Reads dependency names from the appropriate manifest file for a language.
1903
- * Returns a set of all dependency names (production + dev).
1991
+ * Returns a set of all dependency names (production + dev). For Ruby these are
1992
+ * the gems in `Gemfile.lock`, including transitive ones, or the gems the
1993
+ * `Gemfile` declares when there is no lockfile.
1904
1994
  *
1905
1995
  * If the manifest file does not exist, returns an empty set (graceful).
1906
1996
  * If the file exists but cannot be read (`ManifestReadError`) or parsed
@@ -1923,4 +2013,4 @@ declare const filterFunctionsFromAssets: (config: NormalizedConfig) => Normalize
1923
2013
 
1924
2014
  declare const NetworkConfigLive: Layer.Layer<ConfigModuleLoader | RawConfigReader | SchemaValidator | V4ConfigParser | VercelBuildOutputParser, never, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path>;
1925
2015
 
1926
- export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, COMPOSE_FILE_NAMES, CONTAINER_ENTRYPOINT_PREFIX, CONTAINER_RUNTIME, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigModuleLoadError, ConfigModuleLoader, ConfigSchemaValidationError, type ConfigV4, type ConfigV4Container, type ConfigV4ContainerBuild, type ConfigV4FunctionSettings, type ConfigV4Queue, type ConfigV4QueueDuration, type ConfigV4QueueSchedule, type ConfigV4Service, type ConfigV4ServicePostgres, type ConfigV4ServiceRedis, type ConfigV4ServiceStorage, type ConfigV4Services, type ConfigV4StorageBucket, ConfigVersionError, ContainerConfigError, type ContainerProjectDetection, type ContainerRuntime, DEFAULT_CONTAINER_MEMORY_MB, DEFAULT_FUNCTION_DURATION_SECONDS, DEFAULT_SIDECAR_MEMORY_MB, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, type GigadriveNextBuildManifest, GigadriveNextBuildManifestSchema, type GigadriveNextBuildManifestV1, GigadriveNextBuildManifestV1Schema, type GigadriveNextBuildManifestV2, type GigadriveNextBuildManifestV2Export, GigadriveNextBuildManifestV2ExportSchema, type GigadriveNextBuildManifestV2Standalone, GigadriveNextBuildManifestV2StandaloneSchema, type GigadriveNextMiddlewareDescriptor, GigadriveNextMiddlewareDescriptorSchema, type GigadriveNextMiddlewareMatcher, GigadriveNextMiddlewareMatcherSchema, type GigadriveNextPrerenderManifestV1, GigadriveNextPrerenderManifestV1Schema, type GigadriveNextPrerenderOutput, GigadriveNextPrerenderOutputSchema, type GigadriveNextPrerenderSeedMethods, GigadriveNextPrerenderSeedMethodsSchema, type GigadriveNextRouteCondition, GigadriveNextRouteConditionSchema, type GigadriveNextServerDescriptor, GigadriveNextServerDescriptorSchema, type GigadriveNextStaticAssetPrefix, GigadriveNextStaticAssetPrefixSchema, type JsonValue, MAX_FUNCTION_DURATION_SECONDS, MAX_SIDECARS, ManifestNotFoundError, ManifestParseError, ManifestReadError, type NeonAWSRegion, NetworkConfigLive, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigQueue, type NormalizedConfigQueueSchedule, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServiceDefinition, type NormalizedConfigServicePostgres, type NormalizedConfigServiceQueues, type NormalizedConfigServiceRedis, type NormalizedConfigServiceStorage, type NormalizedConfigServiceType, type NormalizedConfigStorageBucket, type NormalizedContainerImageSource, type NormalizedContainerSpec, type NormalizedFramework, type NormalizedImageFit, type NormalizedImageFormat, type NormalizedImageLocalPattern, type NormalizedImagePolicy, type NormalizedImageRemotePattern, type NormalizedImageVariant, type NormalizedNextjsFramework, type NormalizedSharedArtifact, type NormalizedSidecar, type PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type StaticAssetHeaders, StaticAssetHeadersSchema, type StaticAssetManifest, type StaticAssetManifestEntry, StaticAssetManifestEntrySchema, type StaticAssetManifestV1, StaticAssetManifestV1Schema, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, collectAssetFiles, composeDeclaresApp, containerEntrypointPath, defineConfig, detectContainerProject, detectFramework, detectPackageManager, dockerFunctionContainerName, filterFunctionsFromAssets, generateConfig, generatedSecret, getFunctionSettings, mergeWithFrameworkDefaults, normalizeContainers, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, parseGigadriveNextPrerenderManifest, parseStaticAssetManifest, postProcessConfig, readComposeContainers, readDependencies, splitCommandWords };
2016
+ export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, COMPOSE_FILE_NAMES, CONTAINER_ENTRYPOINT_PREFIX, CONTAINER_RUNTIME, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigModuleLoadError, ConfigModuleLoader, ConfigSchemaValidationError, type ConfigV4, type ConfigV4Container, type ConfigV4ContainerBuild, type ConfigV4FunctionSettings, type ConfigV4Queue, type ConfigV4QueueDuration, type ConfigV4QueueSchedule, type ConfigV4Service, type ConfigV4ServicePostgres, type ConfigV4ServiceRedis, type ConfigV4ServiceStorage, type ConfigV4Services, type ConfigV4StorageBucket, ConfigVersionError, ContainerConfigError, type ContainerProjectDetection, type ContainerRuntime, DEFAULT_CONTAINER_MEMORY_MB, DEFAULT_FUNCTION_DURATION_SECONDS, DEFAULT_RUBY_RUNTIME, DEFAULT_SIDECAR_MEMORY_MB, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, type GigadriveNextBuildManifest, GigadriveNextBuildManifestSchema, type GigadriveNextBuildManifestV1, GigadriveNextBuildManifestV1Schema, type GigadriveNextBuildManifestV2, type GigadriveNextBuildManifestV2Export, GigadriveNextBuildManifestV2ExportSchema, type GigadriveNextBuildManifestV2Standalone, GigadriveNextBuildManifestV2StandaloneSchema, type GigadriveNextMiddlewareDescriptor, GigadriveNextMiddlewareDescriptorSchema, type GigadriveNextMiddlewareMatcher, GigadriveNextMiddlewareMatcherSchema, type GigadriveNextPrerenderManifestV1, GigadriveNextPrerenderManifestV1Schema, type GigadriveNextPrerenderOutput, GigadriveNextPrerenderOutputSchema, type GigadriveNextPrerenderSeedMethods, GigadriveNextPrerenderSeedMethodsSchema, type GigadriveNextRouteCondition, GigadriveNextRouteConditionSchema, type GigadriveNextServerDescriptor, GigadriveNextServerDescriptorSchema, type GigadriveNextStaticAssetPrefix, GigadriveNextStaticAssetPrefixSchema, type JsonValue, MAX_FUNCTION_DURATION_SECONDS, MAX_SIDECARS, ManifestNotFoundError, ManifestParseError, ManifestReadError, type NeonAWSRegion, NetworkConfigLive, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigQueue, type NormalizedConfigQueueSchedule, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServiceDefinition, type NormalizedConfigServicePostgres, type NormalizedConfigServiceQueues, type NormalizedConfigServiceRedis, type NormalizedConfigServiceStorage, type NormalizedConfigServiceType, type NormalizedConfigStorageBucket, type NormalizedContainerImageSource, type NormalizedContainerSpec, type NormalizedFramework, type NormalizedImageFit, type NormalizedImageFormat, type NormalizedImageLocalPattern, type NormalizedImagePolicy, type NormalizedImageRemotePattern, type NormalizedImageVariant, type NormalizedNextjsFramework, type NormalizedSharedArtifact, type NormalizedSidecar, type PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type StaticAssetHeaders, StaticAssetHeadersSchema, type StaticAssetManifest, type StaticAssetManifestEntry, StaticAssetManifestEntrySchema, type StaticAssetManifestV1, StaticAssetManifestV1Schema, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, collectAssetFiles, composeDeclaresApp, containerEntrypointPath, defineConfig, detectContainerProject, detectFramework, detectPackageManager, detectRubyRuntime, dockerFunctionContainerName, filterFunctionsFromAssets, generateConfig, generatedSecret, getFunctionSettings, mergeWithFrameworkDefaults, normalizeContainers, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, parseGigadriveNextPrerenderManifest, parseStaticAssetManifest, postProcessConfig, readComposeContainers, readDependencies, rubyRuntimeForRequirement, rubyRuntimeForVersion, rubyRuntimeFromProjectFiles, splitCommandWords };
package/dist/index.d.ts CHANGED
@@ -693,7 +693,7 @@ declare const REGION_DEFINITIONS: readonly ["us-east-1", "us-east-2", "us-west-1
693
693
  type Region = (typeof REGION_DEFINITIONS)[number];
694
694
  declare const AVAILABLE_REGIONS: Region[];
695
695
 
696
- declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "node-22", "node-20", "node-18", "node-16", "bun-1"];
696
+ declare const RUNTIME_DEFINITIONS: readonly ["php-84", "php-83", "php-81", "ruby-40", "ruby-34", "ruby-33", "node-22", "node-20", "node-18", "node-16", "bun-1"];
697
697
  type Runtime = (typeof RUNTIME_DEFINITIONS)[number];
698
698
  declare const AVAILABLE_RUNTIMES: Runtime[];
699
699
 
@@ -1735,15 +1735,19 @@ declare const FrameworkNotDetectedError_base: Schema.TaggedErrorClass<FrameworkN
1735
1735
  declare class FrameworkNotDetectedError extends FrameworkNotDetectedError_base {
1736
1736
  }
1737
1737
  interface FrameworkDetectionItem {
1738
- /** Check manifest dependencies for this package (routed by framework language) */
1738
+ /**
1739
+ * Check manifest dependencies for this package (routed by framework language):
1740
+ * `package.json` for Node, `composer.json` for PHP, and `Gemfile.lock` (or
1741
+ * `Gemfile` without a lockfile) for Ruby.
1742
+ */
1739
1743
  matchPackage?: string;
1740
1744
  /** Check if this file exists (relative to project root) */
1741
1745
  path?: string;
1742
1746
  /** If path is set, also check file content matches this regex */
1743
1747
  matchContent?: string;
1744
1748
  }
1745
- type FrameworkLanguage = 'node' | 'php';
1746
- type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'composer';
1749
+ type FrameworkLanguage = 'node' | 'php' | 'ruby';
1750
+ type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'composer' | 'bundler';
1747
1751
  interface FrameworkDefinition {
1748
1752
  slug: string;
1749
1753
  name: string;
@@ -1841,9 +1845,93 @@ declare const detectFramework: (projectFolder: string) => Effect.Effect<{
1841
1845
  */
1842
1846
  declare const detectPackageManager: (projectFolder: string) => Effect.Effect<PackageManager, never, FileSystem.FileSystem | Path.Path>;
1843
1847
 
1848
+ /**
1849
+ * The runtime every Ruby preset declares until the project names a Ruby
1850
+ * version: Ruby 3.4, which more gems support today than Ruby 4.0.
1851
+ */
1852
+ declare const DEFAULT_RUBY_RUNTIME: Runtime;
1853
+ /**
1854
+ * Picks the Ruby runtime for a concrete version, such as the contents of
1855
+ * `.ruby-version`: the runtime of the same minor series, otherwise the newest
1856
+ * runtime older than the version. A version older than every runtime (`3.2.2`)
1857
+ * gets the oldest one, `ruby-33`, and one newer than every runtime gets
1858
+ * `ruby-40`.
1859
+ *
1860
+ * @param version - The version, e.g. `3.3.6`, `ruby-3.4.1` or `3.3.6p108`.
1861
+ * @returns The runtime, or `undefined` when the version cannot be parsed.
1862
+ *
1863
+ * @example
1864
+ * ```ts
1865
+ * rubyRuntimeForVersion('3.3.6'); // 'ruby-33'
1866
+ * rubyRuntimeForVersion('3.2.2'); // 'ruby-33'
1867
+ * rubyRuntimeForVersion('4.1.0'); // 'ruby-40'
1868
+ * ```
1869
+ */
1870
+ declare const rubyRuntimeForVersion: (version: string) => Runtime | undefined;
1871
+ /**
1872
+ * Picks the Ruby runtime for a RubyGems requirement, such as a Gemfile `ruby`
1873
+ * directive. An exact version (`3.3.6` or `= 3.3.6`) is a concrete version
1874
+ * ({@link rubyRuntimeForVersion}); any other requirement picks the newest
1875
+ * runtime whose newest patch release it allows, so `~> 3.3` picks `ruby-34`
1876
+ * and `>= 3.2` picks `ruby-40`.
1877
+ *
1878
+ * @param requirement - The requirement, e.g. `~> 3.3` or `>= 3.2, < 3.4`.
1879
+ * @returns The runtime, or `undefined` when the requirement cannot be parsed
1880
+ * or allows no runtime.
1881
+ */
1882
+ declare const rubyRuntimeForRequirement: (requirement: string) => Runtime | undefined;
1883
+ /**
1884
+ * Picks the Ruby runtime a project asks for, from file contents the caller
1885
+ * supplies. Pure and synchronous, so a build can choose its Ruby with exactly
1886
+ * the rules the presets use; {@link detectRubyRuntime} is the same function
1887
+ * over the Effect file system. The first of these that names a usable version
1888
+ * wins:
1889
+ *
1890
+ * 1. `.ruby-version` (`3.3.6`, `ruby-3.3.6`, `3.3`; trailing whitespace and
1891
+ * anything after a space ignored)
1892
+ * 2. `.tool-versions` (`ruby 3.3.6`)
1893
+ * 3. the Gemfile `ruby` directive (`ruby "3.3.6"`, `ruby "~> 3.3"`,
1894
+ * `ruby ">= 3.2", "< 4.0"`, or `ruby file: ".ruby-version"`, whose file is
1895
+ * read through `readFile`)
1896
+ * 4. the `RUBY VERSION` a `Gemfile.lock` records (`ruby 3.3.6p108`)
1897
+ *
1898
+ * Concrete versions map with {@link rubyRuntimeForVersion} and requirements
1899
+ * with {@link rubyRuntimeForRequirement}. A source naming no usable version is
1900
+ * skipped.
1901
+ *
1902
+ * @param readFile - Returns the content of a project-relative file, or
1903
+ * `undefined` when it is missing or unreadable.
1904
+ * @returns The runtime, or `undefined` when the project names no usable
1905
+ * version, in which case callers use {@link DEFAULT_RUBY_RUNTIME}.
1906
+ *
1907
+ * @example
1908
+ * ```ts
1909
+ * const runtime =
1910
+ * rubyRuntimeFromProjectFiles((file) => files.get(file)) ?? DEFAULT_RUBY_RUNTIME;
1911
+ * ```
1912
+ */
1913
+ declare const rubyRuntimeFromProjectFiles: (readFile: (relativePath: string) => string | undefined) => Runtime | undefined;
1914
+ /**
1915
+ * Picks the Ruby runtime a project asks for by reading its files with the
1916
+ * Effect file system and handing them to {@link rubyRuntimeFromProjectFiles},
1917
+ * so presets and builds share one implementation. Missing or unreadable files
1918
+ * are skipped, never an error.
1919
+ *
1920
+ * The runtime of a static Ruby preset (Jekyll, Bridgetown) appears nowhere in
1921
+ * the generated config, since it has no function, so a build that needs to
1922
+ * choose its Ruby calls this (or {@link rubyRuntimeFromProjectFiles}) directly.
1923
+ *
1924
+ * @param projectFolder - Absolute path to the project root
1925
+ * @returns The runtime, or `undefined` when the project names no usable version.
1926
+ */
1927
+ declare const detectRubyRuntime: (projectFolder: string) => Effect.Effect<"php-84" | "php-83" | "php-81" | "ruby-40" | "ruby-34" | "ruby-33" | "node-22" | "node-20" | "node-18" | "node-16" | "bun-1" | undefined, never, FileSystem.FileSystem | Path.Path>;
1928
+
1844
1929
  /**
1845
1930
  * All supported framework definitions, sorted by priority descending.
1846
- * Higher priority frameworks are checked first during detection.
1931
+ * Higher priority frameworks are checked first during detection. Every PHP
1932
+ * preset picks its runtime from `composer.json` `require.php`
1933
+ * ({@link withComposerPhpRuntime}), and every Ruby preset from the project's
1934
+ * Ruby version ({@link withRubyRuntime}).
1847
1935
  */
1848
1936
  declare const FRAMEWORK_DEFINITIONS: FrameworkDefinition[];
1849
1937
 
@@ -1900,7 +1988,9 @@ declare const mergeWithFrameworkDefaults: (userConfig: NormalizedConfig, framewo
1900
1988
 
1901
1989
  /**
1902
1990
  * Reads dependency names from the appropriate manifest file for a language.
1903
- * Returns a set of all dependency names (production + dev).
1991
+ * Returns a set of all dependency names (production + dev). For Ruby these are
1992
+ * the gems in `Gemfile.lock`, including transitive ones, or the gems the
1993
+ * `Gemfile` declares when there is no lockfile.
1904
1994
  *
1905
1995
  * If the manifest file does not exist, returns an empty set (graceful).
1906
1996
  * If the file exists but cannot be read (`ManifestReadError`) or parsed
@@ -1923,4 +2013,4 @@ declare const filterFunctionsFromAssets: (config: NormalizedConfig) => Normalize
1923
2013
 
1924
2014
  declare const NetworkConfigLive: Layer.Layer<ConfigModuleLoader | RawConfigReader | SchemaValidator | V4ConfigParser | VercelBuildOutputParser, never, _effect_platform_FileSystem.FileSystem | _effect_platform_Path.Path>;
1925
2015
 
1926
- export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, COMPOSE_FILE_NAMES, CONTAINER_ENTRYPOINT_PREFIX, CONTAINER_RUNTIME, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigModuleLoadError, ConfigModuleLoader, ConfigSchemaValidationError, type ConfigV4, type ConfigV4Container, type ConfigV4ContainerBuild, type ConfigV4FunctionSettings, type ConfigV4Queue, type ConfigV4QueueDuration, type ConfigV4QueueSchedule, type ConfigV4Service, type ConfigV4ServicePostgres, type ConfigV4ServiceRedis, type ConfigV4ServiceStorage, type ConfigV4Services, type ConfigV4StorageBucket, ConfigVersionError, ContainerConfigError, type ContainerProjectDetection, type ContainerRuntime, DEFAULT_CONTAINER_MEMORY_MB, DEFAULT_FUNCTION_DURATION_SECONDS, DEFAULT_SIDECAR_MEMORY_MB, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, type GigadriveNextBuildManifest, GigadriveNextBuildManifestSchema, type GigadriveNextBuildManifestV1, GigadriveNextBuildManifestV1Schema, type GigadriveNextBuildManifestV2, type GigadriveNextBuildManifestV2Export, GigadriveNextBuildManifestV2ExportSchema, type GigadriveNextBuildManifestV2Standalone, GigadriveNextBuildManifestV2StandaloneSchema, type GigadriveNextMiddlewareDescriptor, GigadriveNextMiddlewareDescriptorSchema, type GigadriveNextMiddlewareMatcher, GigadriveNextMiddlewareMatcherSchema, type GigadriveNextPrerenderManifestV1, GigadriveNextPrerenderManifestV1Schema, type GigadriveNextPrerenderOutput, GigadriveNextPrerenderOutputSchema, type GigadriveNextPrerenderSeedMethods, GigadriveNextPrerenderSeedMethodsSchema, type GigadriveNextRouteCondition, GigadriveNextRouteConditionSchema, type GigadriveNextServerDescriptor, GigadriveNextServerDescriptorSchema, type GigadriveNextStaticAssetPrefix, GigadriveNextStaticAssetPrefixSchema, type JsonValue, MAX_FUNCTION_DURATION_SECONDS, MAX_SIDECARS, ManifestNotFoundError, ManifestParseError, ManifestReadError, type NeonAWSRegion, NetworkConfigLive, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigQueue, type NormalizedConfigQueueSchedule, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServiceDefinition, type NormalizedConfigServicePostgres, type NormalizedConfigServiceQueues, type NormalizedConfigServiceRedis, type NormalizedConfigServiceStorage, type NormalizedConfigServiceType, type NormalizedConfigStorageBucket, type NormalizedContainerImageSource, type NormalizedContainerSpec, type NormalizedFramework, type NormalizedImageFit, type NormalizedImageFormat, type NormalizedImageLocalPattern, type NormalizedImagePolicy, type NormalizedImageRemotePattern, type NormalizedImageVariant, type NormalizedNextjsFramework, type NormalizedSharedArtifact, type NormalizedSidecar, type PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type StaticAssetHeaders, StaticAssetHeadersSchema, type StaticAssetManifest, type StaticAssetManifestEntry, StaticAssetManifestEntrySchema, type StaticAssetManifestV1, StaticAssetManifestV1Schema, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, collectAssetFiles, composeDeclaresApp, containerEntrypointPath, defineConfig, detectContainerProject, detectFramework, detectPackageManager, dockerFunctionContainerName, filterFunctionsFromAssets, generateConfig, generatedSecret, getFunctionSettings, mergeWithFrameworkDefaults, normalizeContainers, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, parseGigadriveNextPrerenderManifest, parseStaticAssetManifest, postProcessConfig, readComposeContainers, readDependencies, splitCommandWords };
2016
+ export { ALLOWED_CONFIG_NAMES, AVAILABLE_REGIONS, AVAILABLE_RUNTIMES, COMPOSE_FILE_NAMES, CONTAINER_ENTRYPOINT_PREFIX, CONTAINER_RUNTIME, type Config, ConfigFileEmptyError, ConfigFileNotFoundError, ConfigFileParseError, ConfigModuleLoadError, ConfigModuleLoader, ConfigSchemaValidationError, type ConfigV4, type ConfigV4Container, type ConfigV4ContainerBuild, type ConfigV4FunctionSettings, type ConfigV4Queue, type ConfigV4QueueDuration, type ConfigV4QueueSchedule, type ConfigV4Service, type ConfigV4ServicePostgres, type ConfigV4ServiceRedis, type ConfigV4ServiceStorage, type ConfigV4Services, type ConfigV4StorageBucket, ConfigVersionError, ContainerConfigError, type ContainerProjectDetection, type ContainerRuntime, DEFAULT_CONTAINER_MEMORY_MB, DEFAULT_FUNCTION_DURATION_SECONDS, DEFAULT_RUBY_RUNTIME, DEFAULT_SIDECAR_MEMORY_MB, type DetectionResult, FRAMEWORK_DEFINITIONS, type FilePathMap, type FrameworkDefaultConfig, type FrameworkDefinition, type FrameworkDetectionItem, type FrameworkLanguage, FrameworkNotDetectedError, FunctionConfigError, type GigadriveNextBuildManifest, GigadriveNextBuildManifestSchema, type GigadriveNextBuildManifestV1, GigadriveNextBuildManifestV1Schema, type GigadriveNextBuildManifestV2, type GigadriveNextBuildManifestV2Export, GigadriveNextBuildManifestV2ExportSchema, type GigadriveNextBuildManifestV2Standalone, GigadriveNextBuildManifestV2StandaloneSchema, type GigadriveNextMiddlewareDescriptor, GigadriveNextMiddlewareDescriptorSchema, type GigadriveNextMiddlewareMatcher, GigadriveNextMiddlewareMatcherSchema, type GigadriveNextPrerenderManifestV1, GigadriveNextPrerenderManifestV1Schema, type GigadriveNextPrerenderOutput, GigadriveNextPrerenderOutputSchema, type GigadriveNextPrerenderSeedMethods, GigadriveNextPrerenderSeedMethodsSchema, type GigadriveNextRouteCondition, GigadriveNextRouteConditionSchema, type GigadriveNextServerDescriptor, GigadriveNextServerDescriptorSchema, type GigadriveNextStaticAssetPrefix, GigadriveNextStaticAssetPrefixSchema, type JsonValue, MAX_FUNCTION_DURATION_SECONDS, MAX_SIDECARS, ManifestNotFoundError, ManifestParseError, ManifestReadError, type NeonAWSRegion, NetworkConfigLive, type NormalizedConfig, type NormalizedConfigEntrypoint, type NormalizedConfigQueue, type NormalizedConfigQueueSchedule, type NormalizedConfigRoute, type NormalizedConfigRouteHandler, type NormalizedConfigRouteMatchRequirements, type NormalizedConfigRouteMethod, type NormalizedConfigService, type NormalizedConfigServiceDefinition, type NormalizedConfigServicePostgres, type NormalizedConfigServiceQueues, type NormalizedConfigServiceRedis, type NormalizedConfigServiceStorage, type NormalizedConfigServiceType, type NormalizedConfigStorageBucket, type NormalizedContainerImageSource, type NormalizedContainerSpec, type NormalizedFramework, type NormalizedImageFit, type NormalizedImageFormat, type NormalizedImageLocalPattern, type NormalizedImagePolicy, type NormalizedImageRemotePattern, type NormalizedImageVariant, type NormalizedNextjsFramework, type NormalizedSharedArtifact, type NormalizedSidecar, type PackageManager, RawConfigReader, type Region, type Runtime, SchemaValidator, type StaticAssetHeaders, StaticAssetHeadersSchema, type StaticAssetManifest, type StaticAssetManifestEntry, StaticAssetManifestEntrySchema, type StaticAssetManifestV1, StaticAssetManifestV1Schema, type UpstashAWSRegion, V4ConfigParser, VercelBuildOutputParser, collectAssetFiles, composeDeclaresApp, containerEntrypointPath, defineConfig, detectContainerProject, detectFramework, detectPackageManager, detectRubyRuntime, dockerFunctionContainerName, filterFunctionsFromAssets, generateConfig, generatedSecret, getFunctionSettings, mergeWithFrameworkDefaults, normalizeContainers, parseConfig, parseConfigRaw, parseGigadriveNextBuildManifest, parseGigadriveNextPrerenderManifest, parseStaticAssetManifest, postProcessConfig, readComposeContainers, readDependencies, rubyRuntimeForRequirement, rubyRuntimeForVersion, rubyRuntimeFromProjectFiles, splitCommandWords };