Skip to content

Commit

Permalink
Vastly improved HexEditor render speeds/actions, rewritten FileDrop t…
Browse files Browse the repository at this point in the history
…o Vue, removed FileSystemManager and replaced it's usage with FileSystemsStore, removed unused build steps files,
  • Loading branch information
Lorthiz committed Oct 12, 2024
1 parent 9a09885 commit 995a1fc
Show file tree
Hide file tree
Showing 40 changed files with 324 additions and 743 deletions.
84 changes: 43 additions & 41 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
name: build
name: Deploy to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- master
- stable
branches: [ "v3-refactor" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
Expand All @@ -13,47 +27,35 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20'
node-version: "20"

- name: Setup Pages
uses: actions/configure-pages@v3

- run: npm ci
- name: Use stable versions of KSC and JS runtime
run: |
npm install kaitai-struct-compiler@latest kaitai-struct@latest
npm run generate-license
npm run generate-formats
npm run parcel-build
if: github.ref == 'refs/heads/stable'
- name: Set up environment variables for stable deployment
run: |
echo 'SENTRY_ENV=stable' >> "$GITHUB_ENV"
if: github.ref == 'refs/heads/stable'
- name: Set up environment variables for devel deployment
run: |
echo 'SENTRY_ENV=devel' >> "$GITHUB_ENV"
if: github.ref == 'refs/heads/master'
- name: Build
env:
SENTRY_DSN: 'https://[email protected]/202888'
run: node build.js "dist"
- name: Deploy
env:
BOT_SSH_KEY: ${{secrets.BOT_SSH_KEY}}
OUTDIR: ${{ github.ref == 'refs/heads/master' && 'devel' || '' }}
run: |
./push_artifacts/git_config_kaitai_bot
./push_artifacts/publish \
-o kaitai-io \
-r ide-kaitai-io.github.io \
-d "$OUTDIR" \
-m "Regen ${GITHUB_REF#refs/heads/*} $GITHUB_REPOSITORY@$GITHUB_SHA" \
-- \
--exclude=.git \
--exclude=.github/ \
--exclude=.nojekyll \
--exclude=_build/ \
--exclude=CNAME \
--exclude=favicon.ico \
--exclude=favicon.ico.license \
--exclude=devel/ \
dist/
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./dist


deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
61 changes: 0 additions & 61 deletions .github/workflows/personal.yml

This file was deleted.

Empty file removed .nojekyll
Empty file.
77 changes: 0 additions & 77 deletions build.js

This file was deleted.

1 change: 0 additions & 1 deletion push_artifacts
Submodule push_artifacts deleted from 04b0a0
36 changes: 32 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ConverterPanel from "./Components/ConverterPanel/ConverterPanel.vue";
import InfoPanel from "./Components/InfoPanel/InfoPanel.vue";
import UnsupportedBrowser from "./Components/UnsupportedBrowser.vue";
import WelcomeModal from "./Components/WelcomeModal/WelcomeModal.vue";
import FileDrop from "./Components/FileDrop.vue";
import NewKsyModal from "./Components/NewKsyModal.vue";
import InputContextMenu from "./Components/InputContextMenu.vue";
import HexViewer from "./Components/HexViewer/HexViewer.vue";
Expand All @@ -15,8 +14,15 @@ import {loadBinaryFileAction} from "./GlobalActions/LoadBinaryFile";
import {loadKsyFileAction} from "./GlobalActions/LoadKsyFile";
import {onMounted} from "vue";
import {parseAction} from "./GlobalActions/ParseAction";
import {FILE_SYSTEM_TYPE_LOCAL, IFsItem, ITEM_MODE_DIRECTORY} from "./v1/FileSystems/FileSystemsTypes";
import {LocalForageWrapper} from "./v1/utils/LocalForageWrapper";
import {initKaitaiFs} from "./v1/FileSystems/KaitaiFileSystem";
import {OldLocalStorageFileSystem} from "./v1/FileSystems/OldLocalStorageFileSystem";
import {useFileSystems} from "./Components/FileTree/Store/FileSystemsStore";
const store = useAppStore();
const fileSystemsStore = useFileSystems();
store.$onAction(async ({name, store, args}) => {
switch (name) {
case "updateSelectedBinaryFile": {
Expand All @@ -32,23 +38,45 @@ store.$onAction(async ({name, store, args}) => {
}
});
onMounted(async () => {
const initFileSystems = async () => {
const defaultItem: IFsItem = {
fsType: FILE_SYSTEM_TYPE_LOCAL,
type: ITEM_MODE_DIRECTORY,
children: {},
fn: "Local storage"
};
const storedItem = await LocalForageWrapper.getFsItem(`fs_files`);
if (storedItem) {
storedItem.fn = "Local storage";
}
fileSystemsStore.addFileSystem(initKaitaiFs());
fileSystemsStore.addFileSystem(new OldLocalStorageFileSystem(storedItem || defaultItem));
};
const initFileParsing = async () => {
await loadKsyFileAction(store.selectedKsyInfo);
await loadBinaryFileAction(store.selectedBinaryInfo);
await parseAction();
};
onMounted(async () => {
await initFileSystems();
await initFileParsing();
});
</script>

<template>
<UnsupportedBrowser/>
<ParsedTree/>
<HexViewer/>
<FileDrop/>
<NewKsyModal/>
<InputContextMenu/>
<FileTree/>
<InfoPanel/>
<ConverterPanel/>

<NewKsyModal/>
<WelcomeModal/>
</template>

Expand Down
41 changes: 0 additions & 41 deletions src/Components/FileDrop.vue

This file was deleted.

Loading

0 comments on commit 995a1fc

Please sign in to comment.