Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 1cc555e

Browse files
committed
buildtool migration
1 parent 1bc0c43 commit 1cc555e

File tree

177 files changed

+2200
-1035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+2200
-1035
lines changed

.github/dependabot.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
version: 2
77
updates:
88
- package-ecosystem: "npm" # See documentation for possible values
9-
directory: "/" # Location of package manifests
9+
directory: "/nyanga" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
1212

1313
- package-ecosystem: "pip"
14-
directory: "/scripts/requirements" # Location of package manifests
14+
directory: "/" # Location of package manifests
1515
schedule:
1616
interval: "weekly"

.github/workflows/build.yml

+16-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build
22
on:
33
push:
44
tags:
5-
- 'v*'
5+
- "v*"
66

77
jobs:
88
createrelease:
@@ -36,16 +36,22 @@ jobs:
3636
include:
3737
- os: ubuntu-latest
3838
TARGET: ubuntu
39+
# CMD_BUILD: |
40+
# yarn install
41+
# yarn run svelte:build
42+
# python3 -m venv .venv --upgrade-deps
43+
# source .venv/bin/activate
44+
# mkdir -p log
45+
# touch log/app.log
46+
# python -m pip install --upgrade pip
47+
# pip install -r scripts/requirements/requirements-linux.txt
48+
# pyinstaller --noconfirm --distpath nyanga scripts/specfile/Nyanga-Read-linux.spec
3949
CMD_BUILD: |
40-
yarn install
41-
yarn run svelte:build
42-
python3 -m venv .venv --upgrade-deps
43-
source .venv/bin/activate
50+
poetry install --with dev
51+
poetry run build_ui
4452
mkdir -p log
4553
touch log/app.log
46-
python -m pip install --upgrade pip
47-
pip install -r scripts/requirements/requirements-linux.txt
48-
pyinstaller --noconfirm --distpath nyanga scripts/specfile/Nyanga-Read-linux.spec
54+
poetry run build_linux
4955
OUT_FILE_NAME: Nyanga-Read-bin
5056
ASSET_MIME: application/octet-stream
5157
# - os: windows-latest
@@ -75,6 +81,8 @@ jobs:
7581
sudo apt-get update
7682
sudo apt-get install -y curl libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0 nodejs python3-venv glib-networking
7783
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
84+
curl -sSL https://install.python-poetry.org | python3 -
85+
export PATH="$PATH:$HOME/.local/bin"
7886
export NVM_DIR="$HOME/.nvm"
7987
source "$NVM_DIR/nvm.sh"
8088
nvm install 18.19.0

.gitignore

+1-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
.DS_Store
2-
node_modules
3-
/build
4-
/.svelte-kit
5-
/package
6-
.env
7-
.env.*
8-
!.env.example
9-
.vercel
10-
.output
11-
vite.config.js.timestamp-*
12-
vite.config.ts.timestamp-*
13-
14-
15-
# yarn
16-
.yarn
17-
18-
191
# python
202
__pycache__
213
.build
@@ -26,7 +8,7 @@ build
268
layout
279
*.log
2810

29-
nyanga*
11+
nyanga/__pycache__
3012

3113
*test*
3214

.yarnrc.yml

-5
This file was deleted.

README.md

+60-30
Original file line numberDiff line numberDiff line change
@@ -32,87 +32,113 @@ Manga Reader for desktop powered by sveltekit, mangadex, and pywebview.
3232
- ✅ Transalated manga based on what language you choose
3333
- ✅ Local bookmark save
3434
<p align="center">
35-
<img src="./docs/images/main.png" />
35+
<img src="./nyanga/docs/images/main.png" />
3636
</p>
3737
<p align="center"><i>Main Page preview</i></p>
3838

3939
<p align="center">
40-
<img src="./docs/images/my-bookmarks.png" />
40+
<img src="./nyanga/docs/images/my-bookmarks.png" />
4141
</p>
4242
<p align="center"><i>bookmark list and local bookmark support</i></p>
4343

4444
<p align="center">
45-
<img src="./docs/images/my-bookmark-page.png" />
45+
<img src="./nyanga/docs/images/my-bookmark-page.png" />
4646
</p>
4747
<p align="center"><i>bookmark page lists</i></p>
4848

4949
<p align="center">
50-
<img src="./docs/images/search-page.png" />
50+
<img src="./nyanga/docs/images/search-page.png" />
5151
</p>
5252
<p align="center"><i>search page</i></p>
5353

5454
<p align="center">
55-
<img src="./docs/images/daily-page.png" />
55+
<img src="./nyanga/docs/images/daily-page.png" />
5656
</p>
5757
<p align="center"><i>list all of random daily page</i></p>
5858

5959
<p align="center">
60-
<img src="./docs/images/detail-page.png" />
60+
<img src="./nyanga/docs/images/detail-page.png" />
6161
</p>
6262
<p align="center"><i>volume and chapter selection</i></p>
6363

6464
<p align="center">
65-
<img src="./docs/images/read-image.png" />
65+
<img src="./nyanga/docs/images/read-image.png" />
6666
</p>
6767
<p align="center"><i>Full HD image quality provided by <a href="https://mangadex.org">mangadex</a></i></p>
6868

6969
<p align="center">
70-
<img src="./docs/images/settings.png" />
70+
<img src="./nyanga/docs/images/settings.png" />
7171
</p>
7272
<p align="center"><i>demographic and language selection</i></p>
7373

7474
## Help me transalating application
7575

76-
test
7776
currently this application available only in 2 language, _english_ and _Bahasa Indonesia_, if you feel you can help me transalating this application by transalating you can follow step below
7877

79-
- Before you transalating application please check available manga transalated language from [mangadex source](https://api.mangadex.org/docs/static-data/)
80-
- Fork this repo
78+
Before you transalating application please check available manga transalated language from [mangadex source](https://api.mangadex.org/docs/static-data/)
79+
80+
## Developing new features / adding transalation
81+
8182
- requirements and installation
8283

83-
- requirements :
84+
- Requirements
8485
- node version `18.12.1` or higher (need to be compatilbe with yarn version 3.2.1) or equivalent version
85-
- yarn version `3.3.1` or equivalent package manager tools,
86-
- python 3.8 or newer (needed for windowing system)
86+
- yarn version `4.2.2` or equivalent package manager tools,
87+
- python `3.11.2` or newer (needed for windowing system)
88+
- poetry `1.8.3` or newer for build tool
8789
- setting up development
8890

89-
- python
91+
- Python environment
9092

91-
- inside root folder create python virtual environment with typing `python3 -m venv .venv --upgrade-deps`
92-
- use the newly created python virtual env by running `source ./venv/bin/activate` if you using linux, or `.\.venv\Script\Activate.ps1` if you using windows
93-
- then install the required package by running `pip install -r requirements-(win / linux).txt`
93+
- make sure you already installing python poetry (used for package management in python, although i'm still not sure if pyinstaller still bundling pyinstaller in binary, it is still convenient for automating build in github workflow.) refer to [this](https://python-poetry.org/docs/#installing-with-the-official-installer) page how to set up your python with poetry.
94+
- install package by using poetry with `poetry install --with dev`
9495

95-
- node environment
96+
- Node environment
9697

9798
- run `yarn install` from root folder
9899
- yarn run `svelte:dev`
100+
- **Optional** if you have already run `poetry install --with dev` and have yarnpkg installed, then you can install ui dependencies with running command `poetry run install_ui_dep`
101+
102+
- Testing
103+
104+
- **Testing flag / Environment variable**
105+
106+
in building / editing / testing you maybe want to know some env. variable flag that used during testing UI, and preview or used by python system itself. below is the env. variable flag this application needed
107+
108+
- **`APP_ENV=dev`** used for testing when developing UI, adding new features, and if you generally want to modify UI without losing it autoreload from nodejs.
109+
- **`APP_ENV=preview`** usually used for previewing any UI that have been build. or in case you need to supply front-end some [pywebview token](https://pywebview.flowrl.com/guide/api.html#webview-token)
110+
111+
- UI development
112+
113+
- open up new terminal, then run command `poetry run start_ui`
114+
- in another terminal you need to use flag / env. variable `APP_ENV=dev`
115+
- then run command `poetry run dev`.
99116

100-
- testing
117+
- Window / Ipc testing
101118

102-
- UI Testing
119+
for testing window / ipc testing you need to build your UI because some component such as storage in the ipc end-point is protected by pywebview token for security.
103120

104-
- first you need to start the UI server with command `yarn run svelte:dev`
105-
- then run `yarn run python:(win / linux):ui:dev`
121+
in this step stdout is redirected to `(root folder)/nyanga/log/app.log` file to keep your stdout in terminal clean, some exception is still can escape to stdout in terminal, so when you have any issue when developing feature that related to windowing, ipc, and storage you want keep your eyes in this file.
106122

107-
- window and ipc testing
123+
below is the step to how do you build your UI first, then running the ipc / window testing step.
108124

109-
- first you need to start the UI server with command `yarn run svelte:dev`
110-
- then run `yarn run python:(win /linux):start` to test your ipc or window changes
125+
- build your ui by using poetry
111126

112-
- building
113-
- first run the UI build command `yarn run svelte:build`
114-
- then run in new console start your's python virtual environment
115-
- then run `pyinstaller --noconfirm ./Nyanga-read-(windows / linux).spec`
127+
- in root folder you can typing `poetry run build_ui`, this is automatically installing your front-end dependencies if it not available, and then build your UI front-end.
128+
129+
- build your ui without using poetry (using yarn, or any node package manager that you already have).
130+
131+
- if not you need to install development dependencies first by running command `yarn install` inside folder `(root folder)/nyanga`.
132+
- then you can run command `yarn run svelte:build`.
133+
134+
- for testing your code in testing / preview mode you can run `export APP_ENV=preview` then run command `poetry run dev` again.
135+
136+
- Building locally
137+
138+
for building this project locally (altought i'm not recommending it because it will make the binary file size fat, and don't know why), you can follow step bellow.
139+
140+
- in root folder, build your UI first by running `poetry run buld_ui`.
141+
- then you can run `poetry build_(linux / window)` for building in your os.
116142

117143
- Transalating
118144

@@ -124,6 +150,10 @@ currently this application available only in 2 language, _english_ and _Bahasa I
124150

125151
- Submit your transalation by sending me _gitlab pull request_, i'll review it before merging it to main branch.
126152

153+
## Supported OS
154+
155+
from version 3.0.4 to 3.0.10, currently still being build for linux specifically for debian based distro. for version 3.15.0 build tools and workflow will be able to build for windows again, because i didn't feel like i want to configuring buildtools and the gh-workflow.
156+
127157
## Note
128158

129159
this application not including _manhua_ or _manhwa_ by default because i just want to read some JP manga, but you can request to add it to application, and i did not include tag _Boys Love_ because i mean come on 😕, and no i will not add this tag to application.

.eslintignore nyanga/.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ node_modules
1111
pnpm-lock.yaml
1212
package-lock.json
1313
yarn.lock
14+
15+
__pycache__
16+
*.py
17+
layout

.eslintrc.cjs nyanga/.eslintrc.cjs

File renamed without changes.

nyanga/.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
.vercel
10+
.output
11+
vite.config.js.timestamp-*
12+
vite.config.ts.timestamp-*
13+
14+
15+
# yarn
16+
.yarn
17+
18+
# build output binary
19+
nyanga

.npmrc nyanga/.npmrc

File renamed without changes.

.prettierignore nyanga/.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ node_modules
1111
pnpm-lock.yaml
1212
package-lock.json
1313
yarn.lock
14+
15+
__pycache__
16+
*.py
17+
layout

.prettierrc nyanga/.prettierrc

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"trailingComma": "none",
55
"printWidth": 100,
66
"plugins": ["prettier-plugin-svelte"],
7-
"pluginSearchDirs": ["."],
87
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
98
}

nyanga/.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules
File renamed without changes.
File renamed without changes.
File renamed without changes.

nyanga/buildtool.py

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import subprocess
2+
from pathlib import Path
3+
4+
import PyInstaller.__main__
5+
6+
7+
def start_ui():
8+
try:
9+
subprocess.run(
10+
["yarn", "run", "svelte:dev"], cwd=Path(__file__).parent.absolute()
11+
)
12+
except KeyboardInterrupt:
13+
pass
14+
15+
16+
def install_ui_dep():
17+
try:
18+
subprocess.run(["yarn", "install"], cwd=Path(__file__).parent.absolute())
19+
except KeyboardInterrupt:
20+
pass
21+
22+
23+
def build_ui():
24+
try:
25+
subprocess.run(["yarn", "install"], cwd=Path(__file__).parent.absolute())
26+
subprocess.run(
27+
["yarn", "run", "svelte:build"], cwd=Path(__file__).parent.absolute()
28+
)
29+
except KeyboardInterrupt:
30+
pass
31+
32+
33+
def build_linux():
34+
PyInstaller.__main__.run(
35+
[
36+
f"{Path(__file__).parent.absolute()}/buildtools/specfile/Nyanga-Read-linux.spec",
37+
"--distpath",
38+
"nyanga",
39+
]
40+
)
41+
42+
43+
def build_windows():
44+
PyInstaller.__main__.run(
45+
[
46+
f"{Path(__file__).parent.absolute()}/buildtools/specfile/Nyanga-Read-linux.spec",
47+
"--distpath",
48+
"nyanga",
49+
]
50+
)

scripts/specfile/Nyanga-Read-linux.spec nyanga/buildtools/specfile/Nyanga-Read-linux.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ block_cipher = None
55

66

77
a = Analysis(
8-
['../../window/app.py'],
8+
['../../main.py'],
99
pathex=[],
1010
binaries=[],
1111
datas=[

scripts/specfile/Nyanga-Read-windows.spec nyanga/buildtools/specfile/Nyanga-Read-windows.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ block_cipher = None
55

66

77
a = Analysis(
8-
['..\\..\\window\\app.py'],
8+
['..\\..\\main.py'],
99
pathex=[],
1010
binaries=[],
1111
datas=[
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

nyanga/main.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from nyanga.window.window import Nyanga
2+
3+
def app():
4+
app = Nyanga()
5+
app.run()
6+
7+
if __name__ == "__main__":
8+
app()

0 commit comments

Comments
 (0)