├── .editorconfig ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── index.js ├── logo.png ├── logo_v2.png ├── package.json └── template_src ├── .editorconfig ├── .gitignore ├── .jshintrc ├── babel.config.js ├── build.json ├── config.xml ├── config ├── webpack.common.js ├── webpack.dev.js ├── webpack.release.js └── webpack.server.js ├── hooks ├── README.md ├── beforedep.js └── hookers.js ├── package.json ├── res └── screen │ └── ios │ └── Default@2x~universal~anyany.png ├── src ├── assets │ ├── css │ │ └── .gitkeep │ ├── fonts │ │ └── .gitkeep │ ├── images │ │ └── .gitkeep │ ├── js │ │ └── .gitkeep │ ├── json │ │ └── .gitkeep │ ├── sass │ │ └── main.scss │ ├── vue │ │ └── pages │ │ │ ├── about.vue │ │ │ ├── chat.vue │ │ │ ├── color-themes.vue │ │ │ ├── dynamic-route.vue │ │ │ ├── form.vue │ │ │ ├── home.vue │ │ │ ├── panel-left.vue │ │ │ └── vuex.vue │ └── vuex │ │ └── storage.js ├── index.ejs ├── main.js ├── main.vue ├── routes.js └── static │ └── .gitkeep ├── webpack.config.js ├── webpack ├── dev_helpers │ └── device_router.html └── plugins │ └── CordovaHtmlOutputPlugin.js └── www └── README.md /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # Matches multiple files with brace expansion notation 12 | # Set default charset 13 | [*.{js,py}] 14 | charset = utf-8 15 | indent_style = space 16 | indent_size = 2 17 | trim_trailing_whitespace = true 18 | 19 | # Matches the exact files either package.json or .travis.yml 20 | [{package.json,.travis.yml}] 21 | charset = utf-8 22 | indent_style = space 23 | indent_size = 2 24 | trim_trailing_whitespace = true 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Linux template 3 | *~ 4 | 5 | # temporary files which can be created if a process still has a handle open of a deleted file 6 | .fuse_hidden* 7 | 8 | # KDE directory preferences 9 | .directory 10 | 11 | # Linux trash folder which might appear on any partition or disk 12 | .Trash-* 13 | 14 | # .nfs files are created when an open file is removed but is still being accessed 15 | .nfs* 16 | ### Eclipse template 17 | 18 | .metadata 19 | bin/ 20 | tmp/ 21 | *.tmp 22 | *.bak 23 | *.swp 24 | *~.nib 25 | local.properties 26 | .settings/ 27 | .loadpath 28 | .recommenders 29 | 30 | # Eclipse Core 31 | .project 32 | 33 | # External tool builders 34 | .externalToolBuilders/ 35 | 36 | # Locally stored "Eclipse launch configurations" 37 | *.launch 38 | 39 | # PyDev specific (Python IDE for Eclipse) 40 | *.pydevproject 41 | 42 | # CDT-specific (C/C++ Development Tooling) 43 | .cproject 44 | 45 | # JDT-specific (Eclipse Java Development Tools) 46 | .classpath 47 | 48 | # Java annotation processor (APT) 49 | .factorypath 50 | 51 | # PDT-specific (PHP Development Tools) 52 | .buildpath 53 | 54 | # sbteclipse plugin 55 | .target 56 | 57 | # Tern plugin 58 | .tern-project 59 | 60 | # TeXlipse plugin 61 | .texlipse 62 | 63 | # STS (Spring Tool Suite) 64 | .springBeans 65 | 66 | # Code Recommenders 67 | .recommenders/ 68 | ### Dreamweaver template 69 | # DW Dreamweaver added files 70 | _notes 71 | _compareTemp 72 | dwsync.xml 73 | dw_php_codehinting.config 74 | *.mno 75 | ### JetBrains template 76 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 77 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 78 | 79 | # User-specific stuff: 80 | .idea 81 | 82 | 83 | # Sensitive or high-churn files: 84 | .idea/dataSources/ 85 | .idea/dataSources.ids 86 | .idea/dataSources.xml 87 | .idea/dataSources.local.xml 88 | .idea/sqlDataSources.xml 89 | .idea/dynamic.xml 90 | .idea/uiDesigner.xml 91 | 92 | # Gradle: 93 | .idea/gradle.xml 94 | .idea/libraries 95 | 96 | # Mongo Explorer plugin: 97 | .idea/mongoSettings.xml 98 | 99 | ## File-based project format: 100 | *.iws 101 | 102 | ## Plugin-specific files: 103 | 104 | # IntelliJ 105 | /out/ 106 | 107 | # mpeltonen/sbt-idea plugin 108 | .idea_modules/ 109 | 110 | # JIRA plugin 111 | atlassian-ide-plugin.xml 112 | 113 | # Crashlytics plugin (for Android Studio and IntelliJ) 114 | com_crashlytics_export_strings.xml 115 | crashlytics.properties 116 | crashlytics-build.properties 117 | fabric.properties 118 | ### Dropbox template 119 | # Dropbox settings and caches 120 | .dropbox 121 | .dropbox.attr 122 | .dropbox.cache 123 | ### Xcode template 124 | # Xcode 125 | # 126 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 127 | 128 | ## Build generated 129 | build/ 130 | DerivedData/ 131 | 132 | ## Various settings 133 | *.pbxuser 134 | !default.pbxuser 135 | *.mode1v3 136 | !default.mode1v3 137 | *.mode2v3 138 | !default.mode2v3 139 | *.perspectivev3 140 | !default.perspectivev3 141 | xcuserdata/ 142 | 143 | ## Other 144 | *.moved-aside 145 | *.xccheckout 146 | *.xcscmblueprint 147 | ### Windows template 148 | # Windows image file caches 149 | Thumbs.db 150 | ehthumbs.db 151 | 152 | # Folder config file 153 | Desktop.ini 154 | 155 | # Recycle Bin used on file shares 156 | $RECYCLE.BIN/ 157 | 158 | # Windows Installer files 159 | *.cab 160 | *.msi 161 | *.msm 162 | *.msp 163 | 164 | # Windows shortcuts 165 | *.lnk 166 | ### SublimeText template 167 | # cache files for sublime text 168 | *.tmlanguage.cache 169 | *.tmPreferences.cache 170 | *.stTheme.cache 171 | 172 | # workspace files are user-specific 173 | *.sublime-workspace 174 | 175 | # project files should be checked into the repository, unless a significant 176 | # proportion of contributors will probably not be using SublimeText 177 | # *.sublime-project 178 | 179 | # sftp configuration file 180 | sftp-config.json 181 | 182 | # Package control specific files 183 | Package Control.last-run 184 | Package Control.ca-list 185 | Package Control.ca-bundle 186 | Package Control.system-ca-bundle 187 | Package Control.cache/ 188 | Package Control.ca-certs/ 189 | bh_unicode_properties.cache 190 | 191 | # Sublime-github package stores a github token in this file 192 | # https://packagecontrol.io/packages/sublime-github 193 | GitHub.sublime-settings 194 | ### Node template 195 | # Logs 196 | logs 197 | *.log 198 | npm-debug.log* 199 | 200 | # Runtime data 201 | pids 202 | *.pid 203 | *.seed 204 | *.pid.lock 205 | 206 | # Directory for instrumented libs generated by jscoverage/JSCover 207 | lib-cov 208 | 209 | # Coverage directory used by tools like istanbul 210 | coverage 211 | 212 | # nyc test coverage 213 | .nyc_output 214 | 215 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 216 | .grunt 217 | 218 | # node-waf configuration 219 | .lock-wscript 220 | 221 | # Compiled binary addons (http://nodejs.org/api/addons.html) 222 | build/Release 223 | 224 | # Dependency directories 225 | node_modules 226 | jspm_packages 227 | 228 | # Optional npm cache directory 229 | .npm 230 | 231 | # Optional eslint cache 232 | .eslintcache 233 | 234 | # Optional REPL history 235 | .node_repl_history 236 | 237 | # Output of 'npm pack' 238 | *.tgz 239 | 240 | # Yarn Integrity file 241 | .yarn-integrity 242 | 243 | ### macOS template 244 | *.DS_Store 245 | .AppleDouble 246 | .LSOverride 247 | 248 | # Icon must end with two \r 249 | Icon 250 | 251 | 252 | # Thumbnails 253 | ._* 254 | 255 | # Files that might appear in the root of a volume 256 | .DocumentRevisions-V100 257 | .fseventsd 258 | .Spotlight-V100 259 | .TemporaryItems 260 | .Trashes 261 | .VolumeIcon.icns 262 | .com.apple.timemachine.donotpresent 263 | 264 | # Directories potentially created on remote AFP share 265 | .AppleDB 266 | .AppleDesktop 267 | Network Trash Folder 268 | Temporary Items 269 | .apdisk 270 | ### Android template 271 | # Built application files 272 | *.apk 273 | *.ap_ 274 | 275 | # Files for the ART/Dalvik VM 276 | *.dex 277 | 278 | # Java class files 279 | *.class 280 | 281 | # Generated files 282 | gen/ 283 | out/ 284 | 285 | # Gradle files 286 | .gradle/ 287 | 288 | # Proguard folder generated by Eclipse 289 | proguard/ 290 | 291 | # Android Studio Navigation editor temp files 292 | .navigation/ 293 | 294 | # Android Studio captures folder 295 | captures/ 296 | 297 | # Keystore files 298 | *.jks 299 | 300 | # External native build folder generated in Android Studio 2.2 and later 301 | .externalNativeBuild 302 | 303 | !/template_src/webpack/configs/ 304 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 19.01.2018 - 2.0.0 2 | * Added new framework7 (2.x.x) version from https://framework7.io/. 3 | * Added new framework7-vue (2.x.x) version from https://github.com/framework7io/framework7-vue. 4 | * Added new library fontawesome from http://fontawesome.io/. 5 | * Fixed templates inside static folder. 6 | 7 | ## 29.11.2017 - 1.2.1 8 | * Updated dependencies. 9 | * Fixed device.js related errors. 10 | 11 | ## 23.07.2017 - 1.2.0 12 | * Updated dependencies. 13 | 14 | ## 10.05.2017 - 1.1.3 15 | * Changed uglify-js dependency version. 16 | * Removed source-map-loader dependency. 17 | 18 | ## 04.05.2017 - 1.1.2 19 | * Added support for scss to one page component. 20 | * Chokidar dependency added to template's package.json. 21 | 22 | ## 25.04.2017 - 1.1.1 23 | * Added whitespace support to command paths. You can use folder names with whitespace now. 24 | 25 | ## 25.04.2017 - 1.1.0 26 | * Added static folder for static assets. Static folder directly copies to www folder on compile time also static folder automatically sync with www/static when you are using live-reload. 27 | * Directory structure changed. 28 | * Dependency added: `chokidar` 29 | 30 | ## 25.04.2017 - 1.0.12 31 | * Provided compatibility with latest webpack-dev-server update. Added ip:port to public argument for live reload. 32 | * The double nails were standardized as single nails in `beforedep.js` and `hookers.js`. 33 | 34 | ## 07.04.2017 - 1.0.11 35 | * Fixed Device_router.html has been made compatible with Android < 4.4.0. 36 | * Fixed key to vue lists 37 | > Thanks for **konstantin-popov** for fixes. 38 | * Added .editorconfig and files edited with this config. 39 | 40 | ## 14.03.2017 - 1.0.10 41 | * Added epipebomb for linux and mac os. 42 | * Fixed webpack ^2.2.1 support 43 | * Fixed buffer size for webpack outputs 44 | * Updated uglify js version to latest (for ES6 features) 45 | 46 | ## 17.01.2017 - 1.0.4 47 | * Dev-server supports hot-module-replacement now! 48 | 49 | ## 16.01.2017 - 1.0.1 50 | * Supports phonegap now! 51 | * Template now uses `webpack-dev-server` for live-reload. So cordova-plugin-browsersync dependency dropped. 52 | * `webpack-dev-server` dependency added. 53 | * You can use `cordova (run|emulate) (ios|android|browser) -- --lr` now. lr means `live-reload`. 54 | * Added `before_deploy` hook. You can check at: [beforedep.js](template_src/hooks/beforedep.js) 55 | * [hookers.js](template_src/hooks/hookers.js) changed. 56 | * [CordovaDeviceRouter.js](template_src/webpack/dev_helpers/CordovaDeviceRouter.js) added. In `live-reload` mode, server injects the `cordova.js` file according to where you are connecting. 57 | * [device_router.html](template_src/webpack/dev_helpers/device_router.html) added. In `live-reload` mode, this file routes you to right location. 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | ![template logo](logo_v2.png "template logo") 23 | 24 | # Framework7 - Vue - Webpack Cordova Template 25 | You can start your new cordova project perfectly with this template. 26 | 27 | This template uses: 28 | * [Framework7 5](https://framework7.io) 29 | * [Vue 2](https://vuejs.org/) 30 | * [Vuex](https://github.com/vuejs/vuex) 31 | * [Webpack 4](https://webpack.github.io/) 32 | * [Cordova](https://cordova.apache.org/) 33 | * [FontAwesome 5](http://fontawesome.io/) 34 | * [Babel Loader 7](https://github.com/babel/babel-loader) 35 | 36 | 37 | ## Minimum Requirements 38 | * **Cordova:** _6.0.0_ 39 | * **Node.js:** _6.5.0_ (Supports ES6) 40 | 41 | ## WARNING (For Linux and Mac OS users): 42 | 43 | For live-reload i can't find easy way to do fixed version of this. But you can develop your app with this way: 44 | 45 | 1. `cordova platform add ios browser` (browser needs for development in live-reload mode.) 46 | 2. `cordova run ios -- --lr` (wait till app opens in your ios emulator or phone. it will close console output after publish, so live-reload will not work. don't close the app and go to next step.) 47 | 3. `cordova run browser -- --lr` (you can use live-reload in your phone-emulator and browser at same time. you can edit your files in live-reload mode now.) 48 | 49 | --- 50 | 51 | ## Features 52 | 53 | Hooks are smart. They can fix some problems for you. Fix list: 54 | * `npm install` Automatically checks node js dependencies. 55 | * `package.json` Renames `name` variable if it has a space characters and auto saves. (It needed for npm install) 56 | * `www` Automatically manages `www` folder. You don't need to think about www folder. Your target is always `src` folder. 57 | * `static` Static assets automatically sync on live reload! 58 | * `CordovaHtmlOutputPlugin` Automatically adds `cordova.js` to html. You don't need to add to your file manually. It's helpful for webpack. 59 | * `manifest.json` Some cordova plugins needs manifest.json in root folder. If you add manifest.json file to your `src` folder, our smart hooks automagically copy it to `www` folder! 60 | 61 | ###### Live Reload Related 62 | * `config.xml` Live reload needs `` in development mode. So our smart hooks manages this too. You don't need to think about it. 63 | * `live-reload` Manages live-reload dependencies automatically. Just write your code, and don't think about dependencies. 64 | * `device_router.html` Smart router in live-reload mode. It searches for best available ip for connect server. if it can't find, you can write ip:port manually. 65 | * `CordovaDeviceRouter.js` In live-reload mode, you can connect to server from multiple devices. This file inject right `cordova.js` file to page. So you can connect to webpack-dev-server from multiple devices at same time. 66 | 67 | ## Installation 68 | ### IMPORTANT: Phonegap build tools not supported currently. I suggest to use cordova with this template. 69 | 70 | This template need cordova or phonegap, for more information [cordova installation](https://cordova.apache.org/docs/en/latest/guide/cli/) or [phonegap installation](http://docs.phonegap.com/getting-started/1-install-phonegap/desktop/). 71 | 72 | Our Magic words: 73 | 74 | ``` bash 75 | cordova create [com.example.projectname] [ProjectClassName] --template cordova-template-framework7-vue-webpack 76 | phonegap create [com.example.projectname] [ProjectClassName] --template cordova-template-framework7-vue-webpack 77 | ``` 78 | 79 | boom! :boom: you have your brand new cordova / phonegap project with framework7 - vue 2 and webpack 4! 80 | 81 | ![such a wow!](https://cloud.githubusercontent.com/assets/296796/3511506/4042665c-06b0-11e4-953c-4f14c11f81ec.png "such a wow!") 82 | 83 | ## Installation using pre-defined templates 84 | 85 | Framework v5 version 86 | 87 | ``` bash 88 | cordova create cordova-template com.template DefaultTemplate --template git://github.com/caiobiodere/cordova-template-framework7-vue-webpack.git#master 89 | ``` 90 | 91 | [Framework Single View v5 version](https://github.com/framework7io/framework7-template-single-view) 92 | 93 | ``` bash 94 | Still under development 95 | ``` 96 | 97 | [Framework Tabbed Views v5 version](https://github.com/framework7io/framework7-template-tabs) 98 | 99 | ``` bash 100 | Still under development 101 | ``` 102 | 103 | [Framework Split View v5 version](https://github.com/framework7io/framework7-template-split-view) 104 | 105 | ``` bash 106 | Still under development 107 | ``` 108 | 109 | Framework v3 version 110 | 111 | ``` bash 112 | cordova create cordova-template com.template DefaultTemplate --template git://github.com/caiobiodere/cordova-template-framework7-vue-webpack.git#feature/v3-default-template 113 | ``` 114 | 115 | --- 116 | 117 | ## Usage 118 | 119 | You can use every cordova | phonegap commands. 120 | You just have one more command option: `-- --lr`. It starts live reload. 121 | 122 | Example usage: 123 | ``` 124 | cordova run android -- --lr 125 | cordova run browser -- --live-reload 126 | phonegap run ios -- --lr 127 | ``` 128 | 129 | And :tada: that's all folks! 130 | 131 | --- 132 | 133 | ## Using Cordova-Simulate from microsoft 134 | 135 | We can use Microsoft Cordova-Simulate using: 136 | * [Cordova-Simulate Plugin](https://marketplace.visualstudio.com/items?itemName=vsmobile.cordova-tools) 137 | 138 | You can check: 139 | * [hookers.js](template_src/hooks/hookers.js), 140 | * [beforedep.js](template_src/hooks/beforedep.js), 141 | * [CordovaDeviceRouter.js](template_src/webpack/dev_helpers/CordovaDeviceRouter.js), 142 | * [device_router.html](template_src/webpack/dev_helpers/device_router.html) 143 | 144 | for more information. 145 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | Unless required by applicable law or agreed to in writing, 11 | software distributed under the License is distributed on an 12 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | KIND, either express or implied. See the License for the 14 | specific language governing permissions and limitations 15 | under the License. 16 | */ 17 | 18 | var path = require('path'); 19 | 20 | module.exports = { 21 | dirname : path.join(__dirname, 'template_src') 22 | }; 23 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/logo.png -------------------------------------------------------------------------------- /logo_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/logo_v2.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cordova-template-framework7-vue-webpack", 3 | "version": "2.4.4", 4 | "description": "Cordova template with framework7, vue 2 and webpack 2.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Err: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/caiobiodere/cordova-template-framework7-vue-webpack.git" 12 | }, 13 | "homepage": "https://github.com/caiobiodere/cordova-template-framework7-vue-webpack", 14 | "keywords": [ 15 | "ecosystem:phonegap", 16 | "ecosystem:cordova", 17 | "cordova:template", 18 | "phonegap:template", 19 | "cordova-template", 20 | "template", 21 | "webpack", 22 | "vue.js", 23 | "vue", 24 | "mobile", 25 | "framework", 26 | "framework7", 27 | "ios", 28 | "iphone", 29 | "ipad", 30 | "apple", 31 | "phonegap", 32 | "touch", 33 | "app", 34 | "f7", 35 | "material", 36 | "android" 37 | ], 38 | "author": "Caio Biodere", 39 | "license": "Apache-2.0" 40 | } 41 | -------------------------------------------------------------------------------- /template_src/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # Matches multiple files with brace expansion notation 12 | # Set default charset 13 | [*.{js,py}] 14 | charset = utf-8 15 | indent_style = space 16 | indent_size = 2 17 | trim_trailing_whitespace = true 18 | 19 | # Matches the exact files either package.json or .travis.yml 20 | [{package.json,.travis.yml}] 21 | charset = utf-8 22 | indent_style = space 23 | indent_size = 2 24 | trim_trailing_whitespace = true 25 | -------------------------------------------------------------------------------- /template_src/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Linux template 3 | *~ 4 | 5 | # temporary files which can be created if a process still has a handle open of a deleted file 6 | .fuse_hidden* 7 | 8 | # KDE directory preferences 9 | .directory 10 | 11 | # Linux trash folder which might appear on any partition or disk 12 | .Trash-* 13 | 14 | # .nfs files are created when an open file is removed but is still being accessed 15 | .nfs* 16 | ### Eclipse template 17 | 18 | .metadata 19 | bin/ 20 | tmp/ 21 | *.tmp 22 | *.bak 23 | *.swp 24 | *~.nib 25 | local.properties 26 | .settings/ 27 | .loadpath 28 | .recommenders 29 | 30 | # Eclipse Core 31 | .project 32 | 33 | # External tool builders 34 | .externalToolBuilders/ 35 | 36 | # Locally stored "Eclipse launch configurations" 37 | *.launch 38 | 39 | # PyDev specific (Python IDE for Eclipse) 40 | *.pydevproject 41 | 42 | # CDT-specific (C/C++ Development Tooling) 43 | .cproject 44 | 45 | # JDT-specific (Eclipse Java Development Tools) 46 | .classpath 47 | 48 | # Java annotation processor (APT) 49 | .factorypath 50 | 51 | # PDT-specific (PHP Development Tools) 52 | .buildpath 53 | 54 | # sbteclipse plugin 55 | .target 56 | 57 | # Tern plugin 58 | .tern-project 59 | 60 | # TeXlipse plugin 61 | .texlipse 62 | 63 | # STS (Spring Tool Suite) 64 | .springBeans 65 | 66 | # Code Recommenders 67 | .recommenders/ 68 | ### Dreamweaver template 69 | # DW Dreamweaver added files 70 | _notes 71 | _compareTemp 72 | configs/ 73 | dwsync.xml 74 | dw_php_codehinting.config 75 | *.mno 76 | ### JetBrains template 77 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 78 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 79 | 80 | # User-specific stuff: 81 | .idea/workspace.xml 82 | .idea/tasks.xml 83 | 84 | # Sensitive or high-churn files: 85 | .idea/dataSources/ 86 | .idea/dataSources.ids 87 | .idea/dataSources.xml 88 | .idea/dataSources.local.xml 89 | .idea/sqlDataSources.xml 90 | .idea/dynamic.xml 91 | .idea/uiDesigner.xml 92 | 93 | # Gradle: 94 | .idea/gradle.xml 95 | .idea/libraries 96 | 97 | # Mongo Explorer plugin: 98 | .idea/mongoSettings.xml 99 | 100 | ## File-based project format: 101 | *.iws 102 | 103 | ## Plugin-specific files: 104 | 105 | # IntelliJ 106 | /out/ 107 | 108 | # mpeltonen/sbt-idea plugin 109 | .idea_modules/ 110 | 111 | # JIRA plugin 112 | atlassian-ide-plugin.xml 113 | 114 | # Crashlytics plugin (for Android Studio and IntelliJ) 115 | com_crashlytics_export_strings.xml 116 | crashlytics.properties 117 | crashlytics-build.properties 118 | fabric.properties 119 | ### Dropbox template 120 | # Dropbox settings and caches 121 | .dropbox 122 | .dropbox.attr 123 | .dropbox.cache 124 | ### Xcode template 125 | # Xcode 126 | # 127 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 128 | 129 | ## Build generated 130 | build/ 131 | DerivedData/ 132 | 133 | ## Various settings 134 | *.pbxuser 135 | !default.pbxuser 136 | *.mode1v3 137 | !default.mode1v3 138 | *.mode2v3 139 | !default.mode2v3 140 | *.perspectivev3 141 | !default.perspectivev3 142 | xcuserdata/ 143 | 144 | ## Other 145 | *.moved-aside 146 | *.xccheckout 147 | *.xcscmblueprint 148 | ### Windows template 149 | # Windows image file caches 150 | Thumbs.db 151 | ehthumbs.db 152 | 153 | # Folder config file 154 | Desktop.ini 155 | 156 | # Recycle Bin used on file shares 157 | $RECYCLE.BIN/ 158 | 159 | # Windows Installer files 160 | *.cab 161 | *.msi 162 | *.msm 163 | *.msp 164 | 165 | # Windows shortcuts 166 | *.lnk 167 | ### SublimeText template 168 | # cache files for sublime text 169 | *.tmlanguage.cache 170 | *.tmPreferences.cache 171 | *.stTheme.cache 172 | 173 | # workspace files are user-specific 174 | *.sublime-workspace 175 | 176 | # project files should be checked into the repository, unless a significant 177 | # proportion of contributors will probably not be using SublimeText 178 | # *.sublime-project 179 | 180 | # sftp configuration file 181 | sftp-config.json 182 | 183 | # Package control specific files 184 | Package Control.last-run 185 | Package Control.ca-list 186 | Package Control.ca-bundle 187 | Package Control.system-ca-bundle 188 | Package Control.cache/ 189 | Package Control.ca-certs/ 190 | bh_unicode_properties.cache 191 | 192 | # Sublime-github package stores a github token in this file 193 | # https://packagecontrol.io/packages/sublime-github 194 | GitHub.sublime-settings 195 | ### Node template 196 | # Logs 197 | logs 198 | *.log 199 | npm-debug.log* 200 | 201 | # Runtime data 202 | pids 203 | *.pid 204 | *.seed 205 | *.pid.lock 206 | 207 | # Directory for instrumented libs generated by jscoverage/JSCover 208 | lib-cov 209 | 210 | # Coverage directory used by tools like istanbul 211 | coverage 212 | 213 | # nyc test coverage 214 | .nyc_output 215 | 216 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 217 | .grunt 218 | 219 | # node-waf configuration 220 | .lock-wscript 221 | 222 | # Compiled binary addons (http://nodejs.org/api/addons.html) 223 | build/Release 224 | 225 | # Dependency directories 226 | node_modules 227 | jspm_packages 228 | 229 | # Optional npm cache directory 230 | .npm 231 | 232 | # Optional eslint cache 233 | .eslintcache 234 | 235 | # Optional REPL history 236 | .node_repl_history 237 | 238 | # Output of 'npm pack' 239 | *.tgz 240 | 241 | # Yarn Integrity file 242 | .yarn-integrity 243 | 244 | ### macOS template 245 | *.DS_Store 246 | .AppleDouble 247 | .LSOverride 248 | 249 | # Icon must end with two \r 250 | Icon 251 | 252 | 253 | # Thumbnails 254 | ._* 255 | 256 | # Files that might appear in the root of a volume 257 | .DocumentRevisions-V100 258 | .fseventsd 259 | .Spotlight-V100 260 | .TemporaryItems 261 | .Trashes 262 | .VolumeIcon.icns 263 | .com.apple.timemachine.donotpresent 264 | 265 | # Directories potentially created on remote AFP share 266 | .AppleDB 267 | .AppleDesktop 268 | Network Trash Folder 269 | Temporary Items 270 | .apdisk 271 | !/webpack/configs/ 272 | -------------------------------------------------------------------------------- /template_src/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esversion": 6 3 | } -------------------------------------------------------------------------------- /template_src/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "presets": [ 3 | ["@babel/preset-env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }] 9 | ], 10 | "plugins": [ 11 | "transform-vue-jsx", 12 | // "@babel/plugin-transform-runtime", 13 | "@babel/plugin-syntax-dynamic-import" 14 | ] 15 | }; -------------------------------------------------------------------------------- /template_src/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "ios": { 3 | "release": { 4 | "buildFlag": [ 5 | "-UseModernBuildSystem=0" 6 | ] 7 | }, 8 | "development": { 9 | "buildFlag": [ 10 | "-UseModernBuildSystem=0" 11 | ] 12 | }, 13 | "debug": { 14 | "buildFlag": [ 15 | "-UseModernBuildSystem=0" 16 | ] 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /template_src/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | Cordova - Framework7 - Vue - Webpack Template 26 | 27 | Brand new cordova project! 28 | 29 | 30 | Apache Cordova Team 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /template_src/config/webpack.common.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const webpack = require('webpack'); 4 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 5 | const VueLoaderPlugin = require('vue-loader/lib/plugin'); 6 | 7 | const entryFile = path.join(__dirname + '/../src/main.js'); 8 | 9 | module.exports = function (options) { 10 | return { 11 | mode: options.mode, 12 | entry: entryFile, 13 | 14 | resolve: { 15 | extensions: ['.js', '.json', '.vue'], 16 | modules: [path.join(__dirname, '../src'), 'node_modules'], 17 | alias: { 18 | 'vue$': 'vue/dist/vue.common.js', 19 | 'src': path.resolve(__dirname, '../src/'), 20 | 'assets': path.resolve(__dirname, '../src/assets/'), 21 | 'pages': path.resolve(__dirname, '../src/assets/vue/pages/'), 22 | 'components': path.resolve(__dirname, '../src/assets/vue/components/') 23 | } 24 | }, 25 | 26 | output: { 27 | pathinfo: true, 28 | devtoolLineToLine: true, 29 | filename: '[hash].[name].js', 30 | sourceMapFilename: "[hash].[name].js.map", 31 | path: path.join(__dirname, '../www') 32 | }, 33 | 34 | module: { 35 | rules: [{ 36 | test: /\.(png|jpe?g|gif)$/, 37 | loader: 'file-loader', 38 | options: { 39 | name: '[name].[ext]?[hash]' 40 | } 41 | }, 42 | { 43 | test: /\.(woff2?|eot|ttf|otf|mp3|wav)(\?.*)?$/, 44 | loader: 'file-loader', 45 | options: { 46 | name: '[name].[ext]?[hash]' 47 | } 48 | }, 49 | { 50 | test: /\.svg$/, 51 | loader: 'url-loader' 52 | }, 53 | { 54 | test: /\.scss$/, 55 | loader: ['vue-style-loader', 'css-loader', 'sass-loader'] 56 | }, 57 | { 58 | test: /\.sass$/, 59 | loader: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax'] 60 | }, 61 | { 62 | test: /\.vue$/, 63 | exclude: /node_modules/, 64 | loader: 'vue-loader', 65 | options: { 66 | loaders: { 67 | js: { 68 | loader: 'babel-loader', 69 | options: { 70 | presets: ['env'], 71 | plugins: ['transform-object-rest-spread'] 72 | } 73 | } 74 | } 75 | } 76 | }, 77 | { 78 | test: /\.js$/, 79 | exclude: /node_modules(\/|\\)(?!(framework7|framework7-vue|template7|dom7)(\/|\\)).*/, 80 | use: { 81 | loader: 'babel-loader', 82 | options: { 83 | presets: ['env'], 84 | plugins: ['transform-runtime', 'transform-object-rest-spread'] 85 | } 86 | } 87 | } 88 | ] 89 | }, 90 | 91 | plugins: [ 92 | new webpack.DefinePlugin({ 93 | 'process.env': { 94 | 'NODE_ENV': JSON.stringify(options.mode) 95 | } 96 | }), 97 | new HtmlWebpackPlugin({ 98 | filename: 'index.html', 99 | template: 'src/index.ejs', 100 | platform: process.argv.length > 5 ? process.argv[5].replace(/[- ]/g, '') : "", 101 | inject: true, 102 | minify: { 103 | removeComments: true, 104 | removeScriptTypeAttributes: true, 105 | removeAttributeQuotes: true, 106 | useShortDoctype: true, 107 | decodeEntities: true, 108 | collapseWhitespace: true, 109 | minifyCSS: true 110 | } 111 | }), 112 | new VueLoaderPlugin() 113 | ] 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /template_src/config/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const webpackMerge = require('webpack-merge'); 2 | const commonConfig = require('./webpack.common'); 3 | 4 | const CordovaHtmlOutputPlugin = require('../webpack/plugins/CordovaHtmlOutputPlugin.js'); 5 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 6 | 7 | module.exports = function() { 8 | return webpackMerge(commonConfig({ mode: 'development' }), { 9 | module: { 10 | rules: [ 11 | { 12 | test: /\.css$/, use: ExtractTextPlugin.extract({ 13 | fallback: "style-loader", 14 | use: "css-loader" 15 | }) 16 | } 17 | ] 18 | }, 19 | plugins: [ 20 | new CordovaHtmlOutputPlugin(), 21 | new ExtractTextPlugin("styles.css") 22 | ] 23 | }); 24 | } -------------------------------------------------------------------------------- /template_src/config/webpack.release.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpackMerge = require('webpack-merge'); 3 | const commonConfig = require('./webpack.common'); 4 | 5 | const CordovaHtmlOutputPlugin = require('../webpack/plugins/CordovaHtmlOutputPlugin.js'); 6 | const TerserPlugin = require('terser-webpack-plugin'); 7 | const { CleanWebpackPlugin } = require('clean-webpack-plugin'); 8 | 9 | module.exports = function() { 10 | return webpackMerge(commonConfig({ mode: 'production' }), { 11 | module: { 12 | rules: [ 13 | { 14 | test: /\.css$/, 15 | loader: ['style-loader', 'css-loader'] 16 | } 17 | ] 18 | }, 19 | plugins: [ 20 | new CordovaHtmlOutputPlugin(), 21 | new TerserPlugin({ 22 | extractComments: false 23 | }), 24 | new CleanWebpackPlugin({ 25 | dry: false, 26 | verbose: false, 27 | cleanOnceBeforeBuildPatterns: ['!index.html'], 28 | cleanAfterEveryBuildPatterns: ['!index.html'] 29 | }) 30 | ] 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /template_src/config/webpack.server.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | const webpackMerge = require('webpack-merge'); 4 | const commonConfig = require('./webpack.common'); 5 | 6 | const devServerPort = 8081; 7 | 8 | module.exports = function() { 9 | return webpackMerge(commonConfig({ mode: 'development' }), { 10 | module: { 11 | rules: [ 12 | { 13 | test: /\.css$/, 14 | loader: ['style-loader', 'css-loader'] 15 | } 16 | ] 17 | }, 18 | plugins: [new webpack.NamedModulesPlugin()], 19 | devServer: { 20 | contentBase: path.join(__dirname, '../www'), 21 | port: devServerPort, 22 | stats: { colors: true }, 23 | watchOptions: { 24 | aggregateTimeout: 300, 25 | poll: 100, 26 | ignored: /node_modules|platforms/ 27 | }, 28 | headers: { 29 | 'Access-Control-Allow-Origin': '*' 30 | }, 31 | host: '0.0.0.0' 32 | }, 33 | output: { 34 | publicPath: '/' 35 | } 36 | }); 37 | }; 38 | -------------------------------------------------------------------------------- /template_src/hooks/README.md: -------------------------------------------------------------------------------- 1 | 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. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide. 24 | -------------------------------------------------------------------------------- /template_src/hooks/beforedep.js: -------------------------------------------------------------------------------- 1 | module.exports = function (ctx) { 2 | const Q = require('q'), 3 | path = require('path'), 4 | fs = require('fs'), 5 | pRoot = ctx.opts.projectRoot, 6 | 7 | wwwFolder = path.resolve(pRoot, "www/"), 8 | moveAllTo = path.resolve(wwwFolder, "platform_cordova_files/") 9 | 10 | const sys = { 11 | getPlatformDir(platform, cordovaFile) { 12 | 13 | if( platform === 'android') 14 | return path.resolve(__dirname, `../platforms/${platform}/platform_www/${cordovaFile ? "cordova.js" : ""}`) 15 | else 16 | return path.resolve(__dirname, `../platforms/${platform}/www/${cordovaFile ? "cordova.js" : ""}`) 17 | }, 18 | 19 | copyRecursiveSync(src, dest) { 20 | let exists = fs.existsSync(src), 21 | stats = exists && fs.statSync(src), 22 | isDirectory = exists && stats.isDirectory() 23 | 24 | if (exists && isDirectory) { 25 | 26 | if(!fs.existsSync(dest)) 27 | fs.mkdirSync(dest) 28 | 29 | fs.readdirSync(src).forEach((childItemName) => { 30 | sys.copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName)) 31 | }) 32 | } else 33 | fs.linkSync(src, dest) 34 | }, 35 | 36 | checkAndCopy(platforms) { 37 | platforms.forEach((platform) => { 38 | if (fs.existsSync(sys.getPlatformDir(platform)) && fs.existsSync(sys.getPlatformDir(platform, true))) { 39 | let movePath = path.resolve(moveAllTo, platform + '/') 40 | 41 | if (!fs.existsSync(movePath)) 42 | fs.mkdirSync(movePath) 43 | 44 | sys.copyRecursiveSync(sys.getPlatformDir(platform), movePath) 45 | } 46 | }) 47 | }, 48 | 49 | copyMainXml() { 50 | fs.createReadStream(path.resolve(__dirname, "../config.xml")).pipe(fs.createWriteStream(path.resolve(wwwFolder, "config.xml"))) 51 | }, 52 | 53 | checkOption(name) { 54 | return ( 55 | typeof ctx.opts !== "undefined" && 56 | typeof ctx.opts.options !== "undefined" && 57 | typeof ctx.opts.options[name] !== "undefined" && 58 | ctx.opts.options[name] === true 59 | ) 60 | }, 61 | 62 | checkArgv(name) { 63 | return ( 64 | typeof ctx.opts !== "undefined" && 65 | typeof ctx.opts.options !== "undefined" && 66 | typeof ctx.opts.options.argv !== "undefined" && 67 | ( 68 | Array.isArray(ctx.opts.options.argv) && 69 | ctx.opts.options.argv.indexOf(name) > -1 || 70 | ctx.opts.options.argv[name] === true 71 | ) 72 | ) 73 | }, 74 | 75 | isFoundInCmdline( cmdCommand ) { 76 | return ( 77 | ctx.cmdLine.indexOf(`cordova ${cmdCommand}`) > -1 || 78 | ctx.cmdLine.indexOf(`phonegap ${cmdCommand}`) > -1 79 | ) 80 | } 81 | } 82 | 83 | let deferral = new Q.defer(), 84 | isRun = sys.isFoundInCmdline('run'), 85 | isEmulate = sys.isFoundInCmdline('emulate'), 86 | isPrepare = sys.isFoundInCmdline('prepare'), 87 | isServe = sys.isFoundInCmdline('serve'), 88 | isLiveReload = sys.checkArgv('--live-reload') || sys.checkArgv('--lr') || sys.checkArgv('lr') || sys.checkArgv('live-reload') 89 | 90 | if (ctx.opts.platforms.length === 0 && !isPrepare) { 91 | console.log("Update happened. Skipping...") 92 | deferral.resolve() 93 | } 94 | else { 95 | if (isServe || (isRun || isEmulate) && isLiveReload) { 96 | console.log("Copying platform cordova files...") 97 | 98 | if (!fs.existsSync(moveAllTo)) 99 | fs.mkdirSync(moveAllTo) 100 | 101 | sys.checkAndCopy(['android', 'ios', 'browser']) 102 | sys.copyMainXml() 103 | 104 | console.log("All platform files copied to www/platform_cordova_files/ directory!") 105 | } else 106 | console.log("Dev server not running. Skipping...") 107 | 108 | deferral.resolve() 109 | } 110 | 111 | return deferral.promise 112 | } 113 | -------------------------------------------------------------------------------- /template_src/hooks/hookers.js: -------------------------------------------------------------------------------- 1 | module.exports = function (ctx) { 2 | const Q = require('q'), 3 | path = require('path'), 4 | fs = require('fs'), 5 | cp = require('child_process'), 6 | os = require('os'), 7 | ifaces = os.networkInterfaces(), 8 | spawn = cp.spawn, 9 | exec = cp.exec, 10 | pRoot = ctx.opts.projectRoot, 11 | 12 | nodeModulesPath = path.resolve(pRoot, 'node_modules/'), 13 | wwwFolder = path.resolve(pRoot, 'www/'), 14 | staticFolder = path.resolve(pRoot, 'src/static/'), 15 | targetStaticFolder = path.resolve(wwwFolder, 'static/'), 16 | manifestFileSrcPath = path.resolve(pRoot, 'src/manifest.json'), 17 | manifestFileCopyPath = path.resolve(wwwFolder, 'manifest.json'), 18 | webpackPath = path.resolve(nodeModulesPath, '.bin/webpack'), 19 | epipeBombPath = path.resolve(nodeModulesPath, '.bin/epipebomb'), 20 | webpackDevServerPath = path.resolve(nodeModulesPath, '.bin/webpack-dev-server'), 21 | packageJsonPath = path.resolve(__dirname, '../package.json'), 22 | 23 | packageJson = require(packageJsonPath) 24 | 25 | function getRouterIpAddr () { 26 | for (let key in ifaces) { 27 | if (ifaces.hasOwnProperty(key)) { 28 | for (let ipInfoKey in ifaces[key]) { 29 | if (ifaces[key].hasOwnProperty(ipInfoKey)) { 30 | let ipInfo = ifaces[key][ipInfoKey] 31 | 32 | if (ipInfo.family === 'IPv4' && !ipInfo.internal) 33 | return ipInfo.address 34 | } 35 | } 36 | } 37 | } 38 | 39 | return '127.0.0.1' 40 | } 41 | 42 | 43 | const sys = { 44 | 45 | toKebabCase (txt) { 46 | return txt.replace(/(\s)+/g, '-').replace(/[A-Z]/g, function (t) { 47 | return t.toLowerCase() 48 | }) 49 | }, 50 | 51 | checkPackageName () { 52 | if (typeof packageJson.name === 'undefined' || packageJson.name === '') { 53 | packageJson.name = 'hello-world' 54 | } else if (/\s/g.test(packageJson.name)) { 55 | packageJson.name = sys.toKebabCase(packageJson.name) 56 | fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson), 'utf-8') 57 | } 58 | }, 59 | 60 | deleteFolderRecursive (path, doNotDeleteSelf = false) { 61 | if (fs.existsSync(path)) { 62 | fs.readdirSync(path).forEach((file) => { 63 | let curPath = path + '/' + file 64 | if (fs.lstatSync(curPath).isDirectory()) 65 | sys.deleteFolderRecursive(curPath); 66 | else 67 | fs.unlinkSync(curPath) 68 | }) 69 | 70 | if (!doNotDeleteSelf) 71 | fs.rmdirSync(path) 72 | } 73 | }, 74 | 75 | cleanWww () { 76 | let wwwDir = path.resolve(__dirname, '../www/') 77 | sys.deleteFolderRecursive(wwwDir, true) 78 | }, 79 | 80 | checkManifestFile () { 81 | if (fs.existsSync(manifestFileSrcPath)) { 82 | console.log('Manifest.json found in src folder. Copying...') 83 | fs.writeFileSync(manifestFileCopyPath, fs.readFileSync(manifestFileSrcPath)) 84 | } 85 | }, 86 | 87 | checkNodeModules () { 88 | let defer = new Q.defer() 89 | 90 | console.log('Checking is node modules installed...') 91 | 92 | if (!fs.existsSync(nodeModulesPath) || !fs.existsSync(path.resolve(nodeModulesPath, 'cheerio/'))) { 93 | console.log('Node modules not found. Installing...') 94 | 95 | exec('npm i', { cwd: pRoot, maxBuffer: 1024 * 1024 * 5 }, (error) => { 96 | if (error) { 97 | console.error(`Error happened when npm install: ${error}`); 98 | defer.reject(new Error(`Error happened when npm install: ${error}`)) 99 | } 100 | 101 | console.log('Node modules installed successfully!') 102 | defer.resolve() 103 | }) 104 | } 105 | else { 106 | console.log('Node modules already installed.') 107 | defer.resolve() 108 | } 109 | 110 | return defer.promise 111 | }, 112 | 113 | makeNonDevServerChanges () { 114 | let defer = new Q.defer(), 115 | cheerio = require('cheerio'), 116 | configFile = path.resolve(__dirname, '../config.xml'), 117 | conf = cheerio.load(fs.readFileSync(configFile), { xmlMode: true }) 118 | 119 | if (conf('allow-navigation').length > 0) { 120 | let target = conf('allow-navigation') 121 | 122 | if (target.attr('data-href') !== '') { 123 | target.attr('href', target.attr('data-href')) 124 | target.removeAttr('data-href') 125 | } 126 | } 127 | 128 | fs.writeFileSync(configFile, conf.html(), 'utf-8') 129 | sys.cleanWww() 130 | 131 | defer.resolve() 132 | 133 | return defer.promise 134 | }, 135 | 136 | makeDevServerChanges () { 137 | let defer = new Q.defer(), 138 | configFile = path.resolve(__dirname, '../config.xml'), 139 | srcFile = path.resolve(__dirname, '../webpack/dev_helpers/device_router.html'), 140 | targetFile = path.resolve(wwwFolder, 'index.html'), 141 | 142 | defaultCsp = `default-src *; script-src 'self' data: 'unsafe-inline' 'unsafe-eval' http://127.0.0.1:8081 http://LOCIP:8081; object-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081; style-src 'self' 'unsafe-inline' data: ; img-src *; media-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081; frame-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081; font-src *; connect-src 'self' data: http://127.0.0.1:8081 http://LOCIP:8081`, 143 | 144 | cheerio = require('cheerio'), 145 | $ = cheerio.load(fs.readFileSync(srcFile, 'utf-8')), 146 | conf = cheerio.load(fs.readFileSync(configFile), { xmlMode: true }) 147 | 148 | sys.cleanWww() 149 | 150 | $('head').prepend(``) 151 | $('body').prepend(``).append(``) 152 | fs.writeFileSync(targetFile, $.html()) 153 | 154 | if (conf('allow-navigation').length === 0) 155 | conf('widget').append('') 156 | else { 157 | let target = conf('allow-navigation') 158 | 159 | if (target.attr('href') !== '*') 160 | target.attr('data-href', target.attr('href')).attr('href', '*') 161 | } 162 | 163 | fs.writeFileSync(configFile, conf.html(), 'utf-8') 164 | 165 | sys.deleteFolderRecursive(targetStaticFolder, true) 166 | sys.copyRecursiveSync(staticFolder, targetStaticFolder) 167 | sys.watchStaticFolder() 168 | 169 | defer.resolve() 170 | 171 | return defer.promise 172 | }, 173 | 174 | startWebpackBuild (isRelease) { 175 | let defer = new Q.defer() 176 | 177 | console.log('Starting webpack build...') 178 | 179 | let wpPath = webpackPath + (os.platform() === 'win32' ? '.cmd' : '') 180 | 181 | exec(`"${wpPath}"` + (isRelease ? ' --env.release' : ''), { cwd: pRoot, maxBuffer: 1024 * 1024 * 5 }, (error, log) => { 182 | if (error) { 183 | console.error(`Error happened when webpack build: ${error}`); 184 | defer.reject(new Error(`Error happened when webpack build: ${error}`)) 185 | } 186 | 187 | console.log(`Webpack log: ${log}`); 188 | 189 | sys.deleteFolderRecursive(targetStaticFolder, true) 190 | sys.copyRecursiveSync(staticFolder, targetStaticFolder) 191 | 192 | sys.checkManifestFile() 193 | 194 | console.log('Webpack build completed to www folder successfully!') 195 | defer.resolve() 196 | }) 197 | 198 | return defer.promise 199 | }, 200 | 201 | startWebpackDevServer (platform) { 202 | let defer = new Q.defer(), 203 | outText = '', 204 | isResultFound = false, 205 | args = [`"${webpackDevServerPath}"`, '--hot', '--inline', '--env.devserver', '--' + platform, `--public ${getRouterIpAddr()}:8081`, '--env.devserver'], 206 | run = epipeBombPath 207 | 208 | if (os.platform() === 'win32') { 209 | args = ['--hot', '--inline', '--env.devserver', '--' + platform, `--public ${getRouterIpAddr()}:8081`, '--env.devserver'] 210 | run = `"${webpackDevServerPath}.cmd"` 211 | } 212 | 213 | let devServerSpawn = spawn(run, args, { 214 | shell: true, 215 | cwd: pRoot, 216 | stdio: [process.stdin, 'pipe', process.stderr] 217 | }) 218 | 219 | devServerSpawn.on('error', (err) => { 220 | console.log('Failed to start webpack dev server!') 221 | console.log(err) 222 | 223 | defer.reject(err) 224 | }) 225 | 226 | devServerSpawn.stdout.on('data', (data) => { 227 | process.stdout.write(data) 228 | 229 | if (!isResultFound) { 230 | outText += data 231 | 232 | if (outText.indexOf('bundle is now VALID.') > -1 || outText.indexOf('Compiled successfully.') > -1 || outText.indexOf('Compiled with warnings') > -1) { 233 | isResultFound = true 234 | outText = '' 235 | 236 | defer.resolve() 237 | } 238 | } 239 | }) 240 | 241 | return defer.promise 242 | }, 243 | 244 | emptyDefer () { 245 | let defer = new Q.defer() 246 | 247 | defer.resolve() 248 | 249 | return defer.promise 250 | }, 251 | 252 | checkOption (name) { 253 | return ( 254 | typeof ctx.opts !== 'undefined' && 255 | typeof ctx.opts.options !== 'undefined' && 256 | typeof ctx.opts.options[name] !== 'undefined' && 257 | ctx.opts.options[name] === true 258 | ) 259 | }, 260 | 261 | checkArgv (name) { 262 | return ( 263 | typeof ctx.opts !== 'undefined' && 264 | typeof ctx.opts.options !== 'undefined' && 265 | typeof ctx.opts.options.argv !== 'undefined' && 266 | ( 267 | Array.isArray(ctx.opts.options.argv) && 268 | ctx.opts.options.argv.indexOf(name) > -1 || 269 | ctx.opts.options.argv[name] === true 270 | ) 271 | ) 272 | }, 273 | 274 | isFoundInCmdline (cmdCommand) { 275 | return ( 276 | ctx.cmdLine.indexOf(`cordova ${cmdCommand}`) > -1 || 277 | ctx.cmdLine.indexOf(`phonegap ${cmdCommand}`) > -1 278 | ) 279 | }, 280 | 281 | deleteFolderRecursive (path, doNotDeleteSelf = false) { 282 | if (fs.existsSync(path)) { 283 | fs.readdirSync(path).forEach((file) => { 284 | let curPath = path + '/' + file 285 | if (fs.lstatSync(curPath).isDirectory()) 286 | sys.deleteFolderRecursive(curPath); 287 | else 288 | fs.unlinkSync(curPath) 289 | }) 290 | 291 | if (!doNotDeleteSelf) 292 | fs.rmdirSync(path) 293 | } 294 | }, 295 | 296 | copyRecursiveSync (src, dest) { 297 | let exists = fs.existsSync(src), 298 | stats = exists && fs.statSync(src), 299 | isDirectory = exists && stats.isDirectory() 300 | 301 | if (exists && isDirectory) { 302 | 303 | if (!fs.existsSync(dest)) 304 | fs.mkdirSync(dest) 305 | 306 | fs.readdirSync(src).forEach((childItemName) => { 307 | sys.copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName)) 308 | }) 309 | } else 310 | fs.linkSync(src, dest) 311 | }, 312 | 313 | createFile (p) { 314 | let rel = path.relative('./src/static/', p) 315 | sys.copyFile(p, path.resolve(targetStaticFolder, rel)); 316 | console.log(`${p} created`) 317 | }, 318 | 319 | addUpdate (p) { 320 | let rel = path.relative('./src/static/', p) 321 | console.log(`${p} copied to ${path.resolve(targetStaticFolder, rel)}`) 322 | }, 323 | 324 | addDir (p) { 325 | let rel = path.relative('./src/static/', p) 326 | fs.mkdir(path.resolve(targetStaticFolder, rel), () => { 327 | console.log(`Found ${p} folder. Created to ${path.resolve(targetStaticFolder, rel)}`) 328 | }) 329 | }, 330 | 331 | delete (p) { 332 | let rel = path.relative('./src/static/', p) 333 | 334 | fs.access(path.resolve(targetStaticFolder, rel), fs.constants.W_OK, (err) => { 335 | if (!err) { 336 | fs.unlink(path.resolve(targetStaticFolder, rel), () => { 337 | console.log(`${path.resolve(targetStaticFolder, rel)} deleted.`) 338 | }) 339 | } else { 340 | console.log(`${path.resolve(targetStaticFolder, rel)} not deleted.`) 341 | } 342 | }) 343 | }, 344 | 345 | copyFile (source, target, cb) { 346 | let cbCalled = false 347 | 348 | let rd = fs.createReadStream(source) 349 | rd.on("error", done) 350 | 351 | let wr = fs.createWriteStream(target) 352 | wr.on("error", done) 353 | wr.on("close", done) 354 | 355 | rd.pipe(wr) 356 | 357 | function done (err) { 358 | if (!cbCalled && typeof cb === 'function') { 359 | cb(err) 360 | cbCalled = true 361 | } 362 | } 363 | }, 364 | 365 | watchStaticFolder () { 366 | 367 | if (fs.existsSync(staticFolder)) { 368 | 369 | const chokidar = require('chokidar'), 370 | watcher = chokidar.watch(staticFolder, { 371 | persistent: true 372 | }) 373 | 374 | watcher.on('ready', () => { 375 | console.log('Watcher ready!') 376 | watcher 377 | .on('add', sys.createFile) 378 | .on('change', sys.addUpdate) 379 | .on('unlink', sys.delete) 380 | .on('addDir', sys.addDir) 381 | .on('unlinkDir', sys.delete) 382 | }) 383 | } 384 | } 385 | } 386 | 387 | let deferral = new Q.defer(), 388 | isBuild = sys.isFoundInCmdline('build'), 389 | isRun = sys.isFoundInCmdline('run'), 390 | isEmulate = sys.isFoundInCmdline('emulate'), 391 | isPrepare = sys.isFoundInCmdline('prepare'), 392 | isServe = sys.isFoundInCmdline('serve'), 393 | isLiveReload = sys.checkArgv('--live-reload') || sys.checkArgv('--lr') || sys.checkArgv('lr') || sys.checkArgv('live-reload'), 394 | isNoBuild = sys.checkOption('no-build'), 395 | isRelease = sys.checkOption('release') 396 | 397 | if (ctx.opts.platforms.length === 0 && !isPrepare) { 398 | console.log('Update happened. Skipping...') 399 | deferral.resolve() 400 | } 401 | else { 402 | console.log('Before deploy hook started...') 403 | 404 | // if package name contains space characters, we'll convert it to kebab case. Required for npm install command to work. 405 | sys.checkPackageName() 406 | 407 | sys.checkNodeModules() 408 | .then(() => { 409 | if (isBuild || ((isRun || isEmulate || isPrepare) && !isLiveReload && !isNoBuild)) { 410 | return sys.makeNonDevServerChanges().then(() => sys.startWebpackBuild(isRelease)) 411 | } else if (isServe || (isRun || isEmulate) && isLiveReload) { 412 | return sys.makeDevServerChanges().then(() => sys.startWebpackDevServer(ctx.opts.platforms[0])) 413 | } 414 | else 415 | return sys.emptyDefer() 416 | }) 417 | .then(() => { 418 | console.log('Cordova hook completed. Resuming to run your cordova command...') 419 | deferral.resolve() 420 | }) 421 | .catch((err) => { 422 | console.log('Error happened on main chain:') 423 | console.log(err) 424 | 425 | deferral.reject(err) 426 | }) 427 | .done() 428 | } 429 | 430 | return deferral.promise 431 | } 432 | -------------------------------------------------------------------------------- /template_src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cordovaframework7vuewebpacktemplate", 3 | "version": "1.0.0", 4 | "description": "Brand new cordova project with framework7 - vue - webpack!", 5 | "scripts": { 6 | "default": "echo \"There is no scripts you can run with npm run command.\" && exit 1" 7 | }, 8 | "keywords": [ 9 | "ecosystem:cordova" 10 | ], 11 | "license": "ISC", 12 | "devDependencies": { 13 | "babel-core": "^6.26.3", 14 | "babel-loader": "^7.1.5", 15 | "babel-plugin-transform-object-rest-spread": "^6.26.0", 16 | "babel-plugin-transform-runtime": "^6.23.0", 17 | "babel-preset-env": "^1.7.0", 18 | "cheerio": "^1.0.0-rc.3", 19 | "chokidar": "^3.1.1", 20 | "clean-webpack-plugin": "^3.0.0", 21 | "css-loader": "^3.2.0", 22 | "current-device": "^0.10.0", 23 | "epipebomb": "^1.0.0", 24 | "extract-text-webpack-plugin": "4.0.0-beta.0", 25 | "file-loader": "^5.0.2", 26 | "html-loader": "^0.5.5", 27 | "html-webpack-plugin": "^3.2.0", 28 | "node-sass": "^4.12.0", 29 | "path": "^0.12.7", 30 | "sass-loader": "^8.0.0", 31 | "style-loader": "^1.0.0", 32 | "svg-url-loader": "^3.0.2", 33 | "terser-webpack-plugin": "^2.1.0", 34 | "url-loader": "^3.0.0", 35 | "vue-hot-reload-api": "^2.3.4", 36 | "vue-html-loader": "^1.2.4", 37 | "vue-loader": "^15.7.1", 38 | "vue-style-loader": "^4.1.2", 39 | "vue-template-compiler": "^2.6.10", 40 | "webpack": "^4.40.2", 41 | "webpack-cli": "^3.3.9", 42 | "webpack-dev-server": "^3.8.1", 43 | "webpack-merge": "^4.2.2" 44 | }, 45 | "dependencies": { 46 | "@fortawesome/fontawesome-free": "^5.11.1", 47 | "fastclick": "^1.0.6", 48 | "framework7": "^5.3.0", 49 | "framework7-icons": "^3.0.0", 50 | "framework7-vue": "^5.3.0", 51 | "loglevel": "^1.6.4", 52 | "material-design-icons": "^3.0.1", 53 | "vue": "^2.6.10", 54 | "vuex": "^3.1.1" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /template_src/res/screen/ios/Default@2x~universal~anyany.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/template_src/res/screen/ios/Default@2x~universal~anyany.png -------------------------------------------------------------------------------- /template_src/src/assets/css/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/template_src/src/assets/css/.gitkeep -------------------------------------------------------------------------------- /template_src/src/assets/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/template_src/src/assets/fonts/.gitkeep -------------------------------------------------------------------------------- /template_src/src/assets/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/template_src/src/assets/images/.gitkeep -------------------------------------------------------------------------------- /template_src/src/assets/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/template_src/src/assets/js/.gitkeep -------------------------------------------------------------------------------- /template_src/src/assets/json/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/template_src/src/assets/json/.gitkeep -------------------------------------------------------------------------------- /template_src/src/assets/sass/main.scss: -------------------------------------------------------------------------------- 1 | * { 2 | user-select: none; 3 | } 4 | 5 | input { 6 | user-select: element !important; 7 | } 8 | 9 | .tab-link { 10 | 11 | &.active:not(.offline), 12 | &.active:not(.online) { 13 | background-color: rgba(1, 18, 25, 0.1); 14 | } 15 | 16 | &.offline { 17 | background-color: rgba(255, 0, 0, 0.60); 18 | 19 | &.active { 20 | background-color: rgba(255, 0, 0, 0.70); 21 | } 22 | } 23 | 24 | &.online { 25 | background-color: rgba(0, 255, 0, 0.25); 26 | 27 | &.active { 28 | background-color: rgba(0, 255, 0, 0.50); 29 | } 30 | } 31 | 32 | i { 33 | font-size: 24px; 34 | color: #FFFFFF; 35 | 36 | &.settings-icon { 37 | font-size: 26px; 38 | margin-top: -2px; 39 | margin-left: 2px; 40 | } 41 | 42 | &.a { 43 | display: inline-block; 44 | } 45 | &.b { 46 | display: none; 47 | } 48 | } 49 | 50 | &.active { 51 | 52 | i { 53 | &.a { 54 | display: none; 55 | } 56 | &.b { 57 | display: inline-block; 58 | } 59 | } 60 | } 61 | } 62 | 63 | .fw-flag { 64 | width: 44px; 65 | height: 34px; 66 | border: 1px solid #EEE; 67 | } 68 | 69 | .phone-code-selection, .language-selection { 70 | 71 | .item-title-row { 72 | background-position-y: 10px !important; 73 | 74 | .item-title span { 75 | display: block; 76 | font-size: 12px; 77 | color: #999; 78 | } 79 | 80 | .item-after { 81 | position: relative; 82 | top: 11px; 83 | } 84 | } 85 | } 86 | 87 | .content-block-16-mar { 88 | margin: 16px 0; 89 | } 90 | 91 | #select-contact { 92 | position: relative; 93 | 94 | i { 95 | position: absolute; 96 | font-size: 18px; 97 | left: 10px; 98 | top: 50%; 99 | margin-top: -10px; 100 | } 101 | } 102 | 103 | .phone-code-selection-area { 104 | margin-bottom: 0; 105 | margin-top: 0; 106 | } 107 | 108 | .phone-number-area { 109 | margin-top: -1px; 110 | 111 | ul:before { 112 | background: none; 113 | display: none; 114 | } 115 | 116 | i { 117 | font-size: 26px; 118 | margin-left: 7px; 119 | margin-top: 5px; 120 | } 121 | } 122 | 123 | .phone-info { 124 | border-radius: 3px; 125 | padding: 6px 0; 126 | text-align: center; 127 | color: #FFF; 128 | position: relative; 129 | 130 | i, span { 131 | display: inline-block; 132 | vertical-align: middle; 133 | font-size: 16px; 134 | } 135 | 136 | i { 137 | font-size: 23px; 138 | position: absolute; 139 | left: 5px; 140 | top: 50%; 141 | margin-top: -12px; 142 | } 143 | 144 | &.phone-good { 145 | background: #2196F3; 146 | 147 | .icon-close { 148 | display: none; 149 | } 150 | } 151 | 152 | &.phone-bad { 153 | background: #F44336; 154 | 155 | .icon-check { 156 | display: none; 157 | } 158 | } 159 | } 160 | 161 | .mar-topbot-8 { 162 | margin-top: 8px; 163 | margin-bottom: 8px; 164 | } 165 | 166 | .settings-icon { 167 | font-size: 35px; 168 | margin-left: 4px; 169 | } 170 | 171 | .settings-icon-mini { 172 | font-size: 25px; 173 | margin-left: 8px; 174 | } 175 | 176 | .help-request-item { 177 | .item-title { 178 | padding-left: 6px; 179 | } 180 | } 181 | 182 | .phone_number_input_wrap { 183 | .item-media { 184 | width: 46px; 185 | } 186 | } -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/about.vue: -------------------------------------------------------------------------------- 1 | 57 | -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/chat.vue: -------------------------------------------------------------------------------- 1 | 76 | -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/color-themes.vue: -------------------------------------------------------------------------------- 1 | 26 | 62 | -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/dynamic-route.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 53 | -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/form.vue: -------------------------------------------------------------------------------- 1 | 104 | 109 | -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/home.vue: -------------------------------------------------------------------------------- 1 | 56 | 61 | -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/panel-left.vue: -------------------------------------------------------------------------------- 1 | 21 | 26 | -------------------------------------------------------------------------------- /template_src/src/assets/vue/pages/vuex.vue: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /template_src/src/assets/vuex/storage.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Vuex from 'vuex'; 3 | 4 | Vue.use(Vuex); 5 | 6 | export default new Vuex.Store({ 7 | state: { 8 | user: {} 9 | }, 10 | 11 | actions: { 12 | userLogged ({commit}, user) { 13 | commit('USER_LOGGED', user); 14 | } 15 | }, 16 | 17 | mutations: { 18 | USER_LOGGED (state, user) { 19 | state.user = user; 20 | } 21 | }, 22 | }); -------------------------------------------------------------------------------- /template_src/src/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | My App 11 | 12 | 13 | 14 |
15 | 16 | <% if (htmlWebpackPlugin.options.platform) { %> 17 | 19 | <% } %> 20 | 21 | 22 | -------------------------------------------------------------------------------- /template_src/src/main.js: -------------------------------------------------------------------------------- 1 | // Import Vue 2 | import Vue from 'vue'; 3 | 4 | // Import Framework7 5 | import Framework7 from 'framework7/framework7.esm.bundle'; 6 | 7 | // Import F7 Vue Plugin 8 | import Framework7Vue from 'framework7-vue/framework7-vue.esm.bundle.js'; 9 | 10 | // Import F7 Style 11 | import Framework7CSS from 'framework7/css/framework7.bundle.min.css'; 12 | 13 | // Import F7 iOS Icons 14 | import Framework7Icons from 'framework7-icons/css/framework7-icons.css'; 15 | 16 | // Import Material Icons 17 | import MaterialIcons from 'material-design-icons/iconfont/material-icons.css'; 18 | 19 | // Import Fontawesome Theme Styles 20 | import FontAwesome from '@fortawesome/fontawesome-free/css/all.min.css'; 21 | 22 | // Import fastClick 23 | import FastClick from 'fastclick'; 24 | 25 | // Import App Custom Styles 26 | // import AppStyles from './assets/sass/main.scss' 27 | 28 | // Import App Component 29 | import app from './main.vue'; 30 | 31 | // Import Vuex Storage 32 | import store from './assets/vuex/storage.js'; 33 | 34 | // Different F7-Vue plugin initialization with f7 v3.0 35 | Framework7.use(Framework7Vue); 36 | 37 | // Init Vue App 38 | export default new Vue({ 39 | // Root Element 40 | el: '#app', 41 | store, 42 | render: c => c('app'), 43 | components: { 44 | app 45 | }, 46 | mounted() { 47 | window.addEventListener('load', () => { 48 | // run after everything is in-place 49 | FastClick.attach(document.body); 50 | }); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /template_src/src/main.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /template_src/src/routes.js: -------------------------------------------------------------------------------- 1 | import Home from './assets/vue/pages/home.vue'; 2 | import AboutPage from './assets/vue/pages/about.vue'; 3 | import FormPage from './assets/vue/pages/form.vue'; 4 | import DynamicRoutePage from './assets/vue/pages/dynamic-route.vue'; 5 | 6 | import PanelLeftPage from './assets/vue/pages/panel-left.vue'; 7 | import ColorThemes from './assets/vue/pages/color-themes.vue'; 8 | import Chat from './assets/vue/pages/chat.vue'; 9 | import Vuex from './assets/vue/pages/vuex.vue'; 10 | 11 | export default [ 12 | { 13 | path: '/', 14 | component: Home 15 | }, 16 | { 17 | path: '/about/', 18 | component: AboutPage 19 | }, 20 | { 21 | path: '/form/', 22 | component: FormPage 23 | }, 24 | { 25 | path: '/dynamic-route/blog/:blogId/post/:postId/', 26 | component: DynamicRoutePage 27 | }, 28 | { 29 | path: '/panel-left/', 30 | component: PanelLeftPage 31 | }, 32 | { 33 | path: '/color-themes/', 34 | component: ColorThemes 35 | }, 36 | { 37 | path: '/chat/', 38 | component: Chat 39 | }, 40 | { 41 | path: '/vuex/', 42 | component: Vuex 43 | }, 44 | ]; 45 | -------------------------------------------------------------------------------- /template_src/src/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiobiodere/cordova-template-framework7-vue-webpack/eac2c54c6941cb1917034f245c6348645eb9dabb/template_src/src/static/.gitkeep -------------------------------------------------------------------------------- /template_src/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (env) { 2 | if (typeof env === 'undefined') { 3 | return require('./config/webpack.dev')(); 4 | } else if (typeof env.devserver !== 'undefined' && env.devserver) { 5 | return require('./config/webpack.server')(); 6 | } else if (typeof env.release !== 'undefined' && env.release) { 7 | return require('./config/webpack.release')(); 8 | } 9 | }; -------------------------------------------------------------------------------- /template_src/webpack/dev_helpers/device_router.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | Device Router 10 | 11 | 78 | 79 | 80 | 81 | 82 |
83 |

84 | It seems we can't connect to
127.0.0.1:8081
85 | 86 | :8081

87 | You can test yourself with next inputs: 88 |

89 | 90 |
91 | Waiting for device ready... 92 |
93 | 94 |
95 | 96 |
97 | 98 |
99 | 100 |
101 |
102 | 103 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /template_src/webpack/plugins/CordovaHtmlOutputPlugin.js: -------------------------------------------------------------------------------- 1 | const cheerio = require("cheerio"); 2 | 3 | function CordovaHtmlOutputPlugin() {} 4 | 5 | CordovaHtmlOutputPlugin.prototype.apply = function (compiler) { 6 | compiler.plugin('compilation', (compilation) => { 7 | compilation.plugin('html-webpack-plugin-before-html-processing', function (htmlPluginData) { 8 | let $ = cheerio.load(htmlPluginData.html), 9 | cordovaJsFound = false; 10 | 11 | $("script").each((index, element) => { 12 | if ($(element).attr("src") === "cordova.js") 13 | cordovaJsFound = true; 14 | }); 15 | 16 | if (!cordovaJsFound) 17 | $("body").prepend(''); 18 | 19 | htmlPluginData.html = $.html(); 20 | }) 21 | }) 22 | }; 23 | 24 | module.exports = CordovaHtmlOutputPlugin; 25 | -------------------------------------------------------------------------------- /template_src/www/README.md: -------------------------------------------------------------------------------- 1 | When you use one of `cordova (run|emulate|prepare|serve)` command, this folder's content will automagically generate. --------------------------------------------------------------------------------