@ghostly-ui/cli 0.2.4 → 0.2.5

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.
@@ -6,7 +6,7 @@ import {
6
6
  log,
7
7
  success,
8
8
  warn
9
- } from "./chunk-Q4PDOIND.js";
9
+ } from "./chunk-EHNNQ6RT.js";
10
10
 
11
11
  // src/add-loading.ts
12
12
  import { existsSync, readFileSync, writeFileSync, readdirSync, mkdirSync } from "fs";
@@ -1,10 +1,4 @@
1
1
  #!/usr/bin/env node
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined") return require.apply(this, arguments);
6
- throw Error('Dynamic require of "' + x + '" is not supported');
7
- });
8
2
 
9
3
  // src/utils.ts
10
4
  import { existsSync, readFileSync } from "fs";
@@ -69,7 +63,6 @@ function getAppDir() {
69
63
  }
70
64
 
71
65
  export {
72
- __require,
73
66
  GHOSTLY,
74
67
  log,
75
68
  success,
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  GHOSTLY,
4
- __require,
5
4
  error,
6
5
  fileContains,
7
6
  findFile,
@@ -10,10 +9,11 @@ import {
10
9
  readJson,
11
10
  success,
12
11
  warn
13
- } from "./chunk-Q4PDOIND.js";
12
+ } from "./chunk-EHNNQ6RT.js";
14
13
 
15
14
  // src/doctor.ts
16
- import { existsSync } from "fs";
15
+ import { existsSync, readdirSync } from "fs";
16
+ import { join } from "path";
17
17
  import pc from "picocolors";
18
18
  async function doctor() {
19
19
  console.log(`
@@ -133,16 +133,14 @@ function printResults(checks) {
133
133
  function countRoutes(dir) {
134
134
  let total = 0;
135
135
  let withLoading = 0;
136
- const { readdirSync } = __require("fs");
137
- const { join } = __require("path");
138
136
  function scan(d) {
139
137
  if (!existsSync(d)) return;
140
138
  const entries = readdirSync(d, { withFileTypes: true });
141
- const hasPage = entries.some((e) => e.name.match(/^page\.(tsx|jsx|ts|js)$/));
142
- const hasLoading = entries.some((e) => e.name.match(/^loading\.(tsx|jsx|ts|js)$/));
139
+ const hasPage = entries.some((e) => /^page\.(tsx|jsx|ts|js)$/.test(e.name));
140
+ const hasLoadingFile = entries.some((e) => /^loading\.(tsx|jsx|ts|js)$/.test(e.name));
143
141
  if (hasPage) {
144
142
  total++;
145
- if (hasLoading) withLoading++;
143
+ if (hasLoadingFile) withLoading++;
146
144
  }
147
145
  for (const entry of entries) {
148
146
  if (entry.isDirectory() && !entry.name.startsWith("_") && !entry.name.startsWith(".")) {
package/dist/index.js CHANGED
@@ -9,14 +9,14 @@ var command = args[0];
9
9
  async function main() {
10
10
  switch (command) {
11
11
  case "init": {
12
- const { init } = await import("./init-JZMB5KKV.js");
12
+ const { init } = await import("./init-YYX3QOLN.js");
13
13
  await init();
14
14
  break;
15
15
  }
16
16
  case "add": {
17
17
  const subcommand = args[1];
18
18
  if (subcommand === "loading") {
19
- const { addLoading } = await import("./add-loading-BOTTW5GC.js");
19
+ const { addLoading } = await import("./add-loading-M3FSXKVA.js");
20
20
  await addLoading(args[2]);
21
21
  } else {
22
22
  console.log(`
@@ -29,7 +29,7 @@ async function main() {
29
29
  break;
30
30
  }
31
31
  case "doctor": {
32
- const { doctor } = await import("./doctor-JXBQFCU2.js");
32
+ const { doctor } = await import("./doctor-USHNINPP.js");
33
33
  await doctor();
34
34
  break;
35
35
  }
@@ -12,7 +12,7 @@ import {
12
12
  step,
13
13
  success,
14
14
  warn
15
- } from "./chunk-Q4PDOIND.js";
15
+ } from "./chunk-EHNNQ6RT.js";
16
16
 
17
17
  // src/init.ts
18
18
  import { readFileSync, writeFileSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghostly-ui/cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "CLI for Ghostly — init, generate loading.tsx, diagnose issues",
5
5
  "license": "MIT",
6
6
  "type": "module",