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

Custom tsconfig.json for angular apps. #2669

Merged
merged 9 commits into from Jan 10, 2018
Merged

Custom tsconfig.json for angular apps. #2669

merged 9 commits into from Jan 10, 2018

Conversation

igor-dv
Copy link
Member

@igor-dv igor-dv commented Jan 7, 2018

Issue: one of #2645

What I did

Added ability to create custom tsconfig.json in the storybook config dir.

How to test

Add custom tsconfig.json to the .storybook dir (I've added already one in angular-cli example)

@igor-dv igor-dv changed the title Add ability to load a custom tsconfig.json in the storybook config dir. Custom tsconfig.json for angular apps. Jan 7, 2018
@igor-dv igor-dv self-assigned this Jan 7, 2018
@codecov
Copy link

codecov bot commented Jan 7, 2018

Codecov Report

Merging #2669 into master will increase coverage by <.01%.
The diff coverage is 47.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2669      +/-   ##
==========================================
+ Coverage   34.35%   34.36%   +<.01%     
==========================================
  Files         389      390       +1     
  Lines        8747     8771      +24     
  Branches      907      912       +5     
==========================================
+ Hits         3005     3014       +9     
- Misses       5141     5150       +9     
- Partials      601      607       +6
Impacted Files Coverage Δ
app/angular/src/server/index.js 0% <ø> (ø) ⬆️
...p/angular/src/server/config/webpack.config.prod.js 0% <ø> (ø) ⬆️
app/angular/src/server/config/webpack.config.js 0% <ø> (ø) ⬆️
app/angular/src/server/config.js 0% <0%> (ø) ⬆️
app/angular/src/server/ts_config.js 40.9% <52.94%> (ø)
app/vue/src/server/config/babel.js 0% <0%> (-100%) ⬇️
app/react/src/server/utils.js 0% <0%> (-53.58%) ⬇️
lib/ui/src/modules/ui/libs/filters.js 48.64% <0%> (ø) ⬆️
lib/components/src/table/cell.js 65.21% <0%> (ø) ⬆️
addons/a11y/src/components/Report/Rules.js 0% <0%> (ø) ⬆️
... and 53 more

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 a5d439c...cd40276. Read the comment docs.

@amcdnl
Copy link
Member

amcdnl commented Jan 9, 2018

@igor-dv - Whats the API for this?

@amcdnl amcdnl self-requested a review January 9, 2018 19:05
@igor-dv
Copy link
Member Author

igor-dv commented Jan 9, 2018

@amcdnl just put tsconfig.json to the .storybook dir (like custom babelrc or webpack.config.js)

@amcdnl
Copy link
Member

amcdnl commented Jan 9, 2018

@igor-dv - Can you add this in the docs here? https://storybook.js.org/basics/guide-angular/

Copy link
Member

@amcdnl amcdnl left a comment

Choose a reason for hiding this comment

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

LGTM

@alterx alterx merged commit 5b74bcd into master Jan 10, 2018
@alterx alterx mentioned this pull request Jan 10, 2018
@@ -15,6 +16,9 @@ export default function(configType, baseConfig, configDir) {
const babelConfig = loadBabelConfig(configDir);
config.module.rules[0].query = babelConfig;

const tsOptions = loadTsConfig(configDir);
config.module.rules[1].loaders[0].options = tsOptions;
Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry if it looks ugly, IMO need some work moving webpack configurations to the core.

@igor-dv igor-dv deleted the custom-ts-config branch January 10, 2018 07:14
@igor-dv
Copy link
Member Author

igor-dv commented Jan 10, 2018

Can you add this in the docs here? https://storybook.js.org/basics/guide-angular/

Will add in a separate PR then (or maybe someone will add =)) )

@eagor
Copy link

eagor commented Jan 18, 2020

Can you add this in the docs here? https://storybook.js.org/basics/guide-angular/

Will add in a separate PR then (or maybe someone will add =)) )

is it working only for Angular? or React as well?

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

Successfully merging this pull request may close these issues.

None yet

4 participants