@h3ravel/console 11.15.0-alpha.10 → 11.15.0-alpha.12
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/bin/prepare.js +1 -1
- package/dist/index.cjs +53 -62
- package/dist/index.d.ts +2 -3
- package/dist/index.js +16 -21
- package/package.json +10 -10
package/bin/prepare.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import e,{join as t}from"node:path";import{FileSystem as n,mainTsconfig as r}from"@h3ravel/shared";import{mkdir as i,readdir as a,rm as o,writeFile as s}from"node:fs/promises";import{execa as c}from"execa";import l from"preferred-pm";new class{async prepare(u=`.h3ravel/serve`){let d=(await l(process.cwd()))?.name??`npm`,f=t(process.env.DIST_DIR??u);try{await n.fileExists(f)&&(await a(f)).length>0&&await o(f,{recursive:!0,force:!0}),await n.fileExists(e.join(f,`tsconfig.json`))||(await i(e.join(f.replace(`/serve`,``)),{recursive:!0}),await s(e.join(f.replace(`/serve`,``),`tsconfig.json`),JSON.stringify(r,null,2)))}catch(e){console.log(e.message)}let p={EXTENDED_DEBUG:`false`,CLI_BUILD:`true`,NODE_ENV:`production`,DIST_DIR:f,LOG_LEVEL:`silent`};await c(d,[`tsdown`,`--silent`,`--config-loader`,`
|
|
2
|
+
import e,{join as t}from"node:path";import{FileSystem as n,mainTsconfig as r}from"@h3ravel/shared";import{mkdir as i,readdir as a,rm as o,writeFile as s}from"node:fs/promises";import{execa as c}from"execa";import l from"preferred-pm";new class{async prepare(u=`.h3ravel/serve`){let d=(await l(process.cwd()))?.name??`npm`,f=t(process.env.DIST_DIR??u);try{await n.fileExists(f)&&(await a(f)).length>0&&await o(f,{recursive:!0,force:!0}),await n.fileExists(e.join(f,`tsconfig.json`))||(await i(e.join(f.replace(`/serve`,``)),{recursive:!0}),await s(e.join(f.replace(`/serve`,``),`tsconfig.json`),JSON.stringify(r,null,2)))}catch(e){console.log(e.message)}let p={EXTENDED_DEBUG:`false`,CLI_BUILD:`true`,NODE_ENV:`production`,DIST_DIR:f,LOG_LEVEL:`silent`};await c(d,[`tsdown`,`--silent`,`--config-loader`,`unrun`,`-c`,`tsdown.default.config.ts`].filter(e=>e!==null),{stdout:`inherit`,stderr:`inherit`,cwd:t(process.cwd()),env:Object.assign({},process.env,p)})}}().prepare();export{};
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
9
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
19
16
|
}
|
|
20
17
|
return to;
|
|
21
18
|
};
|
|
@@ -23,27 +20,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
20
|
value: mod,
|
|
24
21
|
enumerable: true
|
|
25
22
|
}) : target, mod));
|
|
26
|
-
|
|
27
23
|
//#endregion
|
|
28
|
-
let
|
|
29
|
-
let
|
|
24
|
+
let _h3ravel_shared = require("@h3ravel/shared");
|
|
25
|
+
let _h3ravel_musket = require("@h3ravel/musket");
|
|
30
26
|
let execa = require("execa");
|
|
31
27
|
let preferred_pm = require("preferred-pm");
|
|
32
|
-
preferred_pm = __toESM(preferred_pm);
|
|
28
|
+
preferred_pm = __toESM(preferred_pm, 1);
|
|
33
29
|
let fs_promises = require("fs/promises");
|
|
34
30
|
let crypto = require("crypto");
|
|
35
|
-
crypto = __toESM(crypto);
|
|
31
|
+
crypto = __toESM(crypto, 1);
|
|
36
32
|
let dotenv = require("dotenv");
|
|
37
|
-
dotenv = __toESM(dotenv);
|
|
33
|
+
dotenv = __toESM(dotenv, 1);
|
|
38
34
|
let node_fs_promises = require("node:fs/promises");
|
|
39
|
-
let
|
|
35
|
+
let _h3ravel_support = require("@h3ravel/support");
|
|
40
36
|
let node_path = require("node:path");
|
|
41
|
-
node_path = __toESM(node_path);
|
|
37
|
+
node_path = __toESM(node_path, 1);
|
|
42
38
|
require("@h3ravel/contracts");
|
|
43
39
|
require("@h3ravel/core");
|
|
44
|
-
|
|
45
40
|
//#region src/Commands/BuildCommand.ts
|
|
46
|
-
var BuildCommand = class BuildCommand extends
|
|
41
|
+
var BuildCommand = class BuildCommand extends _h3ravel_musket.Command {
|
|
47
42
|
/**
|
|
48
43
|
* The name and signature of the console command.
|
|
49
44
|
*
|
|
@@ -63,7 +58,7 @@ var BuildCommand = class BuildCommand extends __h3ravel_musket.Command {
|
|
|
63
58
|
try {
|
|
64
59
|
await this.fire();
|
|
65
60
|
} catch (e) {
|
|
66
|
-
|
|
61
|
+
_h3ravel_shared.Logger.error(e);
|
|
67
62
|
}
|
|
68
63
|
}
|
|
69
64
|
async fire() {
|
|
@@ -110,7 +105,7 @@ var BuildCommand = class BuildCommand extends __h3ravel_musket.Command {
|
|
|
110
105
|
"tsdown",
|
|
111
106
|
silent,
|
|
112
107
|
"--config-loader",
|
|
113
|
-
"
|
|
108
|
+
"unrun",
|
|
114
109
|
"-c",
|
|
115
110
|
"tsdown.default.config.ts"
|
|
116
111
|
].filter((e) => e !== null), {
|
|
@@ -120,12 +115,12 @@ var BuildCommand = class BuildCommand extends __h3ravel_musket.Command {
|
|
|
120
115
|
env: Object.assign({}, process.env, ENV_VARS)
|
|
121
116
|
});
|
|
122
117
|
const type = outDir === "dist" ? "Production" : "Development";
|
|
123
|
-
return await
|
|
118
|
+
return await _h3ravel_shared.TaskManager.advancedTaskRunner([[`Creating ${type} Bundle`, "STARTED"], [`${type} Bundle Created`, "COMPLETED"]], async () => {
|
|
124
119
|
await (0, execa.execa)(pm, [
|
|
125
120
|
"tsdown",
|
|
126
121
|
silent,
|
|
127
122
|
"--config-loader",
|
|
128
|
-
"
|
|
123
|
+
"unrun",
|
|
129
124
|
"-c",
|
|
130
125
|
"tsdown.default.config.ts"
|
|
131
126
|
].filter((e) => e !== null), {
|
|
@@ -137,10 +132,9 @@ var BuildCommand = class BuildCommand extends __h3ravel_musket.Command {
|
|
|
137
132
|
});
|
|
138
133
|
}
|
|
139
134
|
};
|
|
140
|
-
|
|
141
135
|
//#endregion
|
|
142
136
|
//#region src/Commands/KeyGenerateCommand.ts
|
|
143
|
-
var KeyGenerateCommand = class extends
|
|
137
|
+
var KeyGenerateCommand = class extends _h3ravel_musket.Command {
|
|
144
138
|
/**
|
|
145
139
|
* The name and signature of the console command.
|
|
146
140
|
*
|
|
@@ -157,7 +151,7 @@ var KeyGenerateCommand = class extends __h3ravel_musket.Command {
|
|
|
157
151
|
*/
|
|
158
152
|
description = "Set the application key";
|
|
159
153
|
async handle() {
|
|
160
|
-
const config
|
|
154
|
+
const config = {
|
|
161
155
|
key: crypto.default.randomBytes(32).toString("base64"),
|
|
162
156
|
envPath: base_path(".env"),
|
|
163
157
|
egEnvPath: base_path(".env.example"),
|
|
@@ -165,46 +159,45 @@ var KeyGenerateCommand = class extends __h3ravel_musket.Command {
|
|
|
165
159
|
show: this.option("show")
|
|
166
160
|
};
|
|
167
161
|
this.newLine();
|
|
168
|
-
if (!await
|
|
162
|
+
if (!await _h3ravel_shared.FileSystem.fileExists(config.envPath)) if (await _h3ravel_shared.FileSystem.fileExists(config.egEnvPath)) await (0, fs_promises.copyFile)(config.egEnvPath, config.envPath);
|
|
169
163
|
else {
|
|
170
164
|
this.error(".env file not found.");
|
|
171
165
|
this.newLine();
|
|
172
166
|
process.exit(0);
|
|
173
167
|
}
|
|
174
|
-
let content = await (0, fs_promises.readFile)(config
|
|
168
|
+
let content = await (0, fs_promises.readFile)(config.envPath, "utf8");
|
|
175
169
|
const buf = Buffer.from(content);
|
|
176
|
-
const env
|
|
177
|
-
if (config
|
|
178
|
-
if (!env
|
|
170
|
+
const env = dotenv.default.parse(buf);
|
|
171
|
+
if (config.show) {
|
|
172
|
+
if (!env.APP_KEY || env.APP_KEY === "") {
|
|
179
173
|
this.error("Application key not set.");
|
|
180
174
|
this.newLine();
|
|
181
175
|
process.exit(0);
|
|
182
176
|
}
|
|
183
|
-
const [enc, key] = env
|
|
184
|
-
|
|
177
|
+
const [enc, key] = env.APP_KEY.split(":");
|
|
178
|
+
_h3ravel_shared.Logger.log([[enc, "yellow"], [key, "white"]], ":");
|
|
185
179
|
this.newLine();
|
|
186
180
|
process.exit(0);
|
|
187
|
-
} else if (env
|
|
181
|
+
} else if (env.APP_ENV === "production" && !this.option("force")) {
|
|
188
182
|
this.error("Application is currently in production, failed to set key.");
|
|
189
183
|
this.newLine();
|
|
190
184
|
process.exit(1);
|
|
191
185
|
}
|
|
192
186
|
if (/^APP_KEY=.*$/m.test(content)) {
|
|
193
|
-
config
|
|
194
|
-
content = content.replace(/^APP_KEY=.*$/m, `APP_KEY=base64:${config
|
|
187
|
+
config.updated = true;
|
|
188
|
+
content = content.replace(/^APP_KEY=.*$/m, `APP_KEY=base64:${config.key}`);
|
|
195
189
|
} else {
|
|
196
|
-
config
|
|
197
|
-
content = `APP_KEY=base64:${config
|
|
190
|
+
config.updated = false;
|
|
191
|
+
content = `APP_KEY=base64:${config.key}\n\n${content}`;
|
|
198
192
|
}
|
|
199
|
-
await (0, fs_promises.writeFile)(config
|
|
193
|
+
await (0, fs_promises.writeFile)(config.envPath, content, "utf8");
|
|
200
194
|
this.success("Application key set successfully.");
|
|
201
195
|
this.newLine();
|
|
202
196
|
}
|
|
203
197
|
};
|
|
204
|
-
|
|
205
198
|
//#endregion
|
|
206
199
|
//#region src/Commands/MakeCommand.ts
|
|
207
|
-
var MakeCommand = class extends
|
|
200
|
+
var MakeCommand = class extends _h3ravel_musket.Command {
|
|
208
201
|
/**
|
|
209
202
|
* The name and signature of the console command.
|
|
210
203
|
*
|
|
@@ -253,26 +246,26 @@ var MakeCommand = class extends __h3ravel_musket.Command {
|
|
|
253
246
|
const type = this.option("api") ? "-resource" : "";
|
|
254
247
|
const name = this.argument("name");
|
|
255
248
|
const force = this.option("force");
|
|
256
|
-
const crtlrPath =
|
|
249
|
+
const crtlrPath = _h3ravel_shared.FileSystem.findModulePkg("@h3ravel/http", this.kernel.cwd) ?? "";
|
|
257
250
|
const stubPath = node_path.default.join(crtlrPath, `dist/stubs/controller${type}.stub`);
|
|
258
|
-
const path
|
|
251
|
+
const path = app_path(`Http/Controllers/${name}.ts`);
|
|
259
252
|
/** The Controller is scoped to a path make sure to create the associated directories */
|
|
260
|
-
if (name.includes("/")) await (0, node_fs_promises.mkdir)(
|
|
253
|
+
if (name.includes("/")) await (0, node_fs_promises.mkdir)(_h3ravel_support.Str.beforeLast(path, "/"), { recursive: true });
|
|
261
254
|
/** Check if the controller already exists */
|
|
262
|
-
if (!force && await
|
|
255
|
+
if (!force && await _h3ravel_shared.FileSystem.fileExists(path)) _h3ravel_shared.Logger.error(`ERORR: ${name} controller already exists`);
|
|
263
256
|
let stub = await (0, node_fs_promises.readFile)(stubPath, "utf-8");
|
|
264
257
|
stub = stub.replace(/{{ name }}/g, name);
|
|
265
|
-
await (0, node_fs_promises.writeFile)(path
|
|
266
|
-
|
|
258
|
+
await (0, node_fs_promises.writeFile)(path, stub);
|
|
259
|
+
_h3ravel_shared.Logger.split("INFO: Controller Created", _h3ravel_shared.Logger.log(node_path.default.basename(path), "gray", false));
|
|
267
260
|
}
|
|
268
261
|
makeResource() {
|
|
269
|
-
|
|
262
|
+
_h3ravel_shared.Logger.success("Resource support is not yet available");
|
|
270
263
|
}
|
|
271
264
|
/**
|
|
272
265
|
* Create a new Musket command
|
|
273
266
|
*/
|
|
274
267
|
makeCommand() {
|
|
275
|
-
|
|
268
|
+
_h3ravel_shared.Logger.success("Musket command creation is not yet available");
|
|
276
269
|
}
|
|
277
270
|
/**
|
|
278
271
|
* Create a new view.
|
|
@@ -280,19 +273,18 @@ var MakeCommand = class extends __h3ravel_musket.Command {
|
|
|
280
273
|
async makeView() {
|
|
281
274
|
const name = this.argument("name");
|
|
282
275
|
const force = this.option("force");
|
|
283
|
-
const path
|
|
276
|
+
const path = base_path(`src/resources/views/${name}.edge`);
|
|
284
277
|
/** The view is scoped to a path make sure to create the associated directories */
|
|
285
|
-
if (name.includes("/")) await (0, node_fs_promises.mkdir)(
|
|
278
|
+
if (name.includes("/")) await (0, node_fs_promises.mkdir)(_h3ravel_support.Str.beforeLast(path, "/"), { recursive: true });
|
|
286
279
|
/** Check if the view already exists */
|
|
287
|
-
if (!force && await
|
|
288
|
-
await (0, node_fs_promises.writeFile)(path
|
|
289
|
-
|
|
280
|
+
if (!force && await _h3ravel_shared.FileSystem.fileExists(path)) _h3ravel_shared.Logger.error(`ERORR: ${name} view already exists`);
|
|
281
|
+
await (0, node_fs_promises.writeFile)(path, `{{-- src/resources/views/${name}.edge --}}`);
|
|
282
|
+
_h3ravel_shared.Logger.split("INFO: View Created", _h3ravel_shared.Logger.log(`src/resources/views/${name}.edge`, "gray", false));
|
|
290
283
|
}
|
|
291
284
|
};
|
|
292
|
-
|
|
293
285
|
//#endregion
|
|
294
286
|
//#region src/Commands/PostinstallCommand.ts
|
|
295
|
-
var PostinstallCommand = class extends
|
|
287
|
+
var PostinstallCommand = class extends _h3ravel_musket.Command {
|
|
296
288
|
/**
|
|
297
289
|
* The name and signature of the console command.
|
|
298
290
|
*
|
|
@@ -328,13 +320,12 @@ var PostinstallCommand = class extends __h3ravel_musket.Command {
|
|
|
328
320
|
*/
|
|
329
321
|
async createSqliteDB() {
|
|
330
322
|
if (config("database.default") !== "sqlite") return;
|
|
331
|
-
if (!await
|
|
332
|
-
if (!await
|
|
323
|
+
if (!await _h3ravel_shared.FileSystem.fileExists(database_path())) await (0, node_fs_promises.mkdir)(database_path(), { recursive: true });
|
|
324
|
+
if (!await _h3ravel_shared.FileSystem.fileExists(database_path("db.sqlite"))) await (0, node_fs_promises.writeFile)(database_path("db.sqlite"), "");
|
|
333
325
|
}
|
|
334
326
|
};
|
|
335
|
-
|
|
336
327
|
//#endregion
|
|
337
328
|
exports.BuildCommand = BuildCommand;
|
|
338
329
|
exports.KeyGenerateCommand = KeyGenerateCommand;
|
|
339
330
|
exports.MakeCommand = MakeCommand;
|
|
340
|
-
exports.PostinstallCommand = PostinstallCommand;
|
|
331
|
+
exports.PostinstallCommand = PostinstallCommand;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference path="./app.globals.d.ts" />
|
|
2
|
-
import * as execa0 from "execa";
|
|
3
2
|
import { Command } from "@h3ravel/musket";
|
|
4
3
|
|
|
5
4
|
//#region src/Commands/BuildCommand.d.ts
|
|
@@ -33,10 +32,10 @@ declare class BuildCommand extends Command {
|
|
|
33
32
|
minify: boolean;
|
|
34
33
|
verbosity: number;
|
|
35
34
|
outDir: string;
|
|
36
|
-
}): Promise<void |
|
|
35
|
+
}): Promise<void | import("execa").Result<{
|
|
37
36
|
stdout: "inherit";
|
|
38
37
|
stderr: "inherit";
|
|
39
|
-
cwd:
|
|
38
|
+
cwd: any;
|
|
40
39
|
env: NodeJS.ProcessEnv & {
|
|
41
40
|
EXTENDED_DEBUG: string;
|
|
42
41
|
CLI_BUILD: string;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,6 @@ import { Str } from "@h3ravel/support";
|
|
|
10
10
|
import nodepath from "node:path";
|
|
11
11
|
import "@h3ravel/contracts";
|
|
12
12
|
import "@h3ravel/core";
|
|
13
|
-
|
|
14
13
|
//#region src/Commands/BuildCommand.ts
|
|
15
14
|
var BuildCommand = class BuildCommand extends Command {
|
|
16
15
|
/**
|
|
@@ -79,7 +78,7 @@ var BuildCommand = class BuildCommand extends Command {
|
|
|
79
78
|
"tsdown",
|
|
80
79
|
silent,
|
|
81
80
|
"--config-loader",
|
|
82
|
-
"
|
|
81
|
+
"unrun",
|
|
83
82
|
"-c",
|
|
84
83
|
"tsdown.default.config.ts"
|
|
85
84
|
].filter((e) => e !== null), {
|
|
@@ -94,7 +93,7 @@ var BuildCommand = class BuildCommand extends Command {
|
|
|
94
93
|
"tsdown",
|
|
95
94
|
silent,
|
|
96
95
|
"--config-loader",
|
|
97
|
-
"
|
|
96
|
+
"unrun",
|
|
98
97
|
"-c",
|
|
99
98
|
"tsdown.default.config.ts"
|
|
100
99
|
].filter((e) => e !== null), {
|
|
@@ -106,7 +105,6 @@ var BuildCommand = class BuildCommand extends Command {
|
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
107
|
};
|
|
109
|
-
|
|
110
108
|
//#endregion
|
|
111
109
|
//#region src/Commands/KeyGenerateCommand.ts
|
|
112
110
|
var KeyGenerateCommand = class extends Command {
|
|
@@ -126,7 +124,7 @@ var KeyGenerateCommand = class extends Command {
|
|
|
126
124
|
*/
|
|
127
125
|
description = "Set the application key";
|
|
128
126
|
async handle() {
|
|
129
|
-
const config
|
|
127
|
+
const config = {
|
|
130
128
|
key: crypto.randomBytes(32).toString("base64"),
|
|
131
129
|
envPath: base_path(".env"),
|
|
132
130
|
egEnvPath: base_path(".env.example"),
|
|
@@ -134,43 +132,42 @@ var KeyGenerateCommand = class extends Command {
|
|
|
134
132
|
show: this.option("show")
|
|
135
133
|
};
|
|
136
134
|
this.newLine();
|
|
137
|
-
if (!await FileSystem.fileExists(config
|
|
135
|
+
if (!await FileSystem.fileExists(config.envPath)) if (await FileSystem.fileExists(config.egEnvPath)) await copyFile(config.egEnvPath, config.envPath);
|
|
138
136
|
else {
|
|
139
137
|
this.error(".env file not found.");
|
|
140
138
|
this.newLine();
|
|
141
139
|
process.exit(0);
|
|
142
140
|
}
|
|
143
|
-
let content = await readFile(config
|
|
141
|
+
let content = await readFile(config.envPath, "utf8");
|
|
144
142
|
const buf = Buffer.from(content);
|
|
145
|
-
const env
|
|
146
|
-
if (config
|
|
147
|
-
if (!env
|
|
143
|
+
const env = dotenv.parse(buf);
|
|
144
|
+
if (config.show) {
|
|
145
|
+
if (!env.APP_KEY || env.APP_KEY === "") {
|
|
148
146
|
this.error("Application key not set.");
|
|
149
147
|
this.newLine();
|
|
150
148
|
process.exit(0);
|
|
151
149
|
}
|
|
152
|
-
const [enc, key] = env
|
|
150
|
+
const [enc, key] = env.APP_KEY.split(":");
|
|
153
151
|
Logger.log([[enc, "yellow"], [key, "white"]], ":");
|
|
154
152
|
this.newLine();
|
|
155
153
|
process.exit(0);
|
|
156
|
-
} else if (env
|
|
154
|
+
} else if (env.APP_ENV === "production" && !this.option("force")) {
|
|
157
155
|
this.error("Application is currently in production, failed to set key.");
|
|
158
156
|
this.newLine();
|
|
159
157
|
process.exit(1);
|
|
160
158
|
}
|
|
161
159
|
if (/^APP_KEY=.*$/m.test(content)) {
|
|
162
|
-
config
|
|
163
|
-
content = content.replace(/^APP_KEY=.*$/m, `APP_KEY=base64:${config
|
|
160
|
+
config.updated = true;
|
|
161
|
+
content = content.replace(/^APP_KEY=.*$/m, `APP_KEY=base64:${config.key}`);
|
|
164
162
|
} else {
|
|
165
|
-
config
|
|
166
|
-
content = `APP_KEY=base64:${config
|
|
163
|
+
config.updated = false;
|
|
164
|
+
content = `APP_KEY=base64:${config.key}\n\n${content}`;
|
|
167
165
|
}
|
|
168
|
-
await writeFile(config
|
|
166
|
+
await writeFile(config.envPath, content, "utf8");
|
|
169
167
|
this.success("Application key set successfully.");
|
|
170
168
|
this.newLine();
|
|
171
169
|
}
|
|
172
170
|
};
|
|
173
|
-
|
|
174
171
|
//#endregion
|
|
175
172
|
//#region src/Commands/MakeCommand.ts
|
|
176
173
|
var MakeCommand = class extends Command {
|
|
@@ -258,7 +255,6 @@ var MakeCommand = class extends Command {
|
|
|
258
255
|
Logger.split("INFO: View Created", Logger.log(`src/resources/views/${name}.edge`, "gray", false));
|
|
259
256
|
}
|
|
260
257
|
};
|
|
261
|
-
|
|
262
258
|
//#endregion
|
|
263
259
|
//#region src/Commands/PostinstallCommand.ts
|
|
264
260
|
var PostinstallCommand = class extends Command {
|
|
@@ -301,6 +297,5 @@ var PostinstallCommand = class extends Command {
|
|
|
301
297
|
if (!await FileSystem.fileExists(database_path("db.sqlite"))) await writeFile$1(database_path("db.sqlite"), "");
|
|
302
298
|
}
|
|
303
299
|
};
|
|
304
|
-
|
|
305
300
|
//#endregion
|
|
306
|
-
export { BuildCommand, KeyGenerateCommand, MakeCommand, PostinstallCommand };
|
|
301
|
+
export { BuildCommand, KeyGenerateCommand, MakeCommand, PostinstallCommand };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/console",
|
|
3
|
-
"version": "11.15.0-alpha.
|
|
3
|
+
"version": "11.15.0-alpha.12",
|
|
4
4
|
"description": "CLI utilities for scaffolding, running migrations, tasks and for H3ravel.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -48,29 +48,29 @@
|
|
|
48
48
|
"laravel"
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@h3ravel/core": "^1.
|
|
52
|
-
"@h3ravel/support": "^
|
|
51
|
+
"@h3ravel/core": "^1.29.0-alpha.12",
|
|
52
|
+
"@h3ravel/support": "^1.29.0-alpha.12"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@h3ravel/contracts": "^
|
|
56
|
-
"typescript": "^
|
|
55
|
+
"@h3ravel/contracts": "^1.29.0-alpha.12",
|
|
56
|
+
"typescript": "^6.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@h3ravel/musket": "^
|
|
60
|
-
"@h3ravel/shared": "^
|
|
61
|
-
"@h3ravel/foundation": "^
|
|
59
|
+
"@h3ravel/musket": "^1.29.0-alpha.11",
|
|
60
|
+
"@h3ravel/shared": "^1.29.0-alpha.12",
|
|
61
|
+
"@h3ravel/foundation": "^1.29.0-alpha.12",
|
|
62
62
|
"chalk": "^5.6.2",
|
|
63
63
|
"commander": "^14.0.1",
|
|
64
64
|
"dayjs": "^1.11.18",
|
|
65
65
|
"dotenv": "^17.2.3",
|
|
66
|
-
"execa": "^9.6.
|
|
66
|
+
"execa": "^9.6.1",
|
|
67
67
|
"preferred-pm": "^4.1.1",
|
|
68
68
|
"radashi": "^12.6.2",
|
|
69
69
|
"resolve-from": "^5.0.0",
|
|
70
70
|
"tsx": "^4.20.6"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
|
-
"build": "tsdown --config-loader
|
|
73
|
+
"build": "tsdown --config-loader unrun",
|
|
74
74
|
"dev": "tsx watch src/index.ts",
|
|
75
75
|
"start": "node dist/index.js",
|
|
76
76
|
"lint": "eslint . --ext .ts",
|