phpxui 0.0.5 → 0.0.6
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/index.js +10 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const ensure_package_1 = require("./generators/ensure-package");
|
|
|
13
13
|
const copy_tailwind_1 = require("./generators/copy-tailwind");
|
|
14
14
|
const load_config_1 = require("./utils/load-config");
|
|
15
15
|
const icons_1 = require("./commands/icons");
|
|
16
|
+
const CORE_COMPONENTS = ["Slot", "Portal"];
|
|
16
17
|
(async () => {
|
|
17
18
|
const args = process.argv.slice(2);
|
|
18
19
|
const [command, ...rest] = args;
|
|
@@ -58,9 +59,7 @@ const icons_1 = require("./commands/icons");
|
|
|
58
59
|
}
|
|
59
60
|
/* 3) Housekeeping */
|
|
60
61
|
(0, ensure_package_1.ensurePackageInstalled)("tw-animate-css");
|
|
61
|
-
//
|
|
62
|
-
// Tailwind base CSS should only be *forced* on *first run*.
|
|
63
|
-
// Later runs: copy only if missing (no overwrite), even if --force.
|
|
62
|
+
// Tailwind base CSS: only forced on first run
|
|
64
63
|
const cssUpdated = (0, copy_tailwind_1.copyTailwindCss)(isFirstRun /* ignore flags.force here */);
|
|
65
64
|
if (cssUpdated) {
|
|
66
65
|
const relCss = path_1.default
|
|
@@ -73,9 +72,7 @@ const icons_1 = require("./commands/icons");
|
|
|
73
72
|
/* 4) Resolve output directory */
|
|
74
73
|
const targetDir = path_1.default.resolve(config.outputDir || "src/Lib/PHPXUI");
|
|
75
74
|
try {
|
|
76
|
-
//
|
|
77
|
-
// - First run: force overwrite (replace everything)
|
|
78
|
-
// - Otherwise: only overwrite when --force is passed
|
|
75
|
+
// Overwrite policy
|
|
79
76
|
const componentForce = isFirstRun || flags.force;
|
|
80
77
|
/* 5) Bulk mode */
|
|
81
78
|
if (flags.all) {
|
|
@@ -97,11 +94,14 @@ const icons_1 = require("./commands/icons");
|
|
|
97
94
|
});
|
|
98
95
|
names.push(...componentList.split(/[\s,]+/));
|
|
99
96
|
}
|
|
100
|
-
/* 6.5)
|
|
97
|
+
/* 6.5) Ensure core components first on first-run (unless --all) */
|
|
101
98
|
if (isFirstRun && !flags.all) {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
for (const core of CORE_COMPONENTS) {
|
|
100
|
+
const hasCore = names.some((n) => n.toLowerCase() === core.toLowerCase());
|
|
101
|
+
if (!hasCore) {
|
|
102
|
+
// Put each core at the front in the declared order:
|
|
103
|
+
names.unshift(core);
|
|
104
|
+
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
/* 7) Generate each requested component */
|