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

Fix Rollup/Vite generated exports #801

Merged
merged 7 commits into from
Sep 1, 2022
Merged

Fix Rollup/Vite generated exports #801

merged 7 commits into from
Sep 1, 2022

Conversation

@mrm007 mrm007 requested a review from a team August 30, 2022 12:49
@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2022

🦋 Changeset detected

Latest commit: ae10b85

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vanilla-extract/integration Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

.prettierignore Outdated Show resolved Hide resolved
packages/integration/package.json Outdated Show resolved Hide resolved
packages/integration/package.json Outdated Show resolved Hide resolved
packages/integration/src/processVanillaFile.test.ts Outdated Show resolved Hide resolved
value,
/(features_compositionOnly__1o6ek504|features_styleCompositionInSelector__1o6ek507|features_styleVariantsCompositionInSelector_variant__1o6ek50a)\s/g,
);
const exportsObject = evalCode(`module.exports = ${exports}`, 'dummy.js');
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we using eval here? Looks like we could just snapshot exports to the same effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, of course. I wanted to make it easier to read than

    expect(exports).toMatchInlineSnapshot(
      `"{compositionOnly:'features_mergedStyle__1o6ek500 features_styleWithComposition__1o6ek501',mergedStyle:'features_mergedStyle__1o6ek500',styleCompositionInSelector:'features__1o6ek505 features__1o6ek506',styleVariantsCompositionInSelector:{variant:'features__1o6ek508 features__1o6ek509'},styleVariantsWithComposition:{variant:'features_styleVariantsWithComposition_variant__1o6ek502 features_mergedStyle__1o6ek500'},styleVariantsWithMappedComposition:{variant:'features_styleVariantsWithMappedComposition_variant__1o6ek503 features_mergedStyle__1o6ek500'},styleWithComposition:'features_styleWithComposition__1o6ek501 features_mergedStyle__1o6ek500'}"`,
    );

Copy link
Contributor

@mattcompiles mattcompiles Aug 31, 2022

Choose a reason for hiding this comment

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

Could we use JSON.parse instead?

Copy link
Contributor Author

@mrm007 mrm007 Aug 31, 2022

Choose a reason for hiding this comment

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

Nope, not a JSON string (keys are not quoted and values are quoted with single quotes)

Copy link
Contributor

@mattcompiles mattcompiles left a comment

Choose a reason for hiding this comment

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

Looks good. Just a small tweak to the changeset.

.changeset/plenty-comics-compete.md Outdated Show resolved Hide resolved
@mrm007 mrm007 merged commit bb48520 into vanilla-extract-css:master Sep 1, 2022
@mrm007 mrm007 deleted the fix-stringify-exports branch September 1, 2022 01:26
@seek-oss-ci seek-oss-ci mentioned this pull request Sep 1, 2022
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