From bfda25e897d2c455abf4d9781d1fd95d9b4987ec Mon Sep 17 00:00:00 2001 From: Josh Derocher-Vlk Date: Mon, 5 May 2025 17:00:09 +0200 Subject: [PATCH 1/3] update installation section --- pages/docs/manual/v12.0.0/installation.mdx | 54 +++++++++++----------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/pages/docs/manual/v12.0.0/installation.mdx b/pages/docs/manual/v12.0.0/installation.mdx index f737c17c9..4bc93109f 100644 --- a/pages/docs/manual/v12.0.0/installation.mdx +++ b/pages/docs/manual/v12.0.0/installation.mdx @@ -5,25 +5,25 @@ canonical: "/docs/manual/v12.0.0/installation" --- # Installation - -## Notes - -With the instructions below, our new standard library [ReScript Core](https://github.com/rescript-association/rescript-core) will be included by default. (In ReScript 11, it comes as a separate npm package `@rescript/core`. In future versions, it will be included in the `rescript` npm package itself.) - ## Prerequisites -- [Node.js](https://nodejs.org/) version >= 14 +- [Node.js](https://nodejs.org/) version >= 20 - One of the following package managers: - [npm](https://docs.npmjs.com/cli/) (comes with Node.js) - - [yarn](https://yarnpkg.com/) (yarn versions >1 need to set `nodeLinker: node-modules` in `.yarnrc.yml`) + - [yarn](https://yarnpkg.com/) + - yarn versions >1 need to set `nodeLinker: node-modules` in `.yarnrc.yml` - [pnpm](https://pnpm.io/) - [bun](https://bun.sh/) + - [deno]() + - Configure `"nodeModulesDir": "auto"` in `deno.json` ## New Project -The fastest and easiest way to spin up a new ReScript project is with the [create-rescript-app](https://github.com/rescript-lang/create-rescript-app) project generator. You can start it with any of the aforementioned package managers or `npx`. +The fastest and easiest way to spin up a new ReScript project is with the [create-rescript-app](https://github.com/rescript-lang/create-rescript-app) project generator. This will get you started with a fresh Next.js or Vite app with React and Tailwind CSS. + +You can start it with any of the aforementioned package managers or `npx`. - + ```sh example npm create rescript-app@latest @@ -40,7 +40,9 @@ pnpm create rescript-app ```sh bun create rescript-app ``` - +```sh +deno run -A npm:create-rescript-app@latest +``` - Follow the steps of the setup. @@ -66,7 +68,7 @@ If you already have a JavaScript project into which you'd like to add ReScript y ### Quick Setup In the root directory of your project, execute: - + ```sh npm create rescript-app@latest @@ -83,28 +85,34 @@ pnpm create rescript-app ```sh bun create rescript-app ``` - +```sh +// you will need deno configured to have a package.json file and node_modules folder +deno run -A npm:create-rescript-app@latest +``` `create-rescript-app` will tell you that a `package.json` file has been detected and ask you if it should install ReScript into your project. Just follow the steps accordingly. ### Manual Setup - Install ReScript locally: - + ```sh - npm install rescript @rescript/core + npm install rescript ``` ```sh - yarn add rescript @rescript/core + yarn add rescript ``` ```sh - pnpm install rescript @rescript/core + pnpm install rescript ``` ```sh - bun install rescript @rescript/core + bun install rescript + ``` + ```sh + // you will need deno configured to have a node_modules folder + deno install npm:rescript --allow-scripts ``` - - Create a ReScript build configuration file (called `rescript.json`) at the root: ```json @@ -122,13 +130,7 @@ bun create rescript-app "in-source": true } ], - "suffix": ".res.js", - "bs-dependencies": [ - "@rescript/core" - ], - "bsc-flags": [ - "-open RescriptCore" - ] + "suffix": ".res.js" } ``` See [Build Configuration](build-configuration) for more details on `rescript.json`. @@ -140,7 +142,7 @@ bun create rescript-app } ``` -Since ReScript compiles to clean readable JS files, the rest of your existing toolchain (e.g. Babel and Webpack) should just work! +Since ReScript compiles to clean readable JS files, the rest of your existing toolchain (e.g. Vite, Rspack, Rollup) should just work! Helpful guides: From 4816d2ce001a5599b58fe664a148bf61460cd363 Mon Sep 17 00:00:00 2001 From: Josh Derocher-Vlk <60623931+jderochervlk@users.noreply.github.com> Date: Mon, 5 May 2025 17:14:57 +0200 Subject: [PATCH 2/3] Update installation.mdx --- pages/docs/manual/v12.0.0/installation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/manual/v12.0.0/installation.mdx b/pages/docs/manual/v12.0.0/installation.mdx index 4bc93109f..0ea0fdcf5 100644 --- a/pages/docs/manual/v12.0.0/installation.mdx +++ b/pages/docs/manual/v12.0.0/installation.mdx @@ -14,7 +14,7 @@ canonical: "/docs/manual/v12.0.0/installation" - yarn versions >1 need to set `nodeLinker: node-modules` in `.yarnrc.yml` - [pnpm](https://pnpm.io/) - [bun](https://bun.sh/) - - [deno]() + - [deno](http://deno.com/) - Configure `"nodeModulesDir": "auto"` in `deno.json` ## New Project From 6f31d5c9432556ecef62e5f59b25ff5e8e6bfe46 Mon Sep 17 00:00:00 2001 From: jderochervlk Date: Sat, 10 May 2025 14:14:56 -0400 Subject: [PATCH 3/3] remove deno from create-rescript-app for now --- pages/docs/manual/v12.0.0/installation.mdx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pages/docs/manual/v12.0.0/installation.mdx b/pages/docs/manual/v12.0.0/installation.mdx index 0ea0fdcf5..67d71f923 100644 --- a/pages/docs/manual/v12.0.0/installation.mdx +++ b/pages/docs/manual/v12.0.0/installation.mdx @@ -23,7 +23,7 @@ The fastest and easiest way to spin up a new ReScript project is with the [creat You can start it with any of the aforementioned package managers or `npx`. - + ```sh example npm create rescript-app@latest @@ -40,9 +40,6 @@ pnpm create rescript-app ```sh bun create rescript-app ``` -```sh -deno run -A npm:create-rescript-app@latest -``` - Follow the steps of the setup. @@ -68,7 +65,7 @@ If you already have a JavaScript project into which you'd like to add ReScript y ### Quick Setup In the root directory of your project, execute: - + ```sh npm create rescript-app@latest @@ -85,10 +82,6 @@ pnpm create rescript-app ```sh bun create rescript-app ``` -```sh -// you will need deno configured to have a package.json file and node_modules folder -deno run -A npm:create-rescript-app@latest -``` `create-rescript-app` will tell you that a `package.json` file has been detected and ask you if it should install ReScript into your project. Just follow the steps accordingly.