@furry-boilerplates/capacitorjs 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -2
- package/bin/capacitorjs +21 -0
- package/bin/gateway.sh +19 -0
- package/bin/includes.sh +25 -0
- package/bin/install/configure.git.sh +12 -0
- package/bin/install/configure.gradle.sh +11 -0
- package/bin/install/configure.npm.sh +35 -0
- package/bin/install/configure.template.sh +37 -0
- package/bin/install/import.scaffolding.sh +12 -0
- package/bin/install/includes.sh +13 -0
- package/bin/install/init.dist.sh +10 -0
- package/bin/install/install.android.sh +11 -0
- package/bin/install/install.capacitor.sh +13 -0
- package/bin/install/install.ios.sh +10 -0
- package/bin/install/install.npm.sh +38 -0
- package/bin/install/install.sh +108 -0
- package/bin/install/sync.capacitor.sh +9 -0
- package/bin/tests/helloworld.sh +5 -0
- package/bin/tests/includes.sh +2 -0
- package/dist/BUGS.md +14 -0
- package/dist/LICENSE.md +11 -0
- package/dist/README.md +14 -0
- package/dist/bin/build/build.sh +6 -0
- package/dist/bin/build/capacitor.sync.sh +5 -0
- package/dist/bin/build/includes.sh +4 -0
- package/dist/bin/build/rollup.sh +8 -0
- package/dist/bin/cli/gateway.sh +24 -0
- package/dist/bin/cli/includes.sh +2 -0
- package/dist/bin/furrycap/furrycap +21 -0
- package/dist/bin/furrycap/gateway.sh +17 -0
- package/dist/bin/furrycap/includes.sh +24 -0
- package/dist/bin/furrycap/tests/helloworld.sh +5 -0
- package/dist/bin/furrycap/tests/includes.sh +2 -0
- package/dist/bin/furrycapOLD +17 -0
- package/dist/bin/includes.sh +5 -0
- package/dist/bin/launch/gateway.sh +22 -0
- package/dist/bin/launch/includes.sh +5 -0
- package/dist/bin/launch/launch.android.sh +3 -0
- package/dist/bin/launch/launch.ios.sh +3 -0
- package/dist/bin/launch/launch.web.sh +21 -0
- package/dist/capacitor.config.json +3 -0
- package/dist/dotenv +1 -0
- package/dist/index.mjs +18 -0
- package/dist/nodemon.json +8 -0
- package/dist/package.json +35 -0
- package/dist/rollup.config.mjs +31 -0
- package/dist/www/src/index.html +15 -0
- package/dist/www/src/index.mjs +1 -0
- package/package.json +25 -4
package/README.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Capacitor JS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
|
8
|
+
|
|
9
|
+
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
|
10
|
+
|
|
11
|
+
## Add your files
|
|
12
|
+
|
|
13
|
+
* [Create](https://docs.gitlab.com/user/project/repository/web_editor/#create-a-file) or [upload](https://docs.gitlab.com/user/project/repository/web_editor/#upload-a-file) files
|
|
14
|
+
* [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
cd existing_repo
|
|
18
|
+
git remote add origin https://gitlab.com/furry-installers/boilerplates/capacitor-js.git
|
|
19
|
+
git branch -M main
|
|
20
|
+
git push -uf origin main
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Integrate with your tools
|
|
24
|
+
|
|
25
|
+
* [Set up project integrations](https://gitlab.com/furry-installers/boilerplates/capacitor-js/-/settings/integrations)
|
|
26
|
+
|
|
27
|
+
## Collaborate with your team
|
|
28
|
+
|
|
29
|
+
* [Invite team members and collaborators](https://docs.gitlab.com/user/project/members/)
|
|
30
|
+
* [Create a new merge request](https://docs.gitlab.com/user/project/merge_requests/creating_merge_requests/)
|
|
31
|
+
* [Automatically close issues from merge requests](https://docs.gitlab.com/user/project/issues/managing_issues/#closing-issues-automatically)
|
|
32
|
+
* [Enable merge request approvals](https://docs.gitlab.com/user/project/merge_requests/approvals/)
|
|
33
|
+
* [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
|
|
34
|
+
|
|
35
|
+
## Test and Deploy
|
|
36
|
+
|
|
37
|
+
Use the built-in continuous integration in GitLab.
|
|
38
|
+
|
|
39
|
+
* [Get started with GitLab CI/CD](https://docs.gitlab.com/ci/quick_start/)
|
|
40
|
+
* [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/user/application_security/sast/)
|
|
41
|
+
* [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/topics/autodevops/requirements/)
|
|
42
|
+
* [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/user/clusters/agent/)
|
|
43
|
+
* [Set up protected environments](https://docs.gitlab.com/ci/environments/protected_environments/)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
# Editing this README
|
|
48
|
+
|
|
49
|
+
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
|
50
|
+
|
|
51
|
+
## Suggestions for a good README
|
|
52
|
+
|
|
53
|
+
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
|
54
|
+
|
|
55
|
+
## Name
|
|
56
|
+
Choose a self-explaining name for your project.
|
|
57
|
+
|
|
58
|
+
## Description
|
|
59
|
+
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
60
|
+
|
|
61
|
+
## Badges
|
|
62
|
+
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
63
|
+
|
|
64
|
+
## Visuals
|
|
65
|
+
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
72
|
+
|
|
73
|
+
## Support
|
|
74
|
+
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
75
|
+
|
|
76
|
+
## Roadmap
|
|
77
|
+
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
78
|
+
|
|
79
|
+
## Contributing
|
|
80
|
+
State if you are open to contributions and what your requirements are for accepting them.
|
|
81
|
+
|
|
82
|
+
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
|
83
|
+
|
|
84
|
+
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
|
85
|
+
|
|
86
|
+
## Authors and acknowledgment
|
|
87
|
+
Show your appreciation to those who have contributed to the project.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
For open source projects, say how it is licensed.
|
|
91
|
+
|
|
92
|
+
## Project status
|
|
93
|
+
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
package/bin/capacitorjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#! /bin/bash
|
|
2
|
+
__capacitorjs_BIN_PATH="$(cd -- "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" && pwd)"
|
|
3
|
+
__capacitorjs_INSTALL_DIR="$PWD"
|
|
4
|
+
|
|
5
|
+
. "${__capacitorjs_BIN_PATH}/includes.sh"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
__capacitorjs_CLI_PATH="${__capacitorjs_INSTALL_DIR}/node_modules/@furrymink/cli"
|
|
9
|
+
|
|
10
|
+
if [[ ! -d "$__capacitorjs_CLI_PATH" ]]; then
|
|
11
|
+
echo "@furrymink/cli not found. installing now..."
|
|
12
|
+
npm install @furrymink/cli@latest
|
|
13
|
+
else
|
|
14
|
+
echo "@furrymink/cli already installed"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
source "${__capacitorjs_INSTALL_DIR}/node_modules/@furrymink/cli/bin/includes.sh"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
capacitorjs.cli.gateway "$@"
|
package/bin/gateway.sh
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
capacitorjs.cli.gateway(){
|
|
2
|
+
local COMMAND="$1"
|
|
3
|
+
shift
|
|
4
|
+
|
|
5
|
+
local ARGS=("$@")
|
|
6
|
+
|
|
7
|
+
case $COMMAND in
|
|
8
|
+
helloworld)
|
|
9
|
+
capacitorjs.helloworld "${ARGS[@]}";;
|
|
10
|
+
install)
|
|
11
|
+
capacitorjs.install "${ARGS[@]}";;
|
|
12
|
+
export)
|
|
13
|
+
console.info "Exporting capacitorjs includes ..."
|
|
14
|
+
capacitorjs.include.scripts "includes.sh" "$@";;
|
|
15
|
+
*)
|
|
16
|
+
console.info "Unknown command '${COMMAND}'";;
|
|
17
|
+
esac
|
|
18
|
+
|
|
19
|
+
}
|
package/bin/includes.sh
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
__capacitorjs_BIN_PATH="$(cd -- "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" && pwd)"
|
|
2
|
+
__capacitorjs_CLI_PATH="$(realpath "$__capacitorjs_BIN_PATH/..")"
|
|
3
|
+
__capacitorjs_MODULES_PATH="${__capacitorjs_BIN_PATH}/modules"
|
|
4
|
+
__capacitorjs_INSTALL_DIR="$PWD"
|
|
5
|
+
__capacitorjs_PACKAGE_PATH="$(realpath "$__capacitorjs_BIN_PATH/..")"
|
|
6
|
+
|
|
7
|
+
capacitorjs.include.scripts(){
|
|
8
|
+
local BASE="${__capacitorjs_BIN_PATH}"
|
|
9
|
+
local SCRIPTS=()
|
|
10
|
+
|
|
11
|
+
while [[ $# -gt 0 ]]; do
|
|
12
|
+
case $1 in
|
|
13
|
+
--base) BASE="$2"; shift 2 ;;
|
|
14
|
+
*) SCRIPTS+=("$1"); shift 1 ;;
|
|
15
|
+
esac
|
|
16
|
+
done
|
|
17
|
+
for SCRIPT in "${SCRIPTS[@]}"; do
|
|
18
|
+
. "${BASE}/${SCRIPT}"
|
|
19
|
+
done
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
capacitorjs.include.scripts \
|
|
23
|
+
"gateway.sh" \
|
|
24
|
+
"tests/includes.sh" \
|
|
25
|
+
"install/includes.sh"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
capacitorjs.configure.gradle(){
|
|
2
|
+
console.header "Configure gradle"
|
|
3
|
+
local INSTALL_DIR="$1"
|
|
4
|
+
|
|
5
|
+
cd $INSTALL_DIR
|
|
6
|
+
|
|
7
|
+
sed -i 's#^distributionUrl=.*#distributionUrl=https\\://services.gradle.org/distributions/gradle-9.1.0-bin.zip#' "${INSTALL_DIR}/android/gradle/wrapper/gradle-wrapper.properties"
|
|
8
|
+
sed -i "s/proguard-android\.txt/proguard-android-optimize.txt/g" "${INSTALL_DIR}/android/app/build.gradle"
|
|
9
|
+
sed -i "s/com.android.tools.build:gradle:8.13.0/com.android.tools.build:gradle:9.0.1/g" "${INSTALL_DIR}/android/build.gradle"
|
|
10
|
+
console.info "Finished configuring gradle"
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
capacitorjs.configure.npm(){
|
|
2
|
+
console.header "Configure NPM"
|
|
3
|
+
local INSTALL_DIR="$1"
|
|
4
|
+
local APP_NAME="$2"
|
|
5
|
+
local VERSION="$3"
|
|
6
|
+
local TYPE="$4"
|
|
7
|
+
local REPO_URL="$5"
|
|
8
|
+
local BUGS_URL="$6"
|
|
9
|
+
local HOMEPAGE_URL="$7"
|
|
10
|
+
local LICENSE="$8"
|
|
11
|
+
|
|
12
|
+
cd $INSTALL_DIR
|
|
13
|
+
|
|
14
|
+
console.log "Update package.json"
|
|
15
|
+
npm pkg set name="${APP_NAME}"
|
|
16
|
+
npm pkg set type="${TYPE}"
|
|
17
|
+
npm pkg set main="index.mjs"
|
|
18
|
+
npm pkg set repository.url="${REPO_URL}"
|
|
19
|
+
npm pkg set bugs.url="${BUGS_URL}"
|
|
20
|
+
npm pkg set homepage="${HOMEPAGE_URL}"
|
|
21
|
+
npm pkg set scripts.build="./scripts/build.sh"
|
|
22
|
+
npm pkg set scripts.launch:web="./scripts/launch-web.sh"
|
|
23
|
+
npm pkg set scripts.launch:android="./scripts/launch-android.sh"
|
|
24
|
+
npm pkg set scripts.launch:ios="./scripts/launch-ios.sh"
|
|
25
|
+
npm pkg set scripts.git:push="./scripts/git-push.sh"
|
|
26
|
+
npm pkg set scripts.git:commit="./scripts/git-commit.sh"
|
|
27
|
+
npm pkg set scripts.open:studio:push="npx cap open android"
|
|
28
|
+
|
|
29
|
+
if [[ -z "${LICENSE//[[:space:]]/}" ]]; then
|
|
30
|
+
npm pkg delete license
|
|
31
|
+
else
|
|
32
|
+
npm pkg set license="${LICENSE}"
|
|
33
|
+
fi
|
|
34
|
+
console.info "Finished configuring NPM"
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
capacitorjs.configure.template(){
|
|
2
|
+
console.header "Configure template"
|
|
3
|
+
# DEV NOTE SHOULD PASS A LIST OF KEY PAIR VALUES TO REPLACE IN INDEX
|
|
4
|
+
|
|
5
|
+
local INSTALL_DIR="$1"
|
|
6
|
+
local APP_NAME="$2"
|
|
7
|
+
local DESCRIPTION="$3"
|
|
8
|
+
local AUTHOR="$4"
|
|
9
|
+
local EMAIL="$5"
|
|
10
|
+
local LICENSE="$6"
|
|
11
|
+
local LICENSE_NOTICE="${LICENSE:-$__boilerplate_strings__no_license_granted}"
|
|
12
|
+
|
|
13
|
+
cd $INSTALL_DIR
|
|
14
|
+
|
|
15
|
+
if [[ $LICENSE != "" ]]; then
|
|
16
|
+
rm "LICENSE.md"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
local ESCAPED_NOTICE=$(printf '%s' "$LICENSE_NOTICE" | sed 's/[&/\]/\\&/g; s/$/\\n/' | tr -d '\n')
|
|
20
|
+
|
|
21
|
+
console.log "Configuring web resources"
|
|
22
|
+
sed -i "s/{{APP_NAME}}/$APP_NAME/" "${INSTALL_DIR}/www/src/index.html"
|
|
23
|
+
|
|
24
|
+
sed -i "s/{{APP_NAME}}/$APP_NAME/" "${INSTALL_DIR}/README.md"
|
|
25
|
+
sed -i "s/{{DESCRIPTION}}/$DESCRIPTION/" "${INSTALL_DIR}/README.md"
|
|
26
|
+
sed -i "s/{{AUTHOR}}/$AUTHOR/" "${INSTALL_DIR}/README.md"
|
|
27
|
+
sed -i "s/{{EMAIL}}/$EMAIL/" "${INSTALL_DIR}/README.md"
|
|
28
|
+
sed -i "s/{{LICENSE}}/$ESCAPED_NOTICE/g" "${INSTALL_DIR}/README.md"
|
|
29
|
+
|
|
30
|
+
sed -i "s/{{APP_NAME}}/$APP_NAME/" "${INSTALL_DIR}/BUGS.md"
|
|
31
|
+
sed -i "s/{{DESCRIPTION}}/$DESCRIPTION/" "${INSTALL_DIR}/BUGS.md"
|
|
32
|
+
sed -i "s/{{AUTHOR}}/$AUTHOR/" "${INSTALL_DIR}/BUGS.md"
|
|
33
|
+
sed -i "s/{{EMAIL}}/$EMAIL/" "${INSTALL_DIR}/BUGS.md"
|
|
34
|
+
sed -i "s/{{LICENSE}}/$ESCAPED_NOTICE/g" "${INSTALL_DIR}/BUGS.md"
|
|
35
|
+
|
|
36
|
+
console.info "Finished configuring template"
|
|
37
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
capacitorjs.import.scaffolding(){
|
|
2
|
+
console.header "Import scaffolding"
|
|
3
|
+
|
|
4
|
+
local INSTALL_DIR="$1"
|
|
5
|
+
local PACKAGE_PATH="$2"
|
|
6
|
+
|
|
7
|
+
cd $INSTALL_DIR
|
|
8
|
+
|
|
9
|
+
cp -rf "${PACKAGE_PATH}/dist/." "${INSTALL_DIR}/"
|
|
10
|
+
mv "${INSTALL_DIR}/dotenv" "${INSTALL_DIR}/.env"
|
|
11
|
+
console.info "Finished importing scaffolding"
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
capacitorjs.include.scripts \
|
|
2
|
+
"install/configure.git.sh" \
|
|
3
|
+
"install/configure.gradle.sh" \
|
|
4
|
+
"install/configure.npm.sh" \
|
|
5
|
+
"install/configure.template.sh" \
|
|
6
|
+
"install/import.scaffolding.sh" \
|
|
7
|
+
"install/init.dist.sh" \
|
|
8
|
+
"install/install.sh" \
|
|
9
|
+
"install/install.android.sh" \
|
|
10
|
+
"install/install.capacitor.sh" \
|
|
11
|
+
"install/install.ios.sh" \
|
|
12
|
+
"install/install.npm.sh" \
|
|
13
|
+
"install/sync.capacitor.sh"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
capacitorjs.install.capacitor(){
|
|
2
|
+
console.header "Install capacitor"
|
|
3
|
+
local INSTALL_DIR="$1"
|
|
4
|
+
local _APP_NAME="$2"
|
|
5
|
+
local _PACKAGE_ID="$3"
|
|
6
|
+
|
|
7
|
+
cd "${INSTALL_DIR}"
|
|
8
|
+
|
|
9
|
+
console.info "npx cap init ${_APP_NAME} ${_PACKAGE_ID} --web-dir www/dist"
|
|
10
|
+
npx cap init "${_APP_NAME}" "${_PACKAGE_ID}" --web-dir "www/dist"
|
|
11
|
+
|
|
12
|
+
console.info "Finished installing capacitor"
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
capacitorjs.install.npm(){
|
|
2
|
+
console.header "Install NPM"
|
|
3
|
+
|
|
4
|
+
local INSTALL_DIR="$1"
|
|
5
|
+
local _APP_NAME="$2"
|
|
6
|
+
local _TYPE="$3"
|
|
7
|
+
local _REPO_URL="$4"
|
|
8
|
+
local _BUGS_URL="$5"
|
|
9
|
+
local _HOMEPAGE_URL="$6"
|
|
10
|
+
local _LICENSE="$7"
|
|
11
|
+
|
|
12
|
+
cd "${INSTALL_DIR}"
|
|
13
|
+
|
|
14
|
+
npm install
|
|
15
|
+
|
|
16
|
+
console.info "Configure package.json"
|
|
17
|
+
|
|
18
|
+
npm pkg set name="${_APP_NAME}"
|
|
19
|
+
npm pkg set type="${_TYPE}"
|
|
20
|
+
npm pkg set main="index.mjs"
|
|
21
|
+
npm pkg set repository.url="${_REPO_URL}"
|
|
22
|
+
npm pkg set bugs.url="${_BUGS_URL}"
|
|
23
|
+
npm pkg set homepage="${_HOMEPAGE_URL}"
|
|
24
|
+
npm pkg set scripts.build="./scripts/build.sh"
|
|
25
|
+
npm pkg set scripts.launch:web="./scripts/launch-web.sh"
|
|
26
|
+
npm pkg set scripts.launch:android="./scripts/launch-android.sh"
|
|
27
|
+
npm pkg set scripts.launch:ios="./scripts/launch-ios.sh"
|
|
28
|
+
npm pkg set scripts.git:push="./scripts/git-push.sh"
|
|
29
|
+
npm pkg set scripts.git:commit="./scripts/git-commit.sh"
|
|
30
|
+
npm pkg set scripts.open:studio:push="npx cap open android"
|
|
31
|
+
|
|
32
|
+
if [[ -z "${LICENSE//[[:space:]]/}" ]]; then
|
|
33
|
+
npm pkg delete license
|
|
34
|
+
else
|
|
35
|
+
npm pkg set license="${LICENSE}"
|
|
36
|
+
fi
|
|
37
|
+
console.info "Finished installing NPM"
|
|
38
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
capacitorjs.install(){
|
|
2
|
+
console.header "Questionnaire"
|
|
3
|
+
|
|
4
|
+
local _INSTALL_DIR="$__capacitorjs_INSTALL_DIR"
|
|
5
|
+
local _PACKAGE_PATH="$__capacitorjs_PACKAGE_PATH"
|
|
6
|
+
|
|
7
|
+
local ARGS=("$@")
|
|
8
|
+
local _BASE_REPO_URL="furrymink"
|
|
9
|
+
local _DEFAULT_BRANCH="main"
|
|
10
|
+
local _DEFAULT_LICENSE=""
|
|
11
|
+
local _DEFAULT_AUTHOR="Lee"
|
|
12
|
+
local _DEFAULT_DEV_BROWSER_PORT="3000"
|
|
13
|
+
local _DEFAULT_EMAIL="lee@bowyer.fr"
|
|
14
|
+
|
|
15
|
+
local _APP_NAME=$(get.app-name "my-app")
|
|
16
|
+
local _NORMALISED_APP_NAME=$(normalise.package-id $_APP_NAME)
|
|
17
|
+
local _GIT_BASE_URL="${_BASE_REPO_URL}/${_NORMALISED_APP_NAME}"
|
|
18
|
+
|
|
19
|
+
local _PACKAGE_ID=$(get.package-id $_BASE_REPO_URL $_APP_NAME)
|
|
20
|
+
local _HOMEPAGE_URL=$(get.home-page-url "$_GIT_BASE_URL")
|
|
21
|
+
local _REPO_URL=$(get.repo-url "$_GIT_BASE_URL")
|
|
22
|
+
local _BRANCH=$(get.repo-branch "$_DEFAULT_BRANCH")
|
|
23
|
+
local _README_URL=$(get.read-me-url "$_GIT_BASE_URL")
|
|
24
|
+
local _BUGS_URL=$(get.bugs-url "$_GIT_BASE_URL")
|
|
25
|
+
local _LICENSE=$(get.license "$_DEFAULT_LICENSE")
|
|
26
|
+
local _AUTHOR=$(get.author "$_DEFAULT_AUTHOR")
|
|
27
|
+
local _EMAIL=$(get.email "$_DEFAULT_EMAIL")
|
|
28
|
+
local _DESCRIPTION=$(get.description "Give a short description of what $_APP_NAME does")
|
|
29
|
+
local _DEV_BROWSER_PORT=$(get.broswer-port "$_DEFAULT_DEV_BROWSER_PORT")
|
|
30
|
+
local _TYPE=$(get.type)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
capacitorjs.import.scaffolding \
|
|
34
|
+
"${_INSTALL_DIR}" \
|
|
35
|
+
"${_PACKAGE_PATH}"
|
|
36
|
+
|
|
37
|
+
capacitorjs.install.npm \
|
|
38
|
+
"${_INSTALL_DIR}" \
|
|
39
|
+
"${_APP_NAME}" \
|
|
40
|
+
"${_TYPE}" \
|
|
41
|
+
"${_REPO_URL}" \
|
|
42
|
+
"${_BUGS_URL}" \
|
|
43
|
+
"${_HOMEPAGE_URL}" \
|
|
44
|
+
"${_LICENSE}"
|
|
45
|
+
|
|
46
|
+
capacitorjs.install.capacitor \
|
|
47
|
+
"${_INSTALL_DIR}" \
|
|
48
|
+
"${_APP_NAME}" \
|
|
49
|
+
"${_PACKAGE_ID}"
|
|
50
|
+
|
|
51
|
+
capacitorjs.configure.template \
|
|
52
|
+
"$_INSTALL_DIR" \
|
|
53
|
+
"$_APP_NAME" \
|
|
54
|
+
"$_DESCRIPTION" \
|
|
55
|
+
"$_AUTHOR" \
|
|
56
|
+
"$_EMAIL" \
|
|
57
|
+
"$_LICENSE"
|
|
58
|
+
|
|
59
|
+
capacitorjs.init.dist \
|
|
60
|
+
"$_INSTALL_DIR"
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
local _TARGET_PLATFORM=$(
|
|
64
|
+
input.select "Select OS" \
|
|
65
|
+
--prefill "1" \
|
|
66
|
+
--options "Android|iOS|Both"
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
case $_TARGET_PLATFORM in
|
|
70
|
+
"Android")
|
|
71
|
+
capacitorjs.install.android \
|
|
72
|
+
"$_INSTALL_DIR"
|
|
73
|
+
;;
|
|
74
|
+
"iOS")
|
|
75
|
+
capacitorjs.install.ios \
|
|
76
|
+
"$_INSTALL_DIR"
|
|
77
|
+
;;
|
|
78
|
+
"Both")
|
|
79
|
+
capacitorjs.install.android \
|
|
80
|
+
"$_INSTALL_DIR"
|
|
81
|
+
capacitorjs.install.ios \
|
|
82
|
+
"$_INSTALL_DIR"
|
|
83
|
+
;;
|
|
84
|
+
esac
|
|
85
|
+
|
|
86
|
+
capacitorjs.configure.gradle \
|
|
87
|
+
"$_INSTALL_DIR"
|
|
88
|
+
|
|
89
|
+
capacitorjs.configure.npm \
|
|
90
|
+
"$_INSTALL_DIR" \
|
|
91
|
+
"$_APP_NAME" \
|
|
92
|
+
"$_VERSION" \
|
|
93
|
+
"$_TYPE" \
|
|
94
|
+
"$_REPO_URL" \
|
|
95
|
+
"$_BUGS_URL" \
|
|
96
|
+
"$_HOMEPAGE_URL" \
|
|
97
|
+
"$_LICENSE"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
capacitorjs.sync.capacitor \
|
|
101
|
+
"$_INSTALL_DIR"
|
|
102
|
+
|
|
103
|
+
capacitorjs.configure.git \
|
|
104
|
+
"$_REPO_URL" \
|
|
105
|
+
"$_BRANCH" \
|
|
106
|
+
|
|
107
|
+
console.log "All done. Have a nice day"
|
|
108
|
+
}
|
package/dist/BUGS.md
ADDED
package/dist/LICENSE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# SOURCE AVAILABILITY NOTICE
|
|
2
|
+
|
|
3
|
+
This repository is publicly accessible for the purposes of transparency, technical inspection and peer review.
|
|
4
|
+
|
|
5
|
+
No licence is granted or implied. All rights are reserved by the author.
|
|
6
|
+
|
|
7
|
+
Unless expressly authorised in writing, you may not copy, modify, distribute, publish, sublicense or use this code, in whole or in part.
|
|
8
|
+
|
|
9
|
+
Public access to this repository does not constitute permission to reuse its contents.
|
|
10
|
+
|
|
11
|
+
The source code is made available so that others can inspect and evaluate the implementation, not to grant rights of use.
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
furry.cli.gateway(){
|
|
2
|
+
local COMMAND="$1"
|
|
3
|
+
shift
|
|
4
|
+
|
|
5
|
+
local ARGS=("$@")
|
|
6
|
+
|
|
7
|
+
case $COMMAND in
|
|
8
|
+
build)
|
|
9
|
+
furry.build;;
|
|
10
|
+
sync)
|
|
11
|
+
furry.sync.capacitor;;
|
|
12
|
+
rollup)
|
|
13
|
+
furry.rollup;;
|
|
14
|
+
launch)
|
|
15
|
+
furry.launch.gateway "$@";;
|
|
16
|
+
versioncontrol)
|
|
17
|
+
echo "VERSION CONTROL";;
|
|
18
|
+
open)
|
|
19
|
+
echo "OPEN";;
|
|
20
|
+
*)
|
|
21
|
+
console.error "Unknown command '${COMMAND}'";;
|
|
22
|
+
esac
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#! /bin/bash
|
|
2
|
+
__furrycap_BIN_PATH="$(cd -- "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" && pwd)"
|
|
3
|
+
__furrycap_INSTALL_DIR="$PWD"
|
|
4
|
+
|
|
5
|
+
. "${__furrycap_BIN_PATH}/includes.sh"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
__furrycap_CLI_PATH="${__furrycap_INSTALL_DIR}/node_modules/@furrymink/cli"
|
|
9
|
+
|
|
10
|
+
if [[ ! -d "$__furrycap_CLI_PATH" ]]; then
|
|
11
|
+
echo "@furrymink/cli not found. installing now..."
|
|
12
|
+
npm install @furrymink/cli@latest
|
|
13
|
+
else
|
|
14
|
+
echo "@furrymink/cli already installed"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
source "${__furrycap_INSTALL_DIR}/node_modules/@furrymink/cli/bin/includes.sh"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
furrycap.cli.gateway "$@"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
furrycap.cli.gateway(){
|
|
2
|
+
local COMMAND="$1"
|
|
3
|
+
shift
|
|
4
|
+
|
|
5
|
+
local ARGS=("$@")
|
|
6
|
+
|
|
7
|
+
case $COMMAND in
|
|
8
|
+
helloworld)
|
|
9
|
+
furrycap.helloworld "${ARGS[@]}";;
|
|
10
|
+
export)
|
|
11
|
+
console.info "Exporting furrycap includes ..."
|
|
12
|
+
furrycap.include.scripts "includes.sh" "$@";;
|
|
13
|
+
*)
|
|
14
|
+
console.info "Unknown command '${COMMAND}'";;
|
|
15
|
+
esac
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
__furrycap_BIN_PATH="$(cd -- "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" && pwd)"
|
|
2
|
+
__furrycap_CLI_PATH="$(realpath "$__furrycap_BIN_PATH/..")"
|
|
3
|
+
__furrycap_MODULES_PATH="${__furrycap_BIN_PATH}/modules"
|
|
4
|
+
__furrycap_INSTALL_DIR="$PWD"
|
|
5
|
+
__furrycap_PACKAGE_PATH="$(realpath "$__furrycap_BIN_PATH/..")"
|
|
6
|
+
|
|
7
|
+
furrycap.include.scripts(){
|
|
8
|
+
local BASE="${__furrycap_BIN_PATH}"
|
|
9
|
+
local SCRIPTS=()
|
|
10
|
+
|
|
11
|
+
while [[ $# -gt 0 ]]; do
|
|
12
|
+
case $1 in
|
|
13
|
+
--base) BASE="$2"; shift 2 ;;
|
|
14
|
+
*) SCRIPTS+=("$1"); shift 1 ;;
|
|
15
|
+
esac
|
|
16
|
+
done
|
|
17
|
+
for SCRIPT in "${SCRIPTS[@]}"; do
|
|
18
|
+
. "${BASE}/${SCRIPT}"
|
|
19
|
+
done
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
furrycap.include.scripts \
|
|
23
|
+
"gateway.sh" \
|
|
24
|
+
"tests/includes.sh"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#! /bin/bash
|
|
2
|
+
__FURRYCAP_BIN_PATH="$(cd -- "$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" && pwd)"
|
|
3
|
+
__FURRYCAP_CLI_PATH="$(realpath "$__FURRYCAP_BIN_PATH/..")"
|
|
4
|
+
__FURRYCAP_MODULES_PATH="${__FURRYCAP_BIN_PATH}/modules"
|
|
5
|
+
__FURRYCAP_INSTALL_DIR="$PWD"
|
|
6
|
+
__FURRYCAP_PACKAGE_PATH="$(realpath "$__FURRYCAP_BIN_PATH/..")"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
source "${__FURRYCAP_INSTALL_DIR}/node_modules/@furrymink/cli/bin/includes.sh"
|
|
10
|
+
|
|
11
|
+
## WHIY NOT IN INSTALLER SCRIPT ?
|
|
12
|
+
import.dot-env
|
|
13
|
+
|
|
14
|
+
include.scripts --base "${__FURRYCAP_BIN_PATH}" \
|
|
15
|
+
"includes.sh"
|
|
16
|
+
|
|
17
|
+
furry.cli.gateway "$@"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
furry.launch.gateway(){
|
|
2
|
+
local COMMAND="$1"
|
|
3
|
+
shift
|
|
4
|
+
|
|
5
|
+
local ARGS=("$@")
|
|
6
|
+
|
|
7
|
+
case $COMMAND in
|
|
8
|
+
web)
|
|
9
|
+
furry.launch.web;;
|
|
10
|
+
android)
|
|
11
|
+
furry.launch.android;;
|
|
12
|
+
ios)
|
|
13
|
+
furry.launch.ios;;
|
|
14
|
+
all)
|
|
15
|
+
furry.launch.web
|
|
16
|
+
furry.launch.android
|
|
17
|
+
furry.launch.ios;;
|
|
18
|
+
*)
|
|
19
|
+
console.error "Unknown command '${COMMAND}'";;
|
|
20
|
+
esac
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
furry.launch.web(){
|
|
2
|
+
console.info "Building project"
|
|
3
|
+
npx furry build
|
|
4
|
+
|
|
5
|
+
console.info "Kill active node port on 3000"
|
|
6
|
+
console.warn "The port should be the same as the port for this project otherwise it will kill other apps"
|
|
7
|
+
PID=$(lsof -tiTCP:"$PORT" -sTCP:LISTEN)
|
|
8
|
+
|
|
9
|
+
if [ -n "$PID" ]; then
|
|
10
|
+
console.warn "KILL: ${PID}"
|
|
11
|
+
kill "$PID"
|
|
12
|
+
|
|
13
|
+
while lsof -tiTCP:"$PORT" -sTCP:LISTEN >/dev/null 2>&1; do
|
|
14
|
+
sleep 0.1
|
|
15
|
+
done
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# console.info "Start node"
|
|
19
|
+
nodemon "$@"
|
|
20
|
+
|
|
21
|
+
}
|
package/dist/dotenv
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PORT=3000
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import dotenv from 'dotenv'
|
|
2
|
+
dotenv.config()
|
|
3
|
+
|
|
4
|
+
import express from "express";
|
|
5
|
+
|
|
6
|
+
const PORT = process.env.PORT || process.env.DEFAULT_PORT;
|
|
7
|
+
|
|
8
|
+
const app = express();
|
|
9
|
+
app.set("trust proxy", 1);
|
|
10
|
+
app.use(express.json({ limit: '64mb' }));
|
|
11
|
+
|
|
12
|
+
app.use(express.static("./www/dist"))
|
|
13
|
+
import http from "http";
|
|
14
|
+
const server = http.createServer(app);
|
|
15
|
+
|
|
16
|
+
server.listen(PORT, () => {
|
|
17
|
+
console.log(`Dev server has started listening on port: ${PORT}`)
|
|
18
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-app",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+ssh://git@gitlab.com/furry-installers/boilerplates/capacitorjs.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "",
|
|
16
|
+
"type": "commonjs",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": ""
|
|
19
|
+
},
|
|
20
|
+
"homepage": "",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@capacitor/cli": "^8.6.0",
|
|
23
|
+
"@capacitor/core": "^8.6.0",
|
|
24
|
+
"@furrymink/cli": "latest",
|
|
25
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
26
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
27
|
+
"dotenv": "^18.0.9",
|
|
28
|
+
"express": "^5.3.0",
|
|
29
|
+
"nodemon": "^3.1.14",
|
|
30
|
+
"rollup": "^4.68.0"
|
|
31
|
+
},
|
|
32
|
+
"bin": {
|
|
33
|
+
"furrycap": "bin/furrycap/furrycap"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
+
|
|
4
|
+
import { globSync } from 'glob';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
console.log("GO")
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
input: Object.fromEntries(
|
|
12
|
+
globSync('www/dist/**/*.mjs').map(file => [
|
|
13
|
+
path.relative(
|
|
14
|
+
'www/dist',
|
|
15
|
+
file.slice(0, file.length - path.extname(file).length),
|
|
16
|
+
),
|
|
17
|
+
fileURLToPath(new URL(file, import.meta.url))
|
|
18
|
+
])
|
|
19
|
+
),
|
|
20
|
+
output: {
|
|
21
|
+
dir: "www/dist",
|
|
22
|
+
format: "module",
|
|
23
|
+
entryFileNames: "[name].mjs"
|
|
24
|
+
},
|
|
25
|
+
plugins: [
|
|
26
|
+
nodeResolve({ browser: true }),
|
|
27
|
+
commonjs()
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Document</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<h1>{{APP_NAME}}</h1>
|
|
10
|
+
<p>{{VERSION}}</p>
|
|
11
|
+
|
|
12
|
+
<script src="index.mjs" type="module"></script>
|
|
13
|
+
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("Welcome to your app")
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furry-boilerplates/capacitorjs",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+ssh://git@gitlab.com/furry-installers/boilerplates/capacitor-js.git"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@furrymink/cli": "^0.0.25"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [],
|
|
17
|
+
"author": "",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"type": "commonjs",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://gitlab.com/furry-installers/boilerplates/capacitor-js/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://gitlab.com/furry-installers/boilerplates/capacitor-js#readme",
|
|
24
|
+
"bin": {
|
|
25
|
+
"capacitorjs": "bin/capacitorjs"
|
|
26
|
+
}
|
|
27
|
+
}
|