Skip to content

Commit 76303ce

Browse files
committed
Clean up generation script
1 parent b4312f8 commit 76303ce

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

js/scripts/generate-wrappers.js

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,26 @@ var CUSTOM_CLASSES = [
4444
'objects/Blackbox.js',
4545
];
4646

47+
var IGNORE_FILES = [
48+
'**/Three.Legacy.js', // Don't support legacy interface (deprecation should be done python side)
49+
'**/Three.js', // Don't process aggregrate file
50+
'**/polyfills.js', // Polyfill of JS methods, nothing to export
51+
'**/utils.js', // Utility functions, no objects to export
52+
'**/constants.js', // Processed into enums in separate script
53+
'**/animation/KeyframeTrackConstructor.js', // Sub-part of one object, ignore
54+
'**/animation/KeyframeTrackPrototype.js', // Sub-part of one object, ignore
55+
'**/audio/AudioContext.js', // JS API for audio, nothing to expose
56+
'**/geometries/Geometries.js', // index.js like file, nothing new here
57+
'**/materials/Materials.js', // index.js like file, nothing new here
58+
'**/renderers/WebGLRenderer.js', // For now, the internals of the webgl
59+
'**/renderers/WebGL2Renderer.js', // render is not exposed.
60+
'**/renderers/webgl/**',
61+
'**/renderers/shaders/**',
62+
'**/extras/core/Interpolations.js', // Only functions, nothing to export
63+
'**/extras/core/PathPrototype.js', // Sub-part of one object, ignore
64+
'**/textures/CanvasTexture.js' // Canvases are not referenceable from python
65+
]
66+
4767

4868
//
4969
// Templates
@@ -157,10 +177,10 @@ function relativePathToPythonImportPath(relativePath) {
157177
if (tokens.length <= 0) { return '.'; }
158178

159179
var result = '';
160-
if (firstToken == '.') {
180+
if (firstToken === '.') {
161181
tokens = tokens.slice(1);
162182
result = '';
163-
} else if (firstToken == '..') {
183+
} else if (firstToken === '..') {
164184
tokens = tokens.slice(1);
165185
result = '.';
166186
}
@@ -243,24 +263,7 @@ function mapPromiseFnOverThreeModules(mapFn) {
243263
return mapPromiseFnOverGlob('**/*.js', mapFn, {
244264
cwd: threeSrcDir,
245265
nodir: true ,
246-
ignore: [
247-
'**/Three.Legacy.js', // Don't support legacy interface (deprecation should be done python side)
248-
'**/polyfills.js', // Polyfill of JS methods, nothing to export
249-
'**/utils.js', // Utility functions, no objects to export
250-
'**/constants.js', // Processed into enums in separate script
251-
'**/animation/KeyframeTrackConstructor.js', // Sub-part of one object, ignore
252-
'**/animation/KeyframeTrackPrototype.js', // Sub-part of one object, ignore
253-
'**/audio/AudioContext.js', // JS API for audio, nothing to expose
254-
'**/geometries/Geometries.js', // index.js like file, nothing new here
255-
'**/materials/Materials.js', // index.js like file, nothing new here
256-
'**/renderers/WebGLRenderer.js', // For now, the internals of the webgl
257-
'**/renderers/WebGL2Renderer.js', // render is not exposed.
258-
'**/renderers/webgl/**',
259-
'**/renderers/shaders/**',
260-
'**/extras/core/Interpolations.js', // Only functions, nothing to export
261-
'**/extras/core/PathPrototype.js', // Sub-part of one object, ignore
262-
'**/textures/CanvasTexture.js' // Canvases are not referenceable from python
263-
],
266+
ignore: IGNORE_FILES,
264267
});
265268
}
266269

0 commit comments

Comments
 (0)