Skip to content

Commit 6feb00a

Browse files
author
Jaime Villegas
committed
App structure
1 parent 7e28f3c commit 6feb00a

File tree

729 files changed

+342864
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

729 files changed

+342864
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
platforms

.sourcemaps/0.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sourcemaps/1.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sourcemaps/2.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sourcemaps/main.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sourcemaps/main.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
11
# ionic3-woocommerce
2+
3+
## How to use this template
4+
5+
6+
Run
7+
```bash
8+
$ sudo npm install -g ionic cordova
9+
$ sudo npm install
10+
$ sudo ionic serve
11+
```
12+
13+
14+
## With the Ionic CLI:
15+
16+
Run in emulator
17+
18+
```bash
19+
$ ionic cordova run ios
20+
```
21+
22+
Substitute ios for android if not on a Mac.
23+
24+
25+
## Know issues
26+
27+
Problems with translations

config.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<widget id="com.ac.aldeabambu" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<name>Aldea Bambú</name>
4+
<description>Tienda en Linea</description>
5+
<author email="dev@ambarcode.com" href="http://www.ambarcode.com/">Ambar Code</author>
6+
<content src="index.html" />
7+
<access origin="*" />
8+
<allow-intent href="http://*/*" />
9+
<allow-intent href="https://*/*" />
10+
<allow-intent href="tel:*" />
11+
<allow-intent href="sms:*" />
12+
<allow-intent href="mailto:*" />
13+
<allow-intent href="geo:*" />
14+
<preference name="ScrollEnabled" value="false" />
15+
<preference name="android-minSdkVersion" value="16" />
16+
<preference name="BackupWebStorage" value="none" />
17+
<preference name="SplashMaintainAspectRatio" value="true" />
18+
<preference name="FadeSplashScreenDuration" value="300" />
19+
<preference name="SplashShowOnlyFirstTime" value="false" />
20+
<preference name="SplashScreen" value="screen" />
21+
<preference name="SplashScreenDelay" value="3000" />
22+
<platform name="android">
23+
<allow-intent href="market:*" />
24+
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
25+
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
26+
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
27+
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
28+
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
29+
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
30+
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
31+
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
32+
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
33+
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
34+
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
35+
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
36+
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
37+
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
38+
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
39+
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
40+
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
41+
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
42+
</platform>
43+
<platform name="ios">
44+
<allow-intent href="itms:*" />
45+
<allow-intent href="itms-apps:*" />
46+
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
47+
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
48+
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
49+
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
50+
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
51+
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
52+
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
53+
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
54+
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
55+
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
56+
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
57+
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
58+
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
59+
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
60+
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
61+
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
62+
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
63+
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
64+
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
65+
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
66+
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
67+
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
68+
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
69+
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
70+
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
71+
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
72+
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
73+
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
74+
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
75+
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
76+
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
77+
</platform>
78+
<engine name="android" spec="^6.2.3" />
79+
<engine name="ios" spec="^4.5.1" />
80+
<plugin name="cordova-plugin-admobpro" spec="^2.29.23" />
81+
<plugin name="cordova-plugin-device" spec="^1.1.4" />
82+
<plugin name="cordova-plugin-file" spec="^4.3.3" />
83+
<plugin name="cordova-plugin-file-transfer" spec="^1.6.3" />
84+
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.15" />
85+
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
86+
<plugin name="cordova-plugin-statusbar" spec="git+https://github.com/apache/cordova-plugin-statusbar.git" />
87+
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
88+
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
89+
<plugin name="onesignal-cordova-plugin" spec="^2.2.1" />
90+
</widget>

hooks/README.md

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<!--
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
#
20+
-->
21+
# Cordova Hooks
22+
23+
Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. Hook scripts could be defined by adding them to the special predefined folder (`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run serially in the following order:
24+
* Application hooks from `/hooks`;
25+
* Application hooks from `config.xml`;
26+
* Plugin hooks from `plugins/.../plugin.xml`.
27+
28+
__Remember__: Make your scripts executable.
29+
30+
__Note__: `.cordova/hooks` directory is also supported for backward compatibility, but we don't recommend using it as it is deprecated.
31+
32+
## Supported hook types
33+
The following hook types are supported:
34+
35+
after_build/
36+
after_compile/
37+
after_docs/
38+
after_emulate/
39+
after_platform_add/
40+
after_platform_rm/
41+
after_platform_ls/
42+
after_plugin_add/
43+
after_plugin_ls/
44+
after_plugin_rm/
45+
after_plugin_search/
46+
after_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
47+
after_prepare/
48+
after_run/
49+
after_serve/
50+
before_build/
51+
before_compile/
52+
before_docs/
53+
before_emulate/
54+
before_platform_add/
55+
before_platform_rm/
56+
before_platform_ls/
57+
before_plugin_add/
58+
before_plugin_ls/
59+
before_plugin_rm/
60+
before_plugin_search/
61+
before_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
62+
before_plugin_uninstall/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being uninstalled
63+
before_prepare/
64+
before_run/
65+
before_serve/
66+
pre_package/ <-- Windows 8 and Windows Phone only.
67+
68+
## Ways to define hooks
69+
### Via '/hooks' directory
70+
To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example:
71+
72+
# script file will be automatically executed after each build
73+
hooks/after_build/after_build_custom_action.js
74+
75+
76+
### Config.xml
77+
78+
Hooks can be defined in project's `config.xml` using `<hook>` elements, for example:
79+
80+
<hook type="before_build" src="scripts/appBeforeBuild.bat" />
81+
<hook type="before_build" src="scripts/appBeforeBuild.js" />
82+
<hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" />
83+
84+
<platform name="wp8">
85+
<hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.bat" />
86+
<hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.js" />
87+
<hook type="before_plugin_install" src="scripts/wp8/appWP8BeforePluginInstall.js" />
88+
...
89+
</platform>
90+
91+
<platform name="windows8">
92+
<hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.bat" />
93+
<hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.js" />
94+
<hook type="before_plugin_install" src="scripts/windows8/appWin8BeforePluginInstall.js" />
95+
...
96+
</platform>
97+
98+
### Plugin hooks (plugin.xml)
99+
100+
As a plugin developer you can define hook scripts using `<hook>` elements in a `plugin.xml` like that:
101+
102+
<hook type="before_plugin_install" src="scripts/beforeInstall.js" />
103+
<hook type="after_build" src="scripts/afterBuild.js" />
104+
105+
<platform name="wp8">
106+
<hook type="before_plugin_install" src="scripts/wp8BeforeInstall.js" />
107+
<hook type="before_build" src="scripts/wp8BeforeBuild.js" />
108+
...
109+
</platform>
110+
111+
`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled.
112+
113+
## Script Interface
114+
115+
### Javascript
116+
117+
If you are writing hooks in Javascript you should use the following module definition:
118+
```javascript
119+
module.exports = function(context) {
120+
...
121+
}
122+
```
123+
124+
You can make your scipts async using Q:
125+
```javascript
126+
module.exports = function(context) {
127+
var Q = context.requireCordovaModule('q');
128+
var deferral = new Q.defer();
129+
130+
setTimeout(function(){
131+
console.log('hook.js>> end');
132+
deferral.resolve();
133+
}, 1000);
134+
135+
return deferral.promise;
136+
}
137+
```
138+
139+
`context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object:
140+
```json
141+
{
142+
"hook": "before_plugin_install",
143+
"scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js",
144+
"cmdLine": "The\\exact\\command\\cordova\\run\\with arguments",
145+
"opts": {
146+
"projectRoot":"C:\\path\\to\\the\\project",
147+
"cordova": {
148+
"platforms": ["wp8"],
149+
"plugins": ["com.plugin.withhooks"],
150+
"version": "0.21.7-dev"
151+
},
152+
"plugin": {
153+
"id": "com.plugin.withhooks",
154+
"pluginInfo": {
155+
...
156+
},
157+
"platform": "wp8",
158+
"dir": "C:\\path\\to\\the\\project\\plugins\\com.plugin.withhooks"
159+
}
160+
},
161+
"cordova": {...}
162+
}
163+
164+
```
165+
`context.opts.plugin` object will only be passed to plugin hooks scripts.
166+
167+
You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way:
168+
```javascript
169+
var Q = context.requireCordovaModule('q');
170+
```
171+
172+
__Note__: new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only.
173+
For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below.
174+
175+
### Non-javascript
176+
177+
Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
178+
179+
* CORDOVA_VERSION - The version of the Cordova-CLI.
180+
* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).
181+
* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)
182+
* CORDOVA_HOOK - Path to the hook that is being executed.
183+
* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)
184+
185+
If a script returns a non-zero exit code, then the parent cordova command will be aborted.
186+
187+
## Writing hooks
188+
189+
We highly recommend writing your hooks using Node.js so that they are
190+
cross-platform. Some good examples are shown here:
191+
192+
[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
193+
194+
Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example:
195+
196+
#!/usr/bin/env [name_of_interpreter_executable]

ionic.config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "Aldea Bambú",
3+
"app_id": "",
4+
"type": "ionic-angular",
5+
"integrations": {
6+
"cordova": {}
7+
}
8+
}

0 commit comments

Comments
 (0)