Skip to content
This repository was archived by the owner on May 2, 2020. It is now read-only.

V3 #932

Open
wants to merge 252 commits into
base: master
Choose a base branch
from
Open

V3 #932

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
435a8c3
shortlink to templates path
Dec 31, 2018
2d22613
dev build
Dec 31, 2018
9dade16
changed version to beta
Dec 31, 2018
4212418
added alpha suffix to version
Dec 31, 2018
e0e6f3a
fix path
Dec 31, 2018
18aface
add readme file
Dec 31, 2018
419c4d8
version bump
Dec 31, 2018
902027d
typo
Dec 31, 2018
1dc3af5
updated dependencies
Dec 31, 2018
4651112
add default log level value
Dec 31, 2018
ded4d57
issue list link
Dec 31, 2018
77fe4ac
milestone link instead of project link
Jan 1, 2019
c107bd5
added --save command
Jan 1, 2019
bcd1f6d
closes #813
Jan 1, 2019
b9ed4d6
updated year
Jan 1, 2019
9a26ebe
style fix
Jan 1, 2019
7c704e8
closes #814
Jan 1, 2019
d79f769
add tests to CLI
Jan 1, 2019
013eb4a
update run script
Jan 1, 2019
bc63b4d
update lock file
Jan 1, 2019
42bac2e
update eslint test script
Jan 1, 2019
8a3b668
update package config update script
Jan 1, 2019
e820335
update logger helper
Jan 1, 2019
49e9079
use run helper
Jan 1, 2019
3a75c73
update hint
Jan 1, 2019
435be9a
make eslint config configurable
Jan 1, 2019
c2b50a5
version bump
Jan 1, 2019
0900723
Update README.md
Jan 1, 2019
2f7be9a
style fix
Jan 1, 2019
c94a096
exclude node_modules folder
Jan 1, 2019
22dac01
version bump
Jan 1, 2019
7236d10
Update README.md
Jan 1, 2019
0d647de
fixed paths
Jan 2, 2019
477816a
fixed paths
Jan 2, 2019
8046d70
version bump
Jan 2, 2019
36efc36
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 2, 2019
5b05d53
Update README.md
Jan 2, 2019
92f3aeb
Update README.md
Jan 2, 2019
ee3c7ab
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 2, 2019
3382ab0
test if function is exported
Jan 2, 2019
3bdc8c1
style fix
Jan 2, 2019
5639f16
changed config options
Jan 2, 2019
efcc0a0
harmonized scripts
Jan 2, 2019
132d752
version bump
Jan 2, 2019
ee67693
make path relative
Jan 2, 2019
99ae079
handle no configured tests
Jan 2, 2019
ba4051d
version bump
Jan 2, 2019
13eea48
style fix
Jan 2, 2019
163309a
exclude build folder from tests
Jan 2, 2019
bf268d6
version bump
Jan 2, 2019
af643d6
show test reports by default
Jan 2, 2019
6abab8c
typo
Jan 2, 2019
cb73590
PWA build and open in browser
Jan 2, 2019
93dc499
style fix
Jan 2, 2019
deb9179
editor config support added
Jan 2, 2019
75a870c
reordered tasks
Jan 2, 2019
c31bbc4
sync. run instead of callback
Jan 2, 2019
f4d2596
warning for long time need
Jan 2, 2019
656c9f4
improved dev and build processes
Jan 3, 2019
5d6f8bc
add max line length to editor config
Jan 3, 2019
94ea25a
remove debug comment
Jan 3, 2019
1b121f5
async with callback
Jan 3, 2019
499e0ae
remove as buggy
Jan 3, 2019
0dfe749
android build
Jan 3, 2019
8270407
make build configurable
Jan 3, 2019
bd94a13
create app/config file first
Jan 3, 2019
4a57565
version bump
Jan 3, 2019
a2349d4
use short name for native builds
Jan 3, 2019
4b09022
version bump
Jan 3, 2019
40aa984
remove capacitor part from PWA build
Jan 3, 2019
f1ff69e
bump version
Jan 3, 2019
27e3c9f
remove build path
Jan 3, 2019
5ba38b7
add contribution guidelines
Jan 3, 2019
70b7652
improve build routine
Jan 3, 2019
8322be8
version bump, vue update, eslint update
Jan 3, 2019
6f05b9d
style guide added
Jan 3, 2019
2ad4655
tools for contribution added
Jan 3, 2019
3686b81
eslint fix
Jan 3, 2019
2825f0a
optimized script execution
Jan 3, 2019
81e8841
run external scripts silent
Jan 3, 2019
aee13ca
Revert "run external scripts silent"
Jan 3, 2019
314bac4
run external scripts silently
Jan 3, 2019
0870a75
bump version
Jan 3, 2019
1f8d5d2
typo
Jan 4, 2019
ba7ab71
hide vue ip generally
Jan 4, 2019
c0d8ba7
make offline service worker optional
Jan 4, 2019
69a8e03
debug objects properly
Jan 4, 2019
14ec15b
script debug logging
Jan 4, 2019
86298f7
let user configure gitignore
Jan 4, 2019
497d38f
version bump
Jan 4, 2019
09bd28c
added date in license
Jan 4, 2019
800064a
version bump
Jan 4, 2019
37d9863
app config schema validation
Jan 4, 2019
621f2b3
run tests on build command
Jan 4, 2019
4cbf0eb
make config self-explaning
Jan 4, 2019
dbe2896
version bump
Jan 4, 2019
1b4248b
check development mode / proper installation
Jan 4, 2019
12d1d97
version bump and Framework7 update
Jan 4, 2019
914295e
eslint fix
Jan 4, 2019
86ea569
align logging
Jan 4, 2019
d1e6098
make Xcode / Android Studio opening configurable
Jan 4, 2019
906ed32
use file to check development mode
Jan 4, 2019
2d0ac60
update eslint, version bump
Jan 4, 2019
9f65c1b
eslint fixes
Jan 5, 2019
50e6d6b
create config file initially from schema
Jan 5, 2019
f2c79c6
app config fix
Jan 5, 2019
ef771f1
fix app config even is file is no valid json
Jan 5, 2019
f0b160c
fix app config fix run
Jan 5, 2019
2117834
eslint fix
Jan 5, 2019
ceb39cc
ftp deployment
Jan 5, 2019
4a725f9
app config reset on prepublish
Jan 6, 2019
31381ec
run tests in prepublish
Jan 6, 2019
46bf2d9
eslint fix
Jan 6, 2019
5129d1e
check changelog before publishing, use new prepublishOnly
Jan 6, 2019
e9af2af
firebase hosting deployment
Jan 6, 2019
0c90944
eslint fix
Jan 6, 2019
923e2b4
fix json
Jan 6, 2019
4213b17
fix missing manifest and icons
Jan 6, 2019
6870fbe
open PWA in browser after build
Jan 6, 2019
713dada
icon build improvement
Jan 6, 2019
9003fff
bump version
Jan 6, 2019
004c220
icon update
Jan 6, 2019
f803c85
icon update
Jan 6, 2019
f1c5801
prompt user for firebase project to deploy
Jan 6, 2019
4005519
replace paths in general
Jan 6, 2019
de4e510
unblock PWA opening in browser
Jan 6, 2019
0a433b8
ios icons
Jan 6, 2019
856b453
theme = auto is default
Jan 6, 2019
a49a7fa
version bump
Jan 6, 2019
0308d87
removed icon from wrong folder
Jan 7, 2019
1b0dd3b
version bump
Jan 7, 2019
1370202
update eslint config before test
Jan 7, 2019
9f02840
updat eslint config before test only
Jan 7, 2019
a18183c
use icon fonts, add app.css temporary
Jan 7, 2019
2a7c6d5
remove app.css file
Jan 8, 2019
5097b75
improve cli
Jan 8, 2019
4edf9b3
eslint fix
Jan 8, 2019
f9832ba
fix for windows
Jan 9, 2019
a3f2767
splash screen hides after F7 init
Jan 9, 2019
e7da563
added demo to the main repo
Jan 9, 2019
c828a13
script to update F7 demo files
Jan 9, 2019
343bc8a
ESLint fix
Jan 9, 2019
4c3c400
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 9, 2019
faee029
removed templates folder
Jan 9, 2019
077194b
support app.css file
Jan 9, 2019
4cee129
support customized Vue
Jan 9, 2019
4118400
make icon font usage configurable
Jan 9, 2019
b75dba2
favicon support
Jan 9, 2019
f3eaa31
build icons on dev command
Jan 9, 2019
2dc4d59
3.0.1-0
Jan 10, 2019
40eb9ad
3.0.2-0
Jan 10, 2019
8bc624d
Revert "3.0.2-0"
Jan 10, 2019
ff4601c
Revert "3.0.1-0"
Jan 10, 2019
89f5ca1
release v3.0.0-alpha.50
Jan 10, 2019
01c0923
Revert "release v3.0.0-alpha.50"
Jan 10, 2019
3fba3d9
release v3.0.0-alpha.48
Jan 10, 2019
926a2e7
release v3.0.0-alpha.49
Jan 10, 2019
4aaab48
release v3.0.0-alpha.50
Jan 10, 2019
73a6919
release v3.0.0-alpha.51
Jan 10, 2019
cad4696
Revert "release v3.0.0-alpha.51"
Jan 10, 2019
d6083a2
Revert "release v3.0.0-alpha.50"
Jan 10, 2019
ee5b686
Revert "release v3.0.0-alpha.49"
Jan 10, 2019
171a545
Revert "release v3.0.0-alpha.48"
Jan 10, 2019
72df944
improve prepublish script
Jan 10, 2019
034973f
release v3.0.0-alpha.48
Jan 10, 2019
53fda3e
Revert "release v3.0.0-alpha.48"
Jan 10, 2019
072bc56
test
Jan 10, 2019
b7e6e5d
Revert "test"
Jan 10, 2019
5839ba5
test2
Jan 10, 2019
f27a3bf
Revert "test2"
Jan 10, 2019
dd4a02c
test5
Jan 10, 2019
fa745a1
Revert "test5"
Jan 10, 2019
3f5669c
improve prepublish script
Jan 10, 2019
3f41310
eslint fix
Jan 10, 2019
feb03bf
test6
Jan 10, 2019
ecb8d4d
Revert "test6"
Jan 10, 2019
36ce90a
released v3.0.0-alpha.48
Jan 10, 2019
7dc0526
typo
Jan 10, 2019
347da57
release v3.0.0-alpha.49
Jan 10, 2019
0ba3f88
release workflow in readme
Jan 10, 2019
4a7f289
make dev server port configurable
Jan 10, 2019
9acfc8e
release v3.0.0-alpha.50
Jan 10, 2019
87f88d8
release v3.0.0-alpha.51
Jan 10, 2019
ed8b005
make demo app v3 ready for deployment
Jan 10, 2019
6af8949
release v3.0.0-alpha.52
Jan 10, 2019
f395453
Create README_NEW.md
Jan 11, 2019
90da1b8
Update README_NEW.md
Jan 11, 2019
082b7a1
Update README_NEW.md
Jan 11, 2019
c3999d2
Update README_NEW.md
Jan 11, 2019
94ba9c4
Update README_NEW.md
Jan 11, 2019
4315bb3
rename design to media
Jan 11, 2019
bb24b99
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 11, 2019
d707784
fix issues with wrong ios id
Jan 11, 2019
3c9c041
Update README_NEW.md
Jan 11, 2019
91a2d0c
Update README_NEW.md
Jan 11, 2019
898dbdd
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 11, 2019
830d8b6
Update README_NEW.md
Jan 11, 2019
73787bf
Update README_NEW.md
Jan 11, 2019
8cee687
updated process image
Jan 11, 2019
ef5a441
rename process properly
Jan 11, 2019
6b7811b
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 11, 2019
46cc326
Update README_NEW.md
Jan 11, 2019
d5bcba1
Update README_NEW.md
Jan 11, 2019
29e2937
Update README_NEW.md
Jan 11, 2019
bdd6879
Update README_NEW.md
Jan 11, 2019
aa913f6
deployment icons
Jan 11, 2019
1fbf0e9
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 11, 2019
ada3d5b
download icons
Jan 11, 2019
6d1aa55
Update README_NEW.md
Jan 11, 2019
ba886d0
screenshots added
Jan 11, 2019
62db480
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Jan 11, 2019
d4065b5
updated screenshots
Jan 11, 2019
ddaf767
outdated note
Jan 11, 2019
f105a43
Update README_NEW.md
Jan 11, 2019
7ce469b
Update README_NEW.md
Jan 11, 2019
a11eb0b
Update README_NEW.md
Jan 11, 2019
a6fe2f9
Update README_NEW.md
Jan 11, 2019
b53de99
Update README_NEW.md
Jan 11, 2019
ddb40bf
Update README_NEW.md
Jan 11, 2019
f3e34f7
doc update
Jan 11, 2019
c43a242
work on readme
Jan 11, 2019
bedf995
Update README.md
Jan 11, 2019
4d200ed
Update README.md
Jan 11, 2019
463d1e3
Update README.md
Jan 11, 2019
af141ec
Update README.md
Jan 11, 2019
6a1ef2a
Update README.md
Jan 11, 2019
a482dee
Update README.md
Jan 11, 2019
40539be
Update README.md
Jan 11, 2019
7211f71
Update README.md
Jan 11, 2019
e77c3d4
Update README.md
Jan 11, 2019
bcb5a0a
Update README.md
Jan 11, 2019
2857e67
Update README.md
Jan 11, 2019
efbdc6c
Create development-images.md
Jan 11, 2019
ebbfd79
Update development-images.md
Jan 11, 2019
317bd62
Update development-images.md
Jan 11, 2019
148c816
Update README.md
Jan 11, 2019
4eab6c2
Update development-images.md
Jan 11, 2019
7247deb
Update development-images.md
Jan 11, 2019
8ee329b
Update README.md
Jan 15, 2019
e0a48c4
Update README.md
Jan 15, 2019
fb15b17
Update README.md
Jan 15, 2019
75f24ed
typo
Apr 15, 2019
da893af
build android etc
Apr 20, 2019
faa6a81
Merge branch 'v3' of https://github.com/scriptPilot/app-framework int…
Apr 20, 2019
c44cdf6
Update README.md
scriptPilot May 1, 2020
477b599
Update README.md
scriptPilot May 1, 2020
944df99
Update README.md
scriptPilot May 1, 2020
0931e65
Update README.md
scriptPilot May 1, 2020
ef2b9fb
Update README.md
scriptPilot May 1, 2020
508b992
Update README.md
scriptPilot May 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# App Framework - Changelog

## App Framework v3

### App Framework v3.0.0-alpha.52

Current development version. Please check the [milestone](https://github.com/scriptPilot/app-framework/milestone/8) for details.

## App Framework v2

App Framework v2 was never released.

## App Framework v1

Please see the [changelog for v1](https://github.com/scriptPilot/app-framework/blob/v1/CHANGELOG.md).
75 changes: 75 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# App Framework Documentation

### Setup the Development Environment

- [GitHub Desktop](https://desktop.github.com/) to manage GitHub repositories
- [Atom](https://atom.io/) as a code editor
- Package `language-vue-component` for [Vue single file component](https://vuejs.org/v2/guide/single-file-components.html)
- Package `editorconfig` to have same file formatting settings
- [Node.js](https://nodejs.org) as a local development server
- [Google Chrome](https://www.google.de/chrome) as a web browser with integrated [development tools](https://developers.google.com/web/tools/chrome-devtools/)
- Extension [Vue.js devtools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) to debug the Vue components



# App Framework 3

App Framework 3 is under development. **For production usage please use [App Framework 1](https://github.com/scriptPilot/app-framework)**. The status of the development can be seen in [this milestone](https://github.com/scriptPilot/app-framework/milestone/8). You are invited to open any V3 related [question, bug or feature request](https://github.com/scriptPilot/app-framework/issues).

## Get Started

1. Run `mkdir <app_name>` to create a new folder for the application
2. Run `cd <app_name>` to open the newly created folder
3. Run `echo {} > package.json` to create an empty package file
4. Run `npm install --save app-framework@latest` to install latest development release
5. Run `npx app dev` to open application on development server

## CLI Commands

- `npx app test` to run all configured tests
- `npx app test eslint` to run ESLint test
- `npx app test jest` to run Jest tests
- `npx app dev` to open application on development server
- `npx app build` to build application according configuration
- `npx app deploy ftp` to deploy the PWA to any FTP server
- `npx app deploy firebase` to deploy the PWA to any FTP server

## Update

Run `npm update` to update to latest development version.

## Contribution

### Setup the Development Environment

- [GitHub Desktop](https://desktop.github.com/) to manage GitHub repositories
- [Atom](https://atom.io/) as a code editor
- Package `language-vue-component` for [Vue single file component](https://vuejs.org/v2/guide/single-file-components.html)
- Package `editorconfig` to have same file formatting settings
- [Node.js](https://nodejs.org) as a local development server
- [Google Chrome](https://www.google.de/chrome) as a web browser with integrated [development tools](https://developers.google.com/web/tools/chrome-devtools/)
- Extension [Vue.js devtools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) to debug the Vue components

### Setup the Repository

1. Run `clone https://github.com/scriptPilot/app-framework` to clone this repository
2. Run `cd app-framework` to open the repository folder
3. Run `npm install` to install all dependencies
4. Run `sudo npm link` to make CLI available in development mode

### Development Workflow

1. Create an [issue](https://github.com/scriptPilot/app-framework/issues) in GitHub
2. Create a branch with name `issue-<number>`
3. Develop and test your solution, update the documentation
4. Commit your changes on the issue branch
5. Create a pull request with note `closes issue <number>`

Please follow the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).

### Release Workflow

1. Commit all changes
2. Update the changelog file for the next version
3. Run `npm publish` to start the publishing process
-
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018
Copyright (c) 2016-2019

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# App Framework v3

> App Framework v3 was never completed. The latest stable version is [App Framework v1](https://github.com/scriptPilot/app-framework/tree/master).

**iOS and Android Apps with HTML & JavaScript. App Framework combines great pieces of open source code to support your whole workflow with useful scripts and your App with powerful plugins. With App Framework, you can spend your time for your next amazing App and not for the tricky stuff around - free and open source!**

![](media/process.png)

## Features

### Core

- [x] **Beautiful User Interface** with native iOS and Material Design elements and transitions, based on [Framework7](https://framework7.io/)
- [x] **Flexible Routing** for pages, tabs, modals and panels with dynamic routing support, realized with [Framework7-Vue](https://framework7.io/vue/navigation-router.html)
- [ ] **Multi-language Support** with language files and automatic completeness check according the default language
- [x] **Offline Capability** to use the app even without any network connection
- [x] **One Code Base** for all devices with HTML, CSS and JavaScript, realized with [Capacitor](https://capacitor.ionicframework.com/), supporting [ES2015](https://babeljs.io/learn-es2015/)
- [x] **Single File Components** for powerful but easy to maintain apps, made with [Vue.js](https://vuejs.org/) and [Framework7-Vue](http://framework7.io/vue/)
- [x] **Project Folder Creation**, lightweight and well-organized, ready to publish on [GitHub](https://github.com/about)

### Scripts

- [x] **Live Development Server** with hot module replacement, powered by [Parcel](https://parceljs.org/)
- [x] **Test on your own Device** or in any iOS or Android emulator, supported by [Capacitor](https://capacitor.ionicframework.com/), [Xcode](https://developer.apple.com/xcode/) and [Android Studio](https://developer.android.com/studio)
- [x] **Test Framework** for code correctness and standard conformity with [ESLint](http://eslint.org/) and for unit tests with [Jest](https://facebook.github.io/jest/)
- [x] **Optimized Build Process** for good scores at [Google Lighthouse](https://developers.google.com/web/tools/lighthouse/), realized with [Parcel](https://parceljs.org/)
- [ ] **Icon Generation** for favicon, touch icons and splash screens, out of a single image file with [Jimp](https://github.com/oliver-moran/jimp)
- [x] **Easy Deployment** without downtime to [Apple App Store](https://developer.apple.com/xcode/), [Google Play Store](https://developer.android.com/studio), [Firebase Hosting](https://firebase.google.com/products/hosting/) or any FTP server

### Plugins

- [x] **Native Hardware API Plugins** for iOS and Android devices, realized with [Capacitor](https://capacitor.ionicframework.com/)
- [ ] **Comprehensive Icon Fonts** like [FontAwesome](http://fontawesome.io/), [Framework7 Icons](http://framework7.io/icons/), [Ion](http://ionicons.com/) and [Material Design Icons](https://material.io/icons/) out of the box
- [ ] **Phone Frame** around your application on big screens, so you can offer desktop access with charm
- [ ] **State Restoration** for the history per view, tabs, scroll positions, focus, panels, modals and form inputs
- [ ] **Global Data Object** to save user data across several application restarts easily
- [ ] **Vuex Integration** to use the official Vue.js [state management library](https://vuex.vuejs.org/en/intro.html)
- [ ] **Preloading** for images, fonts and JavaScript files
- [ ] **Firebase Integration** for several services like [Authentication](https://firebase.google.com/products/auth/), [Realtime Database](https://firebase.google.com/products/realtime-database/), [Firestore](https://firebase.google.com/products/firestore/) and [Cloud Storage](https://firebase.google.com/products/storage/)

## Demo App

The Apple App Store app may be outdated because Apple blocks demo apps from their store now.

[![Download on the App Store Play](media/download-icon-app-store.png)](https://itunes.apple.com/us/app/app-framework-demo/id1203927581?mt=8')
&nbsp;&nbsp;&nbsp;
[![Get it on Google Play](media/download-icon-play-store.png)](https://play.google.com/store/apps/details?id=de.scriptpilot.appframework)
&nbsp;&nbsp;&nbsp;
[![Open as Web App](media/download-icon-firebase.png)](https://demo.app-framework.com)

![Screenshots](media/demo-app-screenshots.png)

## Documentation

### Quick Start

1. Run `mkdir my-app` to create a new project folder
2. Run `cd my-app` to open the project folder
3. Run `echo {} > package.json` to create an empty json file
4. Run `npm install app-framework` for installation
5. Run `npx app dev` to start the local development server

### Workflow

- Setup your development environment
- Start and configure your app project
- Develop your application
- Modify the app component
- Modify page components and the routing
- Use CSS style sheets
- [Use image files](./docs/development-images.md)
- Use Node packages
- Use hardware APIs
- Test your application
- Deploy your application
- to any FTP server
- to Firebase Hosting
- to the Apple App Store
- to the Android Play Store

### CLI Reference

- Run `npx app test` to run all configured tests
- Run `npx app test eslint` to run the ESLint test
- Run `npx app test jest` to run the Jest tests
- Run `npx app dev` to open the application on the development server
- Run `npx app build` to build the application according the configuration
- Run `npx app deploy ftp` to deploy the PWA to any FTP server
- Run `npx app deploy firebase` to deploy the PWA to Firebase Hosting
74 changes: 74 additions & 0 deletions cli/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env node

// Import modules
const program = require('commander');
const fs = require('fs-extra');
const { execSync } = require('child_process');
const log = require('../scripts/helper/logger');
const path = require('../scripts/helper/path');
const run = require('../scripts/helper/run');
const { version } = require('../package.json');

// Check if App Framework was cloned and no .enableDevelopmentMode file exists
if (path.project() === path.framework() && !fs.pathExistsSync(path.project('.enableDevelopmentMode'))) {
log.error(`
App Framework should be installed as a Node package - not beeing cloned.
To contribute to App Frameworkwork itself, please activate the development mode.
Please read the documentation for details.
`);
}

// Define default programs
program
.version(version, '-v --version');
program
.command('test [name]')
.description('run tests according configuration')
.action((name) => {
if (name === undefined) {
run.script('test');
} else if (name === 'eslint') {
run.script('test-eslint');
} else if (name === 'jest') {
run.script('test-jest');
} else {
log.error('Allowed names are "eslint" and "jest" only.');
}
});
program
.command('dev')
.description('open app on development server with hot-reload')
.action(() => {
run.script('dev');
});
program
.command('build')
.description('build application according configuration')
.action(() => {
run.script('build');
});
program
.command('deploy <target>')
.description('deploy application to the target (ftp or firebase)')
.action((target) => {
if (target === 'ftp') {
execSync('node ./deploy-ftp.js', { cwd: path.scripts(), stdio: 'inherit' });
} else if (target === 'firebase') {
execSync('node ./deploy-firebase.js', { cwd: path.scripts(), stdio: 'inherit' });
} else {
log.error('Allowed targets are "ftp" and "firebase" only.');
}
});

// Define development programs
if (path.framework() === path.project()) {
program
.command('update-f7')
.description('update Framework7 demo files')
.action(() => {
run.script('update-framework7-demo-files');
});
}

// Parse program
program.parse(process.argv);
Loading