Skip to content
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

rootDir option not passed #226

Merged
merged 3 commits into from
Jul 22, 2019
Merged

rootDir option not passed #226

merged 3 commits into from
Jul 22, 2019

Conversation

renoirb
Copy link
Contributor

@renoirb renoirb commented Jul 13, 2019

Related to #225

@codecov
Copy link

codecov bot commented Jul 13, 2019

Codecov Report

Merging #226 into master will increase coverage by 0.23%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #226      +/-   ##
==========================================
+ Coverage   74.82%   75.05%   +0.23%     
==========================================
  Files          11       11              
  Lines         417      421       +4     
  Branches      156      160       +4     
==========================================
+ Hits          312      316       +4     
  Misses        100      100              
  Partials        5        5
Impacted Files Coverage Δ
src/index.ts 71.63% <100%> (+0.31%) ⬆️
src/babel/preset.ts 94.73% <100%> (+0.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f0aa1d...475938e. Read the comment docs.

tasks.push({
title: `Bundle ${source.files.join(', ')} in ${format} format`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I've mixed this here.
This would be more related to when you want multiple build targets though. #219

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<question>Any plans for supporting loading proper {targets:{}} hash-map depending on the target?</question>

src/index.ts Outdated
@@ -75,12 +75,14 @@ export class Bundler {
constructor(config: Config, public options: Options = {}) {
logger.setOptions({ logLevel: options.logLevel })

this.rootDir = path.resolve(options.rootDir || '.')
const rootDir = options.rootDir || '.'
this.rootDir = path.resolve(rootDir)
Copy link
Owner

Choose a reason for hiding this comment

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

I guess we don't need to change these lines

Copy link
Contributor Author

@renoirb renoirb Jul 16, 2019

Choose a reason for hiding this comment

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

We don't indeed.

<question>
Could we have a way to support splitting configuration from there for monorepo setup?
Let's say we have settings common for all in './bili.config.js'.

When we're asking to run bili from another rootDir, we could merge the two bili.config.js (with other possible file names)

From there, we could have a way to check if the value is '.' and we want a way to use bili.config.js from there, then, resolve from ./${rootDir}/bili.config.js and merge values from there.

What do you think?
</question>

Copy link
Owner

Choose a reason for hiding this comment

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

I prefer the way tsconfig.json works:

  • You can populate a common bili.config.js in root directory, and another bili.config.js with module.exports = {extends:'../../bili.config.js'} in a leaf package like packages/foo
  • Then you can run bili in packages/foo

(not implemented yet)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which part is not implemented yet.
The "extends" key part that'd take the string, resolve its path and (?).

If you want a reproduction repo with modules in different formats, along with testing you can use the "reproduction repo" in #219 (I can add more use-cases too: tsx,jsx,vue,ts,js,wasm,yaml, -- things rollup plugins can handle-- etc).

@@ -58,6 +58,7 @@ cli
.example(bin => ` ${bin} --input.index src/foo.ts`)
.action(async (input, options) => {
const { Bundler } = await import('./')
const rootDir = options.rootDir || '.'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, this PR would only be for this line then.

* Added DEBUG to make @babel/preset-env debug
@codecov-io
Copy link

Codecov Report

Merging #226 into master will increase coverage by 0.23%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #226      +/-   ##
==========================================
+ Coverage   74.82%   75.05%   +0.23%     
==========================================
  Files          11       11              
  Lines         417      421       +4     
  Branches      156      160       +4     
==========================================
+ Hits          312      316       +4     
  Misses        100      100              
  Partials        5        5
Impacted Files Coverage Δ
src/index.ts 71.63% <100%> (+0.31%) ⬆️
src/babel/preset.ts 94.73% <100%> (+0.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f0aa1d...fb0cf1b. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Jul 22, 2019

Codecov Report

Merging #226 into master will increase coverage by 0.17%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #226      +/-   ##
========================================
+ Coverage   74.82%    75%   +0.17%     
========================================
  Files          11     11              
  Lines         417    420       +3     
  Branches      156    158       +2     
========================================
+ Hits          312    315       +3     
  Misses        100    100              
  Partials        5      5
Impacted Files Coverage Δ
src/index.ts 71.63% <100%> (+0.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f0aa1d...7045c65. Read the comment docs.

@egoist egoist merged commit f3f1be7 into egoist:master Jul 22, 2019
@egoist
Copy link
Owner

egoist commented Jul 22, 2019

🎉 This PR is included in version 4.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants