-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: add regex for vue SFC to prevent instrumenting style and templates #180
Conversation
Hello @Nol-go, thanks for your PR. Don't worry you did this correctly as i see it 😊. You could try to test the fix through modifying your package json to point to the branch of your fork of the git repo. See this: https://docs.npmjs.com/cli/v10/configuring-npm/package-json#dependencies. You can also use a local path if you have both the projects on your local machine. See this: https://docs.npmjs.com/cli/v10/configuring-npm/package-json#dependencies. You can also link through npm, although i have had some issues using this on Windows. See this: https://docs.npmjs.com/cli/v10/commands/npm-link. |
I managed to install it, I had with building the package because the package.json does not have a prepare script. |
After further investigation, the id had the got rid of the query only for one of the three chunk so I changed the regex isVueSFC to check for We could add a config value for this but I think it's to troublesome for a small minority of cases, I don't even know if this feature (replacing the vue SFC extension name by a custom one) is used by someone. Also, I think the problem will still arise when there is multiple root |
here is a local test result using the updated code with the following config. istanbulPlugin({
include: 'src/*',
exclude: ['node_modules', 'test/'],
cypress: true,
requireEnv: true,
forceBuildInstrument: true,
}) and running As you can see, the |
@iFaxity PR is up for review |
As of this comment, the code does not seem to work for option API. I'll look into it later. |
@lukasbrzobohaty I added you to my project, and created a branch for you. You should be able to push code to it. But please do not touch the |
I fixed @lukasbrzobohaty's issue with hybrid option and composition api.here are screenshots of the coverage in browser, and nyc's report after cypress ran on #178 linked project. |
@iFaxity It all seems good to me, waiting for review and approval. |
Hi @Nol-go, nice job! I will make some minor changes as some changes i do not want pushed to the repo. |
I will move the dependency changes as well as those are handled by dependabot. |
Works fine for me, please do tell me when the patch will be versioned to npmjs.com. |
@Nol-go, when the PR gets merged and pushed to NPM the version will be added here as a comment, so just have notifications on and you will get a notification when the version is out :). |
🎉 This PR is included in version 5.0.0-rc.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@Nol-go an rc release is published on NPM. You should within minutes be able to use the For example using |
🎉 This PR is included in version 6.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Single file Components no longer have their html or css instrumented instead of their script
Closes #96 #178 #89
I was inspired by @sawmuraÏ's fix but didn't use it because I didn't know if it would break other stuff. Instead I added a regex to check if the id links to a vue SFC and if so check if it does not link to the script part.
I tested the RegExp on my computer with the following little script and it worked well:
PS: first ever PR on github so I'm not sure if I did things right or not.