Skip to content

Conversation

@paul-vd
Copy link
Contributor

@paul-vd paul-vd commented Mar 20, 2023

Fixes: #150

This allows to define the path for the file in the transformer, for example

    const result = await applyTransform(
      transformer,
      {
        path: "src/components/Example.tsx",
        source: `
        import React, { useState } from "react";
      
        export default function Example() {
        const [state] = useState("Hello World");
      
        return <div>{state}</div>;
      }`,
      },
      { parser: "tsx" }
    );

Copy link
Contributor

@danieldelcore danieldelcore 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 to me! Thanks for contributing!

@danieldelcore
Copy link
Contributor

Oh btw, could you please generate a changeset for the package so it can be automatically versioned and deployed 🙏

yarn changeset and follow the prompts 👍

@paul-vd

This comment was marked as resolved.

@paul-vd paul-vd force-pushed the file-input-test-utils branch from 21582d3 to 6e5fa3d Compare March 22, 2023 13:04
@paul-vd
Copy link
Contributor Author

paul-vd commented Mar 22, 2023

@danieldelcore I ran the changeset, can you please confirm if it is correct?

@danieldelcore
Copy link
Contributor

Loooks good!! Thanks again!

@danieldelcore danieldelcore merged commit f9f48bf into hypermod-io:main Mar 27, 2023
@paul-vd paul-vd deleted the file-input-test-utils branch March 27, 2023 13:29
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.

No path for the applyTransform with test utils

2 participants