diff --git a/bin/melppx.ml b/bin/melppx.ml index 491feba096..293428418a 100644 --- a/bin/melppx.ml +++ b/bin/melppx.ml @@ -1 +1,25 @@ +(* Copyright (C) 2022- Authors of Melange + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + let () = Ppxlib.Driver.run_as_ppx_rewriter () diff --git a/flake.lock b/flake.lock index e4666b9c8d..a84f057ab8 100644 --- a/flake.lock +++ b/flake.lock @@ -64,11 +64,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1698098084, - "narHash": "sha256-MKz+XmZNFxHuSLC6aekLIaUnT6RhTo3vyozSDbIa5nA=", + "lastModified": 1698308385, + "narHash": "sha256-Iy/5lrHzZEHrxZamaacl5Vf06xTtNwQxEutpvaIS6Yc=", "owner": "nix-ocaml", "repo": "nix-overlays", - "rev": "dab0002da7413431ea1e62bbd34784bc3163c39f", + "rev": "52f99ba0d875cb588feb2a033afb64af5dadca25", "type": "github" }, "original": { @@ -79,17 +79,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1697935353, - "narHash": "sha256-dDwl5ziD24Gs0feke2seFXoQibHafb5XeNDWlUZxCbg=", + "lastModified": 1698256497, + "narHash": "sha256-NdQrWDU11jCpDxDNMwi/2QVA2t38j10seL2qAqVS/Y8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8dfad603247387df1df4826b8bea58efc5d012d8", + "rev": "0e18a0a0b4092f3f52bacfca3c0db8f7c66702d2", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "8dfad603247387df1df4826b8bea58efc5d012d8", + "rev": "0e18a0a0b4092f3f52bacfca3c0db8f7c66702d2", "type": "github" } }, diff --git a/jscomp/ext/ext_js_suffix.ml b/jscomp/ext/ext_js_suffix.ml index 548ba2baa0..6e21a68d95 100644 --- a/jscomp/ext/ext_js_suffix.ml +++ b/jscomp/ext/ext_js_suffix.ml @@ -1,3 +1,27 @@ +(* Copyright (C) 2022- Authors of Melange + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + type t = string let to_string = Fun.id diff --git a/jscomp/ext/ext_js_suffix.mli b/jscomp/ext/ext_js_suffix.mli index 240c419074..a1dc339976 100644 --- a/jscomp/ext/ext_js_suffix.mli +++ b/jscomp/ext/ext_js_suffix.mli @@ -1,3 +1,27 @@ +(* Copyright (C) 2022- Authors of Melange + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + type t val to_string : t -> string diff --git a/jscomp/ext/ext_module_system.ml b/jscomp/ext/ext_module_system.ml index 8312dd7d8a..e4420ec781 100644 --- a/jscomp/ext/ext_module_system.ml +++ b/jscomp/ext/ext_module_system.ml @@ -1,4 +1,26 @@ -let ( // ) = Ext_path.( // ) +(* Copyright (C) 2022- Authors of Melange + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) type t = NodeJS | Es6 | Es6_global @@ -14,7 +36,10 @@ let compatible ~dep t = (* in runtime lib, [es6] and [es6] are treated the same way *) let runtime_dir = function NodeJS -> "js" | Es6 | Es6_global -> "es6" -let runtime_package_path js_file = (Literals.package_name ^ ".js") // js_file + +let runtime_package_path = + let ( // ) = Ext_path.( // ) in + fun js_file -> (Literals.package_name ^ ".js") // js_file let to_string = function | NodeJS -> "commonjs" diff --git a/jscomp/ext/ext_module_system.mli b/jscomp/ext/ext_module_system.mli index d908ee7f6c..85b6b9c306 100644 --- a/jscomp/ext/ext_module_system.mli +++ b/jscomp/ext/ext_module_system.mli @@ -1,3 +1,27 @@ +(* Copyright (C) 2022- Authors of Melange + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * In addition to the permissions granted to you by the LGPL, you may combine + * or link a "work that uses the Library" with a publicly distributed version + * of this file to produce a combined library or application, then distribute + * that combined work under the terms of your choosing, with no requirement + * to comply with the obligations normally placed on you by section 4 of the + * LGPL version 3 (or the corresponding section of a later version of the LGPL + * should you choose to use a later version). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + type t = NodeJS | Es6 | Es6_global val default : t diff --git a/jscomp/ext/ext_modulename.ml b/jscomp/ext/ext_modulename.ml index 0e1fd14760..924101b639 100644 --- a/jscomp/ext/ext_modulename.ml +++ b/jscomp/ext/ext_modulename.ml @@ -55,7 +55,7 @@ and collect_next buf s off len = | '.' | '-' -> collect_start buf s next len | _ -> collect_next buf s next len -(** This is for a js exeternal module, we can change it when printing +(** This is for a JS external module, we can change it when printing for example {[ var React$1 = require('react');