wp-uikit-cli 1.0.0 → 1.1.0
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/README.md +3 -19
- package/index.js +21 -5
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ A blazing-fast command-line toolkit for building **SF Framework** & **SF Widget*
|
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/wp-uikit-cli)
|
|
9
9
|
[](https://www.npmjs.com/package/wp-uikit-cli)
|
|
10
|
-
[](
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
11
|
[](https://nodejs.org)
|
|
12
12
|
|
|
13
13
|
</div>
|
|
@@ -294,12 +294,6 @@ All generated files come from customizable templates in [`stubs/`](./stubs):
|
|
|
294
294
|
Yes — minification replaces original <code>.js</code>/<code>.css</code> files with <code>.min.js</code>/<code>.min.css</code> in your working directory, and the dev-mode flag is flipped to <code>false</code>. Always deploy from a clean git state so you can diff/revert if needed.
|
|
295
295
|
</details>
|
|
296
296
|
|
|
297
|
-
<details>
|
|
298
|
-
<summary><strong>Why does the first command feel slightly slower the very first time?</strong></summary>
|
|
299
|
-
<br>
|
|
300
|
-
Heavy dependencies (<code>adm-zip</code>, <code>terser</code>, <code>clean-css</code>) are <strong>lazy-loaded</strong> only when a command that needs them (<code>deploy</code>, <code>zip</code>) actually runs — keeping <code>create</code>, <code>clean</code>, and <code>debug</code> fast at all times.
|
|
301
|
-
</details>
|
|
302
|
-
|
|
303
297
|
<details>
|
|
304
298
|
<summary><strong>Can I customize the generated widget/trait templates?</strong></summary>
|
|
305
299
|
<br>
|
|
@@ -308,23 +302,13 @@ Yes! Edit the files in the <code>stubs/</code> directory. They support <code>{{P
|
|
|
308
302
|
|
|
309
303
|
---
|
|
310
304
|
|
|
311
|
-
## 🤝 Contributing
|
|
312
|
-
|
|
313
|
-
Contributions, issue reports, and feature ideas are welcome!
|
|
314
|
-
|
|
315
|
-
1. Fork the repo
|
|
316
|
-
2. Create a feature branch: `git checkout -b feature/amazing-thing`
|
|
317
|
-
3. Commit your changes: `git commit -m "Add amazing thing"`
|
|
318
|
-
4. Push and open a Pull Request
|
|
319
|
-
|
|
320
|
-
---
|
|
321
305
|
|
|
322
306
|
## 📄 License
|
|
323
307
|
|
|
324
|
-
Released under the **[MIT License](
|
|
308
|
+
Released under the **[MIT License](https://opensource.org/licenses/MIT)**.
|
|
325
309
|
|
|
326
310
|
<div align="center">
|
|
327
311
|
|
|
328
|
-
Made with ❤️ for the **SF Framework** & **SF Widget** ecosystem.
|
|
312
|
+
Made with ❤️ from WP-UIkit Team for the **SF Framework** & **SF Widget** ecosystem.
|
|
329
313
|
|
|
330
314
|
</div>
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#! /usr/bin/env node
|
|
1
|
+
#! /usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import inquirer from "inquirer";
|
|
4
4
|
import fs from "fs-extra";
|
|
@@ -828,9 +828,6 @@ async function runDeploy(opts) {
|
|
|
828
828
|
const pluginKey = isFramework ? "sf-framework" : "sf-widget";
|
|
829
829
|
const mainPhpFile = isFramework ? "sf-framework.php" : "sf-widget.php";
|
|
830
830
|
const devConstant = isFramework ? "SF_FRAMEWORK_DEVELOPMENT_MODE" : "SF_DEVELOPMENT_MODE";
|
|
831
|
-
const downloadUrl = isFramework
|
|
832
|
-
? `https://gitea.syncfusion.com/syncfusion-wordpress-template/SF-Framework/raw/branch/main/{{VERSION}}`
|
|
833
|
-
: `https://gitea.syncfusion.com/syncfusion-wordpress-template/SF-Widget/raw/branch/development/{{VERSION}}`;
|
|
834
831
|
const description = isFramework
|
|
835
832
|
? "A Design System for SF Widgets and Elementor. Build modern websites with ease."
|
|
836
833
|
: "30+ widgets Pro Feature and new design system for Elementor. Build modern websites with ease.";
|
|
@@ -863,6 +860,26 @@ async function runDeploy(opts) {
|
|
|
863
860
|
|
|
864
861
|
const destDir = path.resolve(folderPath.trim());
|
|
865
862
|
|
|
863
|
+
// ── Read downloadUrl from existing update.json in destination folder ──────
|
|
864
|
+
const jsonFilePath = path.join(destDir, "update.json");
|
|
865
|
+
if (!fs.existsSync(jsonFilePath)) {
|
|
866
|
+
console.log(chalk.red(`❌ update.json not found in ${destDir}`));
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
let downloadUrl;
|
|
871
|
+
try {
|
|
872
|
+
const existingJson = fs.readJsonSync(jsonFilePath);
|
|
873
|
+
downloadUrl = existingJson.download_url;
|
|
874
|
+
if (!downloadUrl) {
|
|
875
|
+
console.log(chalk.red("❌ download_url not found in update.json"));
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
} catch (err) {
|
|
879
|
+
console.log(chalk.red(`❌ Could not read update.json: ${err.message}`));
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
|
|
866
883
|
// ── Step 2: Ask for new version ──────────────────────────────────────────
|
|
867
884
|
const { newVersion } = await inquirer.prompt([
|
|
868
885
|
{
|
|
@@ -968,7 +985,6 @@ async function runDeploy(opts) {
|
|
|
968
985
|
console.log(" " + chalk.green("✔") + " " + chalk.green("Zip moved to destination ") + chalk.gray(finalZipPath));
|
|
969
986
|
|
|
970
987
|
// ── Step 9: Update update.json in destination folder (only if it exists) ──
|
|
971
|
-
const jsonFilePath = path.join(destDir, "update.json");
|
|
972
988
|
if (fs.existsSync(jsonFilePath)) {
|
|
973
989
|
const jsonSpinner = ora({ text: chalk.white("Updating update.json..."), prefixText: " " }).start();
|
|
974
990
|
const versionedUrl = downloadUrl.replace("{{VERSION}}", `${zipName}.zip`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wp-uikit-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "⚡ A blazing-fast CLI to scaffold, clean, debug and deploy SF Framework / SF Widget (Elementor) plugin widgets & traits in seconds.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"LICENSE"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"adm-zip": "^0.
|
|
33
|
+
"adm-zip": "^0.6.0",
|
|
34
34
|
"chalk": "^5.6.2",
|
|
35
35
|
"clean-css": "^5.3.3",
|
|
36
|
-
"commander": "^10.0.
|
|
37
|
-
"figlet": "^1.
|
|
38
|
-
"fs-extra": "^11.
|
|
39
|
-
"inquirer": "^9.
|
|
40
|
-
"ora": "^6.
|
|
41
|
-
"terser": "^5.
|
|
36
|
+
"commander": "^10.0.1",
|
|
37
|
+
"figlet": "^1.11.4",
|
|
38
|
+
"fs-extra": "^11.4.0",
|
|
39
|
+
"inquirer": "^9.3.8",
|
|
40
|
+
"ora": "^6.3.1",
|
|
41
|
+
"terser": "^5.51.2"
|
|
42
42
|
}
|
|
43
43
|
}
|