Skip to content

Commit

Permalink
Loading optimizations, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanH committed Jun 2, 2024
1 parent fb2ff0d commit d98ae91
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 32 deletions.
16 changes: 16 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
default:
just --list

# construct 'future' git branch from stack
git-future:
#!/bin/bash
set -eu -o pipefail

git checkout future

git reset --hard develop

for branch in $@; do
git merge $branch
git commit || :
done
59 changes: 39 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,67 @@
CONFIG_JSON_PATH = "${APPDATA}/unofficial-homestuck-collection/config.json"

.SECONDEXPANSION:
.SUFFIXES:

default: test

## Setup

yarn.lock: package.json
yarn install # --ignore-optional
touch yarn.lock

# We do actually use a dummy install file to track this
install: package.json yarn.lock
yarn install --ignore-optional
yarn install
touch install

## Prep actions

.PHONY: clean
clean:
yarn cache clean
-rm yarn-error.log
-rm ./install src/imods.tar.gz
-rm -r node_modules/.cache/
-rm -r dist/ dist_electron/*/

lint: install
.PHONY: lint
lint: install
yarn run vue-cli-service lint
# yarn lint


## Intermediate files

src/imods.tar.gz: $(wildcard src/imods/*) $(wildcard src/imods/*/*)
# cd src && tar -czf imods.tar.gz imods/
cd src && tar -cf - imods/ | gzip -9 - > imods.tar.gz
# -jq '.appVersion = "2.0.0"' ${CONFIG_JSON_PATH} > ${CONFIG_JSON_PATH}.tmp
# -mv ${CONFIG_JSON_PATH}.tmp ${CONFIG_JSON_PATH}

## Running live

# Run 'SERVE_FLAGS="--reset-last-version" make src/imods.tar.gz test' to make imods and pass --reset-last-version through
.PHONY: test
test: install src/imods.tar.gz
yarn run vue-cli-service electron:serve $(SERVE_FLAGS)
# yarn dev


## Building output

.PHONY: build
build: install src/imods.tar.gz
yarn run vue-cli-service electron:build
# yarn electron:build

publish_release: install src/imods.tar.gz
yarn run vue-cli-service electron:build -p always

vuebuild: install src/imods.tar.gz
yarn run vue-cli-service build

src/imods.tar.gz: $(wildcard src/imods/*) $(wildcard src/imods/*/*)
# cd src && tar -czf imods.tar.gz imods/
cd src && tar -cf - imods/ | gzip -9 - > imods.tar.gz
# -jq '.appVersion = "2.0.0"' ${CONFIG_JSON_PATH} > ${CONFIG_JSON_PATH}.tmp
# -mv ${CONFIG_JSON_PATH}.tmp ${CONFIG_JSON_PATH}
.PHONY: publish-release
publish-release: install src/imods.tar.gz
yarn run vue-cli-service electron:build -p always

.PHONY: help
help:
@echo 'Usage:'
@echo ' make clean try to clean old build artifacts'
@echo ' make test start a development version now'
@echo ' make build create a production version'
@echo ' make lint lints and fixes files'


.PHONY: clean test build publish help lint test
grep -E '(^[^.#[:space:]].*:)|(##)' Makefile

32 changes: 32 additions & 0 deletions gh_export_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash -i

set -eu -o pipefail

mkdir -p github

if ! gh auth status | grep -q 'read:project'; then
(set -x; gh auth login --scopes read:project)
fi

(

echo Saving PRs

pr_out="github/pull_requests.json"
# all_pr_fields="$(echo $(gh pr list --json 2>&1 | tail -n +2) | sed 's/ /,/g')"
# gh pr list -L 50 --json "$all_pr_fields" | jq > $pr_out
gh api repos/bambosh/unofficial-homestuck-collection/pulls --paginate > $pr_out

logparam "Saved" $(jq '.|length' < "$pr_out") "pull requests to" "$pr_out"
)

(
echo Saving Issues

issue_out="github/issues.json"
# all_issue_fields="$(echo $(gh issue list --json 2>&1 | tail -n +2) | sed 's/ /,/g')"
# gh issue list -L 50 --json "$all_issue_fields" | jq > $issue_out
gh api repos/bambosh/unofficial-homestuck-collection/issues --paginate > $issue_out

logparam "Saved" $(jq '.|length' < "$issue_out") "issues to" "$issue_out"
)
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
// Ask for a fresh copy of the archive
// Root must exist to receive it, so this calls from inside the app
// and the app must have registered the receipt listener first to accept it!
this.$root.loadState = "LOADING"
this.$root.loadState = "WAITING_ON_DATA"
ipcRenderer.send("RELOAD_ARCHIVE_DATA")
document.addEventListener('dragover', event => event.preventDefault())
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppMenu/TitleBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
// Give the OS 2500 ms, then force close
setTimeout(function() {
ipcRenderer.sendSync('win-close-sync')
}, 2500)
}, 500)
}
},
mounted() {
Expand Down
15 changes: 11 additions & 4 deletions src/components/SystemPages/Setup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@

</div>
<div class="wizardNavigation">
<button v-if="newReaderCardIndex > 0" @click="wizardNextPage(-1)" style="right: 94px;">&lt; Previous</button>
<button v-if="newReaderCardIndex > 0" @click="wizardNextPage(-1)" class="prev">&lt; Previous</button>
<button v-if="newReaderCardIndex < lastNewReaderCard"
@click="wizardNextPage(1)" style="right: 20px;"
@click="wizardNextPage(1)" class="next"
:disabled="wizardForwardButtonDisabled">Next &gt;</button>
<!--<button v-if="newReaderCardIndex == lastNewReaderCard" @click="">Finish</button>-->
</div>
Expand Down Expand Up @@ -287,13 +287,14 @@ export default {
loadStages: {
"": "Awaiting reactivity",
"MOUNTED": "Entangling connections",
"WAITING_ON_DATA": "Demanding firehose",
"ARCHIVE": "Raking filesystem",
"MODS": "Turbulating canon",
"PATCHES": "Applying spackle",
"LOADED_ARCHIVE_VANILLA": "Deferring responsibility",
"EXTRACT_IMODS": "Applying day 1 patch",
"EXTRACT_IMODS": "Applying day-one patch",
"READ_MODS": "Indexing paraphernalia",
"BAKE_ROUTES": "Convoluting Routing Table",
"BAKE_ROUTES": "Convoluting routing table",
"MODS_DONE": "Disparaging EMCAScript",
},
spiroPos: [
Expand Down Expand Up @@ -599,6 +600,12 @@ export default {
font-size: 16px;
position: absolute;
margin: 0 2px;
&.next {
right: 20px;
}
&.prev {
right: 94px;
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/TabFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ export default {
// page_num = this.$vizToMspa(this.routeParams.base, page_num).p
// }
const isTzPassword = (this.$archive.tweaks.tzPasswordPages.includes(page_num))
const isTzPassword = !this.$archive
? false
: (this.$archive.tweaks.tzPasswordPages.includes(page_num))
if (!(page_num && story_id)) component = 'Error404'
else if (this.$pageIsSpoiler(page_num, true) && !isTzPassword) component = 'Spoiler'
Expand Down
8 changes: 4 additions & 4 deletions src/mods.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// isWebApp for main-process electron execution
const isWebApp = ((typeof window !== 'undefined') && window.isWebApp) || false

const importSassJs = import('sass.js')
const importYaml = import('js-yaml')
const importSassJs = () => import('sass.js')
const importYaml = () => import('js-yaml')
const importResources = import("@/resources.js")

var Resources // lazy
Expand Down Expand Up @@ -442,7 +442,7 @@ async function crawlFileTree(root, recursive = false) {

async function buildApi(mod) {
Resources = Resources || await importResources
yaml = yaml || await importYaml
yaml = yaml || await importYaml()

function safetyChecks(local_path) {
if (mod._singlefile) throw new Error(`Singlefile mods cannot use this method`)
Expand Down Expand Up @@ -816,7 +816,7 @@ function getMainMixin(){
return {
mounted() {
const addScssStyle = (style_id, body) => {
importSassJs.then(SassJs => {
importSassJs().then(SassJs => {
SassJs.compile(body, (result) => {
if (result.status !== 0) throw Error(JSON.stringify(result))
this.stylesheets.push({
Expand Down
2 changes: 1 addition & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
optimization: {
splitChunks: {
minSize: 10000,
maxSize: 250000,
maxSize: 250000
}
},
devtool: "source-map",
Expand Down

0 comments on commit d98ae91

Please sign in to comment.