Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
34d69cb
Add command suggestion and autocomplete mechanism
jon-edward Aug 10, 2025
d133706
Add terminal output with color; fix linting errors
jon-edward Aug 10, 2025
3a44fe9
pillow package
Miras3210 Aug 10, 2025
269439c
Merge pull request #6 from Miras3210/gui
Miras3210 Aug 10, 2025
8503241
lint fix
Miras3210 Aug 10, 2025
992216a
fixed comments, added load_image command
Miras3210 Aug 10, 2025
42f1fe1
fixed comments, added load_image command
Miras3210 Aug 10, 2025
6c38260
Merge remote-tracking branch 'origin/terminal' into terminal
Osiris32-and-a-half Aug 10, 2025
0e8c3da
fixed linting issues
Osiris32-and-a-half Aug 10, 2025
99369c4
fixed docstring in load image
Osiris32-and-a-half Aug 10, 2025
d2283c3
prevent the user to select text while dragging the separator
Jujulien45 Aug 10, 2025
e6262b6
Merge branch 'terminal' of https://github.com/Miras3210/codejam-lauda…
Jujulien45 Aug 10, 2025
39679e2
prevent the user from selecting any text while dragging the separator
Jujulien45 Aug 10, 2025
78db669
added color class
Osiris32-and-a-half Aug 10, 2025
4b0389b
Changed Utils package name to utils
Osiris32-and-a-half Aug 10, 2025
08c2ab8
Added Color to as type to areas of the codebase
Osiris32-and-a-half Aug 10, 2025
e85a979
Added Docstrings to color
Osiris32-and-a-half Aug 10, 2025
69d87a6
Added return types to color
Osiris32-and-a-half Aug 10, 2025
df8b1a1
added a bunch of color types
Miras3210 Aug 10, 2025
f62c20c
Added import for pillow for pyodide
Osiris32-and-a-half Aug 10, 2025
91341cf
Update PIL for lockfile
jon-edward Aug 10, 2025
3dd7f21
Modularize app colors
jon-edward Aug 10, 2025
c44ce36
Merge remote-tracking branch 'origin/terminal' into terminal
Osiris32-and-a-half Aug 10, 2025
ce11dd9
Fix selection CSS, fix incorrect focus on text selection
jon-edward Aug 10, 2025
00aaecd
Added terminal and image creation to gui init
Osiris32-and-a-half Aug 10, 2025
af16869
no more colors, too many ruff errors
Miras3210 Aug 10, 2025
d5339bf
Fixed circular import issue with terminal
Osiris32-and-a-half Aug 10, 2025
82a1949
Fixed linter issues in color
Osiris32-and-a-half Aug 10, 2025
ff0c304
Merge remote-tracking branch 'origin/terminal' into terminal
Osiris32-and-a-half Aug 10, 2025
0c102c3
Auto fix end of file
Osiris32-and-a-half Aug 10, 2025
239e1a7
Add drag and drop interface and file upload functionality
silladgey Aug 10, 2025
3d7020c
Add history navigation with arrow keys
jon-edward Aug 10, 2025
b7a3c27
Integrated terminal with the gui
Osiris32-and-a-half Aug 10, 2025
bb54259
Fixed ping
Osiris32-and-a-half Aug 10, 2025
5d3e8ca
Fixed linter issues in terminal_gui
Osiris32-and-a-half Aug 10, 2025
ca6706a
Merge pull request #7 from Miras3210/terminal
jon-edward Aug 10, 2025
d785a71
Merge branch 'main' into gui
jon-edward Aug 10, 2025
1fd8bc4
Resolve conflicts
jon-edward Aug 10, 2025
6d3a23e
Fix linting errors
jon-edward Aug 10, 2025
9e262a6
Add underline to command verb
jon-edward Aug 10, 2025
5222c2b
Fix underline
jon-edward Aug 10, 2025
3c9c70d
fix load image command comments
Jujulien45 Aug 10, 2025
ea402b7
add bg command
Jujulien45 Aug 11, 2025
9fb7eaf
Image preview container
silladgey Aug 10, 2025
3ee3066
Load Pillow package in browser environment
silladgey Aug 11, 2025
039b84d
Removed unused image testing file
silladgey Aug 11, 2025
957ae0f
Load default image on init and improve drag-drop UX
silladgey Aug 11, 2025
390a8e9
Correct setTimeout usage for placeholder reset
silladgey Aug 11, 2025
bc809b7
Handle FileList correctly and persist click-upload handler
silladgey Aug 11, 2025
574deb6
Load uploaded images as base64 data URLs for display
silladgey Aug 11, 2025
690ef59
Separate GUI section components into Layout module
silladgey Aug 11, 2025
83516de
Integrate Layout component into GUI initialization
silladgey Aug 11, 2025
81db2b1
Separate draggable Separator component into own module
silladgey Aug 11, 2025
b2d76a8
Add author attribution to init_gui function
silladgey Aug 11, 2025
599e575
Add components module for centralized exports
silladgey Aug 11, 2025
e4364ae
Remove inline separator logic and add author attribution to ImagePreview
silladgey Aug 11, 2025
a682d06
Merge remote-tracking branch 'origin/main' into image
silladgey Aug 11, 2025
3b36dbe
modify the bg command so that it changes all the text color
Jujulien45 Aug 11, 2025
5058645
Fix merge conflicts
silladgey Aug 11, 2025
0afc616
modify the bg command so that it changes all the text color
Jujulien45 Aug 11, 2025
a401bce
Fix bug where the drag handler interferes with the separator dragging
silladgey Aug 11, 2025
195f88c
fix the value of v in hsv
Jujulien45 Aug 11, 2025
139c2fe
Merge branch 'main' of https://github.com/Miras3210/codejam-laudatory…
Jujulien45 Aug 11, 2025
4a4c5f5
Fix linting problems to stop it from screaming at me
silladgey Aug 11, 2025
e1fbe9f
Merge remote-tracking branch 'origin/main' into image
silladgey Aug 11, 2025
f6a7385
Changed return on invalid command
Osiris32-and-a-half Aug 11, 2025
2d60715
Fixed tense in BaseCommand docstring
Osiris32-and-a-half Aug 11, 2025
fec5ea2
Added command prediction to `Terminal`
Osiris32-and-a-half Aug 11, 2025
a406ef3
Added argument prediction to commands
Osiris32-and-a-half Aug 11, 2025
aa0bc16
Integrated argument prediction to `Terminal`
Osiris32-and-a-half Aug 11, 2025
584b958
Implemented predict_args for help
Osiris32-and-a-half Aug 11, 2025
ba3260d
Integrated command prediction with gui
Osiris32-and-a-half Aug 11, 2025
afedf18
Fix import in image preview
silladgey Aug 11, 2025
ae5548a
Simplify conditional logic for displaying previous image
silladgey Aug 11, 2025
85529c0
Fixed spacing in argument prediction
Osiris32-and-a-half Aug 11, 2025
54a7c7a
Fixed default argument for `help` not being a new argument
Osiris32-and-a-half Aug 11, 2025
674bbea
Fixed type conversion for page number in `help` command
Osiris32-and-a-half Aug 11, 2025
d66070c
Remove redundant blank lines in docstrings
silladgey Aug 11, 2025
ba26824
Suppress type annotations
silladgey Aug 11, 2025
6481175
Fixed chaining of predictions in terminal_gui
Osiris32-and-a-half Aug 11, 2025
5ddfbc4
Fix linting errors
silladgey Aug 11, 2025
d240496
Add DragDropHandler component for image file uploads
silladgey Aug 11, 2025
d588009
Add FileUploadHandler component for image file uploads
silladgey Aug 11, 2025
1cc0a34
Add ImageDisplayManager component for image file uploads
silladgey Aug 11, 2025
c63651e
Refactor ImagePreview component
silladgey Aug 11, 2025
e219270
Fix linting errors
silladgey Aug 11, 2025
7584277
Upload image functionality feature (#9)
silladgey Aug 11, 2025
25f2ea3
Split terminal gui into smaller files, add css_variables to terminal …
jon-edward Aug 12, 2025
9a4533a
Remove focusing zoom on mobile
jon-edward Aug 12, 2025
566b8fd
Fix linting errors
jon-edward Aug 12, 2025
662fb08
Minor code style fix, return None implicitly
jon-edward Aug 12, 2025
2d1f356
Fix wrapping issue
jon-edward Aug 12, 2025
86b664f
Make individual CSS variable adapters instead of singular adapter
jon-edward Aug 12, 2025
35cb10c
Merge pull request #10 from Miras3210/gui
Osiris32-and-a-half Aug 12, 2025
f9d2603
Changed return on invalid command
Osiris32-and-a-half Aug 11, 2025
d1ecf3c
Fixed tense in BaseCommand docstring
Osiris32-and-a-half Aug 11, 2025
8ca9070
Added command prediction to `Terminal`
Osiris32-and-a-half Aug 11, 2025
4b96d63
Added argument prediction to commands
Osiris32-and-a-half Aug 11, 2025
308a379
Integrated argument prediction to `Terminal`
Osiris32-and-a-half Aug 11, 2025
88b633b
Implemented predict_args for help
Osiris32-and-a-half Aug 11, 2025
d76c7c0
Integrated command prediction with gui
Osiris32-and-a-half Aug 11, 2025
71d5d43
Fixed spacing in argument prediction
Osiris32-and-a-half Aug 11, 2025
990b972
Fixed default argument for `help` not being a new argument
Osiris32-and-a-half Aug 11, 2025
dc9bb2e
Fixed type conversion for page number in `help` command
Osiris32-and-a-half Aug 11, 2025
f6d1e96
Merge remote-tracking branch 'origin/terminal' into terminal
Osiris32-and-a-half Aug 12, 2025
49abd51
Merge pull request #11 from Miras3210/terminal
jon-edward Aug 12, 2025
ddd11a5
Merge remote-tracking branch 'origin/main' into image
Miras3210 Aug 12, 2025
3e6a8de
Merge pull request #12 from Miras3210/image
Miras3210 Aug 12, 2025
06db7a9
New commands, bug fixing, additional features.
Miras3210 Aug 13, 2025
60f4b7b
Modified commands init
Miras3210 Aug 13, 2025
ec1ce6f
Linting errors
Miras3210 Aug 13, 2025
37539e2
Changed image updating to let the image update itself.
Miras3210 Aug 13, 2025
aae1752
Bugfixes
Miras3210 Aug 13, 2025
0504771
Add project title to index.html and format viewport meta tag
silladgey Aug 13, 2025
d2aaa29
refactor: Reindent Python code in Pyodide script
silladgey Aug 13, 2025
a2abfe3
Merge pull request #13 from Miras3210/image
Osiris32-and-a-half Aug 13, 2025
8532559
Include noscript fallback
silladgey Aug 13, 2025
33a100e
Add author and description metatags
silladgey Aug 13, 2025
f6c5372
feat: Add favicon, apple-touch-icon, manifest, and theme color
silladgey Aug 13, 2025
7c97d01
Replace default.png with updated placeholder image
silladgey Aug 13, 2025
aa90e1c
Merge branch 'main' of https://github.com/Miras3210/codejam-laudatory…
silladgey Aug 13, 2025
0edec00
Add trailing newline to site.webmanifest
silladgey Aug 13, 2025
bb06bc4
Update description metatag
silladgey Aug 13, 2025
fc17625
Docs: Add CONTRIBUTING guide, update README, license, and project str…
silladgey Aug 13, 2025
2b193a8
Added options parsing to Terminal and added options argument to all c…
Osiris32-and-a-half Aug 13, 2025
c405cbc
Fixed option arguments actually getting added to the right option
Osiris32-and-a-half Aug 13, 2025
f70927b
Fixed concatenation of option arguments
Osiris32-and-a-half Aug 13, 2025
9ece0bd
docs: Fix numbering in setup instructions
silladgey Aug 13, 2025
8199891
Small fix: Show arg length mismatch error for save_image
jon-edward Aug 14, 2025
0262d74
Allow description to be full-width on small devices, add description …
jon-edward Aug 14, 2025
8563e39
Merge branch 'gui' of github.com:Miras3210/codejam-laudatory-larkspur…
jon-edward Aug 14, 2025
2ab7c37
Add mouse position info element
jon-edward Aug 14, 2025
c9fef14
Change to dark theme, add checkerboard pattern to image preview
jon-edward Aug 14, 2025
ca2f31e
Added webcolors to dependencies
Osiris32-and-a-half Aug 15, 2025
fc62550
Implemented color factory called `create_color`
Osiris32-and-a-half Aug 15, 2025
2c549e9
Rename project to 'Good Image Terminal'
silladgey Aug 15, 2025
18678dc
fix: Apply quick fix to ImagePreview
silladgey Aug 15, 2025
d5dbf7d
Remove unused import from image_display_manager.py
silladgey Aug 15, 2025
df75a24
Containerize app with Docker (#15)
silladgey Aug 15, 2025
e62bee5
Added alpha to color factory and changed the separator between number…
Osiris32-and-a-half Aug 15, 2025
b51b665
Added hsv support to color factory
Osiris32-and-a-half Aug 15, 2025
fe216ce
Changed color factory to evaluate custom evaluators in lowercase
Osiris32-and-a-half Aug 15, 2025
ba07105
Add loading screen, remove on load
jon-edward Aug 16, 2025
4b8f71f
Merge branch 'main' into gui
jon-edward Aug 16, 2025
1821834
Fix linting errors
jon-edward Aug 16, 2025
977684f
Merge branch 'gui' of github.com:Miras3210/codejam-laudatory-larkspur…
jon-edward Aug 16, 2025
ca1826d
Fix linting errors
jon-edward Aug 16, 2025
f579566
Automated build and deployment workflow (#17)
silladgey Aug 16, 2025
3d03162
Automated CI/CD workflows (#18)
silladgey Aug 16, 2025
8328bc2
build: Update workflow trigger
silladgey Aug 16, 2025
7085589
fix: Remove npm cache from Node.js setup
silladgey Aug 16, 2025
551f5b7
Necessary fix for image upload.
Miras3210 Aug 16, 2025
ba868b6
Merge pull request #16 from Miras3210/gui
Miras3210 Aug 16, 2025
341075e
Lint fix
Miras3210 Aug 16, 2025
66bb587
Added known_options to BaseCommand
Osiris32-and-a-half Aug 16, 2025
1ff8034
Added support to terminal for special options fg and bg
Osiris32-and-a-half Aug 16, 2025
a3d0e2c
Renamed background command (or `bg`) to `terminal_background`
Osiris32-and-a-half Aug 16, 2025
5416d24
Added foreground command
Osiris32-and-a-half Aug 16, 2025
d391743
Added background command
Osiris32-and-a-half Aug 16, 2025
110c230
Fixed predict_args in foreground
Osiris32-and-a-half Aug 16, 2025
974c785
Changed draw_rectangle to use the new fg system
Osiris32-and-a-half Aug 16, 2025
2058b8e
Importing webcolors into pyodide
Osiris32-and-a-half Aug 16, 2025
9b8aa40
Fixed type issue in both fg and bg commands, argument prediction
Osiris32-and-a-half Aug 16, 2025
12fc120
Fixed None being in regex capture list when missing alpha which then …
Osiris32-and-a-half Aug 16, 2025
532f8ee
Used fg from inputted options instead of terminal
Osiris32-and-a-half Aug 16, 2025
287432d
Fixed fg prediction to use foreground color
Osiris32-and-a-half Aug 16, 2025
b6491c3
Merge branch 'main' into terminal
Osiris32-and-a-half Aug 16, 2025
c824257
Fixed hsv conversion and added bounds checking to color factory
Osiris32-and-a-half Aug 16, 2025
b2fcf09
Split up create_color factory
Osiris32-and-a-half Aug 16, 2025
0e257e4
Changed draw circle to use fg color system
Osiris32-and-a-half Aug 17, 2025
bdafa78
Removed color predictions from draw circle
Osiris32-and-a-half Aug 17, 2025
a8fb0e7
Removed color predictions from draw line
Osiris32-and-a-half Aug 17, 2025
c09d84c
Draw rectangle now also outputs alpha to terminal
Osiris32-and-a-half Aug 17, 2025
1660111
Changed draw line to use fg color system
Osiris32-and-a-half Aug 17, 2025
308c4c5
Draw rectangle now outputs used color not terminal foreground color
Osiris32-and-a-half Aug 17, 2025
1535d67
Added fg as an option for draw line
Osiris32-and-a-half Aug 17, 2025
20d8958
Changed draw pixel to use fg color system
Osiris32-and-a-half Aug 17, 2025
f878e35
Changed terminal_background to use color factory
Osiris32-and-a-half Aug 17, 2025
6bb07d8
Fixed type issue in color factory (again)
Osiris32-and-a-half Aug 17, 2025
22722c0
Changed terminal_background to change background color of terminal
Osiris32-and-a-half Aug 17, 2025
2642b7a
Merge pull request #19 from Miras3210/terminal
Osiris32-and-a-half Aug 17, 2025
3282d89
Added support to fill_rect for outline
Osiris32-and-a-half Aug 17, 2025
d3d5c95
Added support to draw rectangle command for boarder and no-fill
Osiris32-and-a-half Aug 17, 2025
c7c7594
Fixed fill for draw rectangle
Osiris32-and-a-half Aug 17, 2025
4bd6a2c
Fixed None handling in fill_rect
Osiris32-and-a-half Aug 17, 2025
14cc8d1
Renamed Border option to outline
Osiris32-and-a-half Aug 17, 2025
072ff69
Added support to draw_circle in image for outlines
Osiris32-and-a-half Aug 17, 2025
697cbf2
Added support to draw_circle command for outlines
Osiris32-and-a-half Aug 17, 2025
8517cd5
Upload team banner
silladgey Aug 18, 2025
920b24d
Add footer to project description
silladgey Aug 18, 2025
e5cdf2c
Merge branch 'gui'
silladgey Aug 18, 2025
ada12bd
Color sampling for image preview, docstring improvements (#20)
silladgey Aug 18, 2025
a7c96d5
Fixed class comment and typing in base command
Osiris32-and-a-half Aug 18, 2025
2addade
Fixed and extended `bg` help
Osiris32-and-a-half Aug 18, 2025
74d6989
Extended `fg` help
Osiris32-and-a-half Aug 18, 2025
07c848c
Fixed `draw_circle` help
Osiris32-and-a-half Aug 18, 2025
5f3ca30
Fixed alpha when drawing
Osiris32-and-a-half Aug 18, 2025
8235373
Fixed and added more draw_line help
Osiris32-and-a-half Aug 18, 2025
deeada1
Fixed and added more draw_pixel help
Osiris32-and-a-half Aug 18, 2025
12b510d
Fixed draw_rectangle help
Osiris32-and-a-half Aug 18, 2025
fb542df
Fixed Help help
Osiris32-and-a-half Aug 18, 2025
8ea7595
Fixed terminal_background help
Osiris32-and-a-half Aug 18, 2025
406c921
Merge pull request #21 from Miras3210/terminal
Osiris32-and-a-half Aug 18, 2025
3c96e86
Implemented draw_polygon.py
Osiris32-and-a-half Aug 18, 2025
cc690f5
docs: Initialize project documentation
silladgey Aug 20, 2025
431adf5
docs: Add cover page, sidebar, .nojekyll
silladgey Aug 20, 2025
c9e91e1
docs: Move media assets from root project directory to docs/_media
silladgey Aug 20, 2025
4521493
docs: Add initial commands documentation page
silladgey Aug 20, 2025
a65d905
docs: Add description comment to docs/README
silladgey Aug 20, 2025
863d026
docs: Add size to logo image
silladgey Aug 20, 2025
6e84b7f
docs: Switch banner to logo in coverpage
silladgey Aug 20, 2025
0b5aebc
docs: Add navbar, features.md, code-jam-12.md
silladgey Aug 20, 2025
5665940
docs: Add contribution guide and installation guide
silladgey Aug 20, 2025
c223e0c
docs: Include all terminal commands with usage
silladgey Aug 20, 2025
bbcbe7f
docs: Refactor scripts and styles in docs/index.html
silladgey Aug 20, 2025
f61d79b
docs: Streamline docs landing page with banner, navbar and link tweaks
silladgey Aug 20, 2025
880e30d
docs: Add favicon to documentation pages
silladgey Aug 20, 2025
bd6b3dc
docs: Add Docsify plugins
silladgey Aug 20, 2025
40b06e3
docs: Switch theme to docsify-themeable with light and dark themes
silladgey Aug 20, 2025
7878380
Add features to docs
jon-edward Aug 20, 2025
8cfeed4
docs: Add option flags and showcase GIFs to 'commands' documentation
silladgey Aug 21, 2025
6e83f8a
Contributors :D
Miras3210 Aug 21, 2025
410f84c
Commands description and Contributors image
Miras3210 Aug 21, 2025
032b3de
Added Philip's contribution to docs
Osiris32-and-a-half Aug 21, 2025
eb855aa
Jont contributions
jon-edward Aug 21, 2025
df809e1
docs: Add flexible alerts plugin to index.html
silladgey Aug 22, 2025
99d9604
docs: Reorganize project structure to be up to date
silladgey Aug 22, 2025
b696b17
docs: Add project description to README
silladgey Aug 22, 2025
91e2976
docs: Add project details
silladgey Aug 22, 2025
3f33713
docs: Update installation guide
silladgey Aug 22, 2025
c35bf33
docs: Update contribution guidelines
silladgey Aug 22, 2025
0868364
docs: Update cover page
silladgey Aug 22, 2025
ca764f8
docs: Add information on Code Jam
silladgey Aug 22, 2025
0f87aec
docs: Create documentation on color formats
silladgey Aug 22, 2025
eed17e9
docs: Update commands to include arguments
silladgey Aug 22, 2025
324c834
docs: Remove duplicate code-jam-12.md
silladgey Aug 22, 2025
96ae4e6
Remove sample files
silladgey Aug 22, 2025
58a5414
docs: Add Get Started page to navbar
silladgey Aug 22, 2025
71d98a9
docs: Add Color Formats to navbar
silladgey Aug 22, 2025
30aea60
docs: Add Features to navbar
silladgey Aug 22, 2025
7c6689a
docs: Add version 0.1.0 and update navbar labels
silladgey Aug 22, 2025
4927ba6
Add Julien to contribution.md
Miras3210 Aug 22, 2025
5a884c3
docs: Add workflow badges to README
silladgey Aug 22, 2025
b37a20d
Added link for named CSS colors to docs
Osiris32-and-a-half Aug 22, 2025
dbed01e
Merge remote-tracking branch 'origin/main'
Osiris32-and-a-half Aug 22, 2025
0578b5d
docs: Add FAQ section
silladgey Aug 22, 2025
4826e9d
Update README.md
Miras3210 Aug 22, 2025
29221fd
docs: Update docs/README.md
silladgey Aug 22, 2025
4ff0614
Added webcolors to packages doc
Osiris32-and-a-half Aug 22, 2025
6fe2927
Add 'laudatory-larkspurs/' from commit '4ff0614197a73fd689844ef246987…
janine9vn Sep 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions laudatory-larkspurs/.github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build project and publish

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
build:
name: Build the project
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .

- name: Build project
run: python build.py

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: build
if-no-files-found: error

publish:
name: Publish build artifact
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure Git
run: |
BOT_NAME="github-actions[bot]"
BOT_EMAIL="41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "$BOT_NAME"
git config user.email "$BOT_EMAIL"

- name: Prepare build branch
run: |
set -e
if git ls-remote --exit-code origin build; then
git fetch origin build:build
git checkout build
else
git checkout --orphan build
fi
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build
path: .

- name: Commit build folder
run: |
git add .
git diff --cached --quiet && echo "No build changes to commit" || git commit -m "Deploying production from @ ${GITHUB_SHA::7} 🚀"
git push origin build

timeout-minutes: 15
42 changes: 42 additions & 0 deletions laudatory-larkspurs/.github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to Vercel

on:
workflow_run:
workflows: ["Build project and publish"]
branches: [main]
types: [completed]
workflow_dispatch:

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
name: Deploy production build
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }}
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: build

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Install Vercel CLI
run: npm install -g vercel@latest

- name: Deploy to Vercel
run: vercel deploy --prod --yes --token=${{ secrets.VERCEL_TOKEN }}

timeout-minutes: 15
35 changes: 35 additions & 0 deletions laudatory-larkspurs/.github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# GitHub Action workflow enforcing our code style.

name: Lint

# Trigger the workflow on both push (to the main repository, on the main branch)
# and pull requests (against the main repository, but from any repo, from any branch).
on:
push:
branches:
- main
pull_request:

# Brand new concurrency setting! This ensures that not more than one run can be triggered for the same commit.
# It is useful for pull requests coming from the main repository since both triggers will match.
concurrency: lint-${{ github.sha }}

jobs:
lint:
runs-on: ubuntu-latest

env:
# The Python version your project uses. Feel free to change this if required.
PYTHON_VERSION: "3.12"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1
34 changes: 34 additions & 0 deletions laudatory-larkspurs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Files generated by the interpreter
__pycache__/
*.py[cod]

# Environment specific
.venv
venv
.env
env

# Unittest reports
.coverage*

# Logs
*.log

# PyEnv version selector
.python-version

# Built objects
*.so
dist/
build/

# IDEs
# PyCharm
.idea/
# VSCode
.vscode/
# MacOS
.DS_Store

build/
.vercel
18 changes: 18 additions & 0 deletions laudatory-larkspurs/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Pre-commit configuration.
# See https://github.com/python-discord/code-jam-template/tree/main#pre-commit-run-linting-before-committing

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.2
hooks:
- id: ruff-check
- id: ruff-format
141 changes: 141 additions & 0 deletions laudatory-larkspurs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Contributing

## Information

This project uses [Pyodide](https://pyodide.org) to run Python directly in the browser using WebAssembly (WASM).
Almost no JavaScript is required — the frontend is written entirely in Python and HTML/CSS.

## Dev Code Checks

Use `ruff check` to check your code style. and fix it

```shell
ruff check .
ruff check . --fix
```

Use `pre-commit` to run linting before committing. `pre-commit install` to install.

### Examples

```shell
pre-commit run --show-diff-on-failure --all-files
pre-commit run ruff-check --all-files
pre-commit run check-toml --all-files
```

**Pre-commit hooks:**

- `check-toml`: Lints and corrects your TOML files.
- `check-yaml`: Lints and corrects your YAML files.
- `end-of-file-fixer`: Makes sure you always have an empty line at the end of your file.
- `trailing-whitespace`: Removes whitespaces at the end of each line.
- `ruff-check`: Runs the Ruff linter.
- `ruff-format`: Runs the Ruff formatter.

## Our coding rules

1. Comment your classes, functions, and non-obvious logic.
2. Use docstrings with author tags and short descriptions.

```py
class ClassName:
'''Handle user input and validation.

@author Mira
'''
...

# Short function description
def do_something():
'''Perform a single-step operation.

:param paramname: does something
:return: None

@author Mira
'''
...
```

## Naming Stuff Rules

Use `ruff check` to check your code style. and fix it

```shell
ruff check .
ruff check . --fix
```

**Functions**: lowercase and use underscores

```py
def my_function():
my_variable = "value"
```

**Classes and Variable names**: PascalCase style

```py
from typing import List

class MyClass:
pass

ListOfMyClass = List[MyClass]
```

**Constants**: SCREAMING_SNAKE_CASE style

```py
MY_CONSTANT = 1
```

**Operators**: at the start of a newline

```py
# No
result = (
1 +
2 *
3
)
# Yes
result = (
1
+ 2
* 3
)
```

**equivalent to None**: use `is`, `is not` instead of `==`

```py
if variable == None: # No
print("Variable is None")
if variable is None: # Yes
print("Variable is None")¨
```

**not** positioning:

```py
if not variable is None: # No
print("Variable is not None")

if variable is not None: # Yes, easier to read
print("Variable is not None")
```

**Imports**: do not import multiple modules on one line or everything from a module (\*)

```py
# No
import pathlib, os
from pathlib import *

# Yes
import os
import pathlib
from pathlib import Path
```
33 changes: 33 additions & 0 deletions laudatory-larkspurs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#############################
# Single-stage Python image #
#############################
FROM python:3.12-slim

LABEL org.opencontainers.image.title="good-image-terminal" \
org.opencontainers.image.description="A simple yet interesting image editor." \
org.opencontainers.image.licenses="MIT"

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PORT=8000

# Set the working directory
WORKDIR /app

# Copy project files
COPY build.py pyproject.toml README.md uv.lock* ./
RUN pip install --no-cache-dir .

COPY public ./public
COPY src ./src

EXPOSE 8000

CMD ["bash", "-c", "python build.py --serve --port ${PORT}"]

#####################################################################################################
# Usage #
# docker build -t good-image-terminal:latest . #
# docker run --rm --name good-image-terminal -e PORT=8000 -p 8000:8000 good-image-terminal:latest #
# App: http://localhost:8000 #
#####################################################################################################
Loading