diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc214e2b..b99d3182 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,35 +66,35 @@ jobs: run_install: | - recursive: true - - name: Build preload plugins + - name: Build preload script run: | - cd plugins + cd packages/preload pnpm build - name: Build core (windows) if: runner.os == 'Windows' - run: msbuild.exe pengu.sln -t:build -p:Configuration=Release -p:Platform=x64 + run: msbuild.exe pengu.slnx -t:build -p:Configuration=Release -p:Platform=x64 - name: Build core (macos) if: runner.os == 'macOS' run: make release - - name: Build loader + - name: Build app-hub uses: tauri-apps/tauri-action@v0 with: - projectPath: "loader" + projectPath: "packages/hub" args: ${{ matrix.tauri_args }} - - name: Move loader output (windows) + - name: Move app-hub output (windows) if: runner.os == 'Windows' run: | - cp "loader/src-tauri/target/release/Pengu Loader.exe" bin/ + cp "packages/hub/src-tauri/target/release/Pengu Loader.exe" bin/ - - name: Move loader output (macos) + - name: Move app-hub output (macos) if: runner.os == 'macOS' run: | - cp -r "loader/src-tauri/target/universal-apple-darwin/release/bundle/macos/Pengu Loader.app" bin/ - cp "loader/src-tauri/target/universal-apple-darwin/release/bundle/dmg/"*.dmg bin/ + cp -r "packages/hub/src-tauri/target/universal-apple-darwin/release/bundle/macos/Pengu Loader.app" bin/ + cp "packages/hub/src-tauri/target/universal-apple-darwin/release/bundle/dmg/"*.dmg bin/ - name: Upload build output uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index c73dd52f..a864b74e 100644 --- a/.gitignore +++ b/.gitignore @@ -230,9 +230,7 @@ PublishScripts/ # NuGet Symbol Packages *.snupkg # The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* # except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files @@ -456,6 +454,4 @@ Temporary Items ### Project defines ### bin/* -packages/ -include/ *.g.h \ No newline at end of file diff --git a/app/.gitkeep b/app/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/core/core.vcxproj b/core/core.vcxproj index c023ba61..3d82a756 100644 --- a/core/core.vcxproj +++ b/core/core.vcxproj @@ -50,6 +50,7 @@ Win32Proj core 10.0 + true diff --git a/core/core.vcxproj.filters b/core/core.vcxproj.filters deleted file mode 100644 index 7fdaef2b..00000000 --- a/core/core.vcxproj.filters +++ /dev/null @@ -1,104 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {f7fb3482-8bb9-4289-8727-31c4e42d8158} - - - {dfeda954-1c41-4771-8da2-c733492503fa} - - - {d97c7ba6-93de-4f95-81f6-e18b2c0ba005} - - - {e0b1c27d-cfeb-41e1-87e3-5f64c8ddc7fd} - - - - - src - - - src - - - src\browser - - - src\browser - - - src\browser - - - src\browser - - - src - - - src\renderer - - - src - - - src\browser - - - src\renderer - - - src\renderer - - - src\utils - - - src\utils - - - src\utils - - - src\utils - - - src\utils - - - - - res - - - src\utils - - - - - res - - - - - src - - - src\renderer - - - src\browser - - - src - - - src - - - \ No newline at end of file diff --git a/makefile b/core/makefile similarity index 89% rename from makefile rename to core/makefile index d4fb72a5..97da5f07 100644 --- a/makefile +++ b/core/makefile @@ -1,8 +1,8 @@ VERSION := 1.2.0 # Directories -SRC_DIR := core/src -BIN_DIR := bin +SRC_DIR := ./src +BIN_DIR := ../bin OBJ_DIR := $(BIN_DIR)/obj PLUGINS_DIR := $(BIN_DIR)/plugins @@ -23,12 +23,12 @@ TARGET_LIB_PATH := $(TARGET_LIB_DIR)/libEGL.dylib # Compiler CC := clang CXX := clang++ -CXXFLAGS := -std=c++20 -fPIC -arch x86_64 -I./core/cef -I./core/src -fvisibility=hidden -Wno-address-of-temporary -Wno-nonportable-include-path +CXXFLAGS := -std=c++20 -fPIC -arch x86_64 -I./cef -I./src -fvisibility=hidden -Wno-address-of-temporary -Wno-nonportable-include-path # Linker LDFLAGS := -shared -dynamiclib -arch x86_64 -current_version $(VERSION) -compatibility_version 1.0.0 -LDLIBS := -framework cocoa -Lcore/cef/lib/mac -weak-lcef.d -flat_namespace - +LDLIBS := -framework cocoa -L./cef/lib/mac -weak-lcef.d -flat_namespace + # Source files CPP_SRCS := $(wildcard $(SRC_DIR)/*.cc) $(wildcard $(SRC_DIR)/**/*.cc) OBJCXX_SRCS := $(wildcard $(SRC_DIR)/**/*.mm) @@ -67,7 +67,7 @@ $(LIB_OUT_PATH): $(CPP_OBJS) $(OBJCXX_OBJS) # @install_name_tool -change "libcef.d.dylib" "@loader_path/../Chromium Embedded Framework" $@ $(INSERT_DYLIB_PATH): - $(CC) -O2 -o $@ core/insert_dylib.c + $(CC) -O2 -o $@ ./insert_dylib.c install: $(LIB_OUT_PATH) $(INSERT_DYLIB_PATH) cp -n $(TARGET_LIB_PATH) $(TARGET_LIB_PATH).bak || true diff --git a/core/src/renderer/renderer.cc b/core/src/renderer/renderer.cc index 544079a7..6fd67d2c 100644 --- a/core/src/renderer/renderer.cc +++ b/core/src/renderer/renderer.cc @@ -193,23 +193,43 @@ static void LoadPlugins(V8Object *window) window->set(&u"Pengu"_s, pengu, V8_PROPERTY_ATTRIBUTE_READONLY); } -static void ExecutePreloadScript(cef_frame_t *frame) +// Execute the preload script synchronously in the main-frame V8 context. +// +// Uses cef_v8context_t::eval rather than cef_frame_t::execute_java_script — +// the former runs synchronously inside OnContextCreated, the latter posts the +// script as a renderer task that may be drained after HTML parsing has begun +// and inline classic