@arkstack/console 0.14.2 → 0.14.14

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -49,9 +49,12 @@ var BuildCommand = class extends Command {
49
49
  //#endregion
50
50
  //#region dist/commands/DevCommand.js
51
51
  var DevCommand = class extends Command {
52
- signature = "dev";
52
+ signature = `dev
53
+ {--t|tunnel : tunnel the dev server through Ngrok}
54
+ `;
53
55
  description = "Run the development server";
54
56
  async handle() {
57
+ const tunnel = this.option?.("tunnel");
55
58
  await new Promise((resolve, reject) => {
56
59
  const child = spawn(process.platform === "win32" ? "pnpm.cmd" : "pnpm", [
57
60
  "exec",
@@ -61,7 +64,10 @@ var DevCommand = class extends Command {
61
64
  ], {
62
65
  cwd: Arkstack.rootDir(),
63
66
  stdio: "inherit",
64
- env: Object.assign(process.env, { NODE_ENV: "development" })
67
+ env: Object.assign(process.env, {
68
+ NODE_ENV: "development",
69
+ TUNNEL: tunnel ? "true" : void 0
70
+ })
65
71
  });
66
72
  child.on("error", (error) => {
67
73
  reject(error);
@@ -89,10 +95,12 @@ var KeyGenerateCommand = class KeyGenerateCommand extends Command {
89
95
  signature = `key:generate
90
96
  {--show : Display the generated key instead of writing it to the .env file.}
91
97
  {--force : Overwrite the existing APP_KEY without confirmation.}
98
+ {--ignore : Ignore existing APP_KEY without confirmation.}
92
99
  `;
93
100
  description = "Set the application key (APP_KEY).";
94
101
  async handle() {
95
102
  const key = this.generateKey();
103
+ const ignore = this.option("ignore");
96
104
  if (this.option("show")) {
97
105
  this.line(key);
98
106
  return;
@@ -103,9 +111,9 @@ var KeyGenerateCommand = class KeyGenerateCommand extends Command {
103
111
  return;
104
112
  }
105
113
  const contents = readFileSync(envPath, "utf-8");
106
- if (KeyGenerateCommand.hasEnvValue(contents, "APP_KEY") && !this.option("force")) {
107
- if (!await this.confirm("An application key already exists. Overwrite it?", false)) {
108
- this.info("Application key generation aborted.");
114
+ if (KeyGenerateCommand.hasEnvValue(contents, "APP_KEY") && !this.option("force") || ignore) {
115
+ if (!(!ignore ? await this.confirm("An application key already exists. Overwrite it?", false) : false) || ignore) {
116
+ this.info(`Application key generation ${ignore ? "skipped" : "aborted"}.`);
109
117
  return;
110
118
  }
111
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/console",
3
- "version": "0.14.2",
3
+ "version": "0.14.14",
4
4
  "type": "module",
5
5
  "description": "Console module for Arkstack, providing the command-line runtime and console integration layer.",
6
6
  "homepage": "https://arkstack.toneflix.net/guide/cli",
@@ -51,8 +51,8 @@
51
51
  "chalk": "^5.6.2",
52
52
  "resora": "^1.3.26",
53
53
  "ts-morph": "^28.0.0",
54
- "@arkstack/common": "^0.14.2",
55
- "@arkstack/contract": "^0.14.2"
54
+ "@arkstack/common": "^0.14.14",
55
+ "@arkstack/contract": "^0.14.14"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsdown",