cnui-radix 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +20 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -75,6 +75,15 @@ function getGlobalsCssTemplate() {
|
|
|
75
75
|
@tailwind utilities;
|
|
76
76
|
`;
|
|
77
77
|
}
|
|
78
|
+
function getPostcssConfigTemplate() {
|
|
79
|
+
return `module.exports = {
|
|
80
|
+
plugins: {
|
|
81
|
+
tailwindcss: {},
|
|
82
|
+
autoprefixer: {},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
78
87
|
|
|
79
88
|
// cli/utils/logger.ts
|
|
80
89
|
var RESET = "\x1B[0m";
|
|
@@ -164,6 +173,13 @@ async function initCommand(options) {
|
|
|
164
173
|
writeFileSync(cssPath, getGlobalsCssTemplate());
|
|
165
174
|
success("\u521B\u5EFA src/styles/globals.css");
|
|
166
175
|
}
|
|
176
|
+
const postcssConfigPath = resolve2(cwd, "postcss.config.js");
|
|
177
|
+
if (existsSync(postcssConfigPath) && !force) {
|
|
178
|
+
dim(" postcss.config.js \u5DF2\u5B58\u5728\uFF0C\u8DF3\u8FC7");
|
|
179
|
+
} else {
|
|
180
|
+
writeFileSync(postcssConfigPath, getPostcssConfigTemplate());
|
|
181
|
+
success("\u521B\u5EFA postcss.config.js (Tailwind CSS + Autoprefixer)");
|
|
182
|
+
}
|
|
167
183
|
if (hasTsconfig) {
|
|
168
184
|
updateTsconfig(cwd, force);
|
|
169
185
|
} else {
|
|
@@ -181,6 +197,10 @@ async function initCommand(options) {
|
|
|
181
197
|
console.log("");
|
|
182
198
|
success("cnui-radix \u521D\u59CB\u5316\u5B8C\u6210!");
|
|
183
199
|
console.log("");
|
|
200
|
+
info("\u91CD\u8981: \u8BF7\u5728\u9879\u76EE\u5165\u53E3\u6587\u4EF6\u4E2D\u5BFC\u5165\u5168\u5C40\u6837\u5F0F:");
|
|
201
|
+
dim(' import "./src/styles/globals.css";');
|
|
202
|
+
dim(" (\u5982 main.tsx\u3001App.tsx\u3001.storybook/preview.js \u7B49)");
|
|
203
|
+
console.log("");
|
|
184
204
|
info("\u4E0B\u4E00\u6B65: \u6DFB\u52A0\u7EC4\u4EF6");
|
|
185
205
|
dim(" npx cnui-radix add button");
|
|
186
206
|
dim(" npx cnui-radix add input");
|