juo 0.0.2-pre.1 → 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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ $ npm install -g juo
20
20
  $ juo COMMAND
21
21
  running command...
22
22
  $ juo (--version)
23
- juo/0.0.2-pre.1 darwin-arm64 node-v22.13.1
23
+ juo/0.1.0 linux-x64 node-v22.21.0
24
24
  $ juo --help [COMMAND]
25
25
  USAGE
26
26
  $ juo COMMAND
@@ -1,11 +1,11 @@
1
1
  import debug from "debug";
2
2
 
3
3
  //#region src/utils/config.ts
4
- const MIXPANEL_TOKEN = "";
5
- const MIXPANEL_API_URL = "https://api.mixpanel.com";
6
- const CUSTOMERIO_BETA_FORM_URL = "";
7
- const CUSTOMERIO_SITE_ID = "";
8
- const CUSTOMERIO_API_KEY = "";
4
+ const MIXPANEL_TOKEN = "919dd811a5e2137983cc8fc304b8584b";
5
+ const MIXPANEL_API_URL = "https://api-eu.mixpanel.com";
6
+ const CUSTOMERIO_BETA_FORM_URL = "https://track-cio.juo.io/api/v1/forms/3c02106b-9746-4ebe-a116-553e47494eb4/submit";
7
+ const CUSTOMERIO_SITE_ID = "60da89062ce61084fc27";
8
+ const CUSTOMERIO_API_KEY = "1d54688e66cddda9ea72";
9
9
 
10
10
  //#endregion
11
11
  //#region src/utils/analytics.ts
@@ -1,13 +1,13 @@
1
1
  import { Command } from "@oclif/core";
2
- import * as _oclif_core_interfaces5 from "@oclif/core/interfaces";
2
+ import * as _oclif_core_interfaces7 from "@oclif/core/interfaces";
3
3
 
4
4
  //#region src/commands/create.d.ts
5
5
  declare class Create extends Command {
6
6
  static description: string;
7
7
  static flags: {
8
- quickstart: _oclif_core_interfaces5.BooleanFlag<boolean>;
9
- storybook: _oclif_core_interfaces5.BooleanFlag<boolean>;
10
- verbose: _oclif_core_interfaces5.BooleanFlag<boolean>;
8
+ quickstart: _oclif_core_interfaces7.BooleanFlag<boolean>;
9
+ storybook: _oclif_core_interfaces7.BooleanFlag<boolean>;
10
+ verbose: _oclif_core_interfaces7.BooleanFlag<boolean>;
11
11
  };
12
12
  run(): Promise<void>;
13
13
  private getProjectConfig;
@@ -1,6 +1,6 @@
1
- import { r as BaseTemplateGenerator } from "../juoTemplateGenerator-C0le5FdK.js";
2
- import { t as PackageGenerator } from "../packageGenerator-8E_-V5CL.js";
3
- import { t as Generate } from "../generate-Be3Ctuvv.js";
1
+ import { r as BaseTemplateGenerator } from "../juoTemplateGenerator-MZ8llr7w.js";
2
+ import { t as PackageGenerator } from "../packageGenerator-Dno-ecHh.js";
3
+ import { t as Generate } from "../generate-vpUPJZRH.js";
4
4
  import { Command, Flags } from "@oclif/core";
5
5
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
6
6
  import path from "node:path";
@@ -20,7 +20,7 @@ var ConfigFilesGenerator = class extends BaseTemplateGenerator {
20
20
  //#region src/utils/storybookGenerator.ts
21
21
  const COMMAND_CONFIG = {
22
22
  npm: "npx",
23
- pnpm: "pnpx",
23
+ pnpm: "pnpm dlx",
24
24
  yarn: "yarn dlx"
25
25
  };
26
26
  var StorybookGenerator = class extends BaseTemplateGenerator {
@@ -274,7 +274,6 @@ var Create = class Create extends Command {
274
274
  process.chdir(originalCwd);
275
275
  }
276
276
  outro(`Run \`cd ${packageName}\` to start developing your project.`);
277
- process.exit(0);
278
277
  }
279
278
  async getProjectConfig(quickstart, storybookFlag) {
280
279
  if (quickstart) return {
@@ -293,7 +292,7 @@ var Create = class Create extends Command {
293
292
  if (!/^[a-z0-9-]+$/.test(value)) return `Invalid package name`;
294
293
  }
295
294
  });
296
- if (isCancel(packageName)) process.exit(0);
295
+ if (isCancel(packageName)) this.exit(0);
297
296
  const packageManager = await select({
298
297
  initialValue: "npm",
299
298
  message: "What package manager to use?",
@@ -312,7 +311,7 @@ var Create = class Create extends Command {
312
311
  }
313
312
  ]
314
313
  });
315
- if (isCancel(packageManager)) process.exit(0);
314
+ if (isCancel(packageManager)) this.exit(0);
316
315
  const framework = await select({
317
316
  initialValue: "react",
318
317
  message: "What framework to use?",
@@ -324,7 +323,7 @@ var Create = class Create extends Command {
324
323
  value: "preact"
325
324
  }]
326
325
  });
327
- if (isCancel(framework)) process.exit();
326
+ if (isCancel(framework)) this.exit(0);
328
327
  const tailwind = await select({
329
328
  initialValue: true,
330
329
  message: "Do you want to use Tailwind CSS?",
@@ -336,14 +335,14 @@ var Create = class Create extends Command {
336
335
  value: false
337
336
  }]
338
337
  });
339
- if (isCancel(tailwind)) process.exit(0);
338
+ if (isCancel(tailwind)) this.exit(0);
340
339
  let storybook;
341
340
  if (storybookFlag === void 0) {
342
341
  const storybookAnswer = await confirm({
343
342
  initialValue: false,
344
343
  message: "Do you want Storybook?"
345
344
  });
346
- if (isCancel(storybookAnswer)) process.exit(0);
345
+ if (isCancel(storybookAnswer)) this.exit(0);
347
346
  storybook = storybookAnswer;
348
347
  } else storybook = storybookFlag;
349
348
  return {
@@ -1,4 +1,4 @@
1
- import "../juoTemplateGenerator-C0le5FdK.js";
2
- import { t as Generate } from "../generate-Be3Ctuvv.js";
1
+ import "../juoTemplateGenerator-MZ8llr7w.js";
2
+ import { t as Generate } from "../generate-vpUPJZRH.js";
3
3
 
4
4
  export { Generate as default };
@@ -1,5 +1,5 @@
1
1
  import { Command, Interfaces } from "@oclif/core";
2
- import * as _oclif_core_interfaces8 from "@oclif/core/interfaces";
2
+ import * as _oclif_core_interfaces5 from "@oclif/core/interfaces";
3
3
 
4
4
  //#region src/base-command.d.ts
5
5
  interface BaseConfig {
@@ -30,7 +30,7 @@ declare class Publish extends BaseCommand<typeof Publish> {
30
30
  static description: string;
31
31
  static examples: string[];
32
32
  static flags: {
33
- theme: _oclif_core_interfaces8.OptionFlag<string, _oclif_core_interfaces8.CustomOptions>;
33
+ theme: _oclif_core_interfaces5.OptionFlag<string, _oclif_core_interfaces5.CustomOptions>;
34
34
  };
35
35
  getAllFiles(dirPath: string, basePath: string): string[];
36
36
  run(): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { t as JuoTemplateGenerator } from "./juoTemplateGenerator-C0le5FdK.js";
1
+ import { t as JuoTemplateGenerator } from "./juoTemplateGenerator-MZ8llr7w.js";
2
2
  import { Command, Flags } from "@oclif/core";
3
3
  import { existsSync } from "node:fs";
4
4
  import path from "node:path";
@@ -1,9 +1,12 @@
1
- import { a as CUSTOMERIO_BETA_FORM_URL, i as CUSTOMERIO_API_KEY, n as trackCommandCompleted, o as CUSTOMERIO_SITE_ID, t as trackBetaSignup } from "../analytics-CyANz2YH.js";
1
+ import { a as CUSTOMERIO_BETA_FORM_URL, i as CUSTOMERIO_API_KEY, n as trackCommandCompleted, o as CUSTOMERIO_SITE_ID, t as trackBetaSignup } from "../analytics-CgHTVQWO.js";
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import path from "node:path";
2
4
  import { confirm, isCancel, text } from "@clack/prompts";
3
5
  import debug from "debug";
4
6
 
5
7
  //#region src/utils/betaSignup.ts
6
8
  const log$1 = debug("juo:betaSignup");
9
+ let promptedThisSession = false;
7
10
  async function sendToCustomerIO(email) {
8
11
  if (!CUSTOMERIO_BETA_FORM_URL || !CUSTOMERIO_SITE_ID || !CUSTOMERIO_API_KEY) return;
9
12
  try {
@@ -25,12 +28,36 @@ async function sendToCustomerIO(email) {
25
28
  log$1("Error sending beta signup to CustomerIO: %O", error);
26
29
  }
27
30
  }
28
- async function promptBetaSignup(commandContext) {
31
+ function getBetaSignupStatePath(configDir) {
32
+ return path.join(configDir, "beta-signup.json");
33
+ }
34
+ function hasUserRespondedToBetaSignup(configDir) {
35
+ try {
36
+ const statePath = getBetaSignupStatePath(configDir);
37
+ if (!existsSync(statePath)) return false;
38
+ return JSON.parse(readFileSync(statePath, "utf8")).responded === true;
39
+ } catch {
40
+ return false;
41
+ }
42
+ }
43
+ function markUserRespondedToBetaSignup(configDir) {
44
+ try {
45
+ if (!existsSync(configDir)) mkdirSync(configDir, { recursive: true });
46
+ writeFileSync(getBetaSignupStatePath(configDir), JSON.stringify({ responded: true }), "utf8");
47
+ } catch (error) {
48
+ log$1("Failed to persist beta signup state: %O", error);
49
+ }
50
+ }
51
+ async function promptBetaSignup(commandContext, configDir) {
52
+ if (promptedThisSession) return;
53
+ if (hasUserRespondedToBetaSignup(configDir)) return;
54
+ promptedThisSession = true;
29
55
  try {
30
56
  const shouldSignup = await confirm({
31
57
  initialValue: true,
32
58
  message: "Would you like to request access to the private beta?"
33
59
  });
60
+ markUserRespondedToBetaSignup(configDir);
34
61
  if (isCancel(shouldSignup) || !shouldSignup) return;
35
62
  const email = await text({
36
63
  message: "Enter your email address:",
@@ -54,7 +81,8 @@ async function promptBetaSignup(commandContext) {
54
81
  //#region src/hooks/postrun.ts
55
82
  const hook = async function(options) {
56
83
  if (options.Command) trackCommandCompleted(options.Command.id || options.Command.name || "unknown", true);
57
- if (options.Command && process.stdout.isTTY) await promptBetaSignup(options.Command.id || options.Command.name || "unknown");
84
+ const isInteractive = process.stdin.isTTY && process.stdout.isTTY && !process.env.CI && !process.env.NO_INTERACTIVE;
85
+ if (options.Command && isInteractive) await promptBetaSignup(options.Command.id || options.Command.name || "unknown", options.config.configDir);
58
86
  };
59
87
  var postrun_default = hook;
60
88
 
@@ -1,4 +1,4 @@
1
- import { r as trackCommandStarted } from "../analytics-CyANz2YH.js";
1
+ import { r as trackCommandStarted } from "../analytics-CgHTVQWO.js";
2
2
 
3
3
  //#region src/hooks/prerun.ts
4
4
  const hook = async function(options) {
@@ -57,7 +57,7 @@ var StoryGenerator = class extends BaseTemplateGenerator {
57
57
  }
58
58
  async generateBlockTemplate(destDir, options) {
59
59
  const scope = { block: {
60
- clsName: slugify(options.name, { lower: true }).split("-").map((item) => `${item[0].toUpperCase()}${item.slice(1)}`).join(""),
60
+ clsName: slugify(options.name, { lower: true }).split("-").filter(Boolean).map((item) => `${item[0].toUpperCase()}${item.slice(1)}`).join(""),
61
61
  framework: options.framework,
62
62
  name: options.name,
63
63
  slug: slugify(options.name, { lower: true })
@@ -69,7 +69,7 @@ var StoryGenerator = class extends BaseTemplateGenerator {
69
69
  }
70
70
  async generateThemeTemplate(destDir, options) {
71
71
  const themeScope = { theme: {
72
- clsName: slugify(options.name, { lower: true }).split("-").map((item) => `${item[0].toUpperCase()}${item.slice(1)}`).join(""),
72
+ clsName: slugify(options.name, { lower: true }).split("-").filter(Boolean).map((item) => `${item[0].toUpperCase()}${item.slice(1)}`).join(""),
73
73
  framework: options.framework,
74
74
  name: options.name,
75
75
  slug: slugify(options.name, { lower: true })
@@ -94,7 +94,7 @@ var JuoTemplateGenerator = class extends BaseTemplateGenerator {
94
94
  }
95
95
  async generateBlockTemplate(destDir, options) {
96
96
  const scope = { block: {
97
- clsName: slugify(options.name, { lower: true }).split("-").map((item) => `${item[0].toUpperCase()}${item.slice(1)}`).join(""),
97
+ clsName: slugify(options.name, { lower: true }).split("-").filter(Boolean).map((item) => `${item[0].toUpperCase()}${item.slice(1)}`).join(""),
98
98
  framework: options.framework,
99
99
  name: options.name,
100
100
  slug: slugify(options.name, { lower: true }),
package/dist/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as StoryGenerator, r as BaseTemplateGenerator, t as JuoTemplateGenerator } from "../juoTemplateGenerator-C0le5FdK.js";
2
- import { t as PackageGenerator } from "../packageGenerator-8E_-V5CL.js";
1
+ import { n as StoryGenerator, r as BaseTemplateGenerator, t as JuoTemplateGenerator } from "../juoTemplateGenerator-MZ8llr7w.js";
2
+ import { t as PackageGenerator } from "../packageGenerator-Dno-ecHh.js";
3
3
 
4
4
  export { BaseTemplateGenerator, JuoTemplateGenerator, PackageGenerator, StoryGenerator };
@@ -63,7 +63,7 @@ var PackageGenerator = class {
63
63
  },
64
64
  engines: {
65
65
  node: ">=20.0.0",
66
- pnpm: ">=7.0.0"
66
+ ...options.packageManager === "pnpm" ? { pnpm: ">=7.0.0" } : {}
67
67
  },
68
68
  name: options.name,
69
69
  packageManager: `${options.packageManager}@${pmVersion}`,
@@ -137,5 +137,5 @@
137
137
  ]
138
138
  }
139
139
  },
140
- "version": "0.0.2-pre.1"
140
+ "version": "0.1.0"
141
141
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "juo",
3
3
  "description": "A CLI tool for the Juo platform",
4
- "version": "0.0.2-pre.1",
4
+ "version": "0.1.0",
5
5
  "author": "Juo (https://juo.io)",
6
6
  "bin": {
7
7
  "juo": "./bin/run.js"