@h3ravel/filesystem 0.4.2 → 0.4.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/index.cjs +5 -4
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/package.json +10 -4
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -25,11 +25,13 @@ let __h3ravel_shared = require("@h3ravel/shared");
|
|
|
25
25
|
__h3ravel_shared = __toESM(__h3ravel_shared);
|
|
26
26
|
let fs_promises = require("fs/promises");
|
|
27
27
|
fs_promises = __toESM(fs_promises);
|
|
28
|
+
let __h3ravel_musket = require("@h3ravel/musket");
|
|
29
|
+
__h3ravel_musket = __toESM(__h3ravel_musket);
|
|
28
30
|
let __h3ravel_core = require("@h3ravel/core");
|
|
29
31
|
__h3ravel_core = __toESM(__h3ravel_core);
|
|
30
32
|
|
|
31
33
|
//#region src/Commands/StorageLinkCommand.ts
|
|
32
|
-
var StorageLinkCommand = class extends
|
|
34
|
+
var StorageLinkCommand = class extends __h3ravel_musket.Command {
|
|
33
35
|
/**
|
|
34
36
|
* The name and signature of the console command.
|
|
35
37
|
*
|
|
@@ -121,11 +123,10 @@ var StorageLinkCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
121
123
|
var FilesystemProvider = class extends __h3ravel_core.ServiceProvider {
|
|
122
124
|
static priority = 997;
|
|
123
125
|
register() {
|
|
124
|
-
this.
|
|
126
|
+
this.registerCommands([StorageLinkCommand]);
|
|
125
127
|
}
|
|
126
128
|
};
|
|
127
129
|
|
|
128
130
|
//#endregion
|
|
129
131
|
exports.FilesystemProvider = FilesystemProvider;
|
|
130
|
-
exports.StorageLinkCommand = StorageLinkCommand;
|
|
131
|
-
//# sourceMappingURL=index.cjs.map
|
|
132
|
+
exports.StorageLinkCommand = StorageLinkCommand;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference path="./app.globals.d.ts" />
|
|
2
|
-
import {
|
|
2
|
+
import { Command } from "@h3ravel/musket";
|
|
3
|
+
import { ServiceProvider } from "@h3ravel/core";
|
|
3
4
|
|
|
4
5
|
//#region src/Commands/StorageLinkCommand.d.ts
|
|
5
|
-
declare class StorageLinkCommand extends
|
|
6
|
+
declare class StorageLinkCommand extends Command {
|
|
6
7
|
/**
|
|
7
8
|
* The name and signature of the console command.
|
|
8
9
|
*
|
|
@@ -39,5 +40,4 @@ declare class FilesystemProvider extends ServiceProvider {
|
|
|
39
40
|
register(): void;
|
|
40
41
|
}
|
|
41
42
|
//#endregion
|
|
42
|
-
export { FilesystemProvider, StorageLinkCommand };
|
|
43
|
-
//# sourceMappingURL=index.d.cts.map
|
|
43
|
+
export { FilesystemProvider, StorageLinkCommand };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference path="./app.globals.d.ts" />
|
|
2
|
-
import {
|
|
2
|
+
import { Command } from "@h3ravel/musket";
|
|
3
|
+
import { ServiceProvider } from "@h3ravel/core";
|
|
3
4
|
|
|
4
5
|
//#region src/Commands/StorageLinkCommand.d.ts
|
|
5
|
-
declare class StorageLinkCommand extends
|
|
6
|
+
declare class StorageLinkCommand extends Command {
|
|
6
7
|
/**
|
|
7
8
|
* The name and signature of the console command.
|
|
8
9
|
*
|
|
@@ -39,5 +40,4 @@ declare class FilesystemProvider extends ServiceProvider {
|
|
|
39
40
|
register(): void;
|
|
40
41
|
}
|
|
41
42
|
//#endregion
|
|
42
|
-
export { FilesystemProvider, StorageLinkCommand };
|
|
43
|
-
//# sourceMappingURL=index.d.ts.map
|
|
43
|
+
export { FilesystemProvider, StorageLinkCommand };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FileSystem, Logger } from "@h3ravel/shared";
|
|
2
2
|
import { rm, symlink, unlink } from "fs/promises";
|
|
3
|
-
import {
|
|
3
|
+
import { Command } from "@h3ravel/musket";
|
|
4
|
+
import { ServiceProvider } from "@h3ravel/core";
|
|
4
5
|
|
|
5
6
|
//#region src/Commands/StorageLinkCommand.ts
|
|
6
|
-
var StorageLinkCommand = class extends
|
|
7
|
+
var StorageLinkCommand = class extends Command {
|
|
7
8
|
/**
|
|
8
9
|
* The name and signature of the console command.
|
|
9
10
|
*
|
|
@@ -95,10 +96,9 @@ var StorageLinkCommand = class extends ConsoleCommand {
|
|
|
95
96
|
var FilesystemProvider = class extends ServiceProvider {
|
|
96
97
|
static priority = 997;
|
|
97
98
|
register() {
|
|
98
|
-
this.
|
|
99
|
+
this.registerCommands([StorageLinkCommand]);
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
|
|
102
103
|
//#endregion
|
|
103
|
-
export { FilesystemProvider, StorageLinkCommand };
|
|
104
|
-
//# sourceMappingURL=index.js.map
|
|
104
|
+
export { FilesystemProvider, StorageLinkCommand };
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/filesystem",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Filesystem manager for H3ravel.",
|
|
5
|
+
"h3ravel": {
|
|
6
|
+
"providers": [
|
|
7
|
+
"FilesystemProvider"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"main": "./dist/index.js",
|
|
7
12
|
"types": "./dist/index.d.ts",
|
|
@@ -37,11 +42,12 @@
|
|
|
37
42
|
"filesystem"
|
|
38
43
|
],
|
|
39
44
|
"dependencies": {
|
|
40
|
-
"@h3ravel/
|
|
41
|
-
"@h3ravel/
|
|
45
|
+
"@h3ravel/musket": "^0.1.8",
|
|
46
|
+
"@h3ravel/shared": "^0.22.3",
|
|
47
|
+
"@h3ravel/support": "^0.14.2"
|
|
42
48
|
},
|
|
43
49
|
"peerDependencies": {
|
|
44
|
-
"@h3ravel/core": "^1.
|
|
50
|
+
"@h3ravel/core": "^1.17.0"
|
|
45
51
|
},
|
|
46
52
|
"devDependencies": {
|
|
47
53
|
"typescript": "^5.4.0"
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["ConsoleCommand","FileSystem","ServiceProvider"],"sources":["../src/Commands/StorageLinkCommand.ts","../src/Providers/FilesystemProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { rm, symlink, unlink } from 'fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\n\nexport class StorageLinkCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#storage:\n {link : Create the symbolic links configured for the application. \n | {--r|relative : Create the symbolic link using relative paths}\n | {--force : Recreate existing symbolic links}\n }\n {unlink : Delete existing symbolic links configured for the application.}\n `\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Create the symbolic links configured for the application.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n console.log('')\n const command = (this.dictionary.baseCommand ?? this.dictionary.name)\n\n await this[command]()\n }\n\n /**\n * Create the symbolic links configured for the application.\n */\n public async link () {\n const links = config('filesystem.links')\n\n for (const key in links) {\n const force = this.option('force')\n const newPath = key\n const existingPath = links[key]\n\n if (!force && await FileSystem.fileExists(newPath)) {\n Logger.log([\n [' ERROR ', 'bgRed'],\n ['The', 'white'],\n [`[${newPath.replace(process.cwd(), '')}]`, 'bold'],\n ['link already exists.\\n', 'white']\n ], ' ')\n continue\n } else if (force) {\n await rm(newPath, { recursive: true, force: true })\n }\n\n /**\n * Create the symlink\n */\n await symlink(existingPath, newPath)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${newPath.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been connected to ', 'white'],\n [`[${existingPath.replace(process.cwd(), '')}]`, 'bold'],\n ['.\\n', 'white']\n ], '')\n }\n }\n\n /**\n * Delete existing symbolic links configured for the application.\n */\n public async unlink () {\n const links = config('filesystem.links')\n\n for (const path in links) {\n if (await FileSystem.fileExists(path)) {\n /**\n * Remove the symlink\n */\n await unlink(path)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${path.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been deleted', 'white'],\n ['.\\n', 'white']\n ], '')\n\n }\n }\n }\n}\n","import { ServiceProvider } from '@h3ravel/core'\nimport { StorageLinkCommand } from '../Commands/StorageLinkCommand'\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 this.commands([StorageLinkCommand])\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAa,qBAAb,cAAwCA,8BAAe;;;;;;CAOnD,AAAU,YAAoB;;;;;;;;;;;;CAa9B,AAAU,cAAsB;;;;CAKhC,MAAa,SAAmB;AAC5B,UAAQ,IAAI,GAAG;EACf,MAAM,UAAW,KAAK,WAAW,eAAe,KAAK,WAAW;AAEhE,QAAM,KAAK,UAAU;;;;;CAMzB,MAAa,OAAQ;EACjB,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,OAAO,OAAO;GACrB,MAAM,QAAQ,KAAK,OAAO,QAAQ;GAClC,MAAM,UAAU;GAChB,MAAM,eAAe,MAAM;AAE3B,OAAI,CAAC,SAAS,MAAMC,4BAAW,WAAW,QAAQ,EAAE;AAChD,4BAAO,IAAI;KACP,CAAC,WAAW,QAAQ;KACpB,CAAC,OAAO,QAAQ;KAChB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;KACnD,CAAC,0BAA0B,QAAQ;KACtC,EAAE,IAAI;AACP;cACO,MACP,2BAAS,SAAS;IAAE,WAAW;IAAM,OAAO;IAAM,CAAC;;;;AAMvD,kCAAc,cAAc,QAAQ;AAEpC,2BAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACpD,CAAC,+BAA+B,QAAQ;IACxC,CAAC,IAAI,aAAa,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;IACxD,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;CAOd,MAAa,SAAU;EACnB,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,QAAQ,MACf,KAAI,MAAMA,4BAAW,WAAW,KAAK,EAAE;;;;AAInC,iCAAa,KAAK;AAElB,2BAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,KAAK,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACjD,CAAC,yBAAyB,QAAQ;IAClC,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;;;;;;ACxFtB,IAAa,qBAAb,cAAwCC,+BAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;AACR,OAAK,SAAS,CAAC,mBAAmB,CAAC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/Commands/StorageLinkCommand.ts","../src/Providers/FilesystemProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { rm, symlink, unlink } from 'fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\n\nexport class StorageLinkCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#storage:\n {link : Create the symbolic links configured for the application. \n | {--r|relative : Create the symbolic link using relative paths}\n | {--force : Recreate existing symbolic links}\n }\n {unlink : Delete existing symbolic links configured for the application.}\n `\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Create the symbolic links configured for the application.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n console.log('')\n const command = (this.dictionary.baseCommand ?? this.dictionary.name)\n\n await this[command]()\n }\n\n /**\n * Create the symbolic links configured for the application.\n */\n public async link () {\n const links = config('filesystem.links')\n\n for (const key in links) {\n const force = this.option('force')\n const newPath = key\n const existingPath = links[key]\n\n if (!force && await FileSystem.fileExists(newPath)) {\n Logger.log([\n [' ERROR ', 'bgRed'],\n ['The', 'white'],\n [`[${newPath.replace(process.cwd(), '')}]`, 'bold'],\n ['link already exists.\\n', 'white']\n ], ' ')\n continue\n } else if (force) {\n await rm(newPath, { recursive: true, force: true })\n }\n\n /**\n * Create the symlink\n */\n await symlink(existingPath, newPath)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${newPath.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been connected to ', 'white'],\n [`[${existingPath.replace(process.cwd(), '')}]`, 'bold'],\n ['.\\n', 'white']\n ], '')\n }\n }\n\n /**\n * Delete existing symbolic links configured for the application.\n */\n public async unlink () {\n const links = config('filesystem.links')\n\n for (const path in links) {\n if (await FileSystem.fileExists(path)) {\n /**\n * Remove the symlink\n */\n await unlink(path)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${path.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been deleted', 'white'],\n ['.\\n', 'white']\n ], '')\n\n }\n }\n }\n}\n","import { ServiceProvider } from '@h3ravel/core'\nimport { StorageLinkCommand } from '../Commands/StorageLinkCommand'\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 this.commands([StorageLinkCommand])\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,qBAAb,cAAwC,eAAe;;;;;;CAOnD,AAAU,YAAoB;;;;;;;;;;;;CAa9B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