qooxdoo / qxl.apiviewer

qooxdoo apiviewer app
https://qooxdoo.org/qxl.apiviewer
MIT License
5 stars 5 forks source link

apiviewer does not work #49

Closed peuter closed 4 months ago

peuter commented 1 year ago

I created an empty qx application with the steps described in the documentation:

mkdir myapp
cd myapp
npm init
npm install --save-dev @qooxdoo/framework
npx qx create myapp --type desktop --noninteractive --out=.
npx qx pkg update
npx qx pkg install qooxdoo/qxl.apiviewer
npx qx serve -S

The compiling shows a lot of warnings and errors:

Making applications...
>>> Making the applications...
qx.tool.cli.Application: [36,8] warning: Unresolved use of symbol process.exit
qx.tool.cli.Cli: [253,8] warning: Unresolved use of symbol process.exit
qx.tool.cli.Cli: [283,37] warning: Unresolved use of symbol process.argv
qx.tool.cli.Cli: [285,6] warning: Unresolved use of symbol process.title
qx.tool.cli.Cli: [301,8] warning: Unresolved use of symbol process.chdir
qx.tool.cli.Cli: [649,15] warning: Unresolved use of symbol process.argv.indexOf
qx.tool.cli.Watch: [286,16] warning: Unresolved use of symbol setImmediate
qx.tool.cli.api.AbstractApi: [70,26] warning: Unresolved use of symbol process.cwd
qx.tool.cli.commands.Compile: [681,12] warning: Unresolved use of symbol setImmediate
qx.tool.cli.commands.Es6ify: [100,10] warning: Unresolved use of symbol process.cwd
qx.tool.cli.commands.Es6ify: [113,10] warning: Unresolved use of symbol process.exit
qx.tool.cli.commands.package.List: [450,14] warning: Unresolved use of symbol process.cwd
qx.tool.cli.commands.package.Update: [330,12] warning: Unresolved use of symbol manifest_path
qx.tool.compiler.makers.Maker: [131,29] warning: Unresolved use of symbol process.cwd
qx.tool.compiler.resources.Asset: [81,8] warning: Unresolved use of symbol process.cwd
qx.tool.compiler.resources.ScssConverter: [30,13] warning: Unresolved use of symbol loadSass
qx.tool.compiler.resources.ScssFile: [31,13] warning: Unresolved use of symbol loadSass
qx.tool.config.Utils: [200,34] warning: Unresolved use of symbol __dirname
qx.tool.utils.Website: [37,13] warning: Unresolved use of symbol loadSass
qx.tool.utils.files.Utils: [259,10] warning: Unresolved use of symbol process.platform
Assets required for webfont MaterialIcons are not available in application myapp, consider using @asset to include qx/iconfont/MaterialIcons/materialicons-v126.eot,qx/iconfont/MaterialIcons/materialicons-v126.woff2,qx/iconfont/MaterialIcons/materialicons-v126.woff,qx/iconfont/MaterialIcons/materialicons-v126.ttf
Assets required for webfont MaterialIconsOutlined are not available in application myapp, consider using @asset to include qx/iconfont/MaterialIcons/materialiconsoutlined-v101.eot,qx/iconfont/MaterialIcons/materialiconsoutlined-v101.woff2,qx/iconfont/MaterialIcons/materialiconsoutlined-v101.woff,qx/iconfont/MaterialIcons/materialiconsoutlined-v101.otf
Assets required for webfont MaterialIconsRound are not available in application myapp, consider using @asset to include qx/iconfont/MaterialIcons/materialiconsround-v100.eot,qx/iconfont/MaterialIcons/materialiconsround-v100.woff2,qx/iconfont/MaterialIcons/materialiconsround-v100.woff,qx/iconfont/MaterialIcons/materialiconsround-v100.otf
Assets required for webfont MaterialIconsSharp are not available in application myapp, consider using @asset to include qx/iconfont/MaterialIcons/materialiconssharp-v101.eot,qx/iconfont/MaterialIcons/materialiconssharp-v101.woff2,qx/iconfont/MaterialIcons/materialiconssharp-v101.woff,qx/iconfont/MaterialIcons/materialiconssharp-v101.otf
Assets required for webfont MaterialIconsDuoTone are not available in application myapp, consider using @asset to include qx/iconfont/MaterialIcons/materialiconstwotone-v104.eot,qx/iconfont/MaterialIcons/materialiconstwotone-v104.woff2,qx/iconfont/MaterialIcons/materialiconstwotone-v104.woff,qx/iconfont/MaterialIcons/materialiconstwotone-v104.otf
Writing application myapp
[BABEL] Note: The code generator has deoptimised the styling of /home/tobiasb/develop/tmp/myapp/node_modules/terser/dist/bundle.min.js as it exceeds the max of 500KB.
Unable to browserify - this is probably because a module is being require()'d which is not compatible with Browserify: Cannot find module 'babel-preset-es2015'
Require stack:
- /home/tobiasb/develop/tmp/myapp/node_modules/@babel/core/lib/config/files/plugins.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@babel/core/lib/config/files/index.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@babel/core/lib/index.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@qooxdoo/framework/lib/compiler/index.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@qooxdoo/framework/bin/deploy/qx while parsing file: /home/tobiasb/develop/tmp/myapp/node_modules/replace-in-file/index.js
Unable to browserify - this is probably because a module is being require()'d which is not compatible with Browserify: Line 72: Unexpected token = while parsing file: /home/tobiasb/develop/tmp/myapp/node_modules/@foliojs-fork/fontkit/index.js
DEPRECATED: Using the Qooxdoo v5 style of SASS Compilation; this is backwards compatible but the default will change in v7 to use the new style (see https://git.io/JfTPV for details, and how to disable this warning).
Deprecation Warning on line 120, column 11 of node_modules/@qooxdoo/framework/source/resource/qx/mobile/scss/common/_gradients.scss: 
This operation is parsed as:

    $i + 1

but you may have intended it to mean:

    $i (+1)

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
    ╷
120 │       $i: $i +1;
    │           ^^^^^
    ╵

Writing application apiviewer
[BABEL] Note: The code generator has deoptimised the styling of /home/tobiasb/develop/tmp/myapp/node_modules/terser/dist/bundle.min.js as it exceeds the max of 500KB.
Unable to browserify - this is probably because a module is being require()'d which is not compatible with Browserify: Cannot find module 'babel-preset-es2015'
Require stack:
- /home/tobiasb/develop/tmp/myapp/node_modules/@babel/core/lib/config/files/plugins.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@babel/core/lib/config/files/index.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@babel/core/lib/index.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@qooxdoo/framework/lib/compiler/index.js
- /home/tobiasb/develop/tmp/myapp/node_modules/@qooxdoo/framework/bin/deploy/qx while parsing file: /home/tobiasb/develop/tmp/myapp/node_modules/replace-in-file/index.js
Unable to browserify - this is probably because a module is being require()'d which is not compatible with Browserify: Line 72: Unexpected token = while parsing file: /home/tobiasb/develop/tmp/myapp/node_modules/@foliojs-fork/fontkit/index.js
>>> Compiled 1058 classes in 01m 84.997s
Applications are made
Web server started, please browse to http://localhost:8080

When I open the apiviewer in the browser it does not load, on the browser console I see the error:

index.js:54241 Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
    at Object.init (index.js:54241:23)
    at index.js:254731:13

Which points to this line: l.parts[l.boot].forEach(function(pkg) { and l.parts is empty.

Trying to fix that by adding parts to the config.json:

"parts": {
        "boot" : {
          "include": [
            "qx.*"
          ]
        },
        "tool" : {
          "include": [
            "qx.tool.*"
          ]
        }
      }

Just leads to new errors:

Decoration.js:23 Uncaught TypeError: Cannot read properties of undefined (reading 'MDecoration')
    at Decoration.js:23:21
    at Decoration.js:1:58
(anonym) @ Decoration.js:23
(anonym) @ Decoration.js:1
Button.js:49 Uncaught TypeError: Cannot read properties of undefined (reading 'Widget')
    at Button.js:49:21
    at Button.js:1:2
(anonym) @ Button.js:49
(anonym) @ Button.js:1
Class.js:848 Uncaught Error: Invalid key "extend" in class "qxl.apiviewer.ui.PackageTree"! The value is undefined/null!
    at Object._true [as __validateConfig__P_4_2] (Class.js:848:19)
    at Object.__defineImpl__P_4_1 (Class.js:209:16)
    at Object.define (Class.js:163:21)
    at PackageTree.js:29:10
    at PackageTree.js:1:60

The first error is related to the default setting "exclude": [ "qx.test.*",... but qx.theme.simple uses Mixins from qx.test., which is generally a bad idea. The should not exist dependencies from any "real" code to anything in "qx.test".

goldim commented 1 year ago

@peuter also tried to install apiviewer package in my app and got the error for first time. But has it ever worked this way?

peuter commented 1 year ago

It's the only documented way of getting the apiviewer for your own apps that I am aware of and it used to work, I have used it quite a while without having problems.

peuter commented 1 year ago

I doubt that the provided fix solves this problem. It only solves the missing "parts" section, but as I already mentioned, after adding it manually there are still errors that break the apiviewer.

Also in addition to that I tried to reproduce the problem once again and now I am not able to compile the apiviewer:

TypeError: /home/.../myapp/node_modules/@qooxdoo/framework/source/class/qx/tool/compiler/targets/Target.js: Property left of ForInStatement expected node to be of a type ["VariableDeclaration","LVal"] but instead got undefined
qx.tool.compiler.targets.Target: error: FATAL Syntax error: /home/.../myapp/node_modules/@qooxdoo/framework/source/class/qx/tool/compiler/targets/Target.js: Property left of ForInStatement expected node to be of a type ["VariableDeclaration","LVal"] but instead got undefined
qx.tool.config.Utils: [200,34] warning: Unresolved use of symbol __dirname
qx.tool.utils.Website: [37,13] warning: Unresolved use of symbol loadSass
qx.tool.utils.files.Utils: [259,10] warning: Unresolved use of symbol process.platform
Writing application myapp
Cannot write application 'apiviewer' because it has fatal errors

I am not able to re-open this issue, so I can only leave a comment.

EDIT: This issue has already been reported here: https://github.com/qooxdoo/qooxdoo/issues/10621

goldim commented 1 year ago

@peuter thank you for feedback. But my fixes did. I remember 100% apiviewer worked just fine with them. Now I can not start without errors. I tried different branches, local compilation and still no success. Possibly other problem with api viewer or framework.

goldim commented 4 months ago

Fixed since qooxdoo version of 7.7.1