nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: nuxt/create-nuxt-app
Pull request #462 (2020-04-08 17:26:30)

fix: update prompts to add static in universal
Universal is not only for SSR and it is not clear for those who want to create a static site with create-nuxt-app. Adding the world static as explanation so you know to choose universal will help with this as not every makes the connection between static and universal


Patch:
diff --git a/packages/create-nuxt-app/lib/prompts.js b/packages/create-nuxt-app/lib/prompts.js
index 2a0f607..af29b9a 100644
--- a/packages/create-nuxt-app/lib/prompts.js
+++ b/packages/create-nuxt-app/lib/prompts.js
@@ -127,7 +127,7 @@ module.exports = [
     message: 'Choose rendering mode',
     type: 'list',
     choices: [
-      { name: 'Universal (SSR)', value: 'universal' },
+      { name: 'Universal (SSR / Static)', value: 'universal' },
       { name: 'Single Page App', value: 'spa' }
     ],
     default: 'universal'


Test patch:
diff --git a/packages/create-nuxt-app/test/snapshots/index.test.js.md b/packages/create-nuxt-app/test/snapshots/index.test.js.md
index df67b73..da6235b 100644
--- a/packages/create-nuxt-app/test/snapshots/index.test.js.md
+++ b/packages/create-nuxt-app/test/snapshots/index.test.js.md
@@ -1295,7 +1295,7 @@ Generated by [AVA](https://avajs.dev).
     }␊
     `
 
-## verify mode: Universal (SSR)
+## verify mode: Universal (SSR / Static)
 
 > Generated files
Repository: Deltares/Wflow.jl
Pull request #160 (2021-08-30 20:26:51)

fix get_alias for variables with expanded definition
After #154 the variables that had aliases could no longer also have modifiers in the TOML, since `get_alias` returned a Dict instead of a Config. This fixes that and adds tests.


Patch:
diff --git a/src/io.jl b/src/io.jl
index d77ae09bb..613cb226c 100644
--- a/src/io.jl
+++ b/src/io.jl
@@ -56,7 +56,12 @@ function Base.setproperty!(config::Config, f::Symbol, x)
 end
 
 function get_alias(config::Config, key, alias, default)
-    get(Dict(config), key, get(Dict(config), alias, default))
+    dict = Dict(config)
+    path = pathof(config)
+    alias_or_default = get(dict, alias, default)
+    a = get(dict, key, alias_or_default)
+    # if it is a Dict, wrap the result in Config
+    return a isa AbstractDict ? Config(a, path) : a
 end
 
 # also used in autocomplete
@@ -95,9 +100,13 @@ function ncvar_name_modifier(var; verbose = true)
             end
         elseif haskey(var, "value")
             modifier = (scale = 1.0, offset = 0.0, value = param(var, "value"))
+        else
+            error("Unrecognized modifier $(Dict(var))")
         end
-    else
+    elseif isa(var, String)
         ncname = var
+    else
+        error("Unknown type")
     end
     return ncname, modifier
 end


Test patch:
diff --git a/test/io.jl b/test/io.jl
index 6ab82d2f1..7a8a09cff 100644
--- a/test/io.jl
+++ b/test/io.jl
@@ -24,10 +24,19 @@ config = Wflow.Config(tomlpath)
     @test collect(keys(config.output)) == ["lateral", "vertical", "path"]
 
     # theta_s can also be provided under the alias θₛ
-    Wflow.get_alias(config.input.vertical, "theta_s", "θₛ", nothing) == "thetaR"
+    @test Wflow.get_alias(config.input.vertical, "theta_s", "θₛ", nothing) == "thetaS"
     val = pop!(config.input.vertical, "theta_s")
     config.input.vertical["θₛ"] = val
-    Wflow.get_alias(config.input.vertical, "theta_s", "θₛ", nothing) == "thetaR"
+    @test Wflow.get_alias(config.input.vertical, "theta_s", "θₛ", nothing) == "thetaS"
+
+    # modifiers can also be applied
+    kvconf = Wflow.get_alias(config.input.vertical, "kv_0", "kv₀", nothing)
+    @test kvconf isa Wflow.Config
+    ncname, modifier = Wflow.ncvar_name_modifier(kvconf)
+    @test ncname === "KsatVer"
+    @test modifier.scale == 1.0
+    @test modifier.offset == 0.0
+    @test modifier.value === nothing
 end
 
 @testset "Clock constructor" begin
diff --git a/test/sbm_config.toml b/test/sbm_config.toml
index 3172e4b80..9007c52eb 100644
--- a/test/sbm_config.toml
+++ b/test/sbm_config.toml
@@ -69,7 +69,6 @@ f = "f"
 infiltcappath = "InfiltCapPath"
 infiltcapsoil = "InfiltCapSoil"
 kext = "Kext"
-kv_0 = "KsatVer"
 leaf_area_index = "LAI"
 maxleakage = "MaxLeakage"
 pathfrac = "PathFrac"
@@ -89,6 +88,11 @@ waterfrac = "WaterFrac"
 theta_r = "thetaR"
 theta_s = "thetaS"
 
+[input.vertical.kv_0]
+netcdf.variable.name = "KsatVer"
+scale = 1.0
+offset = 0.0
+
 [input.lateral.river]
 length = "wflow_riverlength"
 n = "N_River"