Skip to content

Commit 651b086

Browse files
committed
🚚 - Rename bsconfig -> config
1 parent 0ed26b6 commit 651b086

File tree

12 files changed

+114
-108
lines changed

12 files changed

+114
-108
lines changed

src/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ pub struct CompilerArgs {
5757
pub fn get_compiler_args(path: &str, rescript_version: Option<String>, bsc_path: Option<String>) -> String {
5858
let filename = &helpers::get_abs_path(path);
5959
let package_root = helpers::get_abs_path(
60-
&helpers::get_nearest_bsconfig(&std::path::PathBuf::from(path)).expect("Couldn't find package root"),
60+
&helpers::get_nearest_config(&std::path::PathBuf::from(path)).expect("Couldn't find package root"),
6161
);
6262
let workspace_root = get_workspace_root(&package_root).map(|p| helpers::get_abs_path(&p));
6363
let root_rescript_config =
64-
packages::read_bsconfig(&workspace_root.to_owned().unwrap_or(package_root.to_owned()));
65-
let rescript_config = packages::read_bsconfig(&package_root);
64+
packages::read_config(&workspace_root.to_owned().unwrap_or(package_root.to_owned()));
65+
let rescript_config = packages::read_config(&package_root);
6666
let rescript_version = if let Some(rescript_version) = rescript_version {
6767
rescript_version
6868
} else {

src/build/build_types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ impl BuildState {
119119
deps_initialized: false,
120120
}
121121
}
122+
122123
pub fn insert_module(&mut self, module_name: &str, module: Module) {
123124
self.modules.insert(module_name.to_owned(), module);
124125
self.module_names.insert(module_name.to_owned());

src/build/clean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn clean_mjs_files(build_state: &BuildState) {
7474
.join(&source_file.implementation.path)
7575
.to_string_lossy()
7676
.to_string(),
77-
root_package.bsconfig.get_suffix(),
77+
root_package.config.get_suffix(),
7878
))
7979
}
8080
_ => None,

src/build/compile.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod dependency_cycle;
55
use super::build_types::*;
66
use super::logs;
77
use super::packages;
8-
use crate::bsconfig;
8+
use crate::config;
99
use crate::helpers;
1010
use ahash::{AHashMap, AHashSet};
1111
use console::style;
@@ -359,8 +359,8 @@ pub fn compile(
359359
}
360360

361361
pub fn compiler_args(
362-
config: &bsconfig::Config,
363-
root_config: &bsconfig::Config,
362+
config: &config::Config,
363+
root_config: &config::Config,
364364
ast_path: &str,
365365
version: &str,
366366
file_path: &str,
@@ -374,11 +374,11 @@ pub fn compiler_args(
374374
) -> Vec<String> {
375375
let normal_deps = config.bs_dependencies.as_ref().unwrap_or(&vec![]).to_owned();
376376

377-
let bsc_flags = bsconfig::flatten_flags(&config.bsc_flags);
377+
let bsc_flags = config::flatten_flags(&config.bsc_flags);
378378
// don't compile dev-deps yet
379379
// let dev_deps = source
380380
// .package
381-
// .bsconfig
381+
// .config
382382
// .bs_dev_dependencies
383383
// .as_ref()
384384
// .unwrap_or(&vec![])
@@ -442,10 +442,10 @@ pub fn compiler_args(
442442
};
443443

444444
let warn_error = match warnings.error {
445-
Some(bsconfig::Error::Catchall(true)) => {
445+
Some(config::Error::Catchall(true)) => {
446446
vec!["-warn-error".to_string(), "A".to_string()]
447447
}
448-
Some(bsconfig::Error::Qualified(errors)) => {
448+
Some(config::Error::Qualified(errors)) => {
449449
vec!["-warn-error".to_string(), errors.to_string()]
450450
}
451451
_ => vec![],
@@ -532,8 +532,8 @@ fn compile_file(
532532
let module_name = helpers::file_path_to_module_name(implementation_file_path, &package.namespace);
533533
let has_interface = module.get_interface().is_some();
534534
let to_mjs_args = compiler_args(
535-
&package.bsconfig,
536-
&root_package.bsconfig,
535+
&package.config,
536+
&root_package.config,
537537
ast_path,
538538
version,
539539
implementation_file_path,

0 commit comments

Comments
 (0)