@hato810424/mc-resources-plugin 0.0.0-beta.11

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present, hato810424
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # @hato810424/mc-resources-plugin
2
+ MinecraftのリソースパックをWebで使用しやすくするVite, Webpack, Docusaurusプラグインです。
3
+
4
+ ## 特徴
5
+ - Mojang APIを使用して、Minecraftのバージョンごとにモデルを取得し、レンダリングします。
6
+ - リソースパックのパスを指定するだけで、簡単にリソースパックを使用できます。
7
+
8
+ ## 使い方
9
+ 最低限の設定は以下の通りです。
10
+ ```ts
11
+ import mcResourcesPlugin from '@hato810424/mc-resources-plugin/vite';
12
+
13
+ export default defineConfig({
14
+ plugins: [
15
+ mcResourcesPlugin({
16
+ resourcePackPath: './assets/resource-pack',
17
+ mcVersion: '1.18.2',
18
+ })
19
+ ],
20
+ });
21
+ ```
22
+
23
+ ## トラブルシューティング
24
+ - リソースパックを変更してもテクスチャが更新されない場合は、`cacheDir`で指定した場所のキャッシュを削除してください。
25
+
26
+ ## Example
27
+ `./packages/test` にReact + Viteのプロジェクトがあります。
28
+ ```bash
29
+ pnpm install
30
+ pnpm run build
31
+ pnpm run dev:vite
32
+ ```
33
+
34
+ ## オプション
35
+ ### resourcePackPath (required)
36
+ リソースパックのパスを指定します。
37
+
38
+ 展開したリソースパックのパスを指定します。
39
+ ```
40
+ 指定したパス/
41
+ └── assets/
42
+ └── minecraft/
43
+
44
+ minecraft/ 以下の画像ファイルが自動で検出され、出力されます。
45
+ ```
46
+
47
+ ### mcVersion (required)
48
+ Minecraftのバージョンを指定します。<br/>
49
+ Snapshotは指定できません。
50
+
51
+ ### outputPath (default: './mcpacks')
52
+ 出力パスを指定します。<br/>
53
+ 自動更新されるため、Git等には含めないでください。
54
+
55
+ ### emptyOutDir (default: false)
56
+ リソースパックの出力ディレクトリを自動生成時に空にするかどうかを指定します。
57
+
58
+ ### include (default: `['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx']`)
59
+ リソースパックの自動生成時に対象とするファイルのパターンを指定します。
60
+
61
+ ### exclude (default: `[]`)
62
+ リソースパックの自動生成時に除外するファイルのパターンを指定します。
63
+
64
+ always exclude: `['node_modules', '.git', '*.d.ts']`
65
+
66
+ ### cacheDir (default: `node_modules/.cache/@hato810424/mc-resources-plugin`)
67
+ キャッシュディレクトリを指定します。
68
+
69
+ ### startUpRenderCacheRefresh (default: false)
70
+ 起動時にレンダーキャッシュを更新するかどうかを指定します。
71
+
72
+ ### logLevel (default: 'info')
73
+ ログレベルを指定します。
74
+
75
+ - debug: デバッグログ(詳しい)
76
+ - info: デフォルトのログレベル(ふつう)
77
+ - error: エラーログのみ表示
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@hato810424/mc-resources-plugin",
3
+ "version": "0.0.0-beta.11",
4
+ "author": "hato810424",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/hato810424/mc-resources-plugin.git"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "exports": {
13
+ "./vite": {
14
+ "types": "./packages/mc-resources-plugin/dist/vite.d.ts",
15
+ "import": "./packages/mc-resources-plugin/dist/vite.mjs",
16
+ "default": "./packages/mc-resources-plugin/dist/vite.mjs"
17
+ },
18
+ "./webpack": {
19
+ "types": "./packages/mc-resources-plugin/dist/webpack.d.cts",
20
+ "import": "./packages/mc-resources-plugin/dist/webpack.mjs",
21
+ "require": "./packages/mc-resources-plugin/dist/webpack.cjs",
22
+ "default": "./packages/mc-resources-plugin/dist/webpack.cjs"
23
+ },
24
+ "./docusaurus": {
25
+ "types": "./packages/mc-resources-plugin/dist/docusaurus.d.ts",
26
+ "import": "./packages/mc-resources-plugin/dist/docusaurus.mjs",
27
+ "default": "./packages/mc-resources-plugin/dist/docusaurus.mjs"
28
+ }
29
+ },
30
+ "files": [
31
+ "packages/mc-resources-plugin/dist"
32
+ ],
33
+ "scripts": {
34
+ "preinstall": "npx only-allow pnpm",
35
+ "build": "pnpm --filter @hato810424/mc-resources-plugin build",
36
+ "test": "pnpm --filter @hato810424/mc-resources-plugin test",
37
+ "dev": "pnpm --filter @hato810424/mc-resources-plugin dev",
38
+ "dev:vite": "pnpm --filter test dev",
39
+ "dev:webpack": "pnpm --filter test-webpack dev",
40
+ "dev:docusaurus": "pnpm --filter test-docusaurus dev",
41
+ "preview": "pnpm build && pnpm --filter test build && pnpm --filter test preview"
42
+ }
43
+ }