pejay-ui 1.2.0 → 1.2.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/bin/cli.js +19 -6
- package/package.json +1 -1
- package/registry.json +6 -2
package/bin/cli.js
CHANGED
|
@@ -156,10 +156,23 @@ program
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
if (missingDependencies.length > 0) {
|
|
159
|
-
console.
|
|
160
|
-
console.log(`
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
console.log(`Missing required package dependencies: ${missingDependencies.join(", ")}`);
|
|
160
|
+
console.log(`Installing missing dependencies...`);
|
|
161
|
+
|
|
162
|
+
let installCmd = `npm install ${missingDependencies.join(" ")}`;
|
|
163
|
+
if (await fs.pathExists(path.join(cwd, "yarn.lock"))) {
|
|
164
|
+
installCmd = `yarn add ${missingDependencies.join(" ")}`;
|
|
165
|
+
} else if (await fs.pathExists(path.join(cwd, "pnpm-lock.yaml"))) {
|
|
166
|
+
installCmd = `pnpm add ${missingDependencies.join(" ")}`;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
try {
|
|
170
|
+
execSync(installCmd, { cwd, stdio: "inherit" });
|
|
171
|
+
console.log(`\nDependencies installed successfully!\n`);
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.error(`\nFailed to automatically install dependencies. Please run: ${installCmd}`);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
}
|
|
163
176
|
}
|
|
164
177
|
|
|
165
178
|
// 2. Process & Copy Utility dependencies
|
|
@@ -196,8 +209,8 @@ program
|
|
|
196
209
|
|
|
197
210
|
// 3. Process & Copy Component Files
|
|
198
211
|
let targetDir;
|
|
199
|
-
if (componentData.category === "
|
|
200
|
-
targetDir = path.join(cwd, "src",
|
|
212
|
+
if (componentData.category === "scaffold") {
|
|
213
|
+
targetDir = path.join(cwd, "src", componentData.targetDirName || compToInstall);
|
|
201
214
|
} else {
|
|
202
215
|
targetDir = path.join(cwd, config.baseDir, "components", componentData.category);
|
|
203
216
|
}
|
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -191,13 +191,17 @@
|
|
|
191
191
|
},
|
|
192
192
|
"tanstack-query-client": {
|
|
193
193
|
"name": "TanstackQueryClient",
|
|
194
|
-
"category": "
|
|
194
|
+
"category": "scaffold",
|
|
195
|
+
"subcategory": "tanstack-query",
|
|
196
|
+
"targetDirName": "tanstack-query",
|
|
195
197
|
"files": ["templates/scaffolds/tanstack-query"],
|
|
196
198
|
"peerDependencies": ["@tanstack/react-query"]
|
|
197
199
|
},
|
|
198
200
|
"react-router-client": {
|
|
199
201
|
"name": "ReactRouterClient",
|
|
200
|
-
"category": "
|
|
202
|
+
"category": "scaffold",
|
|
203
|
+
"subcategory": "react-router",
|
|
204
|
+
"targetDirName": "react-router",
|
|
201
205
|
"files": ["templates/scaffolds/react-router"],
|
|
202
206
|
"peerDependencies": ["react-router-dom"]
|
|
203
207
|
}
|