diff --git a/bsconfig.json b/bsconfig.json index 21aabb16..44eb2d51 100644 --- a/bsconfig.json +++ b/bsconfig.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json", + "$schema": "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/9.0.0/docs/docson/build-schema.json", "name": "ocamlorg", "namespace": true, "reason": { diff --git a/package.json b/package.json index 88296068..b2588a5a 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,14 @@ "next:debug": "NODE_OPTIONS='--inspect' next dev", "watch": "concurrently --raw \"bsb -make-world -w\" \"next dev\" ", "watch-and-serve": "concurrently --raw \"bsb -make-world -w\" \"next dev\" \"http-server out\"", - "build": "bsb -clean-world -make-world && next build && next export", - "start-test-server": "http-server out" + "build": "bsb -clean-world -make-world && next build && next export && yarn total-dependencies-check", + "start-test-server": "http-server out", + "total-dependencies-check": "(test $(grep '^[a-zA-Z@].*:$' yarn.lock | wc -l) -lt 500 && echo ok) || (echo too many deps && exit 1) " }, "scriptsDescription": { - "build": "at present, next export is only used to ensure that we strictly use static site functionality", - "start-test-server": "Vercel deployments use next start, but this command tests running a pure static site. TODO: use npx from Makefile instead." + "build": "At present, next export is only used to ensure that we strictly use static site functionality.", + "start-test-server": "Vercel deployments use next start, but this command tests running a pure static site. TODO: use npx from Makefile instead.", + "total-dependencies-check": "Test, approximately, whether the current transitiive dependencies has grown significantly." }, "devDependencies": { "@tailwindcss/typography": "^0.4.0", diff --git a/src/Unified.res b/src/Unified.res index f95f08ea..baac7c8b 100644 --- a/src/Unified.res +++ b/src/Unified.res @@ -1,3 +1,16 @@ +// The following code causes a warning. My limited understanding is that the warning +// occurs because there is a mismatch between ReScript's assumptions about the version +// of Javascript being used and the actual version of Javascript used in NextJS. Currently, +// we have ReScript configured to target the ES6 version of Javascript. This is the emerging standard. At the same time, +// there are open issues in NextJS requesting ES6 support, but NextJS does not +// currently evaluate Javascript in an ES6 context. NextJS uses CommonJS when +// evaluating Javascript. The warning occurs because ReScript uses an external validator +// on the generated Javascript and the external validator notes that using "import" in +// the syntax below is not valid in ES6. The syntax is valid in CommonJS, which means +// the code will successfully run in NextJS. +// This warning will hopefully be resolved by September of 2021, if +// NextJS proceeds to lift its restriction on using ES6. The status of this issue +// can be tracked in Github issue #298. %%raw(` const MdastUtilToStringInternal = (await import('mdast-util-to-string')).toString `)