p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Clean-up logging in build scripts

Open dhowe opened this issue 3 years ago • 7 comments

Not a critical issue, but there are massive numbers of warnings and debugging output in the bill scripts that make it difficult to tell if things are working correctly. Would be nice to clean these up. A bit of output is shown below but it even worse in the tests:


$ grunt
(node:47751) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:47751) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:47751) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
Running "yuidoc:prod" (yuidoc) task
Failed to find lines for {
  name: 'Shape',
  submodules: {
    '2D Primitives': 1,
    Curves: 1,
    Vertex: 1,
    '3D Primitives': 1,
    '3D Models': 1
  },
  elements: {},
  classes: {},
  fors: { p5: 1 },
  namespaces: {}
}
Failed to find lines for {
  name: 'Events',
  submodules: { Acceleration: 1, Keyboard: 1, Mouse: 1, Touch: 1 },
  elements: {},
  classes: {},
  fors: { p5: 1 },
  namespaces: {}
}
src/io/files.js:1388: method p5.save missing example
src/webgl/material.js:151: method p5.shader missing example
src/webgl/p5.Camera.js:187: method p5.createCamera missing example
src/webgl/p5.Camera.js:298: method p5.Camera.perspective missing example
src/webgl/p5.Camera.js:380: method p5.Camera.ortho missing example
src/webgl/p5.Camera.js:671: method p5.Camera.camera missing example
src/webgl/p5.Geometry.js:50: method p5.Geometry.computeFaces missing example
src/webgl/p5.Geometry.js:92: method p5.Geometry.computeNormals missing example
src/webgl/p5.Geometry.js:131: method p5.Geometry.averageNormals missing example
src/webgl/p5.Geometry.js:152: method p5.Geometry.averagePoleNormals missing example
src/webgl/p5.Geometry.js:245: method p5.Geometry.normalize missing example
src/webgl/p5.Shader.js:274: method p5.Shader.setUniform missing example
Start YUIDoc compile...
Scanning: src/, lib/addons/
Output: docs/reference/
YUIDoc compile completed in 0.778 seconds


dhowe avatar Mar 23 '21 09:03 dhowe

Would be happy to see the output cleaned up!

limzykenneth avatar Mar 23 '21 13:03 limzykenneth

@limzykenneth @dhowe If this issue is open, I would like to work on this. Can you suggest to me how to get started with it?

rt1301 avatar May 12 '21 11:05 rt1301

@rt1301 Sure, do go ahead and see if it can be cleaned up

limzykenneth avatar May 14 '21 20:05 limzykenneth

One of the errors occurring in the YUIDocs is:

Failed to find lines for {
  name: 'Shape',
  submodules: {
    '2D Primitives': 1,
    Curves: 1,
    Vertex: 1,
    '3D Primitives': 1,
    '3D Models': 1
  },
  elements: {},
  classes: {},
  fors: { p5: 1 },
  namespaces: {}
}

@limzykenneth What does the "line" key-value pair signifies in the YUI Documentation?

rt1301 avatar May 15 '21 11:05 rt1301

@rt1301 I'm not quite sure what you are referring to here. Can you elaborate a bit more?

limzykenneth avatar May 27 '21 10:05 limzykenneth

@limzykenneth In the data.json file we have all the p5.js reference functions written in this way:

"Structure": {
            "name": "Structure",
            "submodules": {},
            "elements": {},
            "classes": {},
            "fors": {
                "p5": 1
            },
            "namespaces": {},
            "module": "IO",
            "file": "src\\core\\main.js",
            "line": 1,
            "requires": [
                "constants"
            ]
        }

So what does "line":1 signifies in the YUI doc?

rt1301 avatar May 27 '21 10:05 rt1301

That is the line number of where the function/property is defined in the code file. In the example here it means line 1 of src/core/main.js file. It is used to let the link at the bottom of the reference entry on the website link to the correct line where the function/property is defined.

limzykenneth avatar May 27 '21 10:05 limzykenneth

Hi thanks for working on this. I'd like to bump up this issue for the upcoming 1.7.0 release. Since we have updated the release process, are there anything we need should resolve in this issue? @limzykenneth @rt1301

Qianqianye avatar Jun 30 '23 00:06 Qianqianye

The warnings are a bit different currently and I have looked into it and found the following:

Failed to find lines for {
  name: 'Events',
  submodules: { Acceleration: 1, Keyboard: 1, Mouse: 1, Touch: 1 },
  elements: {},
  classes: {},
  fors: { p5: 1 },
  namespaces: {}
}

This is due to YUIDoc expecting a line number for the "Events" module, I'm not entirely sure why it can't find it but it is non-functional anyway to can be ignored. I can try to look into cleaning it up.

src/core/p5.Element.js:18: unnamed public member

This is a regression due to changes made here. Can be fixed.

src/core/p5.Graphics.js:189: method p5.Graphics.createFramebuffer missing example
src/dom/dom.js:3325: method p5.MediaElement.connect missing example
src/dom/dom.js:3374: method p5.MediaElement.disconnect missing example
src/webgl/p5.Framebuffer.js:246: method p5.Framebuffer.pixelDensity missing example
src/webgl/p5.Framebuffer.js:268: method p5.Framebuffer.autoSized missing example
src/webgl/p5.Framebuffer.js:687: method p5.Framebuffer.createCamera missing example
src/webgl/p5.Framebuffer.js:866: method p5.Framebuffer.end missing example
src/webgl/p5.Framebuffer.js:979: method p5.Framebuffer.get missing example
src/webgl/p5.Geometry.js:91: method p5.Geometry.computeFaces missing example
src/webgl/p5.Geometry.js:134: method p5.Geometry.computeNormals missing example
src/webgl/p5.Geometry.js:172: method p5.Geometry.averageNormals missing example
src/webgl/p5.Geometry.js:193: method p5.Geometry.averagePoleNormals missing example
src/webgl/p5.Geometry.js:467: method p5.Geometry.normalize missing example
src/webgl/p5.RendererGL.Immediate.js:153: method p5.vertexNormal missing example

These are as they say, warnings on methods missing example code. These messages were added manually probably to catch cases where examples are missing in the documentation. If desired these can be removed as well but it is also a nice way to know which methods still need code example in its documentation.


All of the above can probably be fixed in time for 1.7.0 if desired.

limzykenneth avatar Jun 30 '23 21:06 limzykenneth

@Qianqianye @davepagurek I have solutions for all the messages identified above, we just need to decide whether we want to keep the missing example warnings or not. Let me know and I can file a PR after, would be good to get this PR in before the next release to fix the "unamed public member" warning as that will cause the documentation to not render correctly on next release.

limzykenneth avatar Jun 30 '23 21:06 limzykenneth

Thanks @limzykenneth. I think we can go ahead and fix this issue while keeping the missing example warnings for now. @nickmcintyre might be interested in following up with the missing examples for this year's SoD project.

Qianqianye avatar Jun 30 '23 22:06 Qianqianye