Confusing Structure of Plugins and Platforms Folder - ionic-framework

I am using Ionic framework to start on a Cordova hybrid mobile application.
Installing Ionoic via NPM was successful and had no issues.
I am running the below command in a directory as shown below.
C:\wamp\www\my_cordova\> ionic start myapp
This creates a new folder called myapp inside my_cordova folder, which is fine.
But it also creates the plugins folder in C:\wamp\www\ folder. This is the case always how much deeper I create the folder structure. Even if I start a project in C:\wamp\www\my_cordova\level1\, still the plugins folder is created in C:\wamp\www\ folder.
The same happens for platforms folder too when I add them. They are created in C:\wamp\www\ folder.
Is this expected or is it something wrong from my side? I expect all the folders(plugins and platforms) to be created within the same folder directory where I start the ionic project.

It's a problem with the CLI. As the path has "www" in it, these issues happened.
When I tried the CLI commands in another path which does now have www in it, all went fine.

Related

How to add a second example app to a Flutter plugin project?

When creating a plugin project in Flutter, an example app, that is using the plugin, is added in a subfolder of the plugin project. What needs to be done to add a second "example" app to the plugin folder?
So far I have:
Copied and renamed the example folder to (let's call it) app2.
Adjusted the package names at the android manifest files of app2.
Renamed pluginrootfolder/app2/pluginname_example.iml to pluginrootfolder/app2/pluginname_app2.iml (to reflect the name of the second app).
In the .iml file of the plugin project (the root folder):
Copied and adjusted the exclude folder directive to reflect app2
<excludeFolder url="file://$MODULE_DIR$/app2/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/app2/.pub" />
<excludeFolder url="file://$MODULE_DIR$/app2/build" />
Run Flutter clean and Flutter pub get in both the plugins root directory and app2's directory.
Problem now is that app2 causes 1k+ Target of URI doesn't exist: error messages - from packages (like provider and json_annotation) to classes in the plugin's root project.
Do you have any ideas what's wrong here or how to fix it?
Firstly, please give a full GitHub reproducible repository and link it here so I can examine. And also paste (e.g. using github gist) the long log. Please comment to this answer so I can examine more.
"In the .iml file of the plugin project (the root folder)" - indeed not that needed. iml is for intellij idea, and is unrelated to flutter. so should not error even with wrong iml. You can even safely delete iml and when you import that module in intellij it will auto recreate.
Have you modified pubspec.yaml? e.g. the package name in it.
And, where is your plugin located, relative to your app2? In example app, the default pubspec.yaml uses path: ../ to point to your plugin. So if your app2 does not have .. as the plugin path you should change this as well.
Anyway, paste your log and give a reproducible sample please...
I suspect your issue is in the dependency tree. Your example2 project does not seem to point to the project above it. The only manual edits you need are in the pubspec.yaml. In the dependencies for the second example project.yaml file, include the path to the root project. For example:
dependencies:
<YOUR_ROOT_PROJECT>:
path: ../
flutter:
sdk: flutter
Including that should map the decencies of the root over with pub.get.
That should take care of the Target of URI doesn't exist errors.
Since you are using .iml files, I assume you're using an IntelliJ/JetBrains IDE. Creating example subprojects can be done without all of the manual work you listed.
You don't have to copy the files themselves manually to create a second example. You can simply right-click on the project root and select new module. Choose Flutter. The project type is Application.
Secondly, you don't have to add the second project to the exclude folders.

what is the roles of folder www, page, src in an ionic project?

I am new in ionic. I found in some ionic project, there is no src(app & pages) folder, but only is www folder.
After checking some sample ionic projects, it seems the src folder contents the similar components as www folder.
Could you please explain the differences between these folders, are they can be used together? If there is some detailed introduction for ionic framework architecture, it will be really appreciated.
The src folder contains your raw, uncompiled code, the files you need to edit in order to build your app. It'll hold all your pages, components, pipes, services, themes, assets, images.
The www is simply your compiled code, every time you build your project the www content is erased and built again, so there's no need to change anything in this folder. If you want to deploy for web one of the ways is using the code that's inside www folder.
The project you've found with no src folder must be an early version of ionic 2, i remember ionic 2 rc6 was already using src folder, so this project is using a version released before November 2016.
You can learn more about the structure here.
Hope this helps.

Javascript Protractor - Is there any solution to run protractor test with remote node_modules?

I'm writing automation test for the angularjs web app. Using protractor and cucumber.
From beginning, I organized the test as a separate folder and actually it required different node packages from the root project(the project built up the web app).
Today there's a requirement that the node_modules of test project should be merged with the node_modules of root project.
As per my knowledge, when running the command protractor protractor_conf.js, the system looks for the node_modules in 1 level upstream folder.
I'm attaching the screenshot of my project folder to be clearer.
Appreciate all suggestions !
Thanks.
I will not recommend you not to save node_modules as the separate folder in the project directory. Instead, you can create a package.json file for your test project and list all the dependencies in the package.json file. so each time before you run protractor conf.js ,just run npm install command from the directory where your project is available. So by doing this way will help you to run the e2e scripts in different machines without depending on the node_modules folder.
Example package.json for protractor
Also, it is advisable to maintain separate node_modules for different project because it may avoid versions conflicts of any node_module that is used in both projects.

Specify deployment path when deploying to GAE?

I have a GWT app that runs locally using GAE GoogleAppEngine already. Everything works fine and is deployed to the war folder src/main/webapp.
appengine.xml is located at: src\main\webapp\WEB-INF\appengine-web.xml
Problem: when I rightclik project > Google > Deploy to App Engine, then Eclipse tells me that appengine-web.xml could not be found under target\project-0.0.1-SNAPSHOT\WEB-INF. Which is true as this only contains the classes folder. BUT why is this target folder generated at all?
When deploying locally, everything is just placed in src\main\webapp and works fine. How can I tell the Eclipse Google Plugin to look at this location, and not at target`?
Found it:
search for "target" on the whole project, which should bring up 2 config files: org.eclipse.wst.common.component, com.google.gdt.eclipse.core.prefs. replace the target path with: "/src/main/webapp"...

Running Rails in Rubymine from subproject

I'm using RubyMine 3.1.1 with Rails 3.0.9.
I have the Spree project cloned from Github, and I want to debug the server while working on the code. To do this, Spree includes a sandbox rake command that creates a subfolder (called sandbox) that contains an instance of the rails app, one that refers to the parent directory containing the source as its spree gem.
If I close the original project and open the sandbox subfolder as a new probect, I get the correct run configurations for development and production and I can successfully debug. However, this doesn't let me edit the spree code in the parent directory.
If I'm in the parent directory, the subfolder is there of course, but there's no rails run configurations and you can't add one as it says there is no rails server launcher in the project (or some facsimile of that message).
Anyone know how to make RubyMine recognize the run configurations for a subfolder?
I ran across this conversation that resolved a very similar issue to what you're reporting.
The gist is that you can go into settings | project structure and then add your subdirectory as a source root. Then you can set up your run configuration with that subdirectory instead of the project root.