Skip to content

Support .mjs and .bs.mjs for Node.js ES-module-support, and lower "suffix" option into "package-specs", #4116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
236197a
(- meta new) Ignore directory-local _opam switch
ELLIOTTCABLE Apr 13, 2020
0fb4ab9
(- style new) Add .editorconfig file
ELLIOTTCABLE Mar 9, 2020
57a95b0
(style new) Add barebones Ocamlformat configuration
ELLIOTTCABLE Mar 8, 2020
f576773
(- noop style fix) Run relevant sections thru ocamlformat
ELLIOTTCABLE Feb 4, 2020
ae1775d
(- dep new) Add prettier as a devDependency
ELLIOTTCABLE Apr 13, 2020
5c307dd
(- style re) Reformat relevant JS/JSON files with Prettier
ELLIOTTCABLE Apr 13, 2020
e95b0e3
(- style rm) Ignore js_name_of_module_id when formatting
ELLIOTTCABLE Mar 8, 2020
01b4c78
(- noop re) Rename Js_packages_info to Js_package_info
ELLIOTTCABLE Mar 9, 2020
056adf9
(- noop re) Clarify naming of some package-info interfaces
ELLIOTTCABLE Mar 9, 2020
0a33ff1
(- re) Clarify name of Js_packages_state to Js_current_package_info
ELLIOTTCABLE Mar 26, 2020
c25b317
(- re) Rename npm_package_path to package_info, matching correspondin…
ELLIOTTCABLE Apr 6, 2020
10f7d44
(NF new) Add an "extension" compoment to -bs-package-output
ELLIOTTCABLE Mar 9, 2020
c8bbb6c
(!! NF re config) Moving top-level "suffix" config down into "package…
ELLIOTTCABLE Jan 26, 2020
c79d9ef
(- fix doc) Update json-schema to match new "suffix" location
ELLIOTTCABLE Feb 4, 2020
a9dc25c
(- NF fix) Remove all .bs.m?js-suffixed build-products, not just .bs.js
ELLIOTTCABLE Feb 4, 2020
da606d1
(- re) change_ext_ns_suffix: Label ambiguous string-args, clarify name
ELLIOTTCABLE Feb 4, 2020
9f4ab20
(fix) Remove remaining references to bs_suffix in bsb
ELLIOTTCABLE Apr 6, 2020
4b65444
(- meta) Update lib/. Plz explain why this is checked into source-con…
ELLIOTTCABLE Apr 6, 2020
73d2e09
(- new) Add extension to the -bs-package-output generated by bsb
ELLIOTTCABLE Apr 6, 2020
aec8be5
(- fix) Include non-.bs-prefixed .mjs in supported extensions
ELLIOTTCABLE Apr 6, 2020
adb93d3
(- doc fix) Remove a couple old, commented out references to dead code
ELLIOTTCABLE Apr 8, 2020
4086b61
(!! new) Deprecate -bs-suffix; add extensions to -bs-package-output
ELLIOTTCABLE Apr 10, 2020
0908593
(new) Support multiple in-source builds with differing file-extensions
ELLIOTTCABLE Apr 10, 2020
6059c12
(- revert bsb) Restore backwards-compat for deprecated toplevel 'suff…
ELLIOTTCABLE Apr 13, 2020
f99498c
(new style) Add a .prettierrc for auto-formatting JavaScript and JSON…
ELLIOTTCABLE Apr 13, 2020
c9f1820
(- doc re) Improve formatting of suffix-deprecation message
ELLIOTTCABLE Apr 13, 2020
09f89a2
(- fix) Only deprecation-warn if config present
ELLIOTTCABLE Apr 13, 2020
da51ab3
(- fix test) Update in_source test's error-message
ELLIOTTCABLE Apr 13, 2020
7cc9fc9
(test fix) Update bsconfig.json in each build-test
ELLIOTTCABLE Apr 13, 2020
20d87f1
(- test fix) Include module-type in namespacing build-test bsconfig
ELLIOTTCABLE Apr 13, 2020
2fa8b0b
(fix) Repair resolution of mis-matched extensions
ELLIOTTCABLE Apr 14, 2020
ce8e5c9
(new test bsb) Test deprecation of top-level suffix field
ELLIOTTCABLE Apr 14, 2020
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
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
root = true

[*]
charset = utf-8

[*.{ml,mli,mll,mly}, *.{js,jsx,ts,tsx,vue,json}]
max_line_length = 92
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.{js,jsx,ts,tsx,vue,json}]
max_line_length = 92
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[{Makefile, makefile, GNUmakefile}]
indent_style = tab
indent_size = 4

[Makefile.*]
indent_style = tab
indent_size = 4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ reason/
man/
lib/ocaml
bin/*
_opam

*.exe
odoc_gen/*.cmxs
Expand Down
13 changes: 13 additions & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
margin = 80

parse-docstrings = true
wrap-comments = true

field-space = loose
let-binding-spacing = sparse
module-item-spacing = preserve

let-open = auto

break-cases = fit-or-vertical
sequence-blank-line = preserve-one
4 changes: 4 additions & 0 deletions .ocamlformat-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Files containing cppo directives that ocamlformat cannot parse
#jscomp/core/js_name_of_module_id.ml
#jscomp/core/js_cmj_load.ml
#jscomp/core/lam_compile_main.ml
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Explicitly set to override .editorconfig with a lower value; see:
# <https://prettier.io/docs/en/options.html#print-width>
printWidth: 80

# Attempting to match existing style in the codebase
semi: false
singleQuote: true
24 changes: 13 additions & 11 deletions docs/docson/build-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"in-source": {
"type": "boolean",
"description": "Default: false."
},
"suffix" : {
"enum" : [
".js",
".mjs",
".bs.js",
".bs.mjs"
],
"description": "suffix of generated JavaScript files, default varies by 'module' and 'in-source'"
}
},
"required": [
Expand Down Expand Up @@ -78,7 +87,7 @@
}
}
]

}
},
"pp-specs": {
Expand Down Expand Up @@ -139,7 +148,7 @@
"type": "string",
"description": "name of the directory"
},

"type": {
"enum": [
"dev",
Expand Down Expand Up @@ -379,7 +388,7 @@
},
"ignored-dirs" : {
"type" : "array",
"items": {
"items": {
"type" : "string"
},
"description": "a list of directories that bsb will not look into"
Expand Down Expand Up @@ -410,7 +419,7 @@
"gentypeconfig": {
"$ref" : "#/definitions/gentype-specs",
"description": "gentype config, see cristianoc/genType for more details"
},
},
"bsc-flags": {
"$ref": "#/definitions/bsc-flags",
"description": "Flags passed to bsc.exe"
Expand Down Expand Up @@ -482,13 +491,6 @@
"type": "string"
},
"description": "(Not needed usually) arguments to pass to `refmt` above. Default: `[\"--print\", \"binary\"]`."
},
"suffix" : {
"enum" : [
".js",
".bs.js"
],
"description": "suffix of generated js files, default to [.js] "
}
},
"additionalProperties": false,
Expand Down
9 changes: 5 additions & 4 deletions jscomp/bsb/bsb_build_schemas.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* Copyright (C) 2017 Authors of BuckleScript
*
*
* 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
Expand All @@ -17,7 +17,7 @@
* 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. *)
Expand Down Expand Up @@ -75,11 +75,12 @@ let generators = "generators"
let command = "command"
let edge = "edge"
let namespace = "namespace"
let _module = "module"
let in_source = "in-source"
let suffix = "suffix"
let warnings = "warnings"
let number = "number"
let error = "error"
let suffix = "suffix"
let gentypeconfig = "gentypeconfig"
let path = "path"
let ignored_dirs = "ignored-dirs"
let ignored_dirs = "ignored-dirs"
Loading