- Notifications
You must be signed in to change notification settings - Fork74
fix sass tilde importer partials support#193
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Thanks for this! Are you able to add a test or two to cover the change here?
dennispg commentedFeb 3, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
So I had taken a look at trying to add a test to cover this, but I didn't see any examples of modules or dependent modules that were already a part of the package.json that I could use. Would it be ok for me to loop in, for example, sass-mq as a devDependency to accomplish this, or is there a better way to mock it maybe? Maybe I could split out the functionality of |
6bc9ae0
tod49629b
Compared49629b
to15dee92
Comparedennispg commentedFeb 3, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@mrmckeb I've gone ahead and done a significant refactoring here, and split out the resolve bits into it's own function so that tests can be written against it directly. And I added the relevant tests as well. |
Also I removed the part where it was walking the file directory tree.. I don't think that was accomplishing what it was expected to, and was just not necessary. |
Thanks for this, I'm working through some refactoring today/tomorrow, but will release this over the course of the weekend. |
[](https://renovatebot.com)This PR contains the following updates:| Package | Change | Age | Adoption | Passing | Confidence ||---|---|---|---|---|---||[typescript-plugin-css-modules](https://togithub.com/mrmckeb/typescript-plugin-css-modules)| [`4.1.1` ->`4.2.2`](https://renovatebot.com/diffs/npm/typescript-plugin-css-modules/4.1.1/4.2.2)|[](https://docs.renovatebot.com/merge-confidence/)|[](https://docs.renovatebot.com/merge-confidence/)|[](https://docs.renovatebot.com/merge-confidence/)|[](https://docs.renovatebot.com/merge-confidence/)|---### Release Notes<details><summary>mrmckeb/typescript-plugin-css-modules</summary>###[`v4.2.2`](https://togithub.com/mrmckeb/typescript-plugin-css-modules/releases/tag/v4.2.2)[CompareSource](https://togithub.com/mrmckeb/typescript-plugin-css-modules/compare/v4.2.1...v4.2.2)**Bug fixes:**- Fix potentially fatal CSS classname regexp bug([@​mrmckeb](https://togithub.com/mrmckeb),[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/205](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/205)).**Full changelog**:mrmckeb/typescript-plugin-css-modules@v4.2.1...v4.2.2###[`v4.2.1`](https://togithub.com/mrmckeb/typescript-plugin-css-modules/releases/tag/v4.2.1)[CompareSource](https://togithub.com/mrmckeb/typescript-plugin-css-modules/compare/v4.2.0...v4.2.1)**Bug fixes:**- Correct `additionalData` typo([@​mrmckeb](https://togithub.com/mrmckeb),[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/204](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/204)).**Full changelog**:mrmckeb/typescript-plugin-css-modules@v4.2.0...v4.2.1###[`v4.2.0`](https://togithub.com/mrmckeb/typescript-plugin-css-modules/releases/tag/v4.2.0)[CompareSource](https://togithub.com/mrmckeb/typescript-plugin-css-modules/compare/v4.1.1...v4.2.0)**New features:**- Add Less support for `goToDefinition`([@​mariusGundersen](https://togithub.com/mariusGundersen),[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/192](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/192)).- Add `additionalData` option to append text content to files beforethey're processed ([@​mrmckeb](https://togithub.com/mrmckeb),[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/203](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/203)).**Bug fixes:**- Fix Sass tilde importer partial support([@​dennispg](https://togithub.com/dennispg),[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/193](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/193)).**Other:**- Remove unsupported `postcss-*` packages([@​mrmckeb](https://togithub.com/mrmckeb),[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/201](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/201)).- Improve `goToDefinition` documentation and add additional tests([@​mrmckeb](https://togithub.com/mrmckeb),[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/202](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/202)).**New contributors**- [@​mariusGundersen](https://togithub.com/mariusGundersen) madetheir first contribution in[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/192](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/192)- [@​dennispg](https://togithub.com/dennispg) made their firstcontribution in[https://github.com/mrmckeb/typescript-plugin-css-modules/pull/193](https://togithub.com/mrmckeb/typescript-plugin-css-modules/pull/193)**Full changelog**:mrmckeb/typescript-plugin-css-modules@v4.1.1...v4.2.0</details>---### Configuration📅 **Schedule**: Branch creation - At any time (no schedule defined),Automerge - At any time (no schedule defined).🚦 **Automerge**: Disabled by config. Please merge this manually once youare satisfied.♻ **Rebasing**: Whenever PR becomes conflicted, or you tick therebase/retry checkbox.🔕 **Ignore**: Close this PR and you won't be reminded about this updateagain.---- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, checkthis box---This PR has been generated by [MendRenovate](https://www.mend.io/free-developer-tools/renovate/). Viewrepository job log[here](https://app.renovatebot.com/dashboard#github/arrow-kt/arrow-website).<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDMuMSIsInVwZGF0ZWRJblZlciI6IjM0LjE0Ni4xIn0=-->Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This change fixes a bug when importing partial sass files from
node_modules
which happen to have their basename exist also in some part of the dirname.For example,
@import '~sass-mq/mq';
should resolve tonode_modules/sass-mq/_mq.scss
but instead is looking fornode_modules/sass-_mq/mq.scss
.