@sapphire/plugin-hmr 1.3.0-pr-271.8a04ac90.0 → 2.0.0-next.2c0ebcb.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/CHANGELOG.md +10 -0
- package/README.md +8 -0
- package/dist/lib/hmr.js +4 -8
- package/dist/lib/hmr.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
# [@sapphire/plugin-hmr@1.2.2](https://github.com/sapphiredev/plugins/compare/@sapphire/plugin-hmr@1.2.0...@sapphire/plugin-hmr@1.2.2) - (2022-07-11)
|
|
6
|
+
|
|
7
|
+
## 🐛 Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Manually set version ([117d5a6](https://github.com/sapphiredev/plugins/commit/117d5a6256af7e01b420b28f95abec36f3feb0af))
|
|
10
|
+
|
|
11
|
+
## 📝 Documentation
|
|
12
|
+
|
|
13
|
+
- Update typedoc setup ([5c855bd](https://github.com/sapphiredev/plugins/commit/5c855bd8341f155a41c9b85738541f1f47ac837a))
|
|
14
|
+
|
|
5
15
|
# [1.2.0](https://github.com/sapphiredev/plugins/compare/@sapphire/plugin-hmr@1.1.1...@sapphire/plugin-hmr@1.2.0) (2022-03-06)
|
|
6
16
|
|
|
7
17
|
### Features
|
package/README.md
CHANGED
|
@@ -166,6 +166,14 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
166
166
|
<tr>
|
|
167
167
|
<td align="center"><a href="https://github.com/Suyashtnt"><img src="https://avatars.githubusercontent.com/u/45307955?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Just a Badly Drawn TABS Dude</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=Suyashtnt" title="Code">💻</a></td>
|
|
168
168
|
<td align="center"><a href="https://newtt.me/"><img src="https://avatars.githubusercontent.com/u/19301186?v=4?s=100" width="100px;" alt=""/><br /><sub><b>newt :D</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=newtykins" title="Code">💻</a></td>
|
|
169
|
+
<td align="center"><a href="https://linktr.ee/mzato0001"><img src="https://avatars.githubusercontent.com/u/62367547?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mzato</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=Mzato0001" title="Code">💻</a></td>
|
|
170
|
+
<td align="center"><a href="https://github.com/MajesticString"><img src="https://avatars.githubusercontent.com/u/66224939?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Harry Allen</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=MajesticString" title="Code">💻</a></td>
|
|
171
|
+
<td align="center"><a href="https://github.com/jczstudios"><img src="https://avatars.githubusercontent.com/u/17862924?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Julian</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=jczstudios" title="Code">💻</a></td>
|
|
172
|
+
<td align="center"><a href="https://github.com/KrishAgarwal2811"><img src="https://avatars.githubusercontent.com/u/68506145?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Krish</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=KrishAgarwal2811" title="Code">💻</a></td>
|
|
173
|
+
<td align="center"><a href="https://github.com/imranbarbhuiya"><img src="https://avatars.githubusercontent.com/u/74945038?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Parbez</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=imranbarbhuiya" title="Code">💻</a></td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr>
|
|
176
|
+
<td align="center"><a href="https://github.com/ricardooow"><img src="https://avatars.githubusercontent.com/u/28981399?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ricardooow</b></sub></a><br /><a href="https://github.com/sapphiredev/plugins/commits?author=ricardooow" title="Code">💻</a></td>
|
|
169
177
|
</tr>
|
|
170
178
|
</table>
|
|
171
179
|
|
package/dist/lib/hmr.js
CHANGED
|
@@ -33,20 +33,18 @@ async function handlePiecePathDelete(store, path, silent) {
|
|
|
33
33
|
const pieceToDelete = store.find((piece) => piece.location.full === path);
|
|
34
34
|
if (!pieceToDelete)
|
|
35
35
|
return;
|
|
36
|
-
const result = await
|
|
36
|
+
const result = await framework_1.Result.fromAsync(async () => {
|
|
37
37
|
await pieceToDelete.unload();
|
|
38
38
|
if (!silent)
|
|
39
39
|
framework_1.container.logger.info(`[HMR-Plugin]: Unloaded ${pieceToDelete.name} piece from ${pieceToDelete.store.name} store.`);
|
|
40
40
|
});
|
|
41
|
-
|
|
42
|
-
framework_1.container.logger.error(`[HMR-Plugin]: Failed to unload ${pieceToDelete.name} piece from ${pieceToDelete.store.name} store.`, result.error);
|
|
43
|
-
}
|
|
41
|
+
result.inspectErr((error) => framework_1.container.logger.error(`[HMR-Plugin]: Failed to unload ${pieceToDelete.name} piece from ${pieceToDelete.store.name} store.`, error));
|
|
44
42
|
}
|
|
45
43
|
async function handlePiecePathUpdate(store, path, silent) {
|
|
46
44
|
if (!store.strategy.filter(path))
|
|
47
45
|
return;
|
|
48
46
|
const pieceToUpdate = store.find((piece) => piece.location.full === path);
|
|
49
|
-
const result = await
|
|
47
|
+
const result = await framework_1.Result.fromAsync(async () => {
|
|
50
48
|
if (pieceToUpdate) {
|
|
51
49
|
await pieceToUpdate.reload();
|
|
52
50
|
if (!silent)
|
|
@@ -63,8 +61,6 @@ async function handlePiecePathUpdate(store, path, silent) {
|
|
|
63
61
|
framework_1.container.logger.info(`[HMR-Plugin]: Loaded ${piecesLoadedNames.join(', ')} piece(s) from ${[...new Set(piecesLoadedStoreNames)].join(', ')} store(s).`);
|
|
64
62
|
}
|
|
65
63
|
});
|
|
66
|
-
|
|
67
|
-
framework_1.container.logger.error(`[HMR-Plugin]: Failed to load pieces from ${path}.`, result.error);
|
|
68
|
-
}
|
|
64
|
+
result.inspectErr((error) => framework_1.container.logger.error(`[HMR-Plugin]: Failed to load pieces from ${path}.`, error));
|
|
69
65
|
}
|
|
70
66
|
//# sourceMappingURL=hmr.js.map
|
package/dist/lib/hmr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmr.js","sourceRoot":"","sources":["../../src/lib/hmr.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"hmr.js","sourceRoot":"","sources":["../../src/lib/hmr.ts"],"names":[],"mappings":";;;AAAA,mDAAsE;AACtE,uCAA+C;AAC/C,yCAAqC;AAOrC;;;;;;;;;GASG;AACH,SAAgB,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,KAAiB,EAAE,OAAO,EAAE,IAAI,EAAE;IACnG,6CAA6C;IAC7C,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,IAAI,CAAC,MAAM;QAAE,qBAAS,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;IAEzF,KAAK,MAAM,KAAK,IAAI,qBAAS,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;QAC9C,IAAA,gBAAK,EAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;aAC9B,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;aAClE,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;KACrE;AACF,CAAC;AAXD,sBAWC;AAED,KAAK,UAAU,qBAAqB,CAAC,KAAmB,EAAE,IAAY,EAAE,MAAe;IACtF,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO;IAEzC,M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jI;aAAM;YACN,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;YAClF,IAAI,CAAC,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,IAAI,GAAG,CAAC,CAAC;YAEtF,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAA,oBAAQ,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YAC1E,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAClE,MAAM,sBAAsB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7E,IAAI,CAAC,MAAM;gBACV,qBAAS,CAAC,MAAM,CAAC,IAAI,CACpB,wBAAwB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,IAAI,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CACjI,CAAC;SACH;IACF,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAS,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAClH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire/plugin-hmr",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.2c0ebcb.0",
|
|
4
4
|
"description": "Plugin for @sapphire/framework for hot module reloading for pieces",
|
|
5
5
|
"author": "@sapphire",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
+
"@favware/cliff-jumper": "^1.8.7",
|
|
73
74
|
"gen-esm-wrapper": "^1.1.3",
|
|
74
75
|
"typescript": "^4.7.4"
|
|
75
76
|
}
|