wp-uikit-cli 1.0.1 → 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/index.js +21 -5
- package/package.json +8 -8
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.0
|
|
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
|
}
|