Skip to content

Commit

Permalink
upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed Apr 21, 2024
1 parent 2a651b5 commit 12db276
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 69 deletions.
8 changes: 4 additions & 4 deletions cli/Cli.res
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ let main = async () => {
panic(
`Invalid value for --tls-security. Must be one of: ${validTlsSecurityValues
->Array.map(x => `"${x}"`)
->Array.joinWith(" | ")}`,
->Array.join(" | ")}`,
)
} else {
switch tlsSec {
Expand Down Expand Up @@ -184,7 +184,7 @@ let main = async () => {

let connectionConfig = await getNormalizedConfig(config.client)

let url = `http://${connectionConfig["address"]->Array.joinWith(
let url = `http://${connectionConfig["address"]->Array.join(
":",
)}/ui/${connectionConfig["database"]}`
url->JSON.stringifyAny->Console.log
Expand Down Expand Up @@ -330,7 +330,7 @@ let main = async () => {
fileOutput->Array.push(
`let queryText = \`${queryText}\`
${types.distinctTypes->Set.values->Iterator.toArray->Array.joinWith("\n\n")}
${types.distinctTypes->Set.values->Iterator.toArray->Array.join("\n\n")}
@live
let query = (client: EdgeDB.Client.t${hasArgs
Expand All @@ -348,7 +348,7 @@ let transaction = (transaction: EdgeDB.Transaction.t${hasArgs
: ""}${extraInFnApply})
}`,
)
let content = fileOutput->Array.joinWith("")
let content = fileOutput->Array.join("")

// Sync errors
syncErrors()->Promise.done
Expand Down
8 changes: 4 additions & 4 deletions cli/EdgeDbGenerator.res
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ module AnalyzeQuery = {
},
)->generateSetType(field.cardinality)},`
})
->Array.joinWith("\n")}\n}`
->Array.join("\n")}\n}`

ctx.distinctTypes->Set.add(recordDef)
name
Expand All @@ -231,11 +231,11 @@ module AnalyzeQuery = {
let name = polyVariantNameNeedsEscapingRegex->RegExp.test(v) ? v : `"${v}"`
`#${name}`
})
->Array.joinWith(" | ")}]`
->Array.join(" | ")}]`
} else if codec->is(int16Codec) || codec->is(int32Codec) {
"int"
} else if codec->is(bigintCodec) {
"BigInt.t"
"bigint"
} else if codec->is(jsonCodec) {
"JSON.t"
} else {
Expand Down Expand Up @@ -277,7 +277,7 @@ module AnalyzeQuery = {
`(${codec
->getSubcodecs
->Array.map(subCodec => walkCodec(subCodec, ctx))
->Array.joinWith(", ")})`
->Array.join(", ")})`
} else if codec->is(rangeCodec) {
let subCodec = codec->getSubcodecs->Array.getUnsafe(0)
if !(subCodec->is(scalarCodec)) {
Expand Down
4 changes: 2 additions & 2 deletions cli/EdgeDbGenerator__Utils.res
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let uncapitalizeString = str =>
`${str->String.slice(~start=0, ~end=1)->String.toLowerCase}${str->String.sliceToEnd(~start=1)}`

let pathToName = path => {
let name = path->Array.joinWith("__")
let name = path->Array.join("__")

// Make valid ReScript record name.
uncapitalizeString(name)
Expand Down Expand Up @@ -122,7 +122,7 @@ module Errors = {
->Array.length

Some({
text: text->Array.filter(l => l->String.trim !== "")->Array.joinWith("\n"),
text: text->Array.filter(l => l->String.trim !== "")->Array.join("\n"),
start: {
line,
col: colStart,
Expand Down
4 changes: 2 additions & 2 deletions cli/UnusedSelections.res
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type extractedLineInfo = {
let extractLineInfo = line => {
switch line->String.trim->String.split(" ")->List.fromArray {
| list{info, ...rest} =>
let restText = rest->List.toArray->Array.joinWith(" ")->String.trim
let restText = rest->List.toArray->Array.join(" ")->String.trim
switch (info->String.split("."), restText) {
| ([queryName, recordName, fieldName], "is a record label never used to read a value")
if !(recordName->String.startsWith("args")) =>
Expand Down Expand Up @@ -131,7 +131,7 @@ let reportResults = results => {
fileInfo => {
let contextMessage = switch fileInfo.recordPath {
| None | Some([]) => ""
| Some(path) => `${path->Array.joinWith(".")}`
| Some(path) => `${path->Array.join(".")}`
}
Console.log(` - ${contextMessage}.${fileInfo.fieldName}`)
},
Expand Down
25 changes: 0 additions & 25 deletions dbTestProject/bsconfig.json

This file was deleted.

48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"files": [
"README.md",
"CHANGELOG.md",
"bsconfig.json",
"rescript.json",
"dist",
"src"
],
Expand All @@ -30,16 +30,16 @@
"fast-glob": "^3.3.1"
},
"devDependencies": {
"@rescript/core": "1.0.0",
"@rescript/core": "1.3.0",
"esbuild": "^0.19.3",
"rescript": "^11.0.0",
"rescript": "^11.1.0",
"rescript-embed-lang": "0.4.0",
"rescript-nodejs": "^16.0.0"
"rescript-nodejs": "^16.1.0"
},
"peerDependencies": {
"@rescript/core": ">= 1.0.0",
"@rescript/core": ">= 1.3.0",
"edgedb": ">= 1.3.6",
"rescript": "^11.0.0 || ^11.1.0-rc.2",
"rescript": "^11.1.0",
"rescript-embed-lang": ">= 0.4.0"
}
}
2 changes: 1 addition & 1 deletion bsconfig.json → rescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"package-specs": {
"module": "es6",
"module": "esmodule",
"in-source": true
},
"suffix": ".mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/EdgeDB.res
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ module DataTypes = {
type t

@get external bytes: t => float = "bytes"
@get external bytesBigInt: t => BigInt.t = "bytesBigInt"
@get external bytesBigInt: t => bigint = "bytesBigInt"
@get external kibibytes: t => float = "kibibytes"
@get external mebibytes: t => float = "mebibytes"
@get external gibibytes: t => float = "gibibytes"
Expand Down

0 comments on commit 12db276

Please sign in to comment.