Browse Source

Put build scripts in /scripts, add them as Cordova hooks

tags/v1.3.0
Skylar Ittner 8 months ago
parent
commit
5539240793
6 changed files with 54 additions and 3590 deletions
  1. +3
    -0
      config.xml
  2. +7
    -0
      scripts/generate_credits.sh
  3. +4
    -3
      scripts/remove_bloat.sh
  4. +0
    -0
      scripts/yarn_install.sh
  5. +0
    -3587
      www/pages/credits.html
  6. +40
    -0
      www/pages/credits.template.html

+ 3
- 0
config.xml View File

@@ -51,4 +51,7 @@
<plugin name="cordova-plugin-app-version" spec="^0.1.9" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
<engine name="browser" spec="^5.0.4" />
<hook src="scripts/www_npm_install.sh" type="before_prepare"/>
<hook src="scripts/generate_credits.sh" type="before_prepare"/>
<hook src="scripts/remove_bloat.sh" type="before_prepare"/>
</widget>

+ 7
- 0
scripts/generate_credits.sh View File

@@ -0,0 +1,7 @@
cd www
yarn licenses generate-disclaimer > ../license-credits.md
cd ..
yarn licenses generate-disclaimer >> license-credits.md

cp www/pages/credits.template.html www/pages/credits.html
sed -e "/{{credits}}/r license-credits.md" -e "/{{credits}}/d" -i www/pages/credits.html

removebloat.sh → scripts/remove_bloat.sh View File

@@ -1,6 +1,7 @@
#!/bin/sh
#!/bin/bash
# This script removes some stuff in `www/node_modules` that the app doesn't need to run.
# It removes about 6MB from the build size.

echo "Removing bloat in node_modules..."

cd www/node_modules
rm -rf array-parallel
@@ -66,4 +67,4 @@ rm -rf sprites
rm -rf toggle
cd ..

echo "Cleanup finished"
echo "Cleanup finished"

yarninstall.sh → scripts/yarn_install.sh View File


+ 0
- 3587
www/pages/credits.html
File diff suppressed because it is too large
View File


+ 40
- 0
www/pages/credits.template.html View File

@@ -0,0 +1,40 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<div class="page" data-name="credits">

<div class="navbar">
<div class="navbar-bg"></div>
<div class="navbar-inner">
<div class="left">
<a href="#" class="link icon-only back">
<i class="icon icon-back"></i>
</a>
</div>
<div class="title">Open Source</div>
</div>
</div>

<div class="page-content">

<div class="block">
<p>This program is licensed under the Mozilla Public License 2.0.
To get the source code, visit https://source.netsyms.com/Apps/NotePostApp.
<br>
This application relies on and is bundled with third-party code.
See below for the their licenses and where to find source code.
It is likely that not all of the listed third-party code is present
on your system; some of it is platform-specific and not included
in all builds.
</div>

<div class="block">
<h2>Third Party Code and Assets</h2>
<pre style="white-space: pre-line; overflow-wrap: break-word;">
{{credits}}
</pre>
</div>

</div>

</div>

Loading…
Cancel
Save