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

Declare some required dependencies #296

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

akx
Copy link
Contributor

@akx akx commented Jun 18, 2024

ast-types is required (

import * as astTypes from 'ast-types'
), but isn't declared as a dependency.

When using e.g. pnpm, it doesn't get hoisted into node_modules from being recast's transitive dependency:

$ pnpm why ast-types
Legend: production dependency, optional only, dev only

prettier-plugin-tailwindcss@0.6.5 /Users/akx/build/prettier-plugin-tailwindcss

devDependencies:
recast 0.20.5
└── ast-types 0.14.2

so build fails:

> node build.mjs --minify

✘ [ERROR] Could not resolve "ast-types"

    src/index.ts:6:26:
      6 │ import * as astTypes from 'ast-types'

The same stands for @babel/types with a slightly different error (since it's not esbuild but dts complaining).

With these added, things work again:

$ git clean -fdx . -e .idea && pnpm i && pnpm build
[...]
Progress: resolved 607, reused 548, downloaded 0, added 548, done
[...]
DTS ⚡️ Build success in 516ms
$

@thecrypticace thecrypticace merged commit 031e5f1 into tailwindlabs:main Jun 18, 2024
1 check passed
@thecrypticace
Copy link
Contributor

Thanks!

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.

None yet

2 participants