phpxui 0.0.5 → 0.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.
@@ -15,9 +15,9 @@ const path_1 = __importDefault(require("path"));
15
15
  */
16
16
  function copyTailwindCss(force = false) {
17
17
  // Path to the CSS bundled with the CLI
18
- const source = path_1.default.resolve(__dirname, "../css/tailwind.css");
18
+ const source = path_1.default.resolve(__dirname, "../css/global.css");
19
19
  // Path inside the user’s project
20
- const target = path_1.default.resolve(process.cwd(), "src/app/css/tailwind.css");
20
+ const target = path_1.default.resolve(process.cwd(), "src/app/global.css");
21
21
  if (!force && fs_extra_1.default.existsSync(target)) {
22
22
  return false; // skip quietly
23
23
  }
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
- // ⬇️ IMPORTANT:
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
- // ⬇️ Components overwrite policy:
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) First-run: ensure core 'Slot' is installed (unless --all) */
97
+ /* 6.5) Ensure core components first on first-run (unless --all) */
101
98
  if (isFirstRun && !flags.all) {
102
- const hasSlot = names.some((n) => n.toLowerCase() === "slot");
103
- if (!hasSlot) {
104
- names.unshift("Slot"); // put it first so it logs clearly
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 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phpxui",
3
- "version": "0.0.5",
3
+ "version": "0.1.0",
4
4
  "description": "A package for generating Prisma PHP components with a CLI interface.",
5
5
  "main": "index.js",
6
6
  "scripts": {
File without changes