Git Product home page Git Product logo

cordova-app-hello-world's Introduction

Apache Cordova Hello World Application

NPM

A simple Hello World application that serves two purposes:

  • It is used as the default app template when creating new projects
  • It is a reference for building and publishing custom Cordova Templates

Structure of your template

template_package
├── package.json (for your template package to be published on npm)
├── index.js
└── template_src (contains template files)
    ├── package.json
    ├── config.xml
    └── (files and folders that make up the template)

Outside of template_src

All files outside of template_src are used to define parameters about the template. These files are not copied over at creation, so feel free to add a README or any other files outside of template_src.

index.js

index.js points to where the template exists. You'll see that index.js usually looks like:

const path = require('path');

module.exports = {
    dirname : path.join(__dirname, 'template_src')
};

package.json

This package.json holds information about the template itself like its name, version etc. All templates should contain the keyword "cordova:template" so that the template is searchable on npm. For example:

{
    "name": "cordova-example-template",
    "version": "1.0.0",
    "...": "...",
    "keywords": [
        "cordova:template"
    ]
}

Inside of template_src

All files inside of template_src compose the template from which a user would desire in order to create their project. Everything in this folder is copied over to the created project.

The package.json in template_src should be filled with information that describes the project that would be created from the template.

If you want to include .gitignore files in your template, you have to name them gitignore (without a leading dot) instead. They will be renamed to .gitignore upon template expansion.

cordova-app-hello-world's People

Contributors

agrieve avatar audreyso avatar brianleroux avatar carynbear avatar cmarcelk avatar dpogue avatar erisu avatar faisal211 avatar filmaj avatar gasp avatar jamesjong avatar janpio avatar jsoref avatar lmnbeyond avatar marti1125 avatar mmocny avatar mosabab avatar mwbrooks avatar nikhilkh avatar niklasmerz avatar purplecabbage avatar raphinesse avatar sarangan12 avatar sgrebnov avatar shazron avatar stevengill avatar timbru31 avatar yoheishimomae avatar zalun 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  avatar  avatar  avatar  avatar  avatar  avatar

cordova-app-hello-world's Issues

cordova-plugin-whitelist inconsistency in config.xml vs package.json

I discovered that if I do cordova create the generated project has cordova-plugin-whitelist in config.xml but not package.json.

My understanding is that the config.xml support will be dropped in a future release.

I can think of the following possible solutions:

  • fix Cordova to include cordova-plugin-whitelist in package.json as well as config.xml (possible in a patch release)
  • Do not include cordova-plugin-whitelist in the generated project; let the app developer add the cordova-plugin-whitelist plugin if needed (should be considered for a major release)

Add Github actions example

Feature Request

Motivation Behind Feature

It would be nice to have a working example of how to produce application distribution packages via Github Actions.
For instance using this existing action (for APK) : https://github.com/oxr463/setup-cordova

Feature Description

Please add an example Github action workflow to assemble the Cordova application and release it as a Github download.
This is helpful to automate the assembly and distribution of one's application.

Alternatives or Workarounds

Currently, users have to build their application locally, then upload it to Github or an application store of their choice.

Make it easier to use this app for simple reproductions of bugs

When a user has a bug with some plugin, we often ask them to create a new project using cordova create (which will use this template by default). Currently it is not very easy to adapt the layout and content to for example add a few buttons or output of some values because of the design. Also it is not super easy to add JS code in the correct place of the setup.

Remove whitelist from default template

Feature Request

Motivation Behind Feature

Correct me if I am wrong but the whitelist plugin is now integrated into cordova-android & cordova-ios. So we should be able to remove it from the default template to avoid any warnings with new apps that use these new platforms.

Feature Description

Just remove the plugin from package.json?

"cordova-plugin-whitelist": "^1.3.4"

Alternatives or Workarounds

Simplify the generated Cordova project

Feature Request

What

Motivation Behind Feature

I have seen too many app developers write convoluted JavaScript starting with the object in the generated app.js file. In contrast, recent versions of React / React Native seem to generate more functional JavaScript, IIRC.

I think that in general, the main Cordova JavaScript function should do something like document.addEventListener('deviceready', appMainStartupFunction) wherever approapriate. Clean and simple.

Feature Description

See What

Alternatives or Workarounds

  • Document the cleaner, more functional approach somewhere

config.xml typo - <access allow="">?

Bug Report

In config.xml, should <access allow="..." /> tag instead be <access origin="..." /> ? I don't see any reference to "allow" attribute in the docs.

Problem

Typo

Version information

Cordova 11

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

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.