Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/moveArtifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ mv -f binaries-linux-arm64/* "packages/@rescript/linux-arm64/bin"
mv -f binaries-win32-x64/* "packages/@rescript/win32-x64/bin"
check_statically_linked "packages/@rescript/linux-x64/bin"
check_statically_linked "packages/@rescript/linux-arm64/bin"

# @rescript/std
mkdir -p packages/std/lib
cp -R packages/@rescript/runtime/lib/es6 packages/@rescript/runtime/lib/js packages/std/lib
48 changes: 0 additions & 48 deletions .github/workflows/prepare_package_upload.js

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#### :boom: Breaking Change

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

#### :eyeglasses: Spec Compliance

Expand Down
8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,11 @@ To build a new version and release it on NPM, follow these steps:
1. Verify that the version number is already set correctly for the release. (It should have been incremented after releasing the previous version.)
1. Create a PR to update `CHANGELOG.md`, removing the "(Unreleased)" for the version to be released.
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.
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".
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".
1. Verify that the playground bundle for the new version is now present on the settings tab in https://rescript-lang.org/try.
1. Run `npm info rescript` to verify that the new version is now present with tag "ci".
1. Test the new version.
1. Tag the new version as appropriate (`latest` or `next`):
- `npm dist-tag add rescript@<version> <tag>`
- `npm dist-tag add @rescript/std@<version> <tag>`
1. Tag the new version as appropriate (`latest` or `next`): `npm dist-tag add rescript@<version> <tag>`
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`.
1. Create a PR with the following changes to prepare for development of the next version:
- Increment the `EXPECTED_VERSION` number in `yarn.config.cjs` for the next version.
Expand All @@ -416,7 +414,7 @@ To build a new version and release it on NPM, follow these steps:

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

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.
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.

Follow the instructions from the comment, which are like:

Expand Down
2 changes: 1 addition & 1 deletion compiler/bsb/bsb_exception.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let print (fmt : Format.formatter) (x : error) =
modname
| Package_not_found name ->
let name = Bsb_pkg_types.to_string name in
if Ext_string.equal name !Bs_version.package_name then
if Ext_string.equal name Bs_version.package_name then
Format.fprintf fmt
"File \"rescript.json\", line 1\n\
@{<error>Error:@} package @{<error>%s@} is not found\n\
Expand Down
3 changes: 0 additions & 3 deletions compiler/bsb/bsb_pkg_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ let string_as_package (s : string) : t =
if v = '@' then (
let scope_id = Ext_string.no_slash_idx s in
assert (scope_id > 0);
(* better-eror message for invalid scope package:
@rescript/std
*)
Scope
(String.sub s (scope_id + 1) (len - scope_id - 1), String.sub s 0 scope_id))
else Global s
16 changes: 0 additions & 16 deletions compiler/bsc/rescript_compiler_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@ let set_abs_input_name sourcefile =
sourcefile
let setup_outcome_printer () = Lazy.force Res_outcome_printer.setup

let setup_runtime_path path =
let u0 = Filename.dirname path in
let std = Filename.basename path in
let _path = Filename.dirname u0 in
let rescript = Filename.basename u0 in
(match rescript.[0] with
| '@' ->
(* scoped package *)
Bs_version.package_name := rescript ^ "/" ^ std
| _ -> Bs_version.package_name := std
| exception _ -> Bs_version.package_name := std);
Js_config.customize_runtime := Some path

let process_file sourcefile ?kind ppf =
(* This is a better default then "", it will be changed later
The {!Location.input_name} relies on that we write the binary ast
Expand Down Expand Up @@ -411,9 +398,6 @@ let command_line_flags : (string * Bsc_args.spec * string) array =
"<list> Enable or disable error status for warnings according\n\
to <list>. See option -w for the syntax of <list>.\n\
Default setting is " ^ Bsc_warnings.defaults_warn_error );
( "-runtime",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can bring this back later (or make it -runtime-path then) for #7637 (comment)

string_call setup_runtime_path,
"*internal* Set the runtime directory" );
( "-make-runtime",
unit_call Js_packages_state.make_runtime,
"*internal* make runtime library" );
Expand Down
2 changes: 1 addition & 1 deletion compiler/common/bs_version.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "12.0.0-beta.8"
let header = "// Generated by ReScript, PLEASE EDIT WITH CARE"
let package_name = ref "@rescript/runtime"
let package_name = "@rescript/runtime"
2 changes: 1 addition & 1 deletion compiler/common/bs_version.mli
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ val version : string

val header : string

val package_name : string ref
val package_name : string
2 changes: 0 additions & 2 deletions compiler/common/js_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,5 @@ let jsx_module_of_string = function
| "react" -> React
| module_name -> Generic {module_name}

(* option to config `@rescript/std`*)
let customize_runtime : string option ref = ref None
let as_pp = ref false
let self_stack : string Stack.t = Stack.create ()
2 changes: 0 additions & 2 deletions compiler/common/js_config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ val jsx_version_of_int : int -> jsx_version option

val jsx_module_of_string : string -> jsx_module

val customize_runtime : string option ref

val as_pp : bool ref

val self_stack : string Stack.t
7 changes: 1 addition & 6 deletions compiler/core/js_name_of_module_id.ml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ let get_runtime_module_path
(*Invariant: the package path to rescript, it is used to
calculate relative js path
*)
(match !Js_config.customize_runtime with
| None ->
((Filename.dirname (Filename.dirname Sys.executable_name)) // dep_path // js_file)
| Some path ->
path //dep_path // js_file
)
(Config.runtime_module_path // dep_path // js_file)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would actually already have been wrong after the previous PR. Not sure when exactly it is needed.


(* [output_dir] is decided by the command line argument *)
let string_of_module_id
Expand Down
6 changes: 2 additions & 4 deletions compiler/core/js_packages_info.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ let runtime_dir_of_module_system (ms : module_system) =
| Esmodule | Es6_global -> "es6"

let runtime_package_path (ms : module_system) js_file =
!Bs_version.package_name // "lib"
// runtime_dir_of_module_system ms
// js_file
Bs_version.package_name // "lib" // runtime_dir_of_module_system ms // js_file

type t = {name: package_name; module_systems: package_info list}

Expand Down Expand Up @@ -165,7 +163,7 @@ let query_package_infos ({name; module_systems} : t)
with
| Some k ->
let rel_path = k.path in
let pkg_rel_path = !Bs_version.package_name // rel_path in
let pkg_rel_path = Bs_version.package_name // rel_path in
Package_found {rel_path; pkg_rel_path; suffix = k.suffix}
| None -> Package_not_found)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"typescript": "5.8.2"
},
"workspaces": [
"packages/*",
"packages/playground",
"packages/@rescript/*",
"tests/dependencies/**",
"tests/analysis_tests/**",
Expand Down
3 changes: 0 additions & 3 deletions packages/std/.gitignore

This file was deleted.

Loading
Loading