-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
integ-runner: integ-runner implictly depends on ts-node #23710
Comments
Hi @tmokmss That's a good question. To me it's in the same realm as running Peer Dependencies these aren't much different from regular dependencies any more, in the sense that they are automatically installed. So adding Maybe we should check for it's presence and print a nice error? |
Hi @mrgrain, thanks. I agree with that adding ts-node as a dependency is technically not a proper solution, and raising a nicer error is enough for the problem. At the same time, I also tend to think installing ts-node automatically would be more user-friendly and a huge benefit since I believe most users will use integ-runner with TypeScript. Also, integ-runner is usually added as a dev dependency so it shouldn't much affect users who cares CDK package size. |
At some point I had the idea of checking @tmokmss I'm curious - how did you come about finding this out? Did you add integ-runner to a JS only app? PS: Downgrading to p2 since this is an experimental package. But it's on our backlog for integ-runner. |
@mrgrain Sure:) I found this when developing a CDK construct library by using projen (example). The projen template does not include ts-node by default (like the |
Makes sense. I guess the projen template wants you to first compile your code to JS? integ-runner does account for that, if it fnds a js file of the same name or run with |
yeah that's why I set an additional build step here; iirc I believe some guideline about using integ-runner for a CDK construct library will also help a lot (maybe after graduation from experimental). I'm also not sure how we can use the latest integ-runner with some older aws-cdk-lib package (related question: #23711). |
Absolutely! And native projen support is definitely on my list 😅
|
Cool, I'm looking forward to it ❤️ |
Yes, I hate this. But haven't found a good way yet to change the default without breaking everyone :( |
Describe the bug
Hi, I found a tiny minor issue regarding integ-runner. It'd be great if you check it when you get a chance.
Starting from 2.60.0 (#22058), it seems @aws-cdk/integ-runner implicitly depends on ts-node.
aws-cdk/packages/@aws-cdk/integ-runner/lib/runner/integration-tests.ts
Line 251 in aca8a25
Without ts-node, the error below happens:
As for usual CDK apps, ts-node is installed by default so it shouldn't be a big problem. In CDK construct library templates generated by projen, however, ts-node is not installed by default so this library behaves somewhat confusing.
Isn't it be more clear if it is explicitly specified in package.json of integ-runner as peerDependency or Dependency?
Expected Behavior
When installing @aws-cdk/integ-runner, ts-node is installed automatically or at least suggested as a peer dependency.
It will help us a lot if there is more clear way to know the requirements of ts-node, or it is installed automatically.
Current Behavior
We get an error without ts-node. Also we need to carefully inspect the error and manually install ts-node.
Reproduction Steps
Use integ-runner for
*integ.ts
files without installing ts-node.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.60.0
Framework Version
2.60.0
Node.js Version
v16.18.1
OS
macOS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: