@h3ravel/filesystem 0.4.1 → 0.4.3
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
package/dist/index.cjs
CHANGED
|
@@ -121,7 +121,7 @@ var StorageLinkCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
121
121
|
var FilesystemProvider = class extends __h3ravel_core.ServiceProvider {
|
|
122
122
|
static priority = 997;
|
|
123
123
|
register() {
|
|
124
|
-
this.
|
|
124
|
+
this.registerCommands([StorageLinkCommand]);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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.
|
|
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,AAA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AAE,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
CHANGED
|
@@ -95,7 +95,7 @@ var StorageLinkCommand = class extends ConsoleCommand {
|
|
|
95
95
|
var FilesystemProvider = class extends ServiceProvider {
|
|
96
96
|
static priority = 997;
|
|
97
97
|
register() {
|
|
98
|
-
this.
|
|
98
|
+
this.registerCommands([StorageLinkCommand]);
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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.
|
|
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":";;;;;AAKA,IAAa,qBAAb,cAAwC,eAAe;;;;;;CAOnD,AAAU,YAAoB;;;;;;;;;;;;CAa9B,AAAU,cAAsB;;;;CAKhC,MAAa,SAAmB;AAC5B,UAAQ,IAAI,GAAG;EACf,MAAM,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G;;;;;;;;;;;ACxFtB,IAAa,qBAAb,cAAwC,gBAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;AACR,OAAK,iBAAiB,CAAC,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/filesystem",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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,11 @@
|
|
|
37
42
|
"filesystem"
|
|
38
43
|
],
|
|
39
44
|
"dependencies": {
|
|
40
|
-
"@h3ravel/shared": "^0.
|
|
41
|
-
"@h3ravel/support": "^0.
|
|
45
|
+
"@h3ravel/shared": "^0.22.2",
|
|
46
|
+
"@h3ravel/support": "^0.14.1"
|
|
42
47
|
},
|
|
43
48
|
"peerDependencies": {
|
|
44
|
-
"@h3ravel/core": "^1.
|
|
49
|
+
"@h3ravel/core": "^1.16.0"
|
|
45
50
|
},
|
|
46
51
|
"devDependencies": {
|
|
47
52
|
"typescript": "^5.4.0"
|