-
-
Notifications
You must be signed in to change notification settings - Fork 247
Add options to wildcard #86
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
Conversation
In fact it should read tsconfig
(Library template, source files lies in |
Docs modified |
mm @Toilal this will need more work let me.. |
If it's not possible, maybe the option could accept an array ? |
Would it be possible to loop on |
I have to change docs and two more minor things and it's done |
Good work! Could you take a look at the failing build please? |
@johnnyreilly sorry I'm modifiyng my VueProgram.js and translating to your VueProgram.ts xDD PS: mmm the test always the test haha give me some minutes |
Your tests are not working for me on Windows because absoluth path returns |
For what it's worth, I'm a Windows guy but I use the Linux subsystem to run fork-ts-checker-webpack-plugin tests. @piotr-oles could you review this when you get a moment please? |
But can you do it on another PR xD? Is not related with my changes |
Sorry - not sure I understand what you meant? Either way - tests are passing now 😄 |
src/VueProgram.ts
Outdated
const pattern = options.paths ? options.paths['@/*'] : undefined; | ||
const substitution = pattern ? options.paths['@/*'][0].replace('*', '') : 'src'; | ||
const isWildcard = moduleName.substr(0, 2) === '@/'; | ||
const discartedSymbols = ['.', '..', '/']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "discarted" meant to be "discarded" (misspelling)? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry
@@ -210,8 +210,7 @@ import Hello from '@/components/hello.vue' | |||
} | |||
``` | |||
|
|||
6. The commonly used `@` path wildcard will work if you set up a `baseUrl` and `paths` (in `compilerOptions`) to include `@/*`. If you don't set this, then | |||
the fallback for the `@` wildcard will be `[tsconfig directory]/src` (we hope to make this more flexible on future releases): | |||
6. It accepts any wildcard in your TypeScript configuration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have this, the wildcard
option in fork-ts-checker-webpack-plugin` was dropped right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it looks like you dropped that option (good!) since I don't see it here in the final file changes. 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault I was using Github "online" haha and every change was a commit
@CKGrafico Looks good! But I see you are going down the route I took too (trying to cover for the common cases). Let's hope there are no more folks giving us future wildcard issues before we beg Microsoft for an API in TypeScript to resolve those paths in tsconfig.json (or we'll finally tackle it ourselves!). 😨 |
Anybody needs something else? |
Looks good to me to merge! 🚀 |
I experience something I can't understand (again :p)... Even without this change, my project is working properly with You can reproduce this by running, this should raise errors in
|
@CKGrafico Could you test with #87 (https://github.com/Toilal/fork-ts-checker-webpack-plugin/tree/vue-non-ts-module-simple) ? It seems that we can handle wildcard module names the same way we handle relative module name (by building the "full" module name). TypeScript is able to solve paths like |
I just ran your PR locally
|
I'm going to check asap. |
@prograhammer I had this issue too. If you are using yarn, run |
In the integration vue test, the
Then all passes. Weird that Travis didn't catch it? |
So the total is 3 errors. 2 semantic, and 1 syntactic. @CKGrafico if you want to update that line in |
I'm pretty sure you don't run same TypeScript or TSLint version than the travis build. |
Ah @Toilal gotcha. Let me check that... |
Or maybe webpack is suddenly silent? I'm on my phone and can't get to my laptop til later tonight to check. |
@Toilal not sure that your PR :/ will work to every SO |
Checked if you don't use windows npm test is working well (The windows errors is not related with this PR we can merge this and made another one) |
I'll close my PR, it's simpler but only works magically in my project, with yours we are pretty sure it should work everywhere. Thanks a lot, it'll be included on my webpack template fork https://github.com/Toilal/vue-webpack-template when it's released in this library. |
Test failing after I've updated yarn? amazing |
Ok in index.spec something like this
returns an array of '1' is not number and length 1 and you're expecting to be 1 but on vue.spec you have the same and you are expecting 2, I'm assuming that is a strange mistake? and correcting it |
Yeah I think there might have been some extra Webpack output there, but with the latest package.json lock it seems to have gone away. (BTW, you guys should update to latest Node 8 (now LTS) and NPM 5 because NPM is as fast as Yarn now (and yarn is just another abstraction to learn on top of NPM anyway). Anyways, all good to merge! 🚀 |
From my experience it's still a bit slower. In fact. when there's a package-lock file, I use npm5, else I use Yarn. |
I think the PR is ready now :) |
Cool - @piotr-oles could you review when you get a moment please? |
Could you have a look to #88 ? Not sure how it's related ... |
Please is you're not to merge this soon, tell us and we will made a fork for our projects :D |
@piotr-oles could you take a look when you get a moment? @CKGrafico - until that time would you like me to publish it to our makeshift |
Not the best but sounds like a solution 💃 |
Give me an hour... |
@johnnyreilly mmm I think that you're not using my PR xD CKGrafico@f9c01f9 --> d6ce069#diff-23d36b6fe597b409b93d20e36766ff64R31 |
Yup - I didn't build from the |
Is this better? 4fce3bd |
Thank you for your work and sorry for delay :) |
Extend #77 (comment) PR
In progress adding @Toilal request