Skip to content

Declare some required dependencies#296

Merged
thecrypticace merged 1 commit intotailwindlabs:mainfrom
akx:ast-types
Jun 18, 2024
Merged

Declare some required dependencies#296
thecrypticace merged 1 commit intotailwindlabs:mainfrom
akx:ast-types

Conversation

@akx
Copy link
Copy Markdown
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

[email protected] /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
@thecrypticace
Copy link
Copy Markdown
Contributor

Thanks!

bronisMateusz pushed a commit to bronisMateusz/prettier-plugin-tailwindcss-drupal that referenced this pull request Apr 16, 2025
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