@h3ravel/filesystem 0.4.3 → 0.4.5

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 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 __h3ravel_core.ConsoleCommand {
34
+ var StorageLinkCommand = class extends __h3ravel_musket.Command {
33
35
  /**
34
36
  * The name and signature of the console command.
35
37
  *
@@ -127,5 +129,4 @@ var FilesystemProvider = class extends __h3ravel_core.ServiceProvider {
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 { ConsoleCommand, ServiceProvider } from "@h3ravel/core";
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 ConsoleCommand {
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 { ConsoleCommand, ServiceProvider } from "@h3ravel/core";
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 ConsoleCommand {
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 { ConsoleCommand, ServiceProvider } from "@h3ravel/core";
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 ConsoleCommand {
7
+ var StorageLinkCommand = class extends Command {
7
8
  /**
8
9
  * The name and signature of the console command.
9
10
  *
@@ -100,5 +101,4 @@ var FilesystemProvider = class extends ServiceProvider {
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/filesystem",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Filesystem manager for H3ravel.",
5
5
  "h3ravel": {
6
6
  "providers": [
@@ -42,11 +42,12 @@
42
42
  "filesystem"
43
43
  ],
44
44
  "dependencies": {
45
- "@h3ravel/shared": "^0.22.2",
46
- "@h3ravel/support": "^0.14.1"
45
+ "@h3ravel/musket": "^0.1.10",
46
+ "@h3ravel/shared": "^0.22.3",
47
+ "@h3ravel/support": "^0.14.2"
47
48
  },
48
49
  "peerDependencies": {
49
- "@h3ravel/core": "^1.16.0"
50
+ "@h3ravel/core": "^1.17.0"
50
51
  },
51
52
  "devDependencies": {
52
53
  "typescript": "^5.4.0"
@@ -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.registerCommands([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,iBAAiB,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.registerCommands([StorageLinkCommand])\n }\n}\n"],"mappings":";;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