@reactunity/renderer 0.23.2 → 0.24.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/README.md +34 -0
- package/css/preflight.css +54 -0
- package/css/tailwind.css +21 -0
- package/css/theme.css +17 -0
- package/dist/{base-BT2GMEbv.d.ts → base-FL2QIa13.d.ts} +2509 -1151
- package/dist/{components-Cbty8Ffc.d.ts → components-BL4KGbQ4.d.ts} +4 -4
- package/dist/editor/index.d.ts +3 -3
- package/dist/editor/jsx-dev-runtime.d.ts +1 -1
- package/dist/editor/jsx-runtime.d.ts +1 -1
- package/dist/{editor-Ds4U7pg6.d.ts → editor-DwsHqUiS.d.ts} +2708 -2168
- package/dist/index-CEmZZAHV.d.ts +1 -0
- package/dist/index.d.ts +7 -7
- package/dist/{jsx-DXzVL17E.d.ts → jsx-BRwefwcW.d.ts} +4 -3
- package/dist/{jsx-BZUfiU1y.d.ts → jsx-C3umXnyu.d.ts} +3 -3
- package/dist/{jsx-9V8cIFit.d.ts → jsx-pk0p8f7A.d.ts} +4 -4
- package/dist/{tests-DbTTvHZm.d.ts → tests-ByeoZtD1.d.ts} +2 -24
- package/dist/tests.d.ts +2 -2
- package/dist/ugui/index.d.ts +2 -2
- package/dist/ugui/jsx-dev-runtime.d.ts +1 -1
- package/dist/ugui/jsx-runtime.d.ts +1 -1
- package/dist/uitoolkit/index.d.ts +2 -2
- package/dist/uitoolkit/jsx-dev-runtime.d.ts +1 -1
- package/dist/uitoolkit/jsx-runtime.d.ts +1 -1
- package/dist/{unity-BQNCBoTP.d.ts → unity-CqyiwXyf.d.ts} +8125 -5457
- package/dist/vite.d.mts +44 -0
- package/dist/vite.mjs +240 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +32 -7
- package/dist/index-CBMYN8iy.d.ts +0 -1
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import react from "@vitejs/plugin-react";
|
|
2
|
+
import { PluginOption } from "vite";
|
|
3
|
+
//#region src/vite/index.d.ts
|
|
4
|
+
type ReactOptions = Parameters<typeof react>[0];
|
|
5
|
+
interface ReactUnityOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The Unity project to build into, absolute or relative to the Vite root. Discovered by
|
|
8
|
+
* walking up from the Vite root when omitted.
|
|
9
|
+
*/
|
|
10
|
+
unityProject?: string;
|
|
11
|
+
/** Output folder inside the Unity project. Defaults to `Assets/Resources/react`. */
|
|
12
|
+
assetPath?: string;
|
|
13
|
+
/** Empty the output directory before each build, keeping its `.meta` files. Default `true`. */
|
|
14
|
+
clean?: boolean;
|
|
15
|
+
/** Paths inside the output directory, relative to it, that the clean never deletes. */
|
|
16
|
+
preserve?: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* Content hashes in output filenames. Default `false`: a hash renames the file on every
|
|
19
|
+
* build, which costs it its `.meta` and so its Unity GUID.
|
|
20
|
+
*/
|
|
21
|
+
hashFileNames?: boolean;
|
|
22
|
+
/** Options for `@vitejs/plugin-react`, or `false` to add the React plugin yourself. */
|
|
23
|
+
react?: ReactOptions | false;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve a bare `@import "tailwindcss"` to `@reactunity/renderer/tailwind.css`, which is the
|
|
26
|
+
* same thing with a Preflight written for what ReactUnity renders. Default `true`; `false`
|
|
27
|
+
* leaves the import alone. Only the bare specifier is aliased -- `tailwindcss/theme.css` and
|
|
28
|
+
* the rest keep resolving to the package, which is where that entry gets them from.
|
|
29
|
+
*/
|
|
30
|
+
tailwind?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Vite preset for a ReactUnity app: React Fast Refresh, output into the Unity project's
|
|
34
|
+
* `Assets/Resources/react`, a clean that keeps Unity's `.meta` files, and a Tailwind entry with
|
|
35
|
+
* ReactUnity's Preflight in place of the browser one.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* export default defineConfig({ plugins: [reactUnity()] });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare function reactUnity(options?: ReactUnityOptions): PluginOption[];
|
|
42
|
+
//#endregion
|
|
43
|
+
export { ReactUnityOptions, reactUnity as default, reactUnity };
|
|
44
|
+
//# sourceMappingURL=vite.d.mts.map
|
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
//#region src/vite/clean.ts
|
|
5
|
+
const META = ".meta";
|
|
6
|
+
/**
|
|
7
|
+
* Empties the output directory but keeps every `.meta` file.
|
|
8
|
+
*
|
|
9
|
+
* Unity writes a `.meta` beside each asset and the GUID inside it is what scenes,
|
|
10
|
+
* prefabs and asset references point at. Deleting one makes Unity mint a new GUID for
|
|
11
|
+
* the file that replaces it, which silently breaks every reference to it -- so a build
|
|
12
|
+
* clears the output it produced last time and leaves the metas for the files coming back.
|
|
13
|
+
* The ones nothing comes back for are dropped afterwards by `removeOrphanMetaFiles`.
|
|
14
|
+
*/
|
|
15
|
+
function cleanOutDir(outDir, preserve = []) {
|
|
16
|
+
if (!fs.existsSync(outDir)) return;
|
|
17
|
+
cleanDir(outDir, new Set(preserve.map((entry) => path.resolve(outDir, entry))));
|
|
18
|
+
}
|
|
19
|
+
function cleanDir(dir, keep) {
|
|
20
|
+
let survivors = 0;
|
|
21
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
22
|
+
const full = path.join(dir, entry.name);
|
|
23
|
+
if (keep.has(full) || entry.name.endsWith(META)) {
|
|
24
|
+
survivors++;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (entry.isDirectory()) if (cleanDir(full, keep)) survivors++;
|
|
28
|
+
else fs.rmSync(full, {
|
|
29
|
+
recursive: true,
|
|
30
|
+
force: true
|
|
31
|
+
});
|
|
32
|
+
else fs.rmSync(full, { force: true });
|
|
33
|
+
}
|
|
34
|
+
return survivors > 0;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Drops the `.meta` files whose asset did not come back, and the directories the build
|
|
38
|
+
* left empty. Run after the bundle is written, so what remains describes only real files.
|
|
39
|
+
*/
|
|
40
|
+
function removeOrphanMetaFiles(outDir) {
|
|
41
|
+
if (!fs.existsSync(outDir)) return;
|
|
42
|
+
sweep(outDir, true);
|
|
43
|
+
}
|
|
44
|
+
function sweep(dir, isRoot) {
|
|
45
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
46
|
+
const full = path.join(dir, entry.name);
|
|
47
|
+
if (entry.isDirectory()) {
|
|
48
|
+
if (sweep(full, false)) continue;
|
|
49
|
+
fs.rmSync(full, {
|
|
50
|
+
recursive: true,
|
|
51
|
+
force: true
|
|
52
|
+
});
|
|
53
|
+
fs.rmSync(full + META, { force: true });
|
|
54
|
+
} else if (entry.name.endsWith(META) && !fs.existsSync(full.slice(0, -5))) fs.rmSync(full, { force: true });
|
|
55
|
+
}
|
|
56
|
+
return isRoot || fs.readdirSync(dir).length > 0;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Describes why `outDir` must not be cleaned, or nothing when it is safe.
|
|
60
|
+
*
|
|
61
|
+
* The clean deletes everything it finds, so it refuses anything that is not plausibly a
|
|
62
|
+
* build output folder: a Unity project root, a package, or the sources themselves.
|
|
63
|
+
*/
|
|
64
|
+
function unsafeOutDirReason(outDir, root) {
|
|
65
|
+
const dir = path.resolve(outDir);
|
|
66
|
+
if (path.dirname(dir) === dir) return "it is a filesystem root";
|
|
67
|
+
if (path.basename(dir) === "Assets") return "it is a Unity Assets folder";
|
|
68
|
+
const relative = path.relative(dir, path.resolve(root));
|
|
69
|
+
if (!relative || !relative.startsWith("..") && !path.isAbsolute(relative)) return "the project root is inside it";
|
|
70
|
+
for (const marker of [
|
|
71
|
+
"package.json",
|
|
72
|
+
".git",
|
|
73
|
+
"ProjectSettings"
|
|
74
|
+
]) if (fs.existsSync(path.join(dir, marker))) return `it contains ${marker}`;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/vite/unity-project.ts
|
|
78
|
+
const MAX_DEPTH = 10;
|
|
79
|
+
/**
|
|
80
|
+
* A folder is a Unity project when it has an `Assets` directory beside a
|
|
81
|
+
* `ProjectSettings/ProjectVersion.txt`. The version stamp is what tells a real project
|
|
82
|
+
* from any folder that happens to be called `Assets`.
|
|
83
|
+
*/
|
|
84
|
+
function isUnityProject(dir) {
|
|
85
|
+
return isDirectory(path.join(dir, "Assets")) && fs.existsSync(path.join(dir, "ProjectSettings", "ProjectVersion.txt"));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Finds the Unity project a React app belongs to, starting at `from` and walking up.
|
|
89
|
+
*
|
|
90
|
+
* Each ancestor is tested itself and then one level down, so both documented layouts are
|
|
91
|
+
* found: the app inside the project (`MyGame/react`) and the app beside it
|
|
92
|
+
* (`workspace/{MyGame,ui}`).
|
|
93
|
+
*/
|
|
94
|
+
function findUnityProject(from) {
|
|
95
|
+
let dir = path.resolve(from);
|
|
96
|
+
for (let depth = 0; depth < MAX_DEPTH; depth++) {
|
|
97
|
+
if (isUnityProject(dir)) return dir;
|
|
98
|
+
const nested = findUnityProjectIn(dir);
|
|
99
|
+
if (nested) return nested;
|
|
100
|
+
const parent = path.dirname(dir);
|
|
101
|
+
if (parent === dir) break;
|
|
102
|
+
dir = parent;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function findUnityProjectIn(dir) {
|
|
106
|
+
for (const entry of readDir(dir)) {
|
|
107
|
+
if (!entry.isDirectory() || entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
108
|
+
const candidate = path.join(dir, entry.name);
|
|
109
|
+
if (isUnityProject(candidate)) return candidate;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function readDir(dir) {
|
|
113
|
+
try {
|
|
114
|
+
return fs.readdirSync(dir, { withFileTypes: true });
|
|
115
|
+
} catch {
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function isDirectory(dir) {
|
|
120
|
+
try {
|
|
121
|
+
return fs.statSync(dir).isDirectory();
|
|
122
|
+
} catch {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/vite/index.ts
|
|
128
|
+
const DEFAULT_ASSET_PATH = "Assets/Resources/react";
|
|
129
|
+
const TAILWIND_ENTRY = "@reactunity/renderer/tailwind.css";
|
|
130
|
+
/**
|
|
131
|
+
* Vite preset for a ReactUnity app: React Fast Refresh, output into the Unity project's
|
|
132
|
+
* `Assets/Resources/react`, a clean that keeps Unity's `.meta` files, and a Tailwind entry with
|
|
133
|
+
* ReactUnity's Preflight in place of the browser one.
|
|
134
|
+
*
|
|
135
|
+
* ```ts
|
|
136
|
+
* export default defineConfig({ plugins: [reactUnity()] });
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
function reactUnity(options = {}) {
|
|
140
|
+
const reactOptions = options.react ?? {};
|
|
141
|
+
return [
|
|
142
|
+
reactOptions === false ? null : react(reactOptions),
|
|
143
|
+
reactUnityConfig(options),
|
|
144
|
+
reactUnityClean(options)
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
const LIGHTNINGCSS_LIGHT_DARK = 1 << 20;
|
|
148
|
+
function reactUnityConfig(options) {
|
|
149
|
+
const assetPath = options.assetPath ?? DEFAULT_ASSET_PATH;
|
|
150
|
+
let message;
|
|
151
|
+
return {
|
|
152
|
+
name: "reactunity",
|
|
153
|
+
config(config) {
|
|
154
|
+
const patch = {};
|
|
155
|
+
if (config.devtools === void 0) patch.devtools = false;
|
|
156
|
+
const hmr = config.server?.hmr;
|
|
157
|
+
if (hmr !== false && (hmr === void 0 || typeof hmr === "object" && hmr.overlay === void 0)) patch.server = { hmr: { overlay: false } };
|
|
158
|
+
if (options.tailwind !== false) patch.resolve = { alias: [{
|
|
159
|
+
find: /^tailwindcss$/,
|
|
160
|
+
replacement: TAILWIND_ENTRY
|
|
161
|
+
}] };
|
|
162
|
+
const build = {};
|
|
163
|
+
if (config.build?.outDir === void 0) {
|
|
164
|
+
const root = path.resolve(config.root ?? process.cwd());
|
|
165
|
+
const project = options.unityProject ? path.resolve(root, options.unityProject) : findUnityProject(root);
|
|
166
|
+
if (project) {
|
|
167
|
+
build.outDir = path.join(project, assetPath);
|
|
168
|
+
message = {
|
|
169
|
+
level: "info",
|
|
170
|
+
text: `[reactunity] Unity output directory: ${build.outDir}`
|
|
171
|
+
};
|
|
172
|
+
} else message = {
|
|
173
|
+
level: "warn",
|
|
174
|
+
text: "[reactunity] no Unity project found above the Vite root. Set the unityProject option or build.outDir."
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
if (config.build?.assetsInlineLimit === void 0) build.assetsInlineLimit = 0;
|
|
178
|
+
if (config.build?.cssTarget === void 0) build.cssTarget = ["chrome87"];
|
|
179
|
+
if (config.css?.lightningcss?.exclude === void 0) patch.css = { lightningcss: { exclude: LIGHTNINGCSS_LIGHT_DARK } };
|
|
180
|
+
if (options.clean !== false && config.build?.emptyOutDir === void 0) build.emptyOutDir = false;
|
|
181
|
+
const output = config.build?.rolldownOptions?.output ?? config.build?.rollupOptions?.output;
|
|
182
|
+
if (!options.hashFileNames && output === void 0 && !config.build?.lib) {
|
|
183
|
+
const dir = config.build?.assetsDir ?? "assets";
|
|
184
|
+
build.rolldownOptions = { output: {
|
|
185
|
+
entryFileNames: `${dir}/[name].js`,
|
|
186
|
+
chunkFileNames: `${dir}/[name].js`,
|
|
187
|
+
assetFileNames: `${dir}/[name][extname][extname]`
|
|
188
|
+
} };
|
|
189
|
+
}
|
|
190
|
+
if (Object.keys(build).length) patch.build = build;
|
|
191
|
+
return patch;
|
|
192
|
+
},
|
|
193
|
+
configResolved(config) {
|
|
194
|
+
if (message) config.logger[message.level](message.text);
|
|
195
|
+
message = void 0;
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function reactUnityClean(options) {
|
|
200
|
+
const cleaned = /* @__PURE__ */ new Set();
|
|
201
|
+
let written = false;
|
|
202
|
+
let outDir = "";
|
|
203
|
+
let root = "";
|
|
204
|
+
let write = true;
|
|
205
|
+
let logger;
|
|
206
|
+
return {
|
|
207
|
+
name: "reactunity:clean",
|
|
208
|
+
apply: "build",
|
|
209
|
+
configResolved(config) {
|
|
210
|
+
root = config.root;
|
|
211
|
+
logger = config.logger;
|
|
212
|
+
write = config.build.write !== false;
|
|
213
|
+
outDir = path.resolve(config.root, config.build.outDir);
|
|
214
|
+
},
|
|
215
|
+
buildStart() {
|
|
216
|
+
if (options.clean === false || !write || cleaned.has(outDir)) return;
|
|
217
|
+
cleaned.add(outDir);
|
|
218
|
+
const unsafe = unsafeOutDirReason(outDir, root);
|
|
219
|
+
if (unsafe) {
|
|
220
|
+
logger?.warn(`[reactunity] not cleaning ${outDir} because ${unsafe}.`);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
cleanOutDir(outDir, options.preserve);
|
|
224
|
+
},
|
|
225
|
+
writeBundle() {
|
|
226
|
+
written = true;
|
|
227
|
+
},
|
|
228
|
+
closeBundle() {
|
|
229
|
+
cleaned.delete(outDir);
|
|
230
|
+
const succeeded = written;
|
|
231
|
+
written = false;
|
|
232
|
+
if (options.clean === false || !write || !succeeded) return;
|
|
233
|
+
removeOrphanMetaFiles(outDir);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
export { reactUnity as default, reactUnity };
|
|
239
|
+
|
|
240
|
+
//# sourceMappingURL=vite.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.mjs","names":[],"sources":["../src/vite/clean.ts","../src/vite/unity-project.ts","../src/vite/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nconst META = '.meta';\n\n/**\n * Empties the output directory but keeps every `.meta` file.\n *\n * Unity writes a `.meta` beside each asset and the GUID inside it is what scenes,\n * prefabs and asset references point at. Deleting one makes Unity mint a new GUID for\n * the file that replaces it, which silently breaks every reference to it -- so a build\n * clears the output it produced last time and leaves the metas for the files coming back.\n * The ones nothing comes back for are dropped afterwards by `removeOrphanMetaFiles`.\n */\nexport function cleanOutDir(outDir: string, preserve: readonly string[] = []): void {\n if (!fs.existsSync(outDir)) return;\n\n const keep = new Set(preserve.map((entry) => path.resolve(outDir, entry)));\n cleanDir(outDir, keep);\n}\n\n// Returns whether anything survived, so the caller can drop a directory that did not.\nfunction cleanDir(dir: string, keep: Set<string>): boolean {\n let survivors = 0;\n\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n const full = path.join(dir, entry.name);\n\n if (keep.has(full) || entry.name.endsWith(META)) {\n survivors++;\n continue;\n }\n\n if (entry.isDirectory()) {\n // A directory holding metas (or something preserved) has to stay for them.\n if (cleanDir(full, keep)) survivors++;\n else fs.rmSync(full, { recursive: true, force: true });\n } else {\n fs.rmSync(full, { force: true });\n }\n }\n\n return survivors > 0;\n}\n\n/**\n * Drops the `.meta` files whose asset did not come back, and the directories the build\n * left empty. Run after the bundle is written, so what remains describes only real files.\n */\nexport function removeOrphanMetaFiles(outDir: string): void {\n if (!fs.existsSync(outDir)) return;\n sweep(outDir, true);\n}\n\n// Returns whether the directory is still wanted.\nfunction sweep(dir: string, isRoot: boolean): boolean {\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n const full = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n if (sweep(full, false)) continue;\n\n // A directory's own meta lives in its parent, and goes with it.\n fs.rmSync(full, { recursive: true, force: true });\n fs.rmSync(full + META, { force: true });\n } else if (entry.name.endsWith(META) && !fs.existsSync(full.slice(0, -META.length))) {\n fs.rmSync(full, { force: true });\n }\n }\n\n return isRoot || fs.readdirSync(dir).length > 0;\n}\n\n/**\n * Describes why `outDir` must not be cleaned, or nothing when it is safe.\n *\n * The clean deletes everything it finds, so it refuses anything that is not plausibly a\n * build output folder: a Unity project root, a package, or the sources themselves.\n */\nexport function unsafeOutDirReason(outDir: string, root: string): string | undefined {\n const dir = path.resolve(outDir);\n\n if (path.dirname(dir) === dir) return 'it is a filesystem root';\n\n // `Assets` itself rather than a folder inside it: no marker below would catch that one.\n if (path.basename(dir) === 'Assets') return 'it is a Unity Assets folder';\n\n const relative = path.relative(dir, path.resolve(root));\n if (!relative || (!relative.startsWith('..') && !path.isAbsolute(relative))) return 'the project root is inside it';\n\n for (const marker of ['package.json', '.git', 'ProjectSettings']) {\n if (fs.existsSync(path.join(dir, marker))) return `it contains ${marker}`;\n }\n\n return undefined;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\n// How far up the tree to look before giving up. Deep enough for any sane layout, shallow\n// enough that a React app outside a Unity project does not walk to the filesystem root.\nconst MAX_DEPTH = 10;\n\n/**\n * A folder is a Unity project when it has an `Assets` directory beside a\n * `ProjectSettings/ProjectVersion.txt`. The version stamp is what tells a real project\n * from any folder that happens to be called `Assets`.\n */\nexport function isUnityProject(dir: string): boolean {\n return isDirectory(path.join(dir, 'Assets')) && fs.existsSync(path.join(dir, 'ProjectSettings', 'ProjectVersion.txt'));\n}\n\n/**\n * Finds the Unity project a React app belongs to, starting at `from` and walking up.\n *\n * Each ancestor is tested itself and then one level down, so both documented layouts are\n * found: the app inside the project (`MyGame/react`) and the app beside it\n * (`workspace/{MyGame,ui}`).\n */\nexport function findUnityProject(from: string): string | undefined {\n let dir = path.resolve(from);\n\n for (let depth = 0; depth < MAX_DEPTH; depth++) {\n if (isUnityProject(dir)) return dir;\n\n const nested = findUnityProjectIn(dir);\n if (nested) return nested;\n\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n\n return undefined;\n}\n\nfunction findUnityProjectIn(dir: string): string | undefined {\n for (const entry of readDir(dir)) {\n // node_modules and dot-directories cannot hold a Unity project, and both are large.\n if (!entry.isDirectory() || entry.name.startsWith('.') || entry.name === 'node_modules') continue;\n\n const candidate = path.join(dir, entry.name);\n if (isUnityProject(candidate)) return candidate;\n }\n\n return undefined;\n}\n\nfunction readDir(dir: string): fs.Dirent[] {\n try {\n return fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n // Unreadable directories are simply not the project we are looking for.\n return [];\n }\n}\n\nfunction isDirectory(dir: string): boolean {\n try {\n return fs.statSync(dir).isDirectory();\n } catch {\n return false;\n }\n}\n","import path from 'node:path';\nimport react from '@vitejs/plugin-react';\nimport type { Plugin, PluginOption, UserConfig } from 'vite';\nimport { cleanOutDir, removeOrphanMetaFiles, unsafeOutDirReason } from './clean.ts';\nimport { findUnityProject } from './unity-project.ts';\n\ntype ReactOptions = Parameters<typeof react>[0];\n\nconst DEFAULT_ASSET_PATH = 'Assets/Resources/react';\n\nexport interface ReactUnityOptions {\n /**\n * The Unity project to build into, absolute or relative to the Vite root. Discovered by\n * walking up from the Vite root when omitted.\n */\n unityProject?: string;\n\n /** Output folder inside the Unity project. Defaults to `Assets/Resources/react`. */\n assetPath?: string;\n\n /** Empty the output directory before each build, keeping its `.meta` files. Default `true`. */\n clean?: boolean;\n\n /** Paths inside the output directory, relative to it, that the clean never deletes. */\n preserve?: readonly string[];\n\n /**\n * Content hashes in output filenames. Default `false`: a hash renames the file on every\n * build, which costs it its `.meta` and so its Unity GUID.\n */\n hashFileNames?: boolean;\n\n /** Options for `@vitejs/plugin-react`, or `false` to add the React plugin yourself. */\n react?: ReactOptions | false;\n\n /**\n * Resolve a bare `@import \"tailwindcss\"` to `@reactunity/renderer/tailwind.css`, which is the\n * same thing with a Preflight written for what ReactUnity renders. Default `true`; `false`\n * leaves the import alone. Only the bare specifier is aliased -- `tailwindcss/theme.css` and\n * the rest keep resolving to the package, which is where that entry gets them from.\n */\n tailwind?: boolean;\n}\n\nconst TAILWIND_ENTRY = '@reactunity/renderer/tailwind.css';\n\n/**\n * Vite preset for a ReactUnity app: React Fast Refresh, output into the Unity project's\n * `Assets/Resources/react`, a clean that keeps Unity's `.meta` files, and a Tailwind entry with\n * ReactUnity's Preflight in place of the browser one.\n *\n * ```ts\n * export default defineConfig({ plugins: [reactUnity()] });\n * ```\n */\nexport function reactUnity(options: ReactUnityOptions = {}): PluginOption[] {\n const reactOptions = options.react ?? {};\n\n return [reactOptions === false ? null : react(reactOptions), reactUnityConfig(options), reactUnityClean(options)];\n}\n\n// Lightning CSS's `Features.LightDark`. The package is Vite's dependency rather than ours, so the\n// flag is spelled out; it has held this value since the feature was added.\nconst LIGHTNINGCSS_LIGHT_DARK = 1 << 20;\n\nfunction reactUnityConfig(options: ReactUnityOptions): Plugin {\n const assetPath = options.assetPath ?? DEFAULT_ASSET_PATH;\n let message: { level: 'info' | 'warn'; text: string } | undefined;\n\n return {\n name: 'reactunity',\n\n config(config) {\n const patch: UserConfig = {};\n\n // Neither has anything to render against: Unity is not a browser, and an error\n // overlay drawn into a page nobody looks at only hides the console message.\n if (config.devtools === undefined) patch.devtools = false;\n\n const hmr = config.server?.hmr;\n if (hmr !== false && (hmr === undefined || (typeof hmr === 'object' && hmr.overlay === undefined))) {\n patch.server = { hmr: { overlay: false } };\n }\n\n // Tailwind's own Preflight resets a document, and there is no document here. Aliasing the\n // entry is what lets an app write the one line its docs tell it to. `@tailwindcss/vite`\n // resolves `@import` through Vite's resolver, so it sees this the way an app's own CSS does.\n if (options.tailwind !== false) {\n patch.resolve = { alias: [{ find: /^tailwindcss$/, replacement: TAILWIND_ENTRY }] };\n }\n\n const build: UserConfig['build'] = {};\n\n if (config.build?.outDir === undefined) {\n const root = path.resolve(config.root ?? process.cwd());\n const project = options.unityProject ? path.resolve(root, options.unityProject) : findUnityProject(root);\n\n if (project) {\n build.outDir = path.join(project, assetPath);\n message = { level: 'info', text: `[reactunity] Unity output directory: ${build.outDir}` };\n } else {\n message = {\n level: 'warn',\n text: '[reactunity] no Unity project found above the Vite root. Set the unityProject option or build.outDir.',\n };\n }\n }\n\n // Unity resolves an asset URL through its own loaders, and a small file inlined as a\n // data: URI never reaches them the same way -- react-unity-scripts pinned the same\n // limit to 0 rather than take CRA's 10 kB.\n if (config.build?.assetsInlineLimit === undefined) build.assetsInlineLimit = 0;\n\n // ReactUnity's CSS subset is roughly a 2020 browser: no oklch, color-mix or nesting.\n // Naming an old target is what makes Lightning CSS lower them on the way out.\n if (config.build?.cssTarget === undefined) build.cssTarget = ['chrome87'];\n\n // light-dark() is the one thing that target lowers which ReactUnity reads itself, and the\n // lowered form only works next to a color-scheme declaration in the same sheet.\n if (config.css?.lightningcss?.exclude === undefined) {\n patch.css = { lightningcss: { exclude: LIGHTNINGCSS_LIGHT_DARK } };\n }\n\n // Vite's own emptying would take the .meta files with it, and warns about an outDir\n // outside the root besides. The clean plugin below does the job instead.\n if (options.clean !== false && config.build?.emptyOutDir === undefined) build.emptyOutDir = false;\n\n // Library mode names its own output, and an entryFileNames here would override it.\n const output = config.build?.rolldownOptions?.output ?? config.build?.rollupOptions?.output;\n if (!options.hashFileNames && output === undefined && !config.build?.lib) {\n const dir = config.build?.assetsDir ?? 'assets';\n build.rolldownOptions = {\n output: {\n entryFileNames: `${dir}/[name].js`,\n chunkFileNames: `${dir}/[name].js`,\n // Doubled on purpose. Unity keys a resource on its path minus the last extension, so\n // index.js and index.css both answer to `assets/index` and asking for one can hand you\n // the other. index.css.css keeps its type in the name it is looked up by.\n assetFileNames: `${dir}/[name][extname][extname]`,\n },\n };\n }\n\n if (Object.keys(build).length) patch.build = build;\n\n return patch;\n },\n\n configResolved(config) {\n // The config hook has no logger, so anything it decided is reported from here.\n if (message) config.logger[message.level](message.text);\n message = undefined;\n },\n };\n}\n\nfunction reactUnityClean(options: ReactUnityOptions): Plugin {\n const cleaned = new Set<string>();\n let written = false;\n let outDir = '';\n let root = '';\n let write = true;\n let logger: { warn: (message: string) => void } | undefined;\n\n return {\n name: 'reactunity:clean',\n apply: 'build',\n\n configResolved(config) {\n root = config.root;\n logger = config.logger;\n write = config.build.write !== false;\n outDir = path.resolve(config.root, config.build.outDir);\n },\n\n // Before renderStart, which is where Vite empties the outDir and copies publicDir\n // into it -- cleaning any later would delete files this build had just put there.\n buildStart() {\n if (options.clean === false || !write || cleaned.has(outDir)) return;\n cleaned.add(outDir);\n\n const unsafe = unsafeOutDirReason(outDir, root);\n if (unsafe) {\n logger?.warn(`[reactunity] not cleaning ${outDir} because ${unsafe}.`);\n return;\n }\n\n cleanOutDir(outDir, options.preserve);\n },\n\n // Only on success: closeBundle runs after a failed build too, and sweeping then\n // would delete every meta the clean had just set aside -- losing the GUIDs of files\n // the next successful build brings straight back.\n writeBundle() {\n written = true;\n },\n\n closeBundle() {\n // Cleared rather than kept, so a watch rebuild cleans again.\n cleaned.delete(outDir);\n const succeeded = written;\n written = false;\n if (options.clean === false || !write || !succeeded) return;\n\n removeOrphanMetaFiles(outDir);\n },\n };\n}\n\nexport default reactUnity;\n"],"mappings":";;;;AAGA,MAAM,OAAO;;;;;;;;;;AAWb,SAAgB,YAAY,QAAgB,WAA8B,CAAC,GAAS;CAClF,IAAI,CAAC,GAAG,WAAW,MAAM,GAAG;CAG5B,SAAS,QAAQ,IADA,IAAI,SAAS,KAAK,UAAU,KAAK,QAAQ,QAAQ,KAAK,CAAC,CACpD,CAAC;AACvB;AAGA,SAAS,SAAS,KAAa,MAA4B;CACzD,IAAI,YAAY;CAEhB,KAAK,MAAM,SAAS,GAAG,YAAY,KAAK,EAAE,eAAe,KAAK,CAAC,GAAG;EAChE,MAAM,OAAO,KAAK,KAAK,KAAK,MAAM,IAAI;EAEtC,IAAI,KAAK,IAAI,IAAI,KAAK,MAAM,KAAK,SAAS,IAAI,GAAG;GAC/C;GACA;EACF;EAEA,IAAI,MAAM,YAAY,GAEpB,IAAI,SAAS,MAAM,IAAI,GAAG;OACrB,GAAG,OAAO,MAAM;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;OAErD,GAAG,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;CAEnC;CAEA,OAAO,YAAY;AACrB;;;;;A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|
+
"version": "0.24.0",
|
|
4
4
|
"description": "React renderer for Unity3D",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"css"
|
|
11
12
|
],
|
|
12
13
|
"//exports": "`./tests` is the entry that exists: the source file is tests.ts and packages/scripts/lib/types/tests.d.ts references `@reactunity/renderer/tests`. The map only ever declared `./test`, pointed at ./dist/test.js -- a name tsc never emitted -- so both spellings failed to resolve under an exports-aware resolver. `./test` is kept as an alias for the same file rather than dropped, since it costs nothing and it is the name published so far.",
|
|
14
|
+
"//exports-tailwind": "Plain CSS, so `css/` joins `dist/` in `files`. Tailwind reads these through the exports map like any other import; nothing bundles them.",
|
|
15
|
+
"//exports-vite": "Node-only, and the one entry a consumer imports outside the Unity bundle -- hence .mjs. This package is not an ESM package, and Vite loads a config file's externalised imports through Node, which would read a .js file here as CommonJS and choke on its imports.",
|
|
13
16
|
"exports": {
|
|
14
17
|
".": "./dist/index.js",
|
|
15
18
|
"./tests": "./dist/tests.js",
|
|
@@ -20,7 +23,14 @@
|
|
|
20
23
|
"./uitoolkit/*": "./dist/uitoolkit/*.js",
|
|
21
24
|
"./editor": "./dist/editor/index.js",
|
|
22
25
|
"./editor/*": "./dist/editor/*.js",
|
|
23
|
-
"./webgl-compat": "./dist/webgl-compat.js"
|
|
26
|
+
"./webgl-compat": "./dist/webgl-compat.js",
|
|
27
|
+
"./tailwind.css": "./css/tailwind.css",
|
|
28
|
+
"./tailwind/preflight.css": "./css/preflight.css",
|
|
29
|
+
"./tailwind/theme.css": "./css/theme.css",
|
|
30
|
+
"./vite": {
|
|
31
|
+
"types": "./dist/vite.d.mts",
|
|
32
|
+
"default": "./dist/vite.mjs"
|
|
33
|
+
}
|
|
24
34
|
},
|
|
25
35
|
"author": "Gokhan Kurt <krtgkn@gmail.com> (https://github.com/KurtGokhan)",
|
|
26
36
|
"license": "MIT",
|
|
@@ -36,19 +46,33 @@
|
|
|
36
46
|
"unity3d"
|
|
37
47
|
],
|
|
38
48
|
"dependencies": {
|
|
49
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
39
50
|
"react-reconciler": "^0.33.0",
|
|
40
51
|
"use-sync-external-store": "^1.6.0"
|
|
41
52
|
},
|
|
42
53
|
"peerDependencies": {
|
|
43
|
-
"react": "^19.0.0"
|
|
54
|
+
"react": "^19.0.0",
|
|
55
|
+
"tailwindcss": "^4.0.0",
|
|
56
|
+
"vite": "^8.0.0"
|
|
57
|
+
},
|
|
58
|
+
"//peerDependenciesMeta": "Only ./vite needs Vite, and only for its types -- the runtime entries never touch it. Tailwind is the app's own dependency; css/tailwind.css imports its theme and utilities, and nothing else here mentions it.",
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"tailwindcss": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"vite": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
44
66
|
},
|
|
45
67
|
"devDependencies": {
|
|
68
|
+
"@reactunity/scripts": "^0.24.0",
|
|
69
|
+
"@types/node": "^26.4.1",
|
|
46
70
|
"@types/react-reconciler": "^0.33.0",
|
|
47
71
|
"react-unity-webgl": "^10.2.0",
|
|
48
72
|
"rimraf": "^6.1.3",
|
|
73
|
+
"tailwindcss": "^4.3.3",
|
|
49
74
|
"tsdown": "^0.22.14",
|
|
50
|
-
"typescript": "^7.0.2"
|
|
51
|
-
"@reactunity/scripts": "^0.23.2"
|
|
75
|
+
"typescript": "^7.0.2"
|
|
52
76
|
},
|
|
53
77
|
"bugs": {
|
|
54
78
|
"url": "https://github.com/ReactUnity/core/issues"
|
|
@@ -59,7 +83,8 @@
|
|
|
59
83
|
},
|
|
60
84
|
"scripts": {
|
|
61
85
|
"build": "tsdown",
|
|
62
|
-
"typecheck": "tsc",
|
|
86
|
+
"typecheck": "tsc && tsc -p tsconfig.vite.json",
|
|
87
|
+
"test": "node --test src/vite/*.test.mts",
|
|
63
88
|
"watch": "tsdown --watch",
|
|
64
89
|
"lint": "react-unity-scripts lint",
|
|
65
90
|
"version": "node version.js && git add src/version.ts"
|
package/dist/index-CBMYN8iy.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./jsx-DXzVL17E.js";
|