wetw is a command-line interface (CLI) tool for generating and managing UI components, drawing inspiration from `shadcn-ui`. It facilitates the direct copying of template files into your project, allowing for easy customization and deep integration. Currently stable at version `0.1.2`, it is part of the actively developed `weapp-tailwindcss` monorepo, which focuses on providing robust Tailwind CSS integration for mini-program environments. wetw receives frequent updates, often alongside improvements to the core `weapp-tailwindcss` ecosystem. Key features include configurable output directories, support for various mini-program frameworks like `mp-weixin`, `uni-app-vue3`, and `taro-react`, and the ability to define component registries via local JSON files or remote URLs. Components are generated with inline Tailwind CSS utility classes, eliminating the need for separate style files and promoting a utility-first CSS approach tailored for mini-program development.
npm install wetwVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing the configuration, listing available components, and adding a component using the wetw CLI.
Upgrade your Node.js environment to a supported version (e.g., using `nvm install 20` or `nvm install 22`).
To force overwrite existing files, append the `--force` flag to the `wetw add` command: `wetw add <name...> --force`.
Verify that `framework` in `wetw.config.ts` matches your project setup. Incorrect settings can lead to template errors or unusable components.
Ensure you have `tailwindcss` and its PostCSS integration properly set up in your mini-program project. Refer to the `weapp-tailwindcss` documentation for framework-specific setup guides.
If installed as a dev dependency, use `pnpm exec wetw`, `npx wetw`, or `yarn wetw`. If not installed, run `pnpm add -D wetw` or `npm install -D wetw`.
Run `wetw list` to see available components. Check your `wetw.config.ts` to ensure the `registry` path is correct and accessible (local file or remote URL).
Ensure `wetw.config.ts` exists in your project root or specify its path with `--config`. Review the file for syntax errors and correct `defineConfig` usage.
If you intend to update or replace the existing component files, re-run the command with the `--force` flag: `wetw add counter --force`.