From 036cce74f32d54df27ffa20ba5ddc2055ba0a62b Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 19 Nov 2025 14:26:42 +0100 Subject: [PATCH] Use latest ReScript 12 rc --- package-lock.json | 25 +++++++++++++++---- package.json | 9 ++++--- tests/FetchAPI/FormData__test.res | 4 +-- .../SharedWorkerGlobalScope__test.res | 4 +-- tests/WebWorkersAPI/SharedWorker__test.res | 15 ++++++----- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index a8a4152..df970c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,16 +8,17 @@ "name": "@rescript/webapi", "version": "0.1.0", "license": "MIT", - "dependencies": { - "rescript": "^12.0.0-beta.3" - }, "devDependencies": { "@astrojs/starlight": "0.36.2", "astro": "^5.10.1", "micromark": "^4.0.1", "prettier": "^3.3.3", "prettier-plugin-astro": "^0.14.1", + "rescript": ">=12.0.0-rc.0 <13", "sharp": "^0.34.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0-rc.0 <13" } }, "node_modules/@astrojs/compiler": { @@ -1266,6 +1267,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -1281,6 +1283,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -1296,6 +1299,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -1311,6 +1315,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -1322,7 +1327,8 @@ "node_modules/@rescript/runtime": { "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/@rescript/runtime/-/runtime-12.0.0-rc.3.tgz", - "integrity": "sha512-Ihdnppw7A+ArLwfnLPcz04jh6ZaKADo0Rc6vMHYQ2+Dw+snO5VbxJ2As5ahVt9nUVL56w1k9pWgrIoLtb1eHcA==" + "integrity": "sha512-Ihdnppw7A+ArLwfnLPcz04jh6ZaKADo0Rc6vMHYQ2+Dw+snO5VbxJ2As5ahVt9nUVL56w1k9pWgrIoLtb1eHcA==", + "dev": true }, "node_modules/@rescript/win32-x64": { "version": "12.0.0-rc.3", @@ -1331,6 +1337,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "win32" @@ -5651,6 +5658,7 @@ "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.0.0-rc.3.tgz", "integrity": "sha512-8EOLvO6p5MxpprqpN4tbblfk6uJbz2Q5g/VHA7ii7TJu98JFNLehRjPNHhlEk2G4Lx+PZraSnGudTxBVmyLNoQ==", + "dev": true, "dependencies": { "@rescript/runtime": "12.0.0-rc.3" }, @@ -7314,35 +7322,41 @@ "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/@rescript/darwin-arm64/-/darwin-arm64-12.0.0-rc.3.tgz", "integrity": "sha512-d6OMJWnW8I9DgYPNw+9Gy72tOcgRqry+NkpVWYYU4+Ay/LAfCs1W+AWUmsKTlxwTe2JTLhXRX3HzrqXSQoC6tg==", + "dev": true, "optional": true }, "@rescript/darwin-x64": { "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/@rescript/darwin-x64/-/darwin-x64-12.0.0-rc.3.tgz", "integrity": "sha512-ualm4FZRztHaxY7YbEbSgNQwBPRPEsyn30/xHSkuCY2CV7W7808H29X33bqnDkQZ1XxmnG3z2bz9UoZcJJnf6A==", + "dev": true, "optional": true }, "@rescript/linux-arm64": { "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/@rescript/linux-arm64/-/linux-arm64-12.0.0-rc.3.tgz", "integrity": "sha512-StPyP+KHY1k2CQrVLV52VnQvgeQIKz8woEYB0JRL4LtYDb6g6jVj9aXiq6ZWyVo9vxas1zSCzCvzrXubIsgkmg==", + "dev": true, "optional": true }, "@rescript/linux-x64": { "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/@rescript/linux-x64/-/linux-x64-12.0.0-rc.3.tgz", "integrity": "sha512-HB9K4huyr8zCET5BnUJQgskMpiJXERFc7P2mO0vDgMKgmDEmEeOVTUfFiO9aqCwFP/ujGFsWb47SEUxTmHOCcA==", + "dev": true, "optional": true }, "@rescript/runtime": { "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/@rescript/runtime/-/runtime-12.0.0-rc.3.tgz", - "integrity": "sha512-Ihdnppw7A+ArLwfnLPcz04jh6ZaKADo0Rc6vMHYQ2+Dw+snO5VbxJ2As5ahVt9nUVL56w1k9pWgrIoLtb1eHcA==" + "integrity": "sha512-Ihdnppw7A+ArLwfnLPcz04jh6ZaKADo0Rc6vMHYQ2+Dw+snO5VbxJ2As5ahVt9nUVL56w1k9pWgrIoLtb1eHcA==", + "dev": true }, "@rescript/win32-x64": { "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/@rescript/win32-x64/-/win32-x64-12.0.0-rc.3.tgz", "integrity": "sha512-Eyy61o6Wk3Cgiy/99zFCzxumL1WHOGEdbxU+ksqghuD3s2RgBWBobSygf3nhcoNBibXI0Fhpu+XXXoTOsTiQ9w==", + "dev": true, "optional": true }, "@rollup/pluginutils": { @@ -10350,6 +10364,7 @@ "version": "12.0.0-rc.3", "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.0.0-rc.3.tgz", "integrity": "sha512-8EOLvO6p5MxpprqpN4tbblfk6uJbz2Q5g/VHA7ii7TJu98JFNLehRjPNHhlEk2G4Lx+PZraSnGudTxBVmyLNoQ==", + "dev": true, "requires": { "@rescript/darwin-arm64": "12.0.0-rc.3", "@rescript/darwin-x64": "12.0.0-rc.3", diff --git a/package.json b/package.json index 9503d38..ae85102 100644 --- a/package.json +++ b/package.json @@ -28,15 +28,15 @@ "type": "module", "scripts": { "test": "node tests/index.js", - "build": "rescript --dev", + "build": "rescript", "format": "rescript format && prettier --write ./tests/index.js ./package.json ./docs/pages", "docs": "astro dev", "prebuild:docs": "node docs/llm.js", "build:docs": "astro build" }, "license": "MIT", - "dependencies": { - "rescript": "^12.0.0-beta.3" + "peerDependencies": { + "rescript": ">=12.0.0-rc.0 <13" }, "devDependencies": { "@astrojs/starlight": "0.36.2", @@ -44,6 +44,7 @@ "micromark": "^4.0.1", "prettier": "^3.3.3", "prettier-plugin-astro": "^0.14.1", - "sharp": "^0.34.0" + "sharp": "^0.34.0", + "rescript": ">=12.0.0-rc.0 <13" } } diff --git a/tests/FetchAPI/FormData__test.res b/tests/FetchAPI/FormData__test.res index 28890dc..462a6ef 100644 --- a/tests/FetchAPI/FormData__test.res +++ b/tests/FetchAPI/FormData__test.res @@ -3,5 +3,5 @@ external myForm: DOMAPI.htmlFormElement = "myForm" let formData = FormData.make(~form=myForm) -let phone : null = formData->FormData.get("phone") -let image : null = formData->FormData.getFile("image") +let phone: null = formData->FormData.get("phone") +let image: null = formData->FormData.getFile("image") diff --git a/tests/WebWorkersAPI/SharedWorkerGlobalScope__test.res b/tests/WebWorkersAPI/SharedWorkerGlobalScope__test.res index 34c3bbf..b6dfedb 100644 --- a/tests/WebWorkersAPI/SharedWorkerGlobalScope__test.res +++ b/tests/WebWorkersAPI/SharedWorkerGlobalScope__test.res @@ -1,7 +1,7 @@ open WebAPI.WebWorkersAPI -external getSelf: () => sharedWorkerGlobalScope = "self" +external getSelf: unit => sharedWorkerGlobalScope = "self" let self = getSelf() -self -> SharedWorkerGlobalScope.close +self->SharedWorkerGlobalScope.close diff --git a/tests/WebWorkersAPI/SharedWorker__test.res b/tests/WebWorkersAPI/SharedWorker__test.res index e8bd388..8e2c19b 100644 --- a/tests/WebWorkersAPI/SharedWorker__test.res +++ b/tests/WebWorkersAPI/SharedWorker__test.res @@ -4,15 +4,18 @@ let shared1: sharedWorker = SharedWorker.make("sharedworker.js") let shared2: sharedWorker = SharedWorker.makeWithName("sharedworker.js", "name") -let shared3: sharedWorker = SharedWorker.makeWithOptions("sharedworker.js", { - name: "workerName", - type_: Module -}) +let shared3: sharedWorker = SharedWorker.makeWithOptions( + "sharedworker.js", + { + name: "workerName", + type_: Module, + }, +) let port: WebAPI.ChannelMessagingAPI.messagePort = SharedWorker.port(shared1) -external getSelf: () => sharedWorkerGlobalScope = "self" +external getSelf: unit => sharedWorkerGlobalScope = "self" let self = getSelf() -self -> SharedWorkerGlobalScope.close +self->SharedWorkerGlobalScope.close