@maltty/cli 1.0.0-rc.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/LICENSE +21 -0
- package/README.md +88 -0
- package/bin/maltty.js +3 -0
- package/dist/_format-CeQhQTl5.js +23 -0
- package/dist/_format-CeQhQTl5.js.map +1 -0
- package/dist/attemptAsync-BdXzRSIT.js +42 -0
- package/dist/attemptAsync-BdXzRSIT.js.map +1 -0
- package/dist/chunk-DsIazq42.js +26 -0
- package/dist/commands/add/command.d.ts +7 -0
- package/dist/commands/add/command.d.ts.map +1 -0
- package/dist/commands/add/command.js +123 -0
- package/dist/commands/add/command.js.map +1 -0
- package/dist/commands/add/config.d.ts +7 -0
- package/dist/commands/add/config.d.ts.map +1 -0
- package/dist/commands/add/config.js +57 -0
- package/dist/commands/add/config.js.map +1 -0
- package/dist/commands/add/index.d.ts +7 -0
- package/dist/commands/add/index.d.ts.map +1 -0
- package/dist/commands/add/index.js +7 -0
- package/dist/commands/add/index.js.map +1 -0
- package/dist/commands/add/middleware.d.ts +7 -0
- package/dist/commands/add/middleware.d.ts.map +1 -0
- package/dist/commands/add/middleware.js +88 -0
- package/dist/commands/add/middleware.js.map +1 -0
- package/dist/commands/build.d.ts +15 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +246 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/commands.d.ts +14 -0
- package/dist/commands/commands.d.ts.map +1 -0
- package/dist/commands/commands.js +189 -0
- package/dist/commands/commands.js.map +1 -0
- package/dist/commands/dev.d.ts +13 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +58 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +13 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +658 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +305 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/run.d.ts +19 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +478 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/stories.d.ts +11 -0
- package/dist/commands/stories.d.ts.map +1 -0
- package/dist/commands/stories.js +22 -0
- package/dist/commands/stories.js.map +1 -0
- package/dist/config-helpers-pv_2Spux.js +15 -0
- package/dist/config-helpers-pv_2Spux.js.map +1 -0
- package/dist/defu-BBwssjW3.js +192 -0
- package/dist/defu-BBwssjW3.js.map +1 -0
- package/dist/detect-AOq1ehTE.js +61 -0
- package/dist/detect-AOq1ehTE.js.map +1 -0
- package/dist/dist-DW_gRP7_.js +1119 -0
- package/dist/dist-DW_gRP7_.js.map +1 -0
- package/dist/dist-Xa07jNxS.js +15617 -0
- package/dist/dist-Xa07jNxS.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/jiti-CxWlVmZ_.js +5458 -0
- package/dist/jiti-CxWlVmZ_.js.map +1 -0
- package/dist/json-D7WbuVK1.js +43 -0
- package/dist/json-D7WbuVK1.js.map +1 -0
- package/dist/json5-z-PGDMyy.js +777 -0
- package/dist/json5-z-PGDMyy.js.map +1 -0
- package/dist/jsonc-DqZkfC3S.js +401 -0
- package/dist/jsonc-DqZkfC3S.js.map +1 -0
- package/dist/jsonc-KADMdSjU.js +2 -0
- package/dist/lib/templates/command/command.ts.liquid +12 -0
- package/dist/lib/templates/config/config.ts.liquid +16 -0
- package/dist/lib/templates/middleware/middleware.ts.liquid +9 -0
- package/dist/lib/templates/project/gitignore.liquid +3 -0
- package/dist/lib/templates/project/maltty.config.ts.liquid +6 -0
- package/dist/lib/templates/project/package.json.liquid +30 -0
- package/dist/lib/templates/project/src/commands/hello.ts.liquid +12 -0
- package/dist/lib/templates/project/src/config.ts.liquid +16 -0
- package/dist/lib/templates/project/src/index.ts.liquid +13 -0
- package/dist/lib/templates/project/tsconfig.json.liquid +19 -0
- package/dist/lib/templates/project/vitest.config.ts.liquid +8 -0
- package/dist/main-C_8x2aB3.js +274 -0
- package/dist/main-C_8x2aB3.js.map +1 -0
- package/dist/manifest-BIKVDJML.js +112 -0
- package/dist/manifest-BIKVDJML.js.map +1 -0
- package/dist/multipart-parser-MNkxNO83.js +174 -0
- package/dist/multipart-parser-MNkxNO83.js.map +1 -0
- package/dist/node-C91xGGqn.js +644 -0
- package/dist/node-C91xGGqn.js.map +1 -0
- package/dist/node-Drmc03fL.js +3973 -0
- package/dist/node-Drmc03fL.js.map +1 -0
- package/dist/ohash-BPoV4zBH.js +185 -0
- package/dist/ohash-BPoV4zBH.js.map +1 -0
- package/dist/pnpm-workspace.yaml +26 -0
- package/dist/toml-LuHsHQtV.js +646 -0
- package/dist/toml-LuHsHQtV.js.map +1 -0
- package/dist/utils-DlIJNGLQ.js +1905 -0
- package/dist/utils-DlIJNGLQ.js.map +1 -0
- package/dist/validate-C_SXBoLq.js +18 -0
- package/dist/validate-C_SXBoLq.js.map +1 -0
- package/dist/write-CSwG4Stj.js +152 -0
- package/dist/write-CSwG4Stj.js.map +1 -0
- package/dist/yaml-BS9RDuUr.js +1067 -0
- package/dist/yaml-BS9RDuUr.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
2
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3
|
+
function normalizeWindowsPath(input = "") {
|
|
4
|
+
if (!input) return input;
|
|
5
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
6
|
+
}
|
|
7
|
+
const _UNC_REGEX = /^[/\\]{2}/;
|
|
8
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
9
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
10
|
+
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
11
|
+
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
12
|
+
const normalize = function(path) {
|
|
13
|
+
if (path.length === 0) return ".";
|
|
14
|
+
path = normalizeWindowsPath(path);
|
|
15
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
16
|
+
const isPathAbsolute = isAbsolute(path);
|
|
17
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
18
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
19
|
+
if (path.length === 0) {
|
|
20
|
+
if (isPathAbsolute) return "/";
|
|
21
|
+
return trailingSeparator ? "./" : ".";
|
|
22
|
+
}
|
|
23
|
+
if (trailingSeparator) path += "/";
|
|
24
|
+
if (_DRIVE_LETTER_RE.test(path)) path += "/";
|
|
25
|
+
if (isUNCPath) {
|
|
26
|
+
if (!isPathAbsolute) return `//./${path}`;
|
|
27
|
+
return `//${path}`;
|
|
28
|
+
}
|
|
29
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
30
|
+
};
|
|
31
|
+
const join = function(...segments) {
|
|
32
|
+
let path = "";
|
|
33
|
+
for (const seg of segments) {
|
|
34
|
+
if (!seg) continue;
|
|
35
|
+
if (path.length > 0) {
|
|
36
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
37
|
+
const segLeading = seg[0] === "/";
|
|
38
|
+
if (pathTrailing && segLeading) path += seg.slice(1);
|
|
39
|
+
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
40
|
+
} else path += seg;
|
|
41
|
+
}
|
|
42
|
+
return normalize(path);
|
|
43
|
+
};
|
|
44
|
+
function cwd() {
|
|
45
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
46
|
+
return "/";
|
|
47
|
+
}
|
|
48
|
+
const resolve = function(...arguments_) {
|
|
49
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
50
|
+
let resolvedPath = "";
|
|
51
|
+
let resolvedAbsolute = false;
|
|
52
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
53
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
54
|
+
if (!path || path.length === 0) continue;
|
|
55
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
56
|
+
resolvedAbsolute = isAbsolute(path);
|
|
57
|
+
}
|
|
58
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
59
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
60
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
61
|
+
};
|
|
62
|
+
function normalizeString(path, allowAboveRoot) {
|
|
63
|
+
let res = "";
|
|
64
|
+
let lastSegmentLength = 0;
|
|
65
|
+
let lastSlash = -1;
|
|
66
|
+
let dots = 0;
|
|
67
|
+
let char = null;
|
|
68
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
69
|
+
if (index < path.length) char = path[index];
|
|
70
|
+
else if (char === "/") break;
|
|
71
|
+
else char = "/";
|
|
72
|
+
if (char === "/") {
|
|
73
|
+
if (lastSlash === index - 1 || dots === 1);
|
|
74
|
+
else if (dots === 2) {
|
|
75
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
76
|
+
if (res.length > 2) {
|
|
77
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
78
|
+
if (lastSlashIndex === -1) {
|
|
79
|
+
res = "";
|
|
80
|
+
lastSegmentLength = 0;
|
|
81
|
+
} else {
|
|
82
|
+
res = res.slice(0, lastSlashIndex);
|
|
83
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
84
|
+
}
|
|
85
|
+
lastSlash = index;
|
|
86
|
+
dots = 0;
|
|
87
|
+
continue;
|
|
88
|
+
} else if (res.length > 0) {
|
|
89
|
+
res = "";
|
|
90
|
+
lastSegmentLength = 0;
|
|
91
|
+
lastSlash = index;
|
|
92
|
+
dots = 0;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (allowAboveRoot) {
|
|
97
|
+
res += res.length > 0 ? "/.." : "..";
|
|
98
|
+
lastSegmentLength = 2;
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
102
|
+
else res = path.slice(lastSlash + 1, index);
|
|
103
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
104
|
+
}
|
|
105
|
+
lastSlash = index;
|
|
106
|
+
dots = 0;
|
|
107
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
108
|
+
else dots = -1;
|
|
109
|
+
}
|
|
110
|
+
return res;
|
|
111
|
+
}
|
|
112
|
+
const isAbsolute = function(p) {
|
|
113
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
114
|
+
};
|
|
115
|
+
const extname = function(p) {
|
|
116
|
+
if (p === "..") return "";
|
|
117
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
118
|
+
return match && match[1] || "";
|
|
119
|
+
};
|
|
120
|
+
const relative = function(from, to) {
|
|
121
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
122
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
123
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
|
|
124
|
+
const _fromCopy = [..._from];
|
|
125
|
+
for (const segment of _fromCopy) {
|
|
126
|
+
if (_to[0] !== segment) break;
|
|
127
|
+
_from.shift();
|
|
128
|
+
_to.shift();
|
|
129
|
+
}
|
|
130
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
131
|
+
};
|
|
132
|
+
const dirname = function(p) {
|
|
133
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
134
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
135
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
136
|
+
};
|
|
137
|
+
const basename = function(p, extension) {
|
|
138
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
139
|
+
let lastSegment = "";
|
|
140
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
141
|
+
const val = segments[i];
|
|
142
|
+
if (val) {
|
|
143
|
+
lastSegment = val;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
148
|
+
};
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
151
|
+
function isPlainObject(value) {
|
|
152
|
+
if (value === null || typeof value !== "object") return false;
|
|
153
|
+
const prototype = Object.getPrototypeOf(value);
|
|
154
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
155
|
+
if (Symbol.iterator in value) return false;
|
|
156
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
160
|
+
if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
161
|
+
const object = { ...defaults };
|
|
162
|
+
for (const key of Object.keys(baseObject)) {
|
|
163
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
164
|
+
const value = baseObject[key];
|
|
165
|
+
if (value === null || value === void 0) continue;
|
|
166
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
167
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
168
|
+
else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
169
|
+
else object[key] = value;
|
|
170
|
+
}
|
|
171
|
+
return object;
|
|
172
|
+
}
|
|
173
|
+
function createDefu(merger) {
|
|
174
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
175
|
+
}
|
|
176
|
+
const defu = createDefu();
|
|
177
|
+
createDefu((object, key, currentValue) => {
|
|
178
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
179
|
+
object[key] = currentValue(object[key]);
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
createDefu((object, key, currentValue) => {
|
|
184
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
185
|
+
object[key] = currentValue(object[key]);
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
//#endregion
|
|
190
|
+
export { isAbsolute as a, relative as c, extname as i, resolve as l, basename as n, join as o, dirname as r, normalize as s, defu as t };
|
|
191
|
+
|
|
192
|
+
//# sourceMappingURL=defu-BBwssjW3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defu-BBwssjW3.js","names":[],"sources":["../../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs","../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs"],"sourcesContent":["let _lazyMatch = () => { var __lib__=(()=>{var m=Object.defineProperty,V=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyNames,T=Object.prototype.hasOwnProperty,q=(r,e)=>{for(var n in e)m(r,n,{get:e[n],enumerable:true});},H=(r,e,n,a)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let t of G(e))!T.call(r,t)&&t!==n&&m(r,t,{get:()=>e[t],enumerable:!(a=V(e,t))||a.enumerable});return r},J=r=>H(m({},\"__esModule\",{value:true}),r),w={};q(w,{default:()=>re});var A=r=>Array.isArray(r),d=r=>typeof r==\"function\",Q=r=>r.length===0,W=r=>typeof r==\"number\",K=r=>typeof r==\"object\"&&r!==null,X=r=>r instanceof RegExp,b=r=>typeof r==\"string\",h=r=>r===void 0,Y=r=>{const e=new Map;return n=>{const a=e.get(n);if(a)return a;const t=r(n);return e.set(n,t),t}},rr=(r,e,n={})=>{const a={cache:{},input:r,index:0,indexMax:0,options:n,output:[]};if(v(e)(a)&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${a.indexMax}`)},i=(r,e)=>A(r)?er(r,e):b(r)?ar(r,e):nr(r,e),er=(r,e)=>{const n={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: \"${a}\"`);const t=a.charCodeAt(0);n[t]=true;}return a=>{const t=a.index,o=a.input;for(;a.index<o.length&&o.charCodeAt(a.index)in n;)a.index+=1;const u=a.index;if(u>t){if(!h(e)&&!a.options.silent){const s=a.input.slice(t,u),c=d(e)?e(s,o,String(t)):e;h(c)||a.output.push(c);}a.indexMax=Math.max(a.indexMax,a.index);}return true}},nr=(r,e)=>{const n=r.source,a=r.flags.replace(/y|$/,\"y\"),t=new RegExp(n,a);return g(o=>{t.lastIndex=o.index;const u=t.exec(o.input);if(u){if(!h(e)&&!o.options.silent){const s=d(e)?e(...u,o.input,String(o.index)):e;h(s)||o.output.push(s);}return o.index+=u[0].length,o.indexMax=Math.max(o.indexMax,o.index),true}else return false})},ar=(r,e)=>n=>{if(n.input.startsWith(r,n.index)){if(!h(e)&&!n.options.silent){const t=d(e)?e(r,n.input,String(n.index)):e;h(t)||n.output.push(t);}return n.index+=r.length,n.indexMax=Math.max(n.indexMax,n.index),true}else return false},C=(r,e,n,a)=>{const t=v(r);return g(_(M(o=>{let u=0;for(;u<n;){const s=o.index;if(!t(o)||(u+=1,o.index===s))break}return u>=e})))},tr=(r,e)=>C(r,0,1),f=(r,e)=>C(r,0,1/0),x=(r,e)=>{const n=r.map(v);return g(_(M(a=>{for(let t=0,o=n.length;t<o;t++)if(!n[t](a))return false;return true})))},l=(r,e)=>{const n=r.map(v);return g(_(a=>{for(let t=0,o=n.length;t<o;t++)if(n[t](a))return true;return false}))},M=(r,e=false)=>{const n=v(r);return a=>{const t=a.index,o=a.output.length,u=n(a);return (!u||e)&&(a.index=t,a.output.length!==o&&(a.output.length=o)),u}},_=(r,e)=>{const n=v(r);return n},g=(()=>{let r=0;return e=>{const n=v(e),a=r+=1;return t=>{var o;if(t.options.memoization===false)return n(t);const u=t.index,s=(o=t.cache)[a]||(o[a]=new Map),c=s.get(u);if(c===false)return false;if(W(c))return t.index=c,true;if(c)return t.index=c.index,c.output?.length&&t.output.push(...c.output),true;{const Z=t.output.length;if(n(t)){const D=t.index,U=t.output.length;if(U>Z){const ee=t.output.slice(Z,U);s.set(u,{index:D,output:ee});}else s.set(u,D);return true}else return s.set(u,false),false}}}})(),E=r=>{let e;return n=>(e||(e=v(r())),e(n))},v=Y(r=>{if(d(r))return Q(r)?E(r):r;if(b(r)||X(r))return i(r);if(A(r))return x(r);if(K(r))return l(Object.values(r));throw new Error(\"Invalid rule\")}),P=\"abcdefghijklmnopqrstuvwxyz\",ir=r=>{let e=\"\";for(;r>0;){const n=(r-1)%26;e=P[n]+e,r=Math.floor((r-1)/26);}return e},O=r=>{let e=0;for(let n=0,a=r.length;n<a;n++)e=e*26+P.indexOf(r[n])+1;return e},S=(r,e)=>{if(e<r)return S(e,r);const n=[];for(;r<=e;)n.push(r++);return n},or=(r,e,n)=>S(r,e).map(a=>String(a).padStart(n,\"0\")),R=(r,e)=>S(O(r),O(e)).map(ir),p=r=>r,z=r=>ur(e=>rr(e,r,{memoization:false}).join(\"\")),ur=r=>{const e={};return n=>e[n]??(e[n]=r(n))},sr=i(/^\\*\\*\\/\\*$/,\".*\"),cr=i(/^\\*\\*\\/(\\*)?([ a-zA-Z0-9._-]+)$/,(r,e,n)=>`.*${e?\"\":\"(?:^|/)\"}${n.replaceAll(\".\",\"\\\\.\")}`),lr=i(/^\\*\\*\\/(\\*)?([ a-zA-Z0-9._-]*)\\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\\}$/,(r,e,n,a)=>`.*${e?\"\":\"(?:^|/)\"}${n.replaceAll(\".\",\"\\\\.\")}(?:${a.replaceAll(\",\",\"|\").replaceAll(\".\",\"\\\\.\")})`),y=i(/\\\\./,p),pr=i(/[$.*+?^(){}[\\]\\|]/,r=>`\\\\${r}`),vr=i(/./,p),hr=i(/^(?:!!)*!(.*)$/,(r,e)=>`(?!^${L(e)}$).*?`),dr=i(/^(!!)+/,\"\"),fr=l([hr,dr]),xr=i(/\\/(\\*\\*\\/)+/,\"(?:/.+/|/)\"),gr=i(/^(\\*\\*\\/)+/,\"(?:^|.*/)\"),mr=i(/\\/(\\*\\*)$/,\"(?:/.*|$)\"),_r=i(/\\*\\*/,\".*\"),j=l([xr,gr,mr,_r]),Sr=i(/\\*\\/(?!\\*\\*\\/)/,\"[^/]*/\"),yr=i(/\\*/,\"[^/]*\"),N=l([Sr,yr]),k=i(\"?\",\"[^/]\"),$r=i(\"[\",p),wr=i(\"]\",p),Ar=i(/[!^]/,\"^/\"),br=i(/[a-z]-[a-z]|[0-9]-[0-9]/i,p),Cr=i(/[$.*+?^(){}[\\|]/,r=>`\\\\${r}`),Mr=i(/[^\\]]/,p),Er=l([y,Cr,br,Mr]),B=x([$r,tr(Ar),f(Er),wr]),Pr=i(\"{\",\"(?:\"),Or=i(\"}\",\")\"),Rr=i(/(\\d+)\\.\\.(\\d+)/,(r,e,n)=>or(+e,+n,Math.min(e.length,n.length)).join(\"|\")),zr=i(/([a-z]+)\\.\\.([a-z]+)/,(r,e,n)=>R(e,n).join(\"|\")),jr=i(/([A-Z]+)\\.\\.([A-Z]+)/,(r,e,n)=>R(e.toLowerCase(),n.toLowerCase()).join(\"|\").toUpperCase()),Nr=l([Rr,zr,jr]),I=x([Pr,Nr,Or]),kr=i(\"{\",\"(?:\"),Br=i(\"}\",\")\"),Ir=i(\",\",\"|\"),Fr=i(/[$.*+?^(){[\\]\\|]/,r=>`\\\\${r}`),Lr=i(/[^}]/,p),Zr=E(()=>F),Dr=l([j,N,k,B,I,Zr,y,Fr,Ir,Lr]),F=x([kr,f(Dr),Br]),Ur=f(l([sr,cr,lr,fr,j,N,k,B,I,F,y,pr,vr])),Vr=Ur,Gr=z(Vr),L=Gr,Tr=i(/\\\\./,p),qr=i(/./,p),Hr=i(/\\*\\*\\*+/,\"*\"),Jr=i(/([^/{[(!])\\*\\*/,(r,e)=>`${e}*`),Qr=i(/(^|.)\\*\\*(?=[^*/)\\]}])/,(r,e)=>`${e}*`),Wr=f(l([Tr,Hr,Jr,Qr,qr])),Kr=Wr,Xr=z(Kr),Yr=Xr,$=(r,e)=>{const n=Array.isArray(r)?r:[r];if(!n.length)return false;const a=n.map($.compile),t=n.every(s=>/(\\/(?:\\*\\*)?|\\[\\/\\])$/.test(s)),o=e.replace(/[\\\\\\/]+/g,\"/\").replace(/\\/$/,t?\"/\":\"\");return a.some(s=>s.test(o))};$.compile=r=>new RegExp(`^${L(Yr(r))}$`,\"s\");var re=$;return J(w)})();\n return __lib__.default || __lib__; };\nlet _match;\nconst zeptomatch = (path, pattern) => {\n if (!_match) {\n _match = _lazyMatch();\n _lazyMatch = null;\n }\n return _match(path, pattern);\n};\n\nconst _DRIVE_LETTER_START_RE = /^[A-Za-z]:\\//;\nfunction normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n return input.replace(/\\\\/g, \"/\").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());\n}\n\nconst _UNC_REGEX = /^[/\\\\]{2}/;\nconst _IS_ABSOLUTE_RE = /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;\nconst _DRIVE_LETTER_RE = /^[A-Za-z]:$/;\nconst _ROOT_FOLDER_RE = /^\\/([A-Za-z]:)?$/;\nconst _EXTNAME_RE = /.(\\.[^./]+|\\.)$/;\nconst _PATH_ROOT_RE = /^[/\\\\]|^[a-zA-Z]:[/\\\\]/;\nconst sep = \"/\";\nconst normalize = function(path) {\n if (path.length === 0) {\n return \".\";\n }\n path = normalizeWindowsPath(path);\n const isUNCPath = path.match(_UNC_REGEX);\n const isPathAbsolute = isAbsolute(path);\n const trailingSeparator = path[path.length - 1] === \"/\";\n path = normalizeString(path, !isPathAbsolute);\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n if (trailingSeparator) {\n path += \"/\";\n }\n if (_DRIVE_LETTER_RE.test(path)) {\n path += \"/\";\n }\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n};\nconst join = function(...segments) {\n let path = \"\";\n for (const seg of segments) {\n if (!seg) {\n continue;\n }\n if (path.length > 0) {\n const pathTrailing = path[path.length - 1] === \"/\";\n const segLeading = seg[0] === \"/\";\n const both = pathTrailing && segLeading;\n if (both) {\n path += seg.slice(1);\n } else {\n path += pathTrailing || segLeading ? seg : `/${seg}`;\n }\n } else {\n path += seg;\n }\n }\n return normalize(path);\n};\nfunction cwd() {\n if (typeof process !== \"undefined\" && typeof process.cwd === \"function\") {\n return process.cwd().replace(/\\\\/g, \"/\");\n }\n return \"/\";\n}\nconst resolve = function(...arguments_) {\n arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));\n let resolvedPath = \"\";\n let resolvedAbsolute = false;\n for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {\n const path = index >= 0 ? arguments_[index] : cwd();\n if (!path || path.length === 0) {\n continue;\n }\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = isAbsolute(path);\n }\n resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);\n if (resolvedAbsolute && !isAbsolute(resolvedPath)) {\n return `/${resolvedPath}`;\n }\n return resolvedPath.length > 0 ? resolvedPath : \".\";\n};\nfunction normalizeString(path, allowAboveRoot) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n char = path[index];\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== \".\" || res[res.length - 2] !== \".\") {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (res.length > 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n res = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\nconst isAbsolute = function(p) {\n return _IS_ABSOLUTE_RE.test(p);\n};\nconst toNamespacedPath = function(p) {\n return normalizeWindowsPath(p);\n};\nconst extname = function(p) {\n if (p === \"..\") return \"\";\n const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));\n return match && match[1] || \"\";\n};\nconst relative = function(from, to) {\n const _from = resolve(from).replace(_ROOT_FOLDER_RE, \"$1\").split(\"/\");\n const _to = resolve(to).replace(_ROOT_FOLDER_RE, \"$1\").split(\"/\");\n if (_to[0][1] === \":\" && _from[0][1] === \":\" && _from[0] !== _to[0]) {\n return _to.join(\"/\");\n }\n const _fromCopy = [..._from];\n for (const segment of _fromCopy) {\n if (_to[0] !== segment) {\n break;\n }\n _from.shift();\n _to.shift();\n }\n return [..._from.map(() => \"..\"), ..._to].join(\"/\");\n};\nconst dirname = function(p) {\n const segments = normalizeWindowsPath(p).replace(/\\/$/, \"\").split(\"/\").slice(0, -1);\n if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {\n segments[0] += \"/\";\n }\n return segments.join(\"/\") || (isAbsolute(p) ? \"/\" : \".\");\n};\nconst format = function(p) {\n const ext = p.ext ? p.ext.startsWith(\".\") ? p.ext : `.${p.ext}` : \"\";\n const segments = [p.root, p.dir, p.base ?? (p.name ?? \"\") + ext].filter(\n Boolean\n );\n return normalizeWindowsPath(\n p.root ? resolve(...segments) : segments.join(\"/\")\n );\n};\nconst basename = function(p, extension) {\n const segments = normalizeWindowsPath(p).split(\"/\");\n let lastSegment = \"\";\n for (let i = segments.length - 1; i >= 0; i--) {\n const val = segments[i];\n if (val) {\n lastSegment = val;\n break;\n }\n }\n return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;\n};\nconst parse = function(p) {\n const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\\\/g, \"/\") || \"\";\n const base = basename(p);\n const extension = extname(base);\n return {\n root,\n dir: dirname(p),\n base,\n ext: extension,\n name: base.slice(0, base.length - extension.length)\n };\n};\nconst matchesGlob = (path, pattern) => {\n return zeptomatch(pattern, normalize(path));\n};\n\nconst _path = {\n __proto__: null,\n basename: basename,\n dirname: dirname,\n extname: extname,\n format: format,\n isAbsolute: isAbsolute,\n join: join,\n matchesGlob: matchesGlob,\n normalize: normalize,\n normalizeString: normalizeString,\n parse: parse,\n relative: relative,\n resolve: resolve,\n sep: sep,\n toNamespacedPath: toNamespacedPath\n};\n\nexport { _path as _, normalizeString as a, relative as b, basename as c, dirname as d, extname as e, format as f, normalizeWindowsPath as g, isAbsolute as i, join as j, matchesGlob as m, normalize as n, parse as p, resolve as r, sep as s, toNamespacedPath as t };\n","function isPlainObject(value) {\n if (value === null || typeof value !== \"object\") {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {\n return false;\n }\n if (Symbol.iterator in value) {\n return false;\n }\n if (Symbol.toStringTag in value) {\n return Object.prototype.toString.call(value) === \"[object Module]\";\n }\n return true;\n}\n\nfunction _defu(baseObject, defaults, namespace = \".\", merger) {\n if (!isPlainObject(defaults)) {\n return _defu(baseObject, {}, namespace, merger);\n }\n const object = { ...defaults };\n for (const key of Object.keys(baseObject)) {\n if (key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = baseObject[key];\n if (value === null || value === void 0) {\n continue;\n }\n if (merger && merger(object, key, value, namespace)) {\n continue;\n }\n if (Array.isArray(value) && Array.isArray(object[key])) {\n object[key] = [...value, ...object[key]];\n } else if (isPlainObject(value) && isPlainObject(object[key])) {\n object[key] = _defu(\n value,\n object[key],\n (namespace ? `${namespace}.` : \"\") + key.toString(),\n merger\n );\n } else {\n object[key] = value;\n }\n }\n return object;\n}\nfunction createDefu(merger) {\n return (...arguments_) => (\n // eslint-disable-next-line unicorn/no-array-reduce\n arguments_.reduce((p, c) => _defu(p, c, \"\", merger), {})\n );\n}\nconst defu = createDefu();\nconst defuFn = createDefu((object, key, currentValue) => {\n if (object[key] !== void 0 && typeof currentValue === \"function\") {\n object[key] = currentValue(object[key]);\n return true;\n }\n});\nconst defuArrayFn = createDefu((object, key, currentValue) => {\n if (Array.isArray(object[key]) && typeof currentValue === \"function\") {\n object[key] = currentValue(object[key]);\n return true;\n }\n});\n\nexport { createDefu, defu as default, defu, defuArrayFn, defuFn };\n"],"x_google_ignoreList":[0,1],"mappings":";AAWA,MAAM,yBAAyB;AAC/B,SAAS,qBAAqB,QAAQ,IAAI;AACxC,KAAI,CAA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CAC3D,QAAO,OAAO,MACZ,OACA,OAAO,OACN,YAAY,GAAG,UAAU,KAAK,MAAM,IAAI,UAAU,EACnD,OACD;MAED,QAAO,OAAO;;AAGlB,QAAO;;AAET,SAAS,WAAW,QAAQ;AAC1B,SAAQ,GAAG,eAET,WAAW,QAAQ,GAAG,MAAM,MAAM,GAAG,GAAG,IAAI,OAAO,EAAE,EAAE,CAAC;;AAG5D,MAAM,OAAO,YAAY;AACV,YAAY,QAAQ,KAAK,iBAAiB;AACvD,KAAI,OAAO,SAAS,KAAK,KAAK,OAAO,iBAAiB,YAAY;AAChE,SAAO,OAAO,aAAa,OAAO,KAAK;AACvC,SAAO;;EAET;AACkB,YAAY,QAAQ,KAAK,iBAAiB;AAC5D,KAAI,MAAM,QAAQ,OAAO,KAAK,IAAI,OAAO,iBAAiB,YAAY;AACpE,SAAO,OAAO,aAAa,OAAO,KAAK;AACvC,SAAO;;EAET"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { r as ok } from "./attemptAsync-BdXzRSIT.js";
|
|
2
|
+
import { r as fs_exports } from "./node-C91xGGqn.js";
|
|
3
|
+
import { t as jsonParse } from "./json-D7WbuVK1.js";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
//#region src/lib/detect.ts
|
|
6
|
+
/**
|
|
7
|
+
* Detect whether the given directory contains a maltty-based CLI project.
|
|
8
|
+
*
|
|
9
|
+
* Looks for a `package.json` with `maltty` listed in `dependencies` or
|
|
10
|
+
* `devDependencies`, and checks for a `src/commands/` directory.
|
|
11
|
+
*
|
|
12
|
+
* @param cwd - The directory to inspect.
|
|
13
|
+
* @returns An async Result containing project info or null when no maltty project is found.
|
|
14
|
+
*/
|
|
15
|
+
async function detectProject(cwd) {
|
|
16
|
+
const packageJsonPath = join(cwd, "package.json");
|
|
17
|
+
if (!await fs_exports.exists(packageJsonPath)) return ok(null);
|
|
18
|
+
const [readError, pkg] = await readPackageJson(packageJsonPath);
|
|
19
|
+
if (readError) return [readError, null];
|
|
20
|
+
const deps = pkg.dependencies ?? {};
|
|
21
|
+
const devDeps = pkg.devDependencies ?? {};
|
|
22
|
+
const hasMalttyDep = "maltty" in deps || "maltty" in devDeps;
|
|
23
|
+
if (!hasMalttyDep) return ok(null);
|
|
24
|
+
const commandsPath = join(cwd, "src", "commands");
|
|
25
|
+
if (await fs_exports.exists(commandsPath)) return ok({
|
|
26
|
+
commandsDir: commandsPath,
|
|
27
|
+
hasMalttyDep,
|
|
28
|
+
rootDir: cwd
|
|
29
|
+
});
|
|
30
|
+
return ok({
|
|
31
|
+
commandsDir: null,
|
|
32
|
+
hasMalttyDep,
|
|
33
|
+
rootDir: cwd
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Read and parse a package.json file.
|
|
38
|
+
*
|
|
39
|
+
* @param filePath - Absolute path to the package.json.
|
|
40
|
+
* @returns A Result tuple with the parsed package data or a GenerateError.
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
async function readPackageJson(filePath) {
|
|
44
|
+
const [readError, content] = await fs_exports.read(filePath);
|
|
45
|
+
if (readError) return [{
|
|
46
|
+
message: `Failed to read package.json: ${readError.message}`,
|
|
47
|
+
path: filePath,
|
|
48
|
+
type: "read_error"
|
|
49
|
+
}, null];
|
|
50
|
+
const [parseError, data] = jsonParse(content);
|
|
51
|
+
if (parseError) return [{
|
|
52
|
+
message: `Failed to parse package.json: ${parseError.message}`,
|
|
53
|
+
path: filePath,
|
|
54
|
+
type: "read_error"
|
|
55
|
+
}, null];
|
|
56
|
+
return ok(data);
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { detectProject as t };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=detect-AOq1ehTE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-AOq1ehTE.js","names":["fs"],"sources":["../src/lib/detect.ts"],"sourcesContent":["import { join } from 'node:path'\n\nimport { ok } from '@maltty/utils/fp'\nimport type { ResultAsync } from '@maltty/utils/fp'\nimport { jsonParse } from '@maltty/utils/json'\nimport { fs } from '@maltty/utils/node'\n\nimport type { GenerateError, ProjectInfo } from './types.js'\n\n/**\n * Detect whether the given directory contains a maltty-based CLI project.\n *\n * Looks for a `package.json` with `maltty` listed in `dependencies` or\n * `devDependencies`, and checks for a `src/commands/` directory.\n *\n * @param cwd - The directory to inspect.\n * @returns An async Result containing project info or null when no maltty project is found.\n */\nexport async function detectProject(cwd: string): ResultAsync<ProjectInfo | null, GenerateError> {\n const packageJsonPath = join(cwd, 'package.json')\n const packageExists = await fs.exists(packageJsonPath)\n if (!packageExists) {\n return ok(null)\n }\n\n const [readError, pkg] = await readPackageJson(packageJsonPath)\n if (readError) {\n return [readError, null]\n }\n\n const deps = pkg.dependencies ?? {}\n const devDeps = pkg.devDependencies ?? {}\n const hasMalttyDep = 'maltty' in deps || 'maltty' in devDeps\n\n if (!hasMalttyDep) {\n return ok(null)\n }\n\n const commandsPath = join(cwd, 'src', 'commands')\n const commandsDirExists = await fs.exists(commandsPath)\n\n if (commandsDirExists) {\n return ok({\n commandsDir: commandsPath,\n hasMalttyDep,\n rootDir: cwd,\n })\n }\n\n return ok({\n commandsDir: null,\n hasMalttyDep,\n rootDir: cwd,\n })\n}\n\n/**\n * Minimal package.json shape needed for detection.\n *\n * @private\n */\ninterface PackageJson {\n readonly dependencies?: Record<string, string>\n readonly devDependencies?: Record<string, string>\n}\n\n/**\n * Read and parse a package.json file.\n *\n * @param filePath - Absolute path to the package.json.\n * @returns A Result tuple with the parsed package data or a GenerateError.\n * @private\n */\nasync function readPackageJson(filePath: string): ResultAsync<PackageJson, GenerateError> {\n const [readError, content] = await fs.read(filePath)\n if (readError) {\n return [\n {\n message: `Failed to read package.json: ${readError.message}`,\n path: filePath,\n type: 'read_error' as const,\n },\n null,\n ]\n }\n\n const [parseError, data] = jsonParse(content)\n if (parseError) {\n return [\n {\n message: `Failed to parse package.json: ${parseError.message}`,\n path: filePath,\n type: 'read_error' as const,\n },\n null,\n ]\n }\n\n return ok(data as PackageJson)\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,eAAsB,cAAc,KAA6D;CAC/F,MAAM,kBAAkB,KAAK,KAAK,eAAe;AAEjD,KAAI,CADkB,MAAMA,WAAG,OAAO,gBAAgB,CAEpD,QAAO,GAAG,KAAK;CAGjB,MAAM,CAAC,WAAW,OAAO,MAAM,gBAAgB,gBAAgB;AAC/D,KAAI,UACF,QAAO,CAAC,WAAW,KAAK;CAG1B,MAAM,OAAO,IAAI,gBAAgB,EAAE;CACnC,MAAM,UAAU,IAAI,mBAAmB,EAAE;CACzC,MAAM,eAAe,YAAY,QAAQ,YAAY;AAErD,KAAI,CAAC,aACH,QAAO,GAAG,KAAK;CAGjB,MAAM,eAAe,KAAK,KAAK,OAAO,WAAW;AAGjD,KAF0B,MAAMA,WAAG,OAAO,aAAa,CAGrD,QAAO,GAAG;EACR,aAAa;EACb;EACA,SAAS;EACV,CAAC;AAGJ,QAAO,GAAG;EACR,aAAa;EACb;EACA,SAAS;EACV,CAAC;;;;;;;;;AAoBJ,eAAe,gBAAgB,UAA2D;CACxF,MAAM,CAAC,WAAW,WAAW,MAAMA,WAAG,KAAK,SAAS;AACpD,KAAI,UACF,QAAO,CACL;EACE,SAAS,gCAAgC,UAAU;EACnD,MAAM;EACN,MAAM;EACP,EACD,KACD;CAGH,MAAM,CAAC,YAAY,QAAQ,UAAU,QAAQ;AAC7C,KAAI,WACF,QAAO,CACL;EACE,SAAS,iCAAiC,WAAW;EACrD,MAAM;EACN,MAAM;EACP,EACD,KACD;AAGH,QAAO,GAAG,KAAoB"}
|