react-godot-shader-preview 0.5.7 → 0.5.9
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/dist/GodotMaterialPreview.css +2 -4
- package/dist/style.css +2 -4
- package/package.json +1 -1
- package/scripts/copy-embed.mjs +10 -6
|
@@ -29,10 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.rgs-previewWrap {
|
|
32
|
-
max-width: 100%;
|
|
33
|
-
min-width: 0;
|
|
34
32
|
flex: 1 1 0;
|
|
35
|
-
min-height:
|
|
33
|
+
min-height: 100%;
|
|
34
|
+
min-width: 100%;
|
|
36
35
|
display: flex;
|
|
37
36
|
align-items: center;
|
|
38
37
|
justify-content: center;
|
|
@@ -42,7 +41,6 @@
|
|
|
42
41
|
position: relative;
|
|
43
42
|
overflow: hidden;
|
|
44
43
|
border: 1px solid var(--rgs-b);
|
|
45
|
-
border-radius: 6px;
|
|
46
44
|
background: #000;
|
|
47
45
|
aspect-ratio: 1;
|
|
48
46
|
height: 100%;
|
package/dist/style.css
CHANGED
|
@@ -29,10 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.rgs-previewWrap {
|
|
32
|
-
max-width: 100%;
|
|
33
|
-
min-width: 0;
|
|
34
32
|
flex: 1 1 0;
|
|
35
|
-
min-height:
|
|
33
|
+
min-height: 100%;
|
|
34
|
+
min-width: 100%;
|
|
36
35
|
display: flex;
|
|
37
36
|
align-items: center;
|
|
38
37
|
justify-content: center;
|
|
@@ -42,7 +41,6 @@
|
|
|
42
41
|
position: relative;
|
|
43
42
|
overflow: hidden;
|
|
44
43
|
border: 1px solid var(--rgs-b);
|
|
45
|
-
border-radius: 6px;
|
|
46
44
|
background: #000;
|
|
47
45
|
aspect-ratio: 1;
|
|
48
46
|
height: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-godot-shader-preview",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "React component for live Godot shader preview via WebAssembly. Load shader code, switch mesh (sphere/plane), edit uniforms and samplers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/scripts/copy-embed.mjs
CHANGED
|
@@ -5,27 +5,31 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
6
|
const packageRoot = path.resolve(__dirname, '..');
|
|
7
7
|
const sourceDir = path.join(packageRoot, 'godot');
|
|
8
|
-
const
|
|
8
|
+
const embedFolderName = 'react_godot_shader_preview_embed';
|
|
9
9
|
// When installed as a dependency, cwd is the package dir; project root is two levels up.
|
|
10
10
|
const projectRoot = path.resolve(packageRoot, '..', '..');
|
|
11
|
-
const
|
|
11
|
+
const publicDir = path.join(projectRoot, 'public');
|
|
12
|
+
const destDir = path.join(publicDir, embedFolderName);
|
|
12
13
|
|
|
13
14
|
if (!fs.existsSync(sourceDir)) {
|
|
14
15
|
console.warn('[react-godot-shader-preview] postinstall: godot folder not found, skip copy');
|
|
15
16
|
process.exit(0);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
if (
|
|
19
|
-
fs.
|
|
19
|
+
if (fs.existsSync(destDir)) {
|
|
20
|
+
fs.rmSync(destDir, { recursive: true });
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
fs.mkdirSync(publicDir, { recursive: true });
|
|
24
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
25
|
+
|
|
22
26
|
function copyRecursive(src, dest) {
|
|
23
27
|
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
24
28
|
for (const e of entries) {
|
|
25
29
|
const srcPath = path.join(src, e.name);
|
|
26
30
|
const destPath = path.join(dest, e.name);
|
|
27
31
|
if (e.isDirectory()) {
|
|
28
|
-
|
|
32
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
29
33
|
copyRecursive(srcPath, destPath);
|
|
30
34
|
} else {
|
|
31
35
|
fs.copyFileSync(srcPath, destPath);
|
|
@@ -34,4 +38,4 @@ function copyRecursive(src, dest) {
|
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
copyRecursive(sourceDir, destDir);
|
|
37
|
-
console.log(`[react-godot-shader-preview] Copied godot export to
|
|
41
|
+
console.log(`[react-godot-shader-preview] Copied godot export to public/${embedFolderName}/`);
|