@h3ravel/filesystem 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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/index.cjs +98 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 h3ravel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://h3ravel.toneflix.net" target="_blank">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/h3ravel/assets/refs/heads/main/logo-full.svg" width="200" alt="H3ravel Logo">
|
|
4
|
+
</a>
|
|
5
|
+
<h1 align="center"><a href="https://h3ravel.toneflix.net">H3ravel Filesystem</a></h1>
|
|
6
|
+
|
|
7
|
+
[![Framework][ix]][lx]
|
|
8
|
+
[![Filesystem Package Version][i1]][l1]
|
|
9
|
+
[![Downloads][d1]][d1]
|
|
10
|
+
[![Tests][tei]][tel]
|
|
11
|
+
[![License][lini]][linl]
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
# About H3ravel/filesystem
|
|
16
|
+
|
|
17
|
+
This is the filesystem manager for the [H3ravel](https://h3ravel.toneflix.net) framework.
|
|
18
|
+
|
|
19
|
+
## Contributing
|
|
20
|
+
|
|
21
|
+
Thank you for considering contributing to the H3ravel framework! The [Contribution Guide](https://h3ravel.toneflix.net/contributing) can be found in the H3ravel documentation and will provide you with all the information you need to get started.
|
|
22
|
+
|
|
23
|
+
## Code of Conduct
|
|
24
|
+
|
|
25
|
+
In order to ensure that the H3ravel community is welcoming to all, please review and abide by the [Code of Conduct](#).
|
|
26
|
+
|
|
27
|
+
## Security Vulnerabilities
|
|
28
|
+
|
|
29
|
+
If you discover a security vulnerability within H3ravel, please send an e-mail to Legacy via hamzas.legacy@toneflix.ng. All security vulnerabilities will be promptly addressed.
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
The H3ravel framework is open-sourced software licensed under the [MIT license](LICENSE).
|
|
34
|
+
|
|
35
|
+
[ix]: https://img.shields.io/npm/v/%40h3ravel%2Fcore?style=flat-square&label=Framework&color=%230970ce
|
|
36
|
+
[lx]: https://www.npmjs.com/package/@h3ravel/core
|
|
37
|
+
[i1]: https://img.shields.io/npm/v/%40h3ravel%2Fhttp?style=flat-square&label=@h3ravel/filesystem&color=%230970ce
|
|
38
|
+
[l1]: https://www.npmjs.com/package/@h3ravel/filesystem
|
|
39
|
+
[d1]: https://img.shields.io/npm/dt/%40h3ravel%2Fhttp?style=flat-square&label=Downloads&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40h3ravel%2Fhttp
|
|
40
|
+
[linl]: https://github.com/h3ravel/framework/blob/main/LICENSE
|
|
41
|
+
[lini]: https://img.shields.io/github/license/h3ravel/framework
|
|
42
|
+
[tel]: https://github.com/h3ravel/framework/actions/workflows/test.yml
|
|
43
|
+
[tei]: https://github.com/h3ravel/framework/actions/workflows/test.yml/badge.svg
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
let __h3ravel_core = require("@h3ravel/core");
|
|
25
|
+
__h3ravel_core = __toESM(__h3ravel_core);
|
|
26
|
+
let fs_promises = require("fs/promises");
|
|
27
|
+
fs_promises = __toESM(fs_promises);
|
|
28
|
+
let path = require("path");
|
|
29
|
+
path = __toESM(path);
|
|
30
|
+
let fs = require("fs");
|
|
31
|
+
fs = __toESM(fs);
|
|
32
|
+
|
|
33
|
+
//#region src/Providers/FilesystemProvider.ts
|
|
34
|
+
/**
|
|
35
|
+
* Sets up Filesystem management and lifecycle.
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
var FilesystemProvider = class extends __h3ravel_core.ServiceProvider {
|
|
39
|
+
static priority = 997;
|
|
40
|
+
register() {}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs
|
|
45
|
+
function sync_default(start, callback) {
|
|
46
|
+
let dir = (0, path.resolve)(".", start);
|
|
47
|
+
let tmp;
|
|
48
|
+
if (!(0, fs.statSync)(dir).isDirectory()) dir = (0, path.dirname)(dir);
|
|
49
|
+
while (true) {
|
|
50
|
+
tmp = callback(dir, (0, fs.readdirSync)(dir));
|
|
51
|
+
if (tmp) return (0, path.resolve)(dir, tmp);
|
|
52
|
+
dir = (0, path.dirname)(tmp = dir);
|
|
53
|
+
if (tmp === dir) break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/Utils/Helpers.ts
|
|
59
|
+
var Utils = class {
|
|
60
|
+
static findModulePkg(moduleId, cwd) {
|
|
61
|
+
const parts = moduleId.replace(/\\/g, "/").split("/");
|
|
62
|
+
let packageName = "";
|
|
63
|
+
if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
|
|
64
|
+
packageName += parts.shift();
|
|
65
|
+
const packageJson = path.default.join(cwd ?? process.cwd(), "node_modules", packageName);
|
|
66
|
+
const resolved = this.findUpConfig(packageJson, "package", ["json"]);
|
|
67
|
+
if (!resolved) return;
|
|
68
|
+
return path.default.join(path.default.dirname(resolved), parts.join("/"));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Check if file exists
|
|
72
|
+
*
|
|
73
|
+
* @param path
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
static async fileExists(path$2) {
|
|
77
|
+
try {
|
|
78
|
+
await (0, fs_promises.access)(path$2);
|
|
79
|
+
return true;
|
|
80
|
+
} catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
static findUpConfig(cwd, name, extensions) {
|
|
85
|
+
return sync_default(cwd, (_dir, names) => {
|
|
86
|
+
for (const ext of extensions) {
|
|
87
|
+
const filename = `${name}.${ext}`;
|
|
88
|
+
if (names.includes(filename)) return filename;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
exports.FilesystemProvider = FilesystemProvider;
|
|
97
|
+
exports.Utils = Utils;
|
|
98
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["ServiceProvider","path","escalade"],"sources":["../src/Providers/FilesystemProvider.ts","../../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs","../src/Utils/Helpers.ts"],"sourcesContent":["import { ServiceProvider } from '@h3ravel/core'\n\n/**\n * Sets up Filesystem management and lifecycle.\n * \n */\nexport class FilesystemProvider extends ServiceProvider {\n public static priority = 997;\n\n register () {\n }\n}\n","import { dirname, resolve } from 'path';\nimport { readdirSync, statSync } from 'fs';\n\nexport default function (start, callback) {\n\tlet dir = resolve('.', start);\n\tlet tmp, stats = statSync(dir);\n\n\tif (!stats.isDirectory()) {\n\t\tdir = dirname(dir);\n\t}\n\n\twhile (true) {\n\t\ttmp = callback(dir, readdirSync(dir));\n\t\tif (tmp) return resolve(dir, tmp);\n\t\tdir = dirname(tmp = dir);\n\t\tif (tmp === dir) break;\n\t}\n}\n","import { access } from 'fs/promises'\nimport escalade from 'escalade/sync'\nimport path from 'path'\n\nexport class Utils {\n static findModulePkg (moduleId: string, cwd?: string) {\n const parts = moduleId.replace(/\\\\/g, '/').split('/')\n\n let packageName = ''\n // Handle scoped package name\n if (parts.length > 0 && parts[0][0] === '@') {\n packageName += parts.shift() + '/'\n }\n packageName += parts.shift()\n\n const packageJson = path.join(cwd ?? process.cwd(), 'node_modules', packageName)\n\n const resolved = this.findUpConfig(packageJson, 'package', ['json'])\n\n if (!resolved) {\n return\n }\n\n return path.join(path.dirname(resolved), parts.join('/'))\n }\n\n /**\n * Check if file exists\n * \n * @param path \n * @returns \n */\n static async fileExists (path: string): Promise<boolean> {\n try {\n await access(path)\n return true\n } catch {\n return false\n }\n }\n\n static findUpConfig (cwd: string, name: string, extensions: string[]) {\n return escalade(cwd, (_dir, names) => {\n for (const ext of extensions) {\n const filename = `${name}.${ext}`\n if (names.includes(filename)) {\n return filename\n }\n }\n return false\n })\n }\n} \n"],"x_google_ignoreList":[1],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAa,qBAAb,cAAwCA,+BAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;;;;;ACNhB,sBAAyB,OAAO,UAAU;CACzC,IAAI,wBAAc,KAAK,MAAM;CAC7B,IAAI;AAEJ,KAAI,kBAFsB,IAAI,CAEnB,aAAa,CACvB,yBAAc,IAAI;AAGnB,QAAO,MAAM;AACZ,QAAM,SAAS,yBAAiB,IAAI,CAAC;AACrC,MAAI,IAAK,0BAAe,KAAK,IAAI;AACjC,0BAAc,MAAM,IAAI;AACxB,MAAI,QAAQ,IAAK;;;;;;ACXnB,IAAa,QAAb,MAAmB;CACf,OAAO,cAAe,UAAkB,KAAc;EAClD,MAAM,QAAQ,SAAS,QAAQ,OAAO,IAAI,CAAC,MAAM,IAAI;EAErD,IAAI,cAAc;AAElB,MAAI,MAAM,SAAS,KAAK,MAAM,GAAG,OAAO,IACpC,gBAAe,MAAM,OAAO,GAAG;AAEnC,iBAAe,MAAM,OAAO;EAE5B,MAAM,cAAc,aAAK,KAAK,OAAO,QAAQ,KAAK,EAAE,gBAAgB,YAAY;EAEhF,MAAM,WAAW,KAAK,aAAa,aAAa,WAAW,CAAC,OAAO,CAAC;AAEpE,MAAI,CAAC,SACD;AAGJ,SAAO,aAAK,KAAK,aAAK,QAAQ,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;;;;;;;;CAS7D,aAAa,WAAY,QAAgC;AACrD,MAAI;AACA,iCAAaC,OAAK;AAClB,UAAO;UACH;AACJ,UAAO;;;CAIf,OAAO,aAAc,KAAa,MAAc,YAAsB;AAClE,SAAOC,aAAS,MAAM,MAAM,UAAU;AAClC,QAAK,MAAM,OAAO,YAAY;IAC1B,MAAM,WAAW,GAAG,KAAK,GAAG;AAC5B,QAAI,MAAM,SAAS,SAAS,CACxB,QAAO;;AAGf,UAAO;IACT"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ServiceProvider } from "@h3ravel/core";
|
|
2
|
+
|
|
3
|
+
//#region src/Providers/FilesystemProvider.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sets up Filesystem management and lifecycle.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
declare class FilesystemProvider extends ServiceProvider {
|
|
10
|
+
static priority: number;
|
|
11
|
+
register(): void;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/Utils/Helpers.d.ts
|
|
15
|
+
declare class Utils {
|
|
16
|
+
static findModulePkg(moduleId: string, cwd?: string): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Check if file exists
|
|
19
|
+
*
|
|
20
|
+
* @param path
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
static fileExists(path: string): Promise<boolean>;
|
|
24
|
+
static findUpConfig(cwd: string, name: string, extensions: string[]): string | void;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { FilesystemProvider, Utils };
|
|
28
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ServiceProvider } from "@h3ravel/core";
|
|
2
|
+
|
|
3
|
+
//#region src/Providers/FilesystemProvider.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sets up Filesystem management and lifecycle.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
declare class FilesystemProvider extends ServiceProvider {
|
|
10
|
+
static priority: number;
|
|
11
|
+
register(): void;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/Utils/Helpers.d.ts
|
|
15
|
+
declare class Utils {
|
|
16
|
+
static findModulePkg(moduleId: string, cwd?: string): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Check if file exists
|
|
19
|
+
*
|
|
20
|
+
* @param path
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
static fileExists(path: string): Promise<boolean>;
|
|
24
|
+
static findUpConfig(cwd: string, name: string, extensions: string[]): string | void;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { FilesystemProvider, Utils };
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ServiceProvider } from "@h3ravel/core";
|
|
2
|
+
import { access } from "fs/promises";
|
|
3
|
+
import path, { dirname, resolve } from "path";
|
|
4
|
+
import { readdirSync, statSync } from "fs";
|
|
5
|
+
|
|
6
|
+
//#region src/Providers/FilesystemProvider.ts
|
|
7
|
+
/**
|
|
8
|
+
* Sets up Filesystem management and lifecycle.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
var FilesystemProvider = class extends ServiceProvider {
|
|
12
|
+
static priority = 997;
|
|
13
|
+
register() {}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs
|
|
18
|
+
function sync_default(start, callback) {
|
|
19
|
+
let dir = resolve(".", start);
|
|
20
|
+
let tmp;
|
|
21
|
+
if (!statSync(dir).isDirectory()) dir = dirname(dir);
|
|
22
|
+
while (true) {
|
|
23
|
+
tmp = callback(dir, readdirSync(dir));
|
|
24
|
+
if (tmp) return resolve(dir, tmp);
|
|
25
|
+
dir = dirname(tmp = dir);
|
|
26
|
+
if (tmp === dir) break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/Utils/Helpers.ts
|
|
32
|
+
var Utils = class {
|
|
33
|
+
static findModulePkg(moduleId, cwd) {
|
|
34
|
+
const parts = moduleId.replace(/\\/g, "/").split("/");
|
|
35
|
+
let packageName = "";
|
|
36
|
+
if (parts.length > 0 && parts[0][0] === "@") packageName += parts.shift() + "/";
|
|
37
|
+
packageName += parts.shift();
|
|
38
|
+
const packageJson = path.join(cwd ?? process.cwd(), "node_modules", packageName);
|
|
39
|
+
const resolved = this.findUpConfig(packageJson, "package", ["json"]);
|
|
40
|
+
if (!resolved) return;
|
|
41
|
+
return path.join(path.dirname(resolved), parts.join("/"));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if file exists
|
|
45
|
+
*
|
|
46
|
+
* @param path
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
static async fileExists(path$1) {
|
|
50
|
+
try {
|
|
51
|
+
await access(path$1);
|
|
52
|
+
return true;
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
static findUpConfig(cwd, name, extensions) {
|
|
58
|
+
return sync_default(cwd, (_dir, names) => {
|
|
59
|
+
for (const ext of extensions) {
|
|
60
|
+
const filename = `${name}.${ext}`;
|
|
61
|
+
if (names.includes(filename)) return filename;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { FilesystemProvider, Utils };
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["path","escalade"],"sources":["../src/Providers/FilesystemProvider.ts","../../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs","../src/Utils/Helpers.ts"],"sourcesContent":["import { ServiceProvider } from '@h3ravel/core'\n\n/**\n * Sets up Filesystem management and lifecycle.\n * \n */\nexport class FilesystemProvider extends ServiceProvider {\n public static priority = 997;\n\n register () {\n }\n}\n","import { dirname, resolve } from 'path';\nimport { readdirSync, statSync } from 'fs';\n\nexport default function (start, callback) {\n\tlet dir = resolve('.', start);\n\tlet tmp, stats = statSync(dir);\n\n\tif (!stats.isDirectory()) {\n\t\tdir = dirname(dir);\n\t}\n\n\twhile (true) {\n\t\ttmp = callback(dir, readdirSync(dir));\n\t\tif (tmp) return resolve(dir, tmp);\n\t\tdir = dirname(tmp = dir);\n\t\tif (tmp === dir) break;\n\t}\n}\n","import { access } from 'fs/promises'\nimport escalade from 'escalade/sync'\nimport path from 'path'\n\nexport class Utils {\n static findModulePkg (moduleId: string, cwd?: string) {\n const parts = moduleId.replace(/\\\\/g, '/').split('/')\n\n let packageName = ''\n // Handle scoped package name\n if (parts.length > 0 && parts[0][0] === '@') {\n packageName += parts.shift() + '/'\n }\n packageName += parts.shift()\n\n const packageJson = path.join(cwd ?? process.cwd(), 'node_modules', packageName)\n\n const resolved = this.findUpConfig(packageJson, 'package', ['json'])\n\n if (!resolved) {\n return\n }\n\n return path.join(path.dirname(resolved), parts.join('/'))\n }\n\n /**\n * Check if file exists\n * \n * @param path \n * @returns \n */\n static async fileExists (path: string): Promise<boolean> {\n try {\n await access(path)\n return true\n } catch {\n return false\n }\n }\n\n static findUpConfig (cwd: string, name: string, extensions: string[]) {\n return escalade(cwd, (_dir, names) => {\n for (const ext of extensions) {\n const filename = `${name}.${ext}`\n if (names.includes(filename)) {\n return filename\n }\n }\n return false\n })\n }\n} \n"],"x_google_ignoreList":[1],"mappings":";;;;;;;;;;AAMA,IAAa,qBAAb,cAAwC,gBAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;;;;;ACNhB,sBAAyB,OAAO,UAAU;CACzC,IAAI,MAAM,QAAQ,KAAK,MAAM;CAC7B,IAAI;AAEJ,KAAI,CAFa,SAAS,IAAI,CAEnB,aAAa,CACvB,OAAM,QAAQ,IAAI;AAGnB,QAAO,MAAM;AACZ,QAAM,SAAS,KAAK,YAAY,IAAI,CAAC;AACrC,MAAI,IAAK,QAAO,QAAQ,KAAK,IAAI;AACjC,QAAM,QAAQ,MAAM,IAAI;AACxB,MAAI,QAAQ,IAAK;;;;;;ACXnB,IAAa,QAAb,MAAmB;CACf,OAAO,cAAe,UAAkB,KAAc;EAClD,MAAM,QAAQ,SAAS,QAAQ,OAAO,IAAI,CAAC,MAAM,IAAI;EAErD,IAAI,cAAc;AAElB,MAAI,MAAM,SAAS,KAAK,MAAM,GAAG,OAAO,IACpC,gBAAe,MAAM,OAAO,GAAG;AAEnC,iBAAe,MAAM,OAAO;EAE5B,MAAM,cAAc,KAAK,KAAK,OAAO,QAAQ,KAAK,EAAE,gBAAgB,YAAY;EAEhF,MAAM,WAAW,KAAK,aAAa,aAAa,WAAW,CAAC,OAAO,CAAC;AAEpE,MAAI,CAAC,SACD;AAGJ,SAAO,KAAK,KAAK,KAAK,QAAQ,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;;;;;;;;CAS7D,aAAa,WAAY,QAAgC;AACrD,MAAI;AACA,SAAM,OAAOA,OAAK;AAClB,UAAO;UACH;AACJ,UAAO;;;CAIf,OAAO,aAAc,KAAa,MAAc,YAAsB;AAClE,SAAOC,aAAS,MAAM,MAAM,UAAU;AAClC,QAAK,MAAM,OAAO,YAAY;IAC1B,MAAM,WAAW,GAAG,KAAK,GAAG;AAC5B,QAAI,MAAM,SAAS,SAAS,CACxB,QAAO;;AAGf,UAAO;IACT"}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@h3ravel/filesystem",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Filesystem manager for H3ravel.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.cjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"typesVersions": {
|
|
14
|
+
"*": {
|
|
15
|
+
"globals": [
|
|
16
|
+
"./dist/app.globals.d.ts"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://h3ravel.toneflix.net",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/h3ravel/framework.git",
|
|
30
|
+
"directory": "packages/filesystem"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"h3ravel",
|
|
34
|
+
"modern",
|
|
35
|
+
"web",
|
|
36
|
+
"H3",
|
|
37
|
+
"framework",
|
|
38
|
+
"nodejs",
|
|
39
|
+
"typescript",
|
|
40
|
+
"laravel",
|
|
41
|
+
"filesystem"
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"escalade": "^3.2.0",
|
|
45
|
+
"@h3ravel/support": "^0.10.0",
|
|
46
|
+
"@h3ravel/shared": "^0.18.1"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@h3ravel/core": "^1.8.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"typescript": "^5.4.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"barrel": "barrelsby --directory src --delete --singleQuotes",
|
|
56
|
+
"build": "tsdown --config-loader unconfig",
|
|
57
|
+
"dev": "tsx watch src/index.ts",
|
|
58
|
+
"start": "node dist/index.js",
|
|
59
|
+
"lint": "eslint . --ext .ts",
|
|
60
|
+
"test": "jest --passWithNoTests"
|
|
61
|
+
}
|
|
62
|
+
}
|