@@ -2721,6 +2721,163 @@ let package_output ~format:s output=
27212721
27222722
27232723
2724+ end
2725+ module Bs_version : sig
2726+ #1 " bs_version.mli"
2727+ (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
2728+ *
2729+ * This program is free software: you can redistribute it and/or modify
2730+ * it under the terms of the GNU Lesser General Public License as published by
2731+ * the Free Software Foundation, either version 3 of the License, or
2732+ * (at your option) any later version.
2733+ *
2734+ * In addition to the permissions granted to you by the LGPL, you may combine
2735+ * or link a "work that uses the Library" with a publicly distributed version
2736+ * of this file to produce a combined library or application, then distribute
2737+ * that combined work under the terms of your choosing, with no requirement
2738+ * to comply with the obligations normally placed on you by section 4 of the
2739+ * LGPL version 3 (or the corresponding section of a later version of the LGPL
2740+ * should you choose to use a later version).
2741+ *
2742+ * This program is distributed in the hope that it will be useful,
2743+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2744+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2745+ * GNU Lesser General Public License for more details.
2746+ *
2747+ * You should have received a copy of the GNU Lesser General Public License
2748+ * along with this program; if not, write to the Free Software
2749+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2750+
2751+ val version : string
2752+
2753+ val header : string
2754+
2755+ val package_name : string
2756+ end = struct
2757+ #1 " bs_version.ml"
2758+
2759+ (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
2760+ *
2761+ * This program is free software: you can redistribute it and/or modify
2762+ * it under the terms of the GNU Lesser General Public License as published by
2763+ * the Free Software Foundation, either version 3 of the License, or
2764+ * (at your option) any later version.
2765+ *
2766+ * In addition to the permissions granted to you by the LGPL, you may combine
2767+ * or link a "work that uses the Library" with a publicly distributed version
2768+ * of this file to produce a combined library or application, then distribute
2769+ * that combined work under the terms of your choosing, with no requirement
2770+ * to comply with the obligations normally placed on you by section 4 of the
2771+ * LGPL version 3 (or the corresponding section of a later version of the LGPL
2772+ * should you choose to use a later version).
2773+ *
2774+ * This program is distributed in the hope that it will be useful,
2775+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2776+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2777+ * GNU Lesser General Public License for more details.
2778+ *
2779+ * You should have received a copy of the GNU Lesser General Public License
2780+ * along with this program; if not, write to the Free Software
2781+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2782+ let version = " 1.4.3"
2783+ let header =
2784+ " // Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"
2785+ let package_name = " bs-platform"
2786+
2787+ end
2788+ module Bsb_exception : sig
2789+ #1 " bsb_exception.mli"
2790+ (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
2791+ *
2792+ * This program is free software: you can redistribute it and/or modify
2793+ * it under the terms of the GNU Lesser General Public License as published by
2794+ * the Free Software Foundation, either version 3 of the License, or
2795+ * (at your option) any later version.
2796+ *
2797+ * In addition to the permissions granted to you by the LGPL, you may combine
2798+ * or link a "work that uses the Library" with a publicly distributed version
2799+ * of this file to produce a combined library or application, then distribute
2800+ * that combined work under the terms of your choosing, with no requirement
2801+ * to comply with the obligations normally placed on you by section 4 of the
2802+ * LGPL version 3 (or the corresponding section of a later version of the LGPL
2803+ * should you choose to use a later version).
2804+ *
2805+ * This program is distributed in the hope that it will be useful,
2806+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2807+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2808+ * GNU Lesser General Public License for more details.
2809+ *
2810+ * You should have received a copy of the GNU Lesser General Public License
2811+ * along with this program; if not, write to the Free Software
2812+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2813+
2814+
2815+
2816+ type error =
2817+ | Package_not_found of string * string option (* json file *)
2818+
2819+
2820+ val error : error -> 'a
2821+ end = struct
2822+ #1 " bsb_exception.ml"
2823+ (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
2824+ *
2825+ * This program is free software: you can redistribute it and/or modify
2826+ * it under the terms of the GNU Lesser General Public License as published by
2827+ * the Free Software Foundation, either version 3 of the License, or
2828+ * (at your option) any later version.
2829+ *
2830+ * In addition to the permissions granted to you by the LGPL, you may combine
2831+ * or link a "work that uses the Library" with a publicly distributed version
2832+ * of this file to produce a combined library or application, then distribute
2833+ * that combined work under the terms of your choosing, with no requirement
2834+ * to comply with the obligations normally placed on you by section 4 of the
2835+ * LGPL version 3 (or the corresponding section of a later version of the LGPL
2836+ * should you choose to use a later version).
2837+ *
2838+ * This program is distributed in the hope that it will be useful,
2839+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2840+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2841+ * GNU Lesser General Public License for more details.
2842+ *
2843+ * You should have received a copy of the GNU Lesser General Public License
2844+ * along with this program; if not, write to the Free Software
2845+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2846+
2847+
2848+
2849+ type error =
2850+ | Package_not_found of string * string option (* json file *)
2851+
2852+
2853+ exception Error of error
2854+
2855+ let error err = raise (Error err)
2856+
2857+ let to_string (x : error ) =
2858+ match x with
2859+ | Package_not_found (name ,json_opt ) ->
2860+ let in_json = match json_opt with None -> Ext_string. empty | Some x -> " in " ^ x in
2861+ if Ext_string. equal name Bs_version. package_name then
2862+ Printf. sprintf " Package bs-platform is not found %s , it is the basic package required, if you have it installed globally\n \
2863+ Please run 'npm link bs-platform' to make it available " in_json
2864+ else
2865+ Printf. sprintf
2866+ " BuckleScript package %s not found or built %s, if it is not built\n \
2867+ Please run 'bsb -make-world', otherwise please install it " name in_json
2868+
2869+ let () =
2870+ Printexc. register_printer (fun x ->
2871+ match x with
2872+ | Error x ->
2873+ Some (to_string x )
2874+ | _ -> None
2875+ )
2876+
2877+
2878+
2879+
2880+
27242881end
27252882module Ext_array : sig
27262883#1 " ext_array.mli"
@@ -5173,7 +5330,8 @@ let rec walk_all_deps top dir cb =
51735330 begin match js with
51745331 | `Str {Ext_json. str = new_package } ->
51755332 begin match Bs_pkg. resolve_bs_package ~cwd: dir new_package with
5176- | None -> failwith (new_package ^ " not found as dependency of " ^ bsconfig_json )
5333+ | None ->
5334+ Bsb_exception. error (Bsb_exception. Package_not_found (new_package, Some bsconfig_json))
51775335 | Some package_dir ->
51785336 walk_all_deps false package_dir cb ;
51795337 end ;
@@ -7134,69 +7292,6 @@ type t =
71347292 files_to_install : String_hash_set .t ;
71357293 generate_merlin : bool ;
71367294 }
7137- end
7138- module Bs_version : sig
7139- #1 " bs_version.mli"
7140- (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
7141- *
7142- * This program is free software: you can redistribute it and/or modify
7143- * it under the terms of the GNU Lesser General Public License as published by
7144- * the Free Software Foundation, either version 3 of the License, or
7145- * (at your option) any later version.
7146- *
7147- * In addition to the permissions granted to you by the LGPL, you may combine
7148- * or link a "work that uses the Library" with a publicly distributed version
7149- * of this file to produce a combined library or application, then distribute
7150- * that combined work under the terms of your choosing, with no requirement
7151- * to comply with the obligations normally placed on you by section 4 of the
7152- * LGPL version 3 (or the corresponding section of a later version of the LGPL
7153- * should you choose to use a later version).
7154- *
7155- * This program is distributed in the hope that it will be useful,
7156- * but WITHOUT ANY WARRANTY; without even the implied warranty of
7157- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7158- * GNU Lesser General Public License for more details.
7159- *
7160- * You should have received a copy of the GNU Lesser General Public License
7161- * along with this program; if not, write to the Free Software
7162- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
7163-
7164- val version : string
7165-
7166- val header : string
7167-
7168- val package_name : string
7169- end = struct
7170- #1 " bs_version.ml"
7171-
7172- (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
7173- *
7174- * This program is free software: you can redistribute it and/or modify
7175- * it under the terms of the GNU Lesser General Public License as published by
7176- * the Free Software Foundation, either version 3 of the License, or
7177- * (at your option) any later version.
7178- *
7179- * In addition to the permissions granted to you by the LGPL, you may combine
7180- * or link a "work that uses the Library" with a publicly distributed version
7181- * of this file to produce a combined library or application, then distribute
7182- * that combined work under the terms of your choosing, with no requirement
7183- * to comply with the obligations normally placed on you by section 4 of the
7184- * LGPL version 3 (or the corresponding section of a later version of the LGPL
7185- * should you choose to use a later version).
7186- *
7187- * This program is distributed in the hope that it will be useful,
7188- * but WITHOUT ANY WARRANTY; without even the implied warranty of
7189- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7190- * GNU Lesser General Public License for more details.
7191- *
7192- * You should have received a copy of the GNU Lesser General Public License
7193- * along with this program; if not, write to the Free Software
7194- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
7195- let version = " 1.4.3"
7196- let header =
7197- " // Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"
7198- let package_name = " bs-platform"
7199-
72007295end
72017296module Bsb_default : sig
72027297#1 " bsb_default.mli"
@@ -7348,7 +7443,7 @@ let resolve_package cwd package_name =
73487443
73497444 match Bs_pkg. resolve_bs_package ~cwd package_name with
73507445 | None ->
7351- Ext_pervasives. failwithf ~loc: __LOC__ " package: %s not found when resolve bs-dependencies " package_name
7446+ Bsb_exception. error ( Package_not_found ( package_name, None ))
73527447 | Some x ->
73537448 {
73547449 Bsb_config_types. package_name ;
0 commit comments