Coder Social home page Coder Social logo

ember-cli-cordova's Introduction

ember-cli-cordova Build Status Gitter

I will not be focusing on backward compatibility with older ember-cli versions as it's moving too fast and the API is constantly changing. I will always have this working with the latest stable release of ember-cli.

Goals

To provide a toolchain tightly integrated with ember-cli to make developing hybrid apps with cordova and ember as simple as possible.

Supported Platforms

Android and iOS. While we don't plan on actively supporting other platforms, feel free to open an issue or submit a pull request.

Required Ember Versions

Releases as of 0.1.0 require Ember 2.x and ember-cli 2.3.0.

The lastest release for Ember 1.x is 0.0.19 and requires at least ember-cli >= 0.1.1

Getting Started

Please see our Getting Started guide here

Blueprints

  • ember g cordova-init com.reverse.domain --platform=android Required generator that sets up the cordova project with a few tweaks to the ember app
  • (optional) ember g cordova-starter-kit Adds some packages and files that makes up the base setup for projects I develop.

Commands

  • ember cordova:open open xcode project
  • ember cordova:build --environment=production --platform=ios build cordova project
  • ember cordova:archive 0.0.2 --environment=staging --commit --tag archive ios project with xcode
  • ember cordova:prepare needs to be run after cloning a project
  • ember cordova Passes commands(plugin(s), platform(s), run, emulate) and arguments to the cordova command
  • ember help ember cli help with a section for addon provided commands as well

Docs

Documentation can be found found in the docs directory here.

ember-cordova

ember-cordova recently started as a fork of ember-cli-cordova by some contributors and maintainers. It only supports Ember 2, and includes added features such as build hooks, native splash screen & icon management, a platform service (e.g. isIOS) and an ember/cordova plugin ecosystem.

ember-cli-cordova will still be maintained and active.

It does not include features such as mobiletouch by default, starter blueprints and support for Ember <2. For these items, your best bet is to continue with ember-cli-cordova.

Dependency Docs

Contributing

Working with master

git clone https://github.com/poetic/ember-cli-cordova.git
cd ember-cli-cordova
npm i && bower i
npm link
ember new CordovaTest
cd CordovaTest
npm install --save-dev ember-cli-cordova
npm link ember-cli-cordova

After this, any changes you make to the cloned repo will be instantly reflected in the test app you generated. It just symlinks the node_modules folder.

Example App

You can find an example app using this here: jakecraige/ember-cli-cordova-example-app

Credits

ember-cli ember

ember-cli-cordova's People

Contributors

0000marcell avatar alexblom avatar andressrg avatar anulman avatar benjaminedwardparker avatar billybonks avatar bryanh avatar danielochoa avatar deepflame avatar dukex avatar greis avatar huafu avatar jakecraige avatar jbrown avatar jcowley avatar jhilden avatar jwade34 avatar kiwiupover avatar machty avatar matthewford avatar osxi avatar runspired avatar schmooie avatar spruce avatar zigomir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-cordova's Issues

Ideas?

I want to open up this issue for anyone who has any ideas of features that should be added to this project. I feel that it's in a pretty good place but would love to expand on it and make it even more useful.

So if you have any ideas that you think should be added please leave a comment and we can discuss!

Check for dist folder before running ember cordova commands

It would be nice if the ember cordova commands checked for the existence of the dist/ folder before trying to run. This would prevent errors such as 'Current working directory is not a Cordova project'. If the folder is not detected them ember cordova could run ember build to create the folder and then continue with its command.

Compatibility with PhoneGap

Disclaimer: I'm fairly ignorant of the implications of the Cordova/PhoneGap separation, so this might be out of scope for this project.

I just started an Ember-based PhoneGap app. I'm excited to use ember-cli, but my team is more excited about the PhoneGap live-reload thing.

Finding this project seemed like the perfect bridge between the two worlds, but it seems just one step short of what we ultimately need, which is to have all of the dist files end up in the www/ directory.

Is there a simple way to extend this project to conform to PhoneGap's expectations (AFAIK, just that built files end up under www/)?

Perhaps more importantly, is there a more fundamental mismatch between the existing Cordova target and my desired PhoneGap target?

My ideal use case is to use ember serve to live-reload in my browser while using phonegap serve to live-reload on my device.

v0.0.9?

Could you guys tag and release 0.0.9?

HEAD master works great but 0.0.8 causes an infinite recursion with ember-cli 0.0.45.

Add a Task object to extend from

It's weird that all of my tasks return an anon function that I have to execute to return the promise. It may be good to add a Task object that has some sort of run method on it

git does not carry over symlinks when cloning repo

I cloned a repo onto my computer and I notice that the symlink, of course, is broken, but since it points to a dist folder that I do not have I cannot restore the link. Looking in bitbucket I see that the repo does have the symlink path but I understand that git will not add the destination's contents to the repo. The merges folder is also not carried over.

When I try ember-cdv build from the project's root it tells me that the directory is not a Cordova-based project.

When I try ember server from the ember directory I am told
'cannot find module ember-cli/lib/broccoli/ember-app'

Improve testing story

I need to figure out how to write some tests for this. I want to use mocha but I'm somehow going to need to mock out how ember-cli works as well as cordova since I don't want to have to download all the packages and stuff to do it and make testing slow.

ember cordova:init when fails it causes app/router.js to disappear

In windows 7 i have to be an administrator in order to create symlinks. If i don't do this i get a failure. The interesting issue here is that when ember-cli-cordova fails, router.js disappears.

ember new foo
cd foo
npm install --save-dev ember-cli-cordova

Now router.js exist.

After this command the router.js disappears:

C:\Users\davidga\Desktop\ember\foo>ember cordova:init com.exlibris.nextgen --pla
tform android
version: 0.0.39

Installing npm dependencies...done
Removing default ember-cli files...done
Copying custom ember files to new ember-cli project...done
Update index.html with cordova.js ...done
Creating Cordova project...done
Copying default cordova hooks to cordova project...done
Adding ios platform to cordova...
Error thrown while running shell command

Error: Command failed: Error: C:\Users\davidga.cordova\lib\ios\cordova\3.5.0\bi
n\create: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Users\davidga\Desktop\ember\foo\node_modules\em
ber-cli-cordova\node_modules\cordova\node_modules\cordova-lib\src\cordova\supers
pawn.js:135:23)
at ChildProcess.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:807:12)

at ChildProcess.exithandler (child_process.js:647:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
Update config.xml with your project settings...done
Symlinking ember dir to cordova www...done


It may be connected with the issue #37 but i cannot check it because i have not the ability to build ember-cli-cordova from master.
May you please make a new release with the fix of the issue #37 and i will check if the issue persists?

Open Command

Ember cordova:open should support all platforms supported by cordova

  • android
  • ios
  • blackberry10
  • Firefox OS
  • Ubuntu
  • Windows Phone 8
  • Amazon Fire OS

add open xcode command

add a command that will open the xcode project for you

  • ember-cdv open --platform ios

I'll just use open behind the scenes so this will be mac only for now

cordova:init - option for providing platform

In the current implementation of cordova:init it tries to create the ios platform. In our case we want to add android platform but not ios platform. It would be nice to have an option to tell cordova:init to add a specific platform. (maybe with the --platform option?)

Build scripts for archive / deploy

I'd like to have some scripts for building versioned archives

ember-cdv archive 0.4.1 --environment production|staging|development would do a few things

  • build project using ember-cdv build command with the environment passed through
  • run the archive command for the project
    • `cd platforms/ios && xcodebuild -scheme ProjectName archive

If you have the TestFlight program running with archive it'll popup and let you upload it to TestFlight.

A deploy script could be the same as archive(with env production) and you just have to open the xcode organizer to actually deploy it

Nice to have
App.io integration

  • i don't know if they have a command line tool to do it. They're Xcode plugin is nice but I'll have to look into this

problems with cordova:init

When i run the cordova:init on windows i get

C:\Users\davidga\Desktop\ember_test\my-new-app\config>ember cordova:init poetic.myapp
version: 0.0.39

Installing npm dependencies...done
Removing default ember-cli files...done
Copying custom ember files to new ember-cli project...done
Update index.html with cordova.js ...done
Creating Cordova project...done
Copying default cordova hooks to cordova project...done
Adding ios platform to cordova...
Error thrown while running shell command

Error: Command failed: Error: C:\Users\davidga.cordova\lib\ios\cordova\3.5.
n\create: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Users\davidga\Desktop\ember_test\my-new-app
e_modules\ember-cli-cordova\node_modules\cordova\node_modules\cordova-lib\sr
rdova\superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:787:12)

at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)

Update config.xml with your project settings...done
Symlinking ember dir to cordova www...done


All Done. Enjoy :)

This looks like an error. I don't find a way to add just an android platform.

When i try afterwards to add the android platform i get
C:\Users\davidga\Desktop\ember_test\my-new-app\config>ember cordova:build --envi
ronment production --platform android
version: 0.0.39

Symlinking ember dir to cordova www...done
Building cordova project for platform android with environment production...
Error thrown while running shell command

Error: Command failed: Current working directory is not a Cordova-based project.

at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

What can i do?
I use the latest ember--cli(0.39) and the latest ember-cli-cordova

ember init adds code to application

Hi,

I have an application which i want to convert into a cordova application.

When running:

ember cordova:init com.x.a --platform android

there is a lot of code which is added.
As i see in the code it adds the ember-animated-outlet-mobile project.
This is not what all the people want. At least part of them just want their project converted into a cordova project.

It is unclear which code is really needed for cordova and which code was added as a template for an example project.

How do i just get a cordova project with my www application without that it adds code like modal etc.

Thanks,
David

Link environment creates an absolute symlink

The cordova/www symlink is created and committed with an absolute path.

i.e. cordova/www -> /Users/someone/Code/some-project/dist

This leads to some confusion when cloning on other people’s machines.

Ideally it should be cordova/www -> ../dist.

Incredible addon by the way. Thanks so much for your hard work.

Windows 7 android app

cordova platform add android on windows 7 64 throws error

version: 0.0.40

Running 'cordova platform add android'...
Error thrown while running shell command

Error: Command failed:
at ChildProcess.exithandler (child_process.js:647:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Socket. (child_process.js:966:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)

Open android project command

I would like to have a command to open up an android project, whether eclipse, android studio, etc from the command line. But I have no idea how to do this and quick googling doesn't work. If anyone wants to submit a pr for this or simply tell me how I'd be glad to add it

Add access to cordova's useful commands

  • plugin
  • platform
  • run
  • emulate

It's annoying to have to cd into the cordova directory and just confusing to people who aren't aware. I'll add a "proxy" command that passes in the argument to the cordova command so that you don't have to cd into the cordova dir

Error thrown while running shell

Getting a cryptic error while building a project.

Error thrown while running shell command

Error thrown while setting up project:

Any ideas on what's happening? I'll try to send a PR if I find the issue.

After debugging this more, it's happening while setting up Ember (specifically when installing the npm dependencies) resulting in:

[TypeError: invalid data]

Edit: I guess the first error was a permission issue, but running any command, after the project is generated, fails (ember-cdv build, for example). Running the command natively errors at: Current working directory is not a Cordova-based project.

Gitignore

I’m unsure which bits of the cordova directory should and shouldn’t be under version control but it seems like there are some build artefacts we could definitely gitignore. Could the generator add some best practice entries to the project .gitignore?

environment variable is misnamed

created project with

ember-cdv new anthem com.poeticsystems.anthem --git

and got an ENV not defined error because it was named anthemENV instead of AnthemENV

Turn into Ember CLI Addon

waiting for PR to be accepted and I can work on implementing this. These are just thoughts of how I'm thinking it will be.

Usage changes:
You will generate a project using ember-cli normally, then you can run the generator for the cordova part of it. This potentially allows you to turn any cli app into a cordova compatible one

Command changes:

  • ember generate cordova com.poetic.myapp this is run inside of a cli app
  • ember cdv:build --environment production --platform ios build cordova project
  • ember cdv:archive 0.0.2 --environment staging --commit --tag archive ios project with xcode
  • ember cdv:prepare needs to be run after cloning a project

authorship/licensing concern

First let me say, this is a really cool project! Please read the rest of this issue while assuming a positive tone.

Although I love experimentation and do not want to stifle innovation, large amounts of this code-base originated from https://github.com/stefanpenner/ember-cli but have lost original authorship and licensing.

Some have nice little remarks: https://github.com/poetic/ember-cordova-cli/blob/master/lib/models/core-object.js#L1-L2 which I appreciate. It is likely best if the rest of the files which originated from ember-cli also had this shoutout. Until they have diverged significantly.

I would like to encourage you to continue to innovate.

I also acknowledge that ember-cli should begin to be broken into smaller modules so others can easily consume the parts they want.

Another idea would be to work on improving the addon extensibility of ember-cli: #28

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.