In this article, we review attw script in CopilotKit codebase. You will learn:
What is attw?
attw script in CopilotKit
What is attw?
attw is a CLI for arethetypeswrong.github.io..This project attempts to analyze npm package contents for issues with their TypeScript types, particularly ESM-related module resolution issues. The following kinds of problems can be detected in the node10, node16, and bundler module resolution modes:
β οΈ ESM (dynamic import only).
βοΈ Incorrect default export.
π Unexpected module syntax.
π₯΄ Internal resolution error.
π΅οΈββοΈ Named exports.
Below is a check I ran on my npm package, thinkthroo and these were the issues found
attw script in CopilotKit
Since now that we understand what attw does, letβs review how CopilotKit uses this in the package.json script.
I the CopilotKit/packages/agentcore-runner/package.json,. you will find the below code nsippet:
"scripts": {
...
"attw": "attw --pack . --profile node16"
},
This has two arguments/options/flags passed.
- pack
Specify a directory to run npm pack in (instead of specifying a tarball filename), analyze the resulting tarball, and delete it afterwards.
attw --pack .
- profile
Profiles select a set of resolution modes to require/ignore. All are evaluated but failures outside of those required are ignored.
The available profiles are:
strict - requires all resolutions
node16 - ignores node10 resolution failures
esm-only - ignores CJS resolution failures
In the CLI: --profile
The script in CopilotKit ignores the node10 resolution failures.
About me:
Hey, my name is ramunarasinga. Email: ramunarasinga@gmail.com
Tired of AI slop?
I spent 3+ years studying OSS codebases and wrote 350+ articles on what makes them production-grade. I built
Codebase architecture skills, inspired by best OSS projects.


Top comments (0)