🛠 New framework7-cli feedback needed

This new CLI creates project with Framework7 v4, which is not recommended to use for production yet

I deleted the previous post because it is irrelevant. My English is bad and I read “you need to be root”
image
at least in Manjaro Linux (similar to ArchLinux) with root and sudo gives error, with common user installed correctly

  • Works on Manjaro Linux with Nodejs LTS downloaded from the web, with the package of yaourt gives permission error I do not know why (when there are permissions)

  • I also have an error:

    ERROR in ./src/js/app.js
    Module build failed (from ./node_modules/babel-loader/lib/index.js):
    SyntaxError: /home/user/node/f7cli/src/js/app.js: Unexpected token (11:18)

      9 | import '../css/app.css';
     10 | // Import Cordova APIs
    

    11 | import cordovaApp ‘./cordova-app.js’;
    | ^
    12 | // Import Routes
    13 | import routes from ‘./routes.js’;

but if I comment cordova on app.js, the app works correctly :
(cordova --version —> 8.1.2 ([email protected])

framework-cli options:
All good, you have latest framework7-cli version.
? What type of the app are you targeting? Cordova app (target native iOS and Android)
? App (project) name: f7app
? App package (Bundle ID): io.framework7.myapp
? Target Cordova platform: Android
? What type of framework do you prefer? Framework7 Core
? Choose starter template: Tabbed Views (Tabs)
? Should we setup project with bundler? Webpack (recommended)
? Do you want to specify custom theme color? No, use default color theme

Runs without errors on node.js LTS + Windows (ui+cordova+vue-webpack), thanks! I recommend to write about node.js LTS in README.md, it’s possible for someone to have the same bug.

1 Like

Just tried again and same issue - I assume that ‘framework7 create’ will invoke the latest version?
Hope this helps…

No, you should update it as npm i framework7-cli@beta -g

Thanks, issue with cordova app fixed

Sorry, just realised that a few seconds before your post. Just tried again and spaces in folder names are accepted.
This is a brilliant tool!!

Have a good new year, everybody!

For me (new machine, cordova 8.1.2, node 11.6.0) framework7 create --ui doesn’t do anything.

$ npm install -g framework7-cli@beta
/usr/local/bin/framework7 -> /usr/local/lib/node_modules/framework7-cli/index.js

> [email protected] install /usr/local/lib/node_modules/framework7-cli/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.0/libvips-8.7.0-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=11.6.0 runtime=node arch=x64 platform=darwin)
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
  CXX(target) Release/obj.target/sharp/src/operations.o
  CXX(target) Release/obj.target/sharp/src/pipeline.o
../src/pipeline.cc:1020:8: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
      [this](sharp::InputDescriptor *joinChannelIn) {
       ^
1 warning generated.
  CXX(target) Release/obj.target/sharp/src/sharp.o
  CXX(target) Release/obj.target/sharp/src/utilities.o
  SOLINK_MODULE(target) Release/sharp.node
+ [email protected]

After that issuing another framework7 create --ui doesn’t do anything. Re-installing fixed the problem (note: this maybe due to the fact, the machine is new).

Re-try:
After issuing again framework7 create --ui installation worked partially, but

Generating package.json
✔ Generating package.json
Creating required folders structure
✔ Creating required folders structure
Installing NPM Dependencies (Please wait, it can take a while)
✔ Installing NPM Dependencies
Installing NPM Dev Dependencies (Please wait, it can take a while)
✔ Installing NPM Dev Dependencies
Creating project files

X ERROR

Here’s the console output:

✔ All good, you have latest framework7-cli version.
✔ Launching Framework7 UI server

Framework7 CLI UI is running on http://localhost:3001 (CTRL + C to exit)
TypeError: Cannot read property 'indexOf' of undefined
    at module.exports (/usr/local/lib/node_modules/framework7-cli/create-app/templates/copy-assets.js:24:26)
    at module.exports (/usr/local/lib/node_modules/framework7-cli/create-app/index.js:108:23)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

Some more questions:

  • Is there some more docu on framework7-cli?
  • How do I retrieve the version I’m currently using (framework7 --version doesn’t seem to work)?
  • Is there a way to auto-generate a set of manifest-entries for PWA?
  • How would I specify which items to auto-generate? (Or am I supposed to do that later?)

thx - looks promising

Folder cleared and all OK.

Seems working perfectly in Windows with CLI and UI.

Amazing job! many thanks!

Yes, I did clear the folder. Btw. there was only 1 file created sharp_<something>. After re-installing it worked up to the point where X ERROR appeared

framework7 create (working)
framework7 create --ui (not working)

Distro: Manjaro Linux
cordova: 8.1.2
node: v10.15.0

framework7 create --ui
✔ All good, you have latest framework7-cli version.
✔ Launching Framework7 UI server
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::3001
    at Server.setupListenHandle [as _listen2] (net.js:1290:14)
    at listenInCluster (net.js:1338:12)
    at Server.listen (net.js:1425:7)
    at Function.listen (/opt/node-v10.15.0-linux-x64/lib/node_modules/framework7-cli/node_modules/express/lib/application.js:618:24)
    at module.exports (/opt/node-v10.15.0-linux-x64/lib/node_modules/framework7-cli/ui/server.js:127:7)
    at Command.program.command.option.description.action (/opt/node-v10.15.0-linux-x64/lib/node_modules/framework7-cli/index.js:38:7)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Emitted 'error' event at:
    at emitErrorNT (net.js:1317:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)

the command does not generate any file. If you need any information, please let me know.

This issue is fixed in latest beta 14

Means localhost:3001 address is already in use (taken) by other process, or you try to run framework7-cli UI multiple times.

In latest update it is possible to specify the port with

framework7 create --ui --port 8080

Not yet, will be with stable release

From beta 14, framework7 --version will work

If you use webpack, then it will auto generate required PWA cache entries. If you mean manifest icons, you can generate them by using framework7 generate-assets command

ok! with --port 8080 works perfectly. With port 3001 is working to. it happened what you said, I was testing and surely the port was in use.

I’m probably just missing something… I just see blank app on my browser after I run “nmp run dev”, eventhough it looked like the built was successful (command line says - 「wdm」: Compiled successfully).

Would be good to see, all commands and what questions did you choose? Also, your system + Node.js version

I had that problem too. It was because I used an older node-version (8.6.x). Updating to the current node-version helped