Skip to content

Commit 94a7879

Browse files
authored
Remove @rescript/std (in favor of @rescript/runtime) (#7811)
1 parent 183d982 commit 94a7879

21 files changed

+11
-1020
lines changed

.github/workflows/moveArtifacts.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,3 @@ mv -f binaries-linux-arm64/* "packages/@rescript/linux-arm64/bin"
3737
mv -f binaries-win32-x64/* "packages/@rescript/win32-x64/bin"
3838
check_statically_linked "packages/@rescript/linux-x64/bin"
3939
check_statically_linked "packages/@rescript/linux-arm64/bin"
40-
41-
# @rescript/std
42-
mkdir -p packages/std/lib
43-
cp -R packages/@rescript/runtime/lib/es6 packages/@rescript/runtime/lib/js packages/std/lib

.github/workflows/prepare_package_upload.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#### :boom: Breaking Change
1616

1717
- Extract ReScript runtime files from main `rescript` package to separate `@rescript/runtime` package. https://github.com/rescript-lang/rescript/pull/7796
18+
- Remove `@rescript/std` (in favor of `@rescript/runtime`). https://github.com/rescript-lang/rescript/pull/7811
1819

1920
#### :eyeglasses: Spec Compliance
2021

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,11 @@ To build a new version and release it on NPM, follow these steps:
399399
1. Verify that the version number is already set correctly for the release. (It should have been incremented after releasing the previous version.)
400400
1. Create a PR to update `CHANGELOG.md`, removing the "(Unreleased)" for the version to be released.
401401
1. Once that PR is merged and built successfully, tag the commit with the version number (e.g., "v10.0.0", or "v10.0.0-beta.1") and push the tag.
402-
1. This triggers a tag build that will upload the playground bundle to Cloudflare R2 and publish the `rescript` and `@rescript/std` npm packages with the tag "ci".
402+
1. This triggers a tag build that will upload the playground bundle to Cloudflare R2 and publish the `rescript` npm package with the tag "ci".
403403
1. Verify that the playground bundle for the new version is now present on the settings tab in https://rescript-lang.org/try.
404404
1. Run `npm info rescript` to verify that the new version is now present with tag "ci".
405405
1. Test the new version.
406-
1. Tag the new version as appropriate (`latest` or `next`):
407-
- `npm dist-tag add rescript@<version> <tag>`
408-
- `npm dist-tag add @rescript/std@<version> <tag>`
406+
1. Tag the new version as appropriate (`latest` or `next`): `npm dist-tag add rescript@<version> <tag>`
409407
1. Create a release entry for the version tag on the [Github Releases page](https://github.com/rescript-lang/rescript-compiler/releases), copying the changes from `CHANGELOG.md`.
410408
1. Create a PR with the following changes to prepare for development of the next version:
411409
- Increment the `EXPECTED_VERSION` number in `yarn.config.cjs` for the next version.
@@ -416,7 +414,7 @@ To build a new version and release it on NPM, follow these steps:
416414

417415
To reproduce issues, it can be helpful to the team to install a specific version of the compiler.
418416

419-
ReScript uses [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) for continuous releases. Once tests are passed successfully, the bot comment is available.
417+
ReScript uses [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) for continuous releases. Once tests are passed successfully, the bot comment is available.
420418

421419
Follow the instructions from the comment, which are like:
422420

compiler/bsb/bsb_exception.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let print (fmt : Format.formatter) (x : error) =
4747
modname
4848
| Package_not_found name ->
4949
let name = Bsb_pkg_types.to_string name in
50-
if Ext_string.equal name !Bs_version.package_name then
50+
if Ext_string.equal name Bs_version.package_name then
5151
Format.fprintf fmt
5252
"File \"rescript.json\", line 1\n\
5353
@{<error>Error:@} package @{<error>%s@} is not found\n\

compiler/bsb/bsb_pkg_types.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ let string_as_package (s : string) : t =
8383
if v = '@' then (
8484
let scope_id = Ext_string.no_slash_idx s in
8585
assert (scope_id > 0);
86-
(* better-eror message for invalid scope package:
87-
@rescript/std
88-
*)
8986
Scope
9087
(String.sub s (scope_id + 1) (len - scope_id - 1), String.sub s 0 scope_id))
9188
else Global s

compiler/bsc/rescript_compiler_main.ml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@ let set_abs_input_name sourcefile =
5050
sourcefile
5151
let setup_outcome_printer () = Lazy.force Res_outcome_printer.setup
5252

53-
let setup_runtime_path path =
54-
let u0 = Filename.dirname path in
55-
let std = Filename.basename path in
56-
let _path = Filename.dirname u0 in
57-
let rescript = Filename.basename u0 in
58-
(match rescript.[0] with
59-
| '@' ->
60-
(* scoped package *)
61-
Bs_version.package_name := rescript ^ "/" ^ std
62-
| _ -> Bs_version.package_name := std
63-
| exception _ -> Bs_version.package_name := std);
64-
Js_config.customize_runtime := Some path
65-
6653
let process_file sourcefile ?kind ppf =
6754
(* This is a better default then "", it will be changed later
6855
The {!Location.input_name} relies on that we write the binary ast
@@ -415,9 +402,6 @@ let command_line_flags : (string * Bsc_args.spec * string) array =
415402
"<list> Enable or disable error status for warnings according\n\
416403
to <list>. See option -w for the syntax of <list>.\n\
417404
Default setting is " ^ Bsc_warnings.defaults_warn_error );
418-
( "-runtime",
419-
string_call setup_runtime_path,
420-
"*internal* Set the runtime directory" );
421405
( "-make-runtime",
422406
unit_call Js_packages_state.make_runtime,
423407
"*internal* make runtime library" );

compiler/common/bs_version.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424
let version = "12.0.0-beta.8"
2525
let header = "// Generated by ReScript, PLEASE EDIT WITH CARE"
26-
let package_name = ref "@rescript/runtime"
26+
let package_name = "@rescript/runtime"

compiler/common/bs_version.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ val version : string
2626

2727
val header : string
2828

29-
val package_name : string ref
29+
val package_name : string

compiler/common/js_config.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,5 @@ let jsx_module_of_string = function
7070
| "react" -> React
7171
| module_name -> Generic {module_name}
7272

73-
(* option to config `@rescript/std`*)
74-
let customize_runtime : string option ref = ref None
7573
let as_pp = ref false
7674
let self_stack : string Stack.t = Stack.create ()

0 commit comments

Comments
 (0)