vite-plugin-fvtt 0.2.0 → 0.2.1

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 CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
3
+ ## [0.2.1] - 2025-09-09
4
+
5
+ ### Fixed
6
+
7
+ - Fixed language generation to not error out on mixed entries.
8
+
9
+ ## [0.2.0] - 2025-09-08
4
10
 
5
11
  ### Added
6
12
 
@@ -63,7 +69,9 @@
63
69
 
64
70
  - Initial Release
65
71
 
66
- [unreleased]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.1.4...HEAD
72
+ [unreleased]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.1...HEAD
73
+ [0.2.1]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.2.0...v0.2.1
74
+ [0.2.0]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.1.4...v0.2.0
67
75
  [0.1.4]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.1.3...v0.1.4
68
76
  [0.1.3]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.1.2...v0.1.3
69
77
  [0.1.2]: https://github.com/MatyeusM/vite-plugin-fvtt/compare/v0.1.1...v0.1.2
package/README.md CHANGED
@@ -102,7 +102,11 @@ Supports both complete and partial translation workflows:
102
102
 
103
103
  Merging follows your manifest’s declared language paths, searching in root or source directories.
104
104
 
105
- ⚠️ **Note:** HMR works for language files, but non-English locales may not reload as expected.
105
+ ### **6. Packs**
106
+
107
+ Packs are tried to be auto-discovered in the source directory. If the paths match, they are automatically compiled.
108
+
109
+ **Note:** Packs are currently not watched for changes.
106
110
 
107
111
  ### **Example Project Structure**
108
112
 
package/dist/index.js CHANGED
@@ -598,17 +598,18 @@ function foundryVTTPlugin(options = { buildPacks: true }) {
598
598
  configResolved(config) {
599
599
  context.config = config;
600
600
  },
601
- async writeBundle() {
602
- if (!context.config) return;
603
- const outDir = path_utils_default.getOutDir();
604
- const candidates = ["system.json", "module.json"];
605
- for (const file of candidates) {
601
+ async generateBundle() {
602
+ const manifestCandidates = ["system.json", "module.json"];
603
+ for (const file of manifestCandidates) {
606
604
  const src = posix.resolve(file);
607
- if (!path_utils_default.getOutDirFile(file) && fs.existsSync(src)) {
605
+ if (!path_utils_default.getPublicDirFile(file) && fs.existsSync(src)) {
608
606
  this.addWatchFile(src);
609
- const dest = posix.join(outDir, file);
610
- await fs.copy(src, dest);
611
- logger_default.info(`Copied ${file} >>> ${dest}`);
607
+ const manifest = fs.readJsonSync(src);
608
+ this.emitFile({
609
+ type: "asset",
610
+ fileName: file,
611
+ source: JSON.stringify(manifest, null, 2)
612
+ });
612
613
  }
613
614
  }
614
615
  const languages = context.manifest?.languages ?? [];
@@ -617,8 +618,14 @@ function foundryVTTPlugin(options = { buildPacks: true }) {
617
618
  getLocalLanguageFiles(language.lang).forEach((langFile) => this.addWatchFile(langFile));
618
619
  const languageDataRaw = loadLanguage(language.lang);
619
620
  const languageData = transform(languageDataRaw);
620
- fs.writeJSONSync(posix.join(outDir, language.path), languageData);
621
+ this.emitFile({
622
+ type: "asset",
623
+ fileName: posix.join(language.path),
624
+ source: JSON.stringify(languageData, null, 2)
625
+ });
621
626
  }
627
+ },
628
+ async writeBundle() {
622
629
  if (options.buildPacks) await compileManifestPacks();
623
630
  },
624
631
  closeBundle() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-fvtt",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A Vite plugin for module and system development for Foundry VTT",
5
5
  "keywords": [
6
6
  "vite",