@yannick-z/modulo 0.3.2 → 0.3.4

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/dist/183.js DELETED
@@ -1,130 +0,0 @@
1
- import { cac } from "cac";
2
- import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
3
- import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
4
- import * as __WEBPACK_EXTERNAL_MODULE_picocolors__ from "picocolors";
5
- export const __webpack_id__ = "183";
6
- export const __webpack_ids__ = [
7
- "183"
8
- ];
9
- export const __webpack_modules__ = {
10
- "./src/index.ts?fb01": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
11
- __webpack_require__.r(__webpack_exports__);
12
- __webpack_require__.d(__webpack_exports__, {
13
- exec: ()=>exec
14
- });
15
- var log = __webpack_require__("./src/tools/log.ts");
16
- var package_namespaceObject = {
17
- rE: "0.3.2"
18
- };
19
- const cli = cac("modulo");
20
- cli.command("init <target>", "Initialize modulo configuration or scripts").option("-f, --force", "Force overwrite existing files").option("--path <path>", "Specify the path to initialize").option("--preset <preset>", "Specify the preset to use").action((target, options)=>{
21
- __webpack_require__.e("882").then(__webpack_require__.bind(__webpack_require__, "./src/cli/init.ts")).then(({ init_tool })=>{
22
- init_tool({
23
- cmd: "init",
24
- target: target,
25
- init: {
26
- path: options.path,
27
- force: options.force,
28
- preset: options.preset
29
- }
30
- });
31
- });
32
- });
33
- cli.command("build <target>", "Build the project for production").option("-c, --config <file>", "Use specified config file").option("-w, --watch", "Watch for changes").option("--env <env>", "Specify the environment (dev/prd)").action((target, options)=>{
34
- __webpack_require__.e("740").then(__webpack_require__.bind(__webpack_require__, "./src/cli/pack-code.ts")).then(({ pack_code })=>{
35
- pack_code({
36
- cmd: "build",
37
- target: target,
38
- pack: {
39
- config: options.config,
40
- env: options.env || "prd",
41
- watch: options.watch,
42
- esm: true
43
- }
44
- });
45
- });
46
- });
47
- cli.command("dev <target>", "Start development server").option("-c, --config <file>", "Use specified config file").option("--env <env>", "Specify the environment (dev/prd)").option("--debug", "Enable debug mode").action((target, options)=>{
48
- if (options.debug) process.env.DEBUG = "true";
49
- __webpack_require__.e("740").then(__webpack_require__.bind(__webpack_require__, "./src/cli/pack-code.ts")).then(({ pack_code })=>{
50
- pack_code({
51
- cmd: "dev",
52
- target: target,
53
- pack: {
54
- config: options.config,
55
- env: options.env || "dev",
56
- watch: true,
57
- esm: true
58
- }
59
- });
60
- });
61
- });
62
- cli.command("preview <target>", "Preview the production build").option("-c, --config <file>", "Use specified config file").action((target, options)=>{
63
- __webpack_require__.e("740").then(__webpack_require__.bind(__webpack_require__, "./src/cli/pack-code.ts")).then(({ pack_code })=>{
64
- pack_code({
65
- cmd: "preview",
66
- target: target,
67
- pack: {
68
- config: options.config,
69
- env: "prd",
70
- watch: false,
71
- esm: true
72
- }
73
- });
74
- });
75
- });
76
- cli.help();
77
- cli.version(package_namespaceObject.rE);
78
- function exec() {
79
- try {
80
- cli.parse();
81
- } catch (error) {
82
- log.v.error(`Error: ${error.message}`);
83
- cli.outputHelp();
84
- process.exit(1);
85
- }
86
- }
87
- },
88
- "./src/tools/log.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
89
- __webpack_require__.d(__webpack_exports__, {
90
- n: ()=>debug_log,
91
- v: ()=>logger
92
- });
93
- var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:fs");
94
- var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("node:path");
95
- var picocolors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("picocolors");
96
- const logFile = node_path__WEBPACK_IMPORTED_MODULE_1__.join(process.cwd(), "modulo.debug.log");
97
- let index = 0;
98
- function debug_log(hint, ...params) {
99
- const argv_debug = process.env.DEBUG || process.argv.includes("--debug");
100
- const argv_verbose = process.argv.includes("--verbose") || process.argv.includes("-v");
101
- if (!argv_debug && !argv_verbose) return;
102
- const timestamp = new Date().toISOString();
103
- const sn = String(index++).padStart(3, "0");
104
- const logEntry = `--------------\n${sn} [${timestamp}] ${hint}\n${params.map((p)=>"object" == typeof p ? JSON.stringify(p, null, 2) : String(p)).join("\n")}\n---------------\n\n`;
105
- if (argv_verbose) console.log(logEntry);
106
- if (argv_debug) {
107
- console.log(picocolors__WEBPACK_IMPORTED_MODULE_2__["default"].blue(`\ndebug log ${sn}`));
108
- node_fs__WEBPACK_IMPORTED_MODULE_0__.appendFileSync(logFile, logEntry);
109
- }
110
- }
111
- const logger = {
112
- info: (msg)=>console.log(picocolors__WEBPACK_IMPORTED_MODULE_2__["default"].cyan(msg)),
113
- success: (msg)=>console.log(picocolors__WEBPACK_IMPORTED_MODULE_2__["default"].green(msg)),
114
- warn: (msg)=>console.log(picocolors__WEBPACK_IMPORTED_MODULE_2__["default"].yellow(msg)),
115
- error: (msg)=>console.log(picocolors__WEBPACK_IMPORTED_MODULE_2__["default"].red(msg)),
116
- debug: (msg)=>{
117
- if (process.env.DEBUG) console.log(picocolors__WEBPACK_IMPORTED_MODULE_2__["default"].gray(`[DEBUG] ${msg}`));
118
- }
119
- };
120
- },
121
- "node:fs": function(module) {
122
- module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__;
123
- },
124
- "node:path": function(module) {
125
- module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
126
- },
127
- picocolors: function(module) {
128
- module.exports = __WEBPACK_EXTERNAL_MODULE_picocolors__;
129
- }
130
- };