@sapphire/plugin-hmr
Advanced tools
Comparing version 1.0.0 to 1.0.1-next.94efab7.0
@@ -12,3 +12,3 @@ "use strict"; | ||
function start() { | ||
framework_1.container.logger.info('HMR-Plugin: Enabled.'); | ||
framework_1.container.logger.info('[HMR-Plugin]: Enabled. Watching for piece changes.'); | ||
for (const store of framework_1.container.stores.values()) { | ||
@@ -31,6 +31,6 @@ const deleteCb = handlePiecePathDelete.bind(null, store); | ||
await pieceToDelete.unload(); | ||
framework_1.container.logger.info(`HMR-Plugin: Unloaded ${pieceToDelete.name}.`); | ||
framework_1.container.logger.info(`[HMR-Plugin]: Unloaded piece ${pieceToDelete.name} from ${pieceToDelete.store.name} store.`); | ||
}); | ||
if ((0, framework_1.isErr)(result)) { | ||
framework_1.container.logger.error(`HMR-Plugin: Failed to unload ${pieceToDelete.name}.`, console_1.error); | ||
framework_1.container.logger.error(`[HMR-Plugin]: Failed to unload piece ${pieceToDelete.name} from ${pieceToDelete.store.name} store.`, console_1.error); | ||
} | ||
@@ -45,3 +45,3 @@ } | ||
await pieceToUpdate.reload(); | ||
framework_1.container.logger.info(`HMR-Plugin: reloaded ${pieceToUpdate.name}.`); | ||
framework_1.container.logger.info(`[HMR-Plugin]: reloaded piece ${pieceToUpdate.name} from ${pieceToUpdate.store.name} store.`); | ||
} | ||
@@ -51,12 +51,13 @@ else { | ||
if (!rootPath) | ||
throw new Error(`HMR-Plugin: Could not find root path for ${path}.`); | ||
const commandsLoaded = await store.load(rootPath, (0, path_1.relative)(rootPath, path)); | ||
const commandsLoadedNames = commandsLoaded.map((piece) => piece.name); | ||
framework_1.container.logger.info(`HMR-Plugin: Loaded ${commandsLoadedNames.join(', ')}.`); | ||
throw new Error(`[HMR-Plugin]: Could not find root path for ${path}.`); | ||
const piecesLoaded = await store.load(rootPath, (0, path_1.relative)(rootPath, path)); | ||
const piecesLoadedNames = piecesLoaded.map((piece) => piece.name); | ||
const piecesLoadedStoreNames = piecesLoaded.map((piece) => piece.store.name); | ||
framework_1.container.logger.info(`[HMR-Plugin]: Loaded ${piecesLoadedNames.join(', ')} piece(s) from ${[...new Set(piecesLoadedStoreNames)].join(', ')} store(s).`); | ||
} | ||
}); | ||
if ((0, framework_1.isErr)(result)) { | ||
framework_1.container.logger.error(`HMR-Plugin: Failed to load pieces from ${path}.`, result.error); | ||
framework_1.container.logger.error(`[HMR-Plugin]: Failed to load pieces from ${path}.`, result.error); | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sapphire/plugin-hmr", | ||
"version": "1.0.0", | ||
"version": "1.0.1-next.94efab7.0", | ||
"description": "Plugin for @sapphire/framework for hot module reloading for pieces", | ||
@@ -68,3 +68,3 @@ "author": "@sapphire", | ||
}, | ||
"gitHead": "0c2958c49585dc0ba476831f1ea3005c5c03204c" | ||
"gitHead": "94efab789b7b72672f8cd89b00c729ef4f6c795c" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
22127
101
0
1