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

Integrate Input#document #36

Merged
merged 3 commits into from
Jan 16, 2025
Merged

Integrate Input#document #36

merged 3 commits into from
Jan 16, 2025

Conversation

romainmenke
Copy link
Contributor

PostCSS 8.4.x started using Node.source.input.css more and more in various methods.
Mostly when calculating source positions (e.g. positionInside, rangeBy, ...).

This conflicted with how postcss-styled-syntax was implemented, so we added a new field through which custom syntax plugins can provide the entire document source.

const root = syntax.parse(
	cssSource,
	{
		document: jsSource,
		map: false,
	},
);

This is mostly important for linters where accurate positioning in the original source files is key.

It seemed that there was no test coverage for these postcss node methods so I've added one commit with some test coverage and a second where I integrated Input#document and updated postcss in the lock file.

@hudochenkov
Copy link
Owner

Thank you! This would explain regression I saw while updating to Stylelint 16.11.0+ (version, where new utilities for reported ranges were used).

I didn't feel comfortable with massive change in package-lock due to lockfile version change. So, if you can, could you rebase on main, please? main branch uses latest PostCSS version.

@romainmenke
Copy link
Contributor Author

I didn't feel comfortable with massive change in package-lock due to lockfile version change.

Thank you for catching this!
Sorry for the inconvenience, I completely overlooked that the diff was larger than expected.

@hudochenkov
Copy link
Owner

Sorry for the inconvenience, I completely overlooked that the diff was larger than expected.

No worries :)

@hudochenkov hudochenkov merged commit aa1405d into hudochenkov:main Jan 16, 2025
4 checks passed
@hudochenkov
Copy link
Owner

Thank you for your help!

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

Successfully merging this pull request may close these issues.

2 participants