Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick all new changes #353

Closed
wants to merge 334 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
8d3d5ca
[pnpm] enable shell-emulator for new contributors on windows
zardoy Aug 21, 2023
2a0533c
simple fov change on sprint (so sprint can be indicated)
zardoy Aug 22, 2023
aeeb012
refactor modal stacks so they are:
zardoy Aug 22, 2023
edf1def
feat: display leave confirmation when playing (prevent accidental ctr…
zardoy Aug 22, 2023
bb26208
inventories are almost here wip:
zardoy Aug 22, 2023
7b08d17
rm log
zardoy Aug 22, 2023
bc474cc
Merge remote-tracking branch 'origin/main' into inventory
zardoy Aug 22, 2023
42a11dd
add ci.yml
zardoy Aug 26, 2023
714bf3d
make render distance updatable, refactor controls spend some time on …
zardoy Aug 22, 2023
e519e69
make new ci.yml run on pulls
zardoy Aug 26, 2023
2e3f30a
replace legacy lib, comment
zardoy Aug 22, 2023
50b5c76
flying check for spectator
zardoy Aug 22, 2023
37a3a7b
play -> connect to server
zardoy Aug 22, 2023
860ed43
fix opening chat
zardoy Aug 22, 2023
8a563ae
[experimental] allow to override num of workers
zardoy Aug 23, 2023
0285401
feat: preserve chat history in sessionstorage
zardoy Aug 23, 2023
8e385c6
support player saving data :rocket:
zardoy Aug 23, 2023
3c8200a
support world saving :rocket:
zardoy Aug 23, 2023
d58867b
refactor: move browserfs to its own file
zardoy Aug 23, 2023
b405289
temporary fix for block model in inventory gui
zardoy Aug 23, 2023
b1b03f0
add support for icons in button
zardoy Aug 23, 2023
7eb2d54
feat(big!): implement folder save loading with write access
zardoy Aug 26, 2023
2ea2f53
add ci.yml
zardoy Aug 26, 2023
6deb405
Merge branch 'main' into inventory
zardoy Aug 26, 2023
359930d
build should be fixed (disable inventory for now)
zardoy Aug 26, 2023
6f6f089
Remove linked dep
zardoy Aug 26, 2023
1d895a3
wip testing cypress
zardoy Aug 27, 2023
e5f1810
install false
zardoy Aug 27, 2023
ff52875
Offline saving + world folder read / write! (#8)
zardoy Aug 26, 2023
947f76a
Merge branch 'main' into cypress
zardoy Aug 27, 2023
c36f52c
update ci for cypress
zardoy Aug 27, 2023
dcb6011
try fo fix page actually
zardoy Aug 27, 2023
8363c12
[skip ci] up ci.yml
zardoy Aug 27, 2023
cce07c9
move building to esbuild
zardoy Aug 28, 2023
cc8675f
format manifest: specify orientation
zardoy Aug 28, 2023
96d42d6
expose nbt to window to allow parse of custom data
zardoy Aug 28, 2023
9f00b52
workaround offline world player saving data
zardoy Aug 28, 2023
ba04bc8
skip subsequent package patches
zardoy Aug 28, 2023
49ff10a
Green cypress (fix build) (#9)
zardoy Aug 28, 2023
0c1b404
ci: publish correct folder
zardoy Aug 28, 2023
3bce2bc
test ci: sync publish with ci steps
zardoy Aug 28, 2023
02f9eaa
ci: do not generate too large sourcemaps on prod
zardoy Aug 28, 2023
ccc729b
move localServerOptions into options namespace
zardoy Aug 28, 2023
7f4f69c
fix dev esbuild config
zardoy Aug 28, 2023
a8c2af0
test error fix
zardoy Aug 28, 2023
b12783f
feat: first class camera touch support! tested on ios, currently no k…
zardoy Aug 28, 2023
82f611f
variable renames
zardoy Aug 29, 2023
6bdecc0
fix debug config, align generated sw with webpack, cleanup optionsSto…
zardoy Aug 28, 2023
699688d
improve esbuild config: report reload time into console!
zardoy Aug 29, 2023
fd5462f
displaly save & quit on folder load
zardoy Aug 28, 2023
f4ccf5b
important: fix build for safari (transpile to es2020)
zardoy Aug 29, 2023
ed3dadd
fix build errors in console (dont affect runtime much)
zardoy Aug 28, 2023
ab2d721
fix reload text
zardoy Aug 29, 2023
3797122
experimental dragndrop save world handle
zardoy Aug 29, 2023
8504fa5
small logging of bundled json size :/
zardoy Aug 29, 2023
8fcfcf1
fix: do not mutate localServerOptions
zardoy Aug 29, 2023
2a9ae33
fix chat on mobile
zardoy Aug 29, 2023
ae8a2af
feat: world loading on ios (support zip files)!
zardoy Aug 29, 2023
c7a38a7
implement /save and /export commands to export singleplayer worlds!
zardoy Aug 29, 2023
3551bed
first inventory work on servers (left click support for now)
zardoy Aug 29, 2023
3c6af46
add a way to reset world when loading errored or disconnected
zardoy Aug 30, 2023
b9c7f1f
use custom mc loader to drop a few mb of bundle & allow to specify al…
zardoy Aug 30, 2023
6fcdaed
copy only entity textures, inline others! it reduces copy time and de…
zardoy Aug 30, 2023
a4a6de6
almost fix annoying key controls issue
zardoy Aug 30, 2023
039295b
fix annoying keyboard conflicts (ctrl+s, l)
zardoy Aug 30, 2023
6adf25e
singleplayer saves: fix loading player data from level.dat (todo: not…
zardoy Aug 30, 2023
1f8c593
make process of world loading less annoying, more configurable
zardoy Aug 30, 2023
6aefd64
fix ui zoom on ctrl+w + wheel scroll
zardoy Aug 31, 2023
ae45bc5
change back for some settings
zardoy Sep 1, 2023
31ca9db
inventory support with sprites (only multiplayer fully supported for …
zardoy Aug 31, 2023
5f8d8b6
feat(setting): auto exit fullscreen on esc
zardoy Sep 1, 2023
077c20a
test vercel preview deploys on ci
zardoy Sep 1, 2023
be01da9
fix critical gameLoaded bug
zardoy Aug 31, 2023
6d1a891
fix all known annoying mis-keyboard reaction! fix annoying slow creat…
zardoy Sep 1, 2023
8a948d1
oops fix prevuilt target
zardoy Sep 1, 2023
9b71088
vercel: get correct env
zardoy Sep 1, 2023
670c560
fix dragndrop files in firefox and / action
zardoy Sep 1, 2023
9976b9a
download minecraft-data on demand
zardoy Sep 2, 2023
190c511
allow to load worlf from ?map= qs url
zardoy Sep 2, 2023
9787f79
refactor to utils for fixes
zardoy Sep 2, 2023
f92c1f7
add eruda
zardoy Sep 2, 2023
b9f621d
cleanup preparedata
zardoy Sep 2, 2023
fc9fc8b
try to fix with css loading with webpack + new space-squid esbuild re…
zardoy Sep 3, 2023
47f86ca
fix inventory & hotbar crash on unknown itme
zardoy Sep 3, 2023
f897a6e
add firefox attach config that I don't use
zardoy Sep 3, 2023
0c1607b
add singleplayer explainer a few load steps
zardoy Sep 3, 2023
e51e7c2
do not bundle large assets package, cleanup esbuildPlugins
zardoy Sep 3, 2023
6faa3c6
speed preparedata
zardoy Sep 3, 2023
734ecdf
fix always showing mobile inventory button
zardoy Sep 3, 2023
54d6598
refactor controls to use contro-max!
zardoy Sep 4, 2023
7005634
fix sw error, cache mc-data
zardoy Sep 4, 2023
7622a15
controls: use ctrl only as activation to match original game behavior
zardoy Sep 4, 2023
e66862d
dispose world on exit (that should finally allow clean exit)
zardoy Sep 4, 2023
342a2f0
singlePlayerServer -> localServer (intention: will allow other player…
zardoy Sep 4, 2023
ce566b0
upstream fork changes
zardoy Sep 4, 2023
bebd65e
display sync error as well!
zardoy Sep 4, 2023
70681fa
change default singleplayer version to 1.8.8 as it supports more feat…
zardoy Sep 4, 2023
c4ae650
add visual sneaking + touch support
zardoy Sep 4, 2023
4cf323c
add force reload chunks (F3+A)
zardoy Sep 4, 2023
e04fef0
enable eruda only on mobile
zardoy Sep 4, 2023
c9b2b1c
loadFolder -> loadSave
zardoy Sep 4, 2023
aeca97d
build prismarine-viewer locally which should increase install speed
zardoy Sep 4, 2023
2d8d522
add a way to disable prompts on load
zardoy Sep 4, 2023
f856bc5
add a way to always init eruda
zardoy Sep 4, 2023
0dca522
fix autoversion (download data on demand)
zardoy Sep 4, 2023
bfd8279
fix regression (hopefully have tests)
zardoy Sep 4, 2023
dfa45a5
not sure how but try to disable automatic deploys on vercel
zardoy Sep 4, 2023
78d4b62
rn workflow, fixes
zardoy Sep 4, 2023
bc51c9f
disable silent
zardoy Sep 4, 2023
29b47fb
try to increaese snapshot timeout
zardoy Sep 4, 2023
6f2c030
better download ui & fix qs conflict
zardoy Sep 4, 2023
5044e4e
dont test before publish
zardoy Sep 4, 2023
033eeef
next release preparing (#10)
zardoy Aug 30, 2023
767ca3f
Want to release asap. New inventory! (#12)
zardoy Aug 31, 2023
f589032
fix: excellent in-game gamepad support
zardoy Sep 4, 2023
c41c010
forcefully disconnect from server
zardoy Sep 7, 2023
83627a5
small cleanup, don't specify default version
zardoy Sep 7, 2023
ffaa523
propose to remove world only for on-device saves
zardoy Sep 7, 2023
33ddfa1
fix modal restore on title screen
zardoy Sep 7, 2023
e2670a5
refactor: migrate new code to typescript!
zardoy Sep 7, 2023
6e8e3ca
correctly display cursor mesh using collision data
zardoy Sep 7, 2023
b8b8f7b
upstream server changes
zardoy Sep 8, 2023
3decbe3
up anvil for singleplayer compatibility
zardoy Sep 8, 2023
2895a1f
fix too fast block placing
zardoy Sep 8, 2023
898648d
fix: display non-breakable blocks
zardoy Sep 8, 2023
3008be0
select hotbar on touch
zardoy Sep 9, 2023
bd98795
temp fixes for ios scaling & chat issues
zardoy Sep 9, 2023
0929e60
select block on middle mouse
zardoy Sep 9, 2023
16c42de
grass issues in inventory
zardoy Sep 9, 2023
c3a189d
fix build
zardoy Sep 9, 2023
659b089
more require to import
zardoy Sep 10, 2023
7bd9a5c
download map improvements
zardoy Sep 12, 2023
f2677ee
improve downloading progress reporting
zardoy Sep 12, 2023
e99faef
add blockInteractionShape, make cursor singleton
zardoy Sep 14, 2023
d414996
always display target, meaningful error on proxy unavailable
zardoy Sep 14, 2023
ddd763c
important keyboard & usability fixes (#13)
zardoy Sep 1, 2023
2bceab9
adjust seo a bit
zardoy Sep 14, 2023
af288d3
feat: always include source-map on prod
zardoy Sep 4, 2023
e18722c
A lot of cool features! (#14)
zardoy Sep 4, 2023
5e6cd63
restore filesize
zardoy Sep 14, 2023
8adee6a
improve eruda check & sw index.html
zardoy Sep 4, 2023
e6354f6
[skip ci] upstream changes
zardoy Sep 4, 2023
8a093b2
initial resource pack support (blocks only)! support custom size
zardoy Sep 15, 2023
9947c13
support panorama from resourcepack
zardoy Sep 15, 2023
1f14154
add blocks generate script for resourcepack
zardoy Sep 15, 2023
6074e18
specify default interaction box
zardoy Sep 15, 2023
f475364
should fix build
zardoy Sep 15, 2023
7edddf8
add experimental release posting
zardoy Sep 15, 2023
38e0c08
use 1.14.4 (post-flatenning) as default for stable state rendering
zardoy Sep 15, 2023
4b01819
feat: always include source-map on prod (#16)
zardoy Sep 4, 2023
348aa26
Hot features & fixes (#17)
zardoy Sep 15, 2023
111c97c
ci: pass GITHUB_TOKEN
zardoy Sep 15, 2023
06ea7dd
ci: pass default GITHUB_TOKEN
zardoy Sep 15, 2023
c6b78c3
add contributing, speed start, cleanup esbuild
zardoy Sep 17, 2023
214ec56
fix cypress schema
zardoy Sep 17, 2023
b7c6a8f
all most missing integration cypress tests
zardoy Sep 17, 2023
f33db2c
remove using non custom communication variant
zardoy Sep 17, 2023
3a71f43
initial p2p multiplayer support powered by peerJS
zardoy Sep 15, 2023
e95b776
improve new tests
zardoy Sep 17, 2023
2c64bca
Merge remote-tracking branch 'origin/main' into next
zardoy Sep 16, 2023
9b0828b
ci: remove prepublish scripts
zardoy Sep 15, 2023
4f33758
temp fix for connect
zardoy Sep 17, 2023
155d994
Merge remote-tracking branch 'origin/main' into next
zardoy Sep 16, 2023
2a85497
ci: draft a release
zardoy Sep 16, 2023
d8feab7
restore old working preview pipeline
zardoy Sep 17, 2023
d5f4853
allow to specify guest name
zardoy Sep 16, 2023
a6da82e
ci: oops, use specified version actually
zardoy Sep 16, 2023
9cd3b95
restore default versin select for default host
zardoy Sep 17, 2023
3b97408
implement qr display
zardoy Sep 16, 2023
e1020d5
deploy also to vercel prod
zardoy Sep 16, 2023
df41129
should fix ci
zardoy Sep 17, 2023
95a5598
fix bot version select
zardoy Sep 16, 2023
f2fff9f
ci: trigger fresh build to pull new secrets
zardoy Sep 16, 2023
60ea5b9
fix silly parens mistake
zardoy Sep 17, 2023
ecab69f
ci: specify build commands?
zardoy Sep 16, 2023
b720d45
ci: update vercel pipelines
zardoy Sep 16, 2023
d9988c3
dont create world folder
zardoy Sep 17, 2023
badf004
feat: peerjs (p2p) wan multiplayer! (#18)
zardoy Sep 16, 2023
3176893
skip join to server test for now
zardoy Sep 17, 2023
962b689
fix: ask for guest username
zardoy Sep 16, 2023
57cb655
new cypress tests & impoertant fixes (#19)
zardoy Sep 17, 2023
44515c9
feat: texturepack install via qs
zardoy Sep 17, 2023
1afdf5b
a few fixes (#20)
zardoy Sep 19, 2023
47ccc70
Merge remote-tracking branch 'upstream/master' into main-2
zardoy Sep 19, 2023
1d94117
manual build fixes
zardoy Sep 19, 2023
17a6048
add assets dep
zardoy Sep 19, 2023
202bd02
dont fail vercel on gh pages preview
zardoy Sep 19, 2023
81e6e56
ci should be fixed now
zardoy Sep 19, 2023
af6d749
refactor last status display
zardoy Sep 19, 2023
a7fb8c6
refactor resourcepack state
zardoy Sep 19, 2023
9a83884
always define viewer
zardoy Sep 19, 2023
65840cf
move resourcepack to state
zardoy Sep 19, 2023
ec2e917
fix: regression: sloppy camera movement
zardoy Sep 19, 2023
f1917a5
fix: regression chat input is now visible
zardoy Sep 20, 2023
6dd9a95
fix: always apply render distance (regression)
zardoy Sep 20, 2023
4cff9f5
refactor: migrate to new options backend
zardoy Sep 22, 2023
52d2ea7
add a way to go back in ui with gamepad & notification impr
zardoy Sep 22, 2023
d210aca
fix annoying audiocontext start on page load, remove unused playSound…
zardoy Sep 22, 2023
2905567
fix chat translate
zardoy Sep 22, 2023
43342a7
fix join link buttons positioning
zardoy Sep 22, 2023
fb27c56
[doubt] use macrotasks for processing local server data
zardoy Sep 23, 2023
369a4ae
fix: buttons in menu now clickable on mobile (regression)
zardoy Sep 23, 2023
145ae51
feat: Chat commands completions! tab complete + auto complete for sin…
zardoy Sep 23, 2023
39c7fb3
simplify height set
zardoy Sep 19, 2023
f8ed865
confirm before reinstalling resourcepack
zardoy Sep 23, 2023
eed9736
make completions partially work somehow on latest versions
zardoy Sep 23, 2023
cc48883
adopt mc protocol: add custom client here
zardoy Sep 23, 2023
38d1a58
add lodash dep
zardoy Sep 23, 2023
09a9550
feat: display custom client-side commands in completions
zardoy Sep 23, 2023
62f3f72
rm unused mobile controls
zardoy Sep 24, 2023
dad3b6d
up esbuild
zardoy Sep 24, 2023
2896971
server: allow to specify port on start
zardoy Sep 24, 2023
611f07b
sync build.js from main-ligth
zardoy Sep 24, 2023
37d1ca0
prerender -> generateTextures
zardoy Sep 24, 2023
c5cffc1
drop dist/textures folder 76mb -> 3mb
zardoy Sep 24, 2023
0f11227
feat: correctly show all interaction & break shapes on some blocks li…
zardoy Sep 25, 2023
47b895d
fix: fix hotbar interactions on mobile
zardoy Sep 25, 2023
e4265e2
always show errors on tcp disconnect!
zardoy Sep 25, 2023
34dcd5c
up prototol
zardoy Sep 25, 2023
ae18411
button click: restore using web audio to ensure it doesn't affect mus…
zardoy Sep 25, 2023
e7c2b98
fix server default port
zardoy Sep 25, 2023
fd8445d
fix: regression: placing blocks on mobile now always works
zardoy Sep 25, 2023
c728d79
autocmplete fixes: dont auto-trigger in non-commands, fix manual tab …
zardoy Sep 25, 2023
2f35f00
cleanup cypress tests! they now run as fast as possible
zardoy Sep 25, 2023
25d858e
add typecheck to ci, always prepare data
zardoy Sep 25, 2023
9dc6a43
preview workflow should be fixed
zardoy Sep 25, 2023
ffa2c08
fix eruda clicks
zardoy Sep 25, 2023
b360187
feat: add a way to change size of touch buttons
zardoy Sep 25, 2023
f5c07e0
remove webpack & unused deps
zardoy Sep 25, 2023
b38ec08
cleanup unused code
zardoy Sep 26, 2023
38e2621
add massive eslint config and big number of fixes for it! thx to ext
zardoy Sep 26, 2023
f8ae3e1
enforce style that was used in repo! indent back to 2
zardoy Sep 26, 2023
a99a8ff
resolve pr todo comments
zardoy Sep 26, 2023
18e5022
fix(important): fix connect to servers by domain
zardoy Sep 26, 2023
fa564bf
include deployment url to release
zardoy Sep 26, 2023
7a77b2d
dont crash on mousedown
zardoy Sep 26, 2023
9dde8f0
small comments cleanup
zardoy Sep 26, 2023
9d9e774
also lint js, improve style rules
zardoy Sep 27, 2023
7f67f8b
fix: dont activate fly mode when double pressed space not that fast
zardoy Sep 27, 2023
3be311d
fix: always allow to activate block eg lever
zardoy Sep 27, 2023
4910354
fix: blocks should be placed until left click is released (regression)
zardoy Sep 27, 2023
6f56bab
refactor stats to display gpu / cpu stats
zardoy Sep 27, 2023
f081d16
fix eslint in more js files
zardoy Sep 27, 2023
bcb10e3
use excludeCommunicationDebugEvents for local server
zardoy Sep 27, 2023
443d89b
fix: include local commands only in singleplayer
zardoy Sep 27, 2023
5bdf626
fix most annoying ts-js issue here I guess
zardoy Sep 27, 2023
f60e363
manual build fixes
zardoy Sep 27, 2023
295253c
remove my links
zardoy Sep 27, 2023
0633d8d
run preview on every pr commit
zardoy Sep 27, 2023
9bb29a3
preview: simplify checkout
zardoy Sep 27, 2023
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
89 changes: 89 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"extends": "zardoy",
"ignorePatterns": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this file ? We use standard

"!*.js"
],
"rules": {
"object-curly-spacing": [
"error",
"always"
],
"semi": [
"error",
"never"
],
"comma-dangle": [
"error",
// todo maybe "always-multiline"?
"only-multiline"
],
"indent": [
"error",
2,
{
"SwitchCase": 1,
"ignoredNodes": [
"TemplateLiteral"
]
}
],
"quotes": [
"error",
"single",
{
"allowTemplateLiterals": true
}
],
// perf
"import/no-deprecated": "off",
// ---
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/naming-convention": "off",
"prefer-template": "off",
// intentional: improve readability in some cases
"no-else-return": "off",
"@typescript-eslint/padding-line-between-statements": "off",
"arrow-body-style": "off",
"unicorn/prefer-ternary": "off",
"unicorn/switch-case-braces": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"unicorn/explicit-length-check": "off",
"unicorn/prefer-dom-node-append": "off",
"typescript-eslint/no-confusing-void-expression": "off",
"unicorn/no-lonely-if": "off",
"no-multi-assign": "off",
"sonarjs/no-duplicate-string": "off",
"new-cap": "off",
"unicorn/consistent-destructuring": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-add-event-listener": "off",
"unicorn/prefer-top-level-await": "off",
"default-case": "off",
// I guess it would better to fix
"node/prefer-global/buffer": "off",
"unicorn/prefer-optional-catch-binding": "off", // still useful for debugging
"no-alert": "off", // todo once replaced with ui, enable
"@typescript-eslint/restrict-plus-operands": "off",
// ---
"@typescript-eslint/no-throw-literal": "off", // disabling because of "rule expansion"
"no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"import/no-extraneous-dependencies": "off",
"@typescript-eslint/ban-types": "off",
"unicorn/prefer-query-selector": "off",
"@typescript-eslint/dot-notation": "off", // trick prop type-checking
"@typescript-eslint/consistent-type-imports": "off",
"no-negated-condition": "off",
"@typescript-eslint/no-require-imports": "off",
"unicorn/prefer-number-properties": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"unicorn/no-empty-file": "off",
"unicorn/prefer-event-target": "off",
// needs to be fixed actually
"@typescript-eslint/no-floating-promises": "warn",
"no-async-promise-executor": "off",
"no-bitwise": "off",
"unicorn/filename-case": "off",
"max-depth": "off"
}
}
70 changes: 17 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,25 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

build-and-deploy:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

permissions: write-all
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build
- run: npm test
DeployPages:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- name: Checkout 🛎️
uses: actions/[email protected] # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
- name: Checkout repository
uses: actions/checkout@master
- name: Install pnpm
run: npm i -g pnpm
- run: pnpm install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pnpm ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because of pnpm lock i guess

Copy link
Contributor Author

@zardoy zardoy Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, it should not matter what pm you use, but I had to put lockfile into the repo so I can lock deps for fully reproducible builds (without sacrificing branch information stored in package.json). So, yes, you are forced to use pnpm for reproducible builds, but if you don't care you actually use any other pm.
i personally use pnpm because obviously, it is fast for external deps (gh, npm) (when I started working on all this my initial goal was to make ci as fast as possible). I hope it answers your question, but since it's not my project I don't mind any changes in workflow files (you decide)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Npm also supports package lock. Doesn't it ?

- run: pnpm lint
- run: pnpm check-build
- run: nohup pnpm prod-start &
- run: nohup node cypress/minecraft-server.mjs &
- uses: cypress-io/github-action@v5
with:
persist-credentials: false
fetch-depth: 0
- name: Edit config
run: |
sed -i -E 's/^ "defaultProxy": ""/ "defaultProxy": "pproxy.rom1504.fr"/g' config.json
zardoy marked this conversation as resolved.
Show resolved Hide resolved
sed -i -E 's/^ "defaultProxyPort": 0/ "defaultProxyPort": 443/g' config.json
- name: Build
run: |
npm install
npm run build
cp -R public/ ../
rm -Rf ./*
git checkout gh-pages
rm -Rf ./*
rm -Rf .github .gitignore .gitpod .gitpod.DockerFile .npmignore .npmrc
cp -R ../public/* ./
- name: Create commits
run: |
git config user.name 'rom1504bot'
git config user.email '[email protected]'
git add --all
git commit --amend -m "Update gh-pages"
- name: Deploy 🚀
uses: ad-m/github-push-action@master
install: false
- uses: actions/upload-artifact@v3
if: failure()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
name: cypress-images
path: cypress/integration/__image_snapshots__/
29 changes: 29 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Vercel Deploy Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Global Dependencies
run: npm install --global vercel pnpm
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
uses: mathiasvr/[email protected]
with:
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
id: deploy
- uses: mshick/add-pr-comment@v2
with:
message: |
Deployed to Vercel Preview: ${{ steps.deploy.outputs.stdout }}
59 changes: 31 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
name: npm-publish
name: Deploy to GitHub pages
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- master # Change this to your default branch
branches: [main]
jobs:
npm-publish:
name: npm-publish
build-and-deploy:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 18.0.0
- run: npm install
- id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Create Release
if: steps.publish.outputs.type != 'none'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.publish.outputs.version }}
release_name: Release ${{ steps.publish.outputs.version }}
body: ${{ steps.publish.outputs.version }}
draft: false
prerelease: false
- name: Checkout repository
uses: actions/checkout@master
- name: Install pnpm
run: npm i -g vercel pnpm
# - run: pnpm install
# - run: pnpm build
- run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
# will install + build to .vercel/output/static
- run: vercel build --token=${{ secrets.VERCEL_TOKEN }} --prod
- name: Deploy Project to Vercel
uses: mathiasvr/[email protected]
with:
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --prod
id: deploy
- run: |
pnpx zardoy-release node --footer "This release URL: ${{ steps.deploy.outputs.stdout }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: cp vercel.json .vercel/output/static/vercel.json
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .vercel/output/static
force_orphan: true
14 changes: 12 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
node_modules/
package-lock.json
.vscode
public
**/public
*.log
.env.local
Thumbs.db
build
localSettings.mjs
dist
.DS_Store
.idea/
*.iml
world
out
*.iml
.vercel
generated
2 changes: 0 additions & 2 deletions .gitpod

This file was deleted.

4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package-lock=false
public-hoist-pattern=*
ignore-workspace-root-check=true
shell-emulator=true
61 changes: 61 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"configurations": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? how do you debug this project otherwise?

// UPDATED: all configs below are misconfigured and will crash vscode, open dist/index.html and use live preview debug instead
// recommended as much faster
{
// to launch "C:\Program Files\Google\Chrome Beta\Application\chrome.exe" --remote-debugging-port=9222
"type": "chrome",
"address": "localhost",
"name": "Attach Chrome",
"request": "attach",
// comment if using webpack
"pathMapping": {
"/": "${workspaceFolder}/dist"
},
"outFiles": [
"${workspaceFolder}/dist/**/*.js",
// "!${workspaceFolder}/dist/**/*vendors*",
"!${workspaceFolder}/dist/**/*minecraftData*",
"!**/node_modules/**"
],
"skipFiles": [
// "<node_internals>/**/*vendors*"
"<node_internals>/**/*minecraftData*"
],
"port": 9222,
},
{
// not recommended as in most cases it will slower as it launches from extension host so it slows down extension host, not sure why
"type": "chrome",
"name": "Launch Chrome",
"request": "launch",
"url": "http://localhost:8080/",
"pathMapping": {
"/": "${workspaceFolder}/dist"
},
"outFiles": [
"${workspaceFolder}/dist/**/*.js",
// "!${workspaceFolder}/dist/**/*vendors*",
"!${workspaceFolder}/dist/**/*minecraftData*",
"!**/node_modules/**"
],
"skipFiles": [
// "<node_internals>/**/*vendors*"
"<node_internals>/**/*minecraftData*"
],
},
{
// to launch "C:\Program Files\Mozilla Firefox\firefox.exe" -start-debugger-server
"type": "firefox",
"name": "Attach Firefox",
"request": "attach",
// comment if using webpack
"url": "http://localhost:8080/",
"webRoot": "${workspaceFolder}/",
"skipFiles": [
// "<node_internals>/**/*vendors*"
"<node_internals>/**/*minecraftData*"
],
},
]
}
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing Guide

After forking the repository, run the following commands to get started:

0. Ensure you have [Node.js](https://nodejs.org) and `pnpm` installed. To install pnpm run `npm i -g pnpm`.
1. Install dependencies: `pnpm i`
2. Start the project in development mode: `pnpm start`

A few notes:

- It's recommended to use debugger for debugging. VSCode has a great debugger built-in. If debugger is slow, you can use `--no-sources` flag that would allow browser to speedup .map file parsing.
- Some data are cached between restarts. If you see something doesn't work after upgrading dependencies, try to clear the by simply removing the `dist` folder.
- The same folder `dist` is used for both development and production builds, so be careful when deploying the project.
- Use `start-prod` script to start the project in production mode after running `build` script to build the project.
Binary file added assets/button_click.mp3
Binary file not shown.
Binary file removed assets/click_stereo.ogg
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
18 changes: 11 additions & 7 deletions assets/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "Prismarine Web Client",
"short_name": "Prismarine Web Client",
"scope": "/",
"start_url": "/",
"icons": [{
"src": "favicon.png",
"sizes": "512x512"
}],
"scope": "./",
"start_url": "./",
"icons": [
{
"src": "favicon.png",
"sizes": "512x512"
}
],
"background_color": "#349474",
"theme_color": "#349474",
"lang": "en-US",
"orientation": "landscape",
"display": "standalone"
}
}
Loading
Loading