1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-11 09:11:50 +00:00
Commit Graph

56 Commits

Author SHA1 Message Date
Даниїл Григор'єв
9906397170
Build tools cleanup pass (#81)
* Fix tsconfig scopes affecting html.js

Since it's quite hard to use a DOM library type there, remove the type
entirely.

* Remove environment variables check

Nothing is using them anymore. It can be added back if needed later.

* Refactor Texture Packer downloading

Refactor local-config.js tasks file into a generic "environment"
category consisting of checking if Java is installed, downloading the
runnable Texture Packer if it's not yet downloaded and copying the local
configuration template; update README accordingly.

* Prepare environment only at postinstall

Remove environment.prepare task from default build pipelines, add a
postinstall script that calls the task, using environment.js as the
gulpfile to speed it up.

* Remove "docs" tasks and types generation script

Remove tasks from docs.js as they are unlikely to do anything meaningful
nowadays. Also remove the buildTypes script as it doesn't work anymore.
A better solution will be provided in the future.

* Simplify some globs

Use additional gulp.src options instead of specifying more or complex
globs.

* Extract built-temp location to a variable

Add the src/js/built-temp directory as a new variable in config.js,
replace all existing references to built-temp with this variable.
2025-06-19 04:51:34 +03:00
Даниїл Григор'єв
36a3ae2da9
Do not compress translation files
Remove the compressjson loader and related defines in webpack config.
Also remove the remaining lz-string usages in the project and a local
copy.
2025-06-14 06:02:58 +03:00
Даниїл Григор'єв
82dae1158e
Re-implement compression workers and abstraction
Implement DefaultCompression class along with a generic interface to
facilitate easy to use compression in a background thread, and make use
of this class in Storage implementation by default.
2025-06-10 16:46:28 +03:00
Даниїл Григор'єв
6e81afd372
Remove some compression leftovers
Remove the CRC dependency and "binary file salt" in globalConfig.
2025-04-18 11:09:45 +03:00
Даниїл Григор'єв
321f517593
Remove game version check
Doesn't make much sense with how experimental CE is right now. A
different logic for checking whether a mod is compatible will be used
later.
2025-04-11 00:04:14 +03:00
Даниїл Григор'єв
75e306ec59
Migrate from Yarn Classic to npm (#65)
* Switch to npm in electron/

May change resolved package versions.

* Remove redundant electron-notarize dependency

The number of dependencies stays the same. Only direct mention in
package.json is removed.

* Assume Node.js 22.x and clean up dependencies

Targeting Node.js 22.x allows using the new fs.glob* functions, which
can replace the glob module. It is still downloaded as there are other
packages using it, but is no longer included in devDependencies.

Also remove @types/filesystem, as this API is not used anywhere in the
code, it is non-standard and some of it was removed from Chromium. Was
likely used with Cordova for YORG.io 3 mobile support.

* Update linting stack

Install the latest versions of the following packages:

- @eslint/js (^9.24.0)
- eslint (^9.24.0)
- typescript-eslint (^8.29.1)

and remove packages that are no longer used:

- @types/eslint__js
- yarn

Config files were not modified.

* Switch root package to npm

npm is able to resolve packages using yarn.lock as a resolution hint.
Note that files other than those included in this commit are
intentionally kept outdated, as they may need a bigger change.
2025-04-10 23:22:03 +03:00
Даниїл Григор'єв
5bbbcceb18
Remove unused build pipeline code 2025-04-08 14:18:20 +03:00
Даниїл Григор'єв
6695aa0fa0
Remove most of "preloader" code (#60)
Make the build process less complicated and reduce scatter
of renderer source code.
2025-04-06 23:13:13 +03:00
Даниїл Григор'єв
8e87398c3c
Update TypeScript packages
Yarn seems to complain due to my hand-edited package.json, but
TypeScript packages are out of sync if I let it update the electron one.
To avoid these issues, update both packages.
2025-03-29 20:11:07 +02:00
Даниїл Григор'єв
c836589d9b
Rewrite the Electron wrapper (#47)
* Migrate Electron wrapper to ESM

Use ESM syntax for main process, move some fs usages to fs.promises,
switch to import.meta.url/import.meta.dirname to handle file paths;
clean up redundant code.

* Add TypeScript support to Electron wrapper

The support is very basic, tsc is used to transpile code. Build scripts
are modified to not copy any Electron code other than preload.cjs and
use an extremely cursed setup to call the TypeScript compiler.

* [TS] Rename platform/storage

* Rewrite Electron wrapper

MVP, missing some features from the old wrapper and most planned
features. Some of the functionality hasn't been verified.
2025-03-21 16:30:13 +02:00
Даниїл Григор'єв
67f7babd09
Drop support for SHA1 checksums
Also remove an unused function and switch to crypto.randomUUID() for
savegame ID generation.
2024-07-26 18:01:38 +03:00
Даниїл Григор'єв
f5d8b73d8a
Remove FTP tasks 2024-06-20 19:48:57 +03:00
Даниїл Григор'єв
25614e2d7e
Merge branch 'master' into dengr1065/formatting-update 2024-06-20 15:16:46 +03:00
Даниїл Григор'єв
96aef3d9e7
Merge pull request #31 from tobspr-games/dengr1065/eslint-config2
Fix and modify ESLint configuration
2024-06-20 15:14:40 +03:00
Даниїл Григор'єв
0c8b87983b
Update prettier-all script
Also exclude files with extensions that are usually large. Reduces the
format time by approximately 4 seconds.
2024-06-20 13:29:06 +03:00
Даниїл Григор'єв
e0fd899cb8
Update Prettier to 3.3.2 2024-06-20 12:43:03 +03:00
cody-ferguson
894ceab854 Remove folders and steam stuff 2024-06-19 17:12:08 -05:00
Даниїл Григор'єв
6f1706aa23
Modify ESLint configuration
Fix minimatch patterns, disable no-unused-vars entirely, stop calling
tsc in the lint script.
2024-06-19 12:25:13 +03:00
Даниїл Григор'єв
d8f378d7e1
Redo ESLint and TypeScript compiler config
Many configuration files in this repository were created a long time
ago, then were modified as problems occurred. Now that there is
TypeScript support, it makes sense to clean up this mess, at least by
making small steps. This configuration is based on strict settings, but
most of these are currently disabled - otherwise it would be too hard to
work with existing JavaScript code. The downside of this change is
pollution of files with warnings and errors, even though they are valid.

- ESLint/TypeScript upgraded
- TS configuration is now shared between arbitrary Node scripts, Gulp
  files and the Electron wrapper
- A few eslint-disable comments are removed
2024-04-27 00:23:34 +03:00
Даниїл Григор'єв
e10edca73e
Add more packaging tasks and fix localConfig not being created (#22)
* Update Electron dependencies

This will break some mods and a few things were deprecated, but the
Electron wrapper will be replaced anyway.

* Add macOS and arm64 packaging tasks

As @chunkybanana has tested the general approach to building shapez on
macOS, I can now add these tasks. Aside from that, now there are tasks
to build for the 64-bit ARM variant of each system and a task that
builds packages for all platforms and architectures at once. A bug where
localConfig wasn't created when building for the first time was also
fixed.
2024-04-16 21:50:36 +03:00
Danyil Hryhoriev
62b170a92d Fix missing Gulp CWD in packaging scripts
The gulpfile is in a subdirectory and the scripts need to take that into
account. While there's already one such script, I forgot to add the
arguments in the new ones.
2024-04-14 20:26:03 +03:00
Даниїл Григор'єв
c2855d528d
Slight improvements for the build process (#19)
* Unify the version source

Changes the development config to use version from package.json and
makes the production config use the same utility function. Also removes
the version file as it's no longer needed.

* Remove some Steam references from build process

Removes files needed to publish the game on Steam and related tasks that
can be only used by the developer anyway. Only the build process is
affected, the actual game part still supports Steam integration.

* Refactor/add packaging tasks

Adds new Gulp tasks to create a distributable package of the game. A
task for macOS is not provided because signing needs to be figured out
first. Package creation tasks are also aliased in package.json for
future usage in external tools or CI. Aside from that, alternative
methods of downloading the libGDX Texture Packer are dropped.
2024-04-14 19:03:27 +03:00
Frode Austvik
76a00db34d Fix build by re-adding a missing dev dependency
This fixes cssnano being unable to load the preset "advanced", after
the dependency for that was removed in commit 24ceb6664d.
2023-11-07 18:19:43 +02:00
Bagel03
47ee05b715
Update ts to 5.0 (#11) 2023-03-05 14:32:19 -05:00
Bagel03
1eb264716a Add ts support 2023-03-04 21:32:47 -06:00
EmeraldBlock
24ceb6664d ES modules and config refactor
- switches to ES modules in gulp and src
- uses dengr's webpack configs and package.json, with modifications
- removes gulp/package.json
- removes babel stuff
- removes gulp-load-plugins, instead importing gulp plugins manually
- removes unused and trivial packages
- upgrades packages
- uses path/posix, for gulp
- removes __dirname in favor of relative urls
2023-03-04 00:46:55 -06:00
Thomas (DJ1TJOO)
0713c850ec
Fixed dev and devStandalone script (#1503)
* Fixed dev and devStandalone script

* Added eslint no-unreachable code rule

* Fix small type issue
2022-12-29 09:57:34 +01:00
tobspr
885d1e609e Update repository links, add patreon link 2022-10-22 16:14:54 +02:00
tobspr
a5022443f3 Remove events connector 2022-06-28 10:41:46 +02:00
tobspr
9b8789527e Update savegame imports, minor adjustments 2022-06-17 12:02:48 +02:00
tobspr
3b4ae39caa Try out transpiled-only builds 2022-06-16 10:35:58 +02:00
tobspr
44d0a8bcf7 Use better random number generation package 2022-06-12 17:33:54 +02:00
tobspr
c41aaa1fc5
Mod Support - 1.5.0 Update (#1361)
* initial modloader draft

* modloader features

* Refactor mods to use signals

* Add support for modifying and registering new transltions

* Minor adjustments

* Support for string building ids for mods

* Initial support for adding new buildings

* Refactor how mods are loaded to resolve circular dependencies and prepare for future mod loading

* Lazy Load mods to make sure all dependencies are loaded

* Expose all exported members automatically to mods

* Fix duplicate exports

* Allow loading mods from standalone

* update changelog

* Fix mods folder incorrect path

* Fix modloading in standalone

* Fix sprites not getting replaced, update demo mod

* Load dev mod via raw loader

* Improve mod developing so mods are directly ready to be deployed, load mods from local file server

* Proper mods ui

* Allow mods to register game systems and draw stuff

* Change mods path

* Fix sprites not loading

* Minor adjustments, closes #1333

* Add support for loading atlases via mods

* Add support for loading mods from external sources in DEV

* Add confirmation when loading mods

* Fix circular dependency

* Minor Keybindings refactor, add support for keybindings to mods, add support for dialogs to mods

* Add some mod signals

* refactor game loading states

* Make shapez exports global

* Start to make mods safer

* Refactor file system electron event handling

* Properly isolate electron renderer process

* Update to latest electron

* Show errors when loading mods

* Update confirm dialgo

* Minor restructure, start to add mod examples

* Allow adding custom themesw

* Add more examples and allow defining custom item processor operations

* Add interface to register new buildings

* Fixed typescript type errors (#1335)

* Refactor building registry, make it easier for mods to add new buildings

* Allow overriding existing methods

* Add more examples and more features

* More mod examples

* Make mod loading simpler

* Add example how to add custom drawings

* Remove unused code

* Minor modloader adjustments

* Support for rotation variants in mods (was broken previously)

* Allow mods to replace builtin sub shapes

* Add helper methods to extend classes

* Fix menu bar on mac os

* Remember window state

* Add support for paste signals

* Add example how to add custom components and systems

* Support for mod settings

* Add example for adding a new item type

* Update class extensions

* Minor adjustments

* Fix typo

* Add notification blocks mod example

* Add small tutorial

* Update readme

* Add better instructions

* Update JSDoc for Replacing Methods (#1336)

* upgraded types for overriding methods

* updated comments

Co-authored-by: Edward Badel <you@example.com>

* Direction lock now indicates when there is a building inbetween

* Fix mod examples

* Fix linter error

* Game state register (#1341)

* Added a gamestate register helper

Added a gamestate register helper

* Update mod_interface.js

* export build options

* Fix runBeforeMethod and runAfterMethod

* Minor game system code cleanup

* Belt path drawing optimization

* Fix belt path optimization

* Belt drawing improvements, again

* Do not render belts in statics disabled view

* Allow external URL to load more than one mod (#1337)

* Allow external URL to load more than one mod

Instead of loading the text returned from the remote server, load a JSON object with a `mods` field, containing strings of all the mods. This lets us work on more than one mod at a time or without separate repos. This will break tooling such as `create-shapezio-mod` though.

* Update modloader.js

* Prettier fixes

* Added link to create-shapezio-mod npm page (#1339)

Added link to create-shapezio-mod npm page: https://www.npmjs.com/package/create-shapezio-mod

* allow command line switch to load more than one mod (#1342)

* Fixed class handle type (#1345)

* Fixed class handle type

* Fixed import game state

* Minor adjustments

* Refactor item acceptor to allow only single direction slots

* Allow specifying minimumGameVersion

* Add sandbox example

* Replaced concatenated strings with template literals (#1347)

* Mod improvements

* Make wired pins component optional on the storage

* Fix mod examples

* Bind `this` for method overriding JSDoc (#1352)

* fix entity debugger reaching HTML elements (#1353)

* Store mods in savegame and show warning when it differs

* Closes #1357

* Fix All Shapez Exports Being Const (#1358)

* Allowed setting of variables inside webpack modules

* remove console log

* Fix stringification of things inside of eval

Co-authored-by: Edward Badel <you@example.com>

* Fix building placer intersection warning

* Add example for storing data in the savegame

* Fix double painter bug (#1349)

* Add example on how to extend builtin buildings

* update readme

* Disable steam achievements when playing with mods

* Update translations

Co-authored-by: Thomas (DJ1TJOO) <44841260+DJ1TJOO@users.noreply.github.com>
Co-authored-by: Bagel03 <70449196+Bagel03@users.noreply.github.com>
Co-authored-by: Edward Badel <you@example.com>
Co-authored-by: Emerald Block <69981203+EmeraldBlock@users.noreply.github.com>
Co-authored-by: saile515 <63782477+saile515@users.noreply.github.com>
Co-authored-by: Sense101 <67970865+Sense101@users.noreply.github.com>
2022-02-01 16:35:49 +01:00
Greg Considine
26b842494f
Achievements (#1087)
* [WIP] Add boilerplate for achievement implementation

* Add config.local.template.js and rm cached copy of config.local.js

* [WIP] Implement painting, cutting, rotating achievements (to log only)

* [WIP] Refactor achievements, jsdoc fixes, add npm script

- Refactor achievements to make use of Signals
- Move implemented achievement interfaces to appropriate
platform folders (SteamAchievements in currently in use
in browser wrapper for testing)
- Fix invalid jsdocs
- Add dev-standalone script to package.json scripts

* Add steam/greenworks IPC calls and optional private-artifact dependency

* Include private artifacts in standalone builds

* Uncomment appid include

* [WIP] Add steam overlay fix, add hash to artifact dependency

* Update electron, greenworks. Add task to add local config if not present

* Add more achievements, refactor achievement code

* Add receiver flexibility and more achievements
- Add check to see if necessary to create achievement and add receiver
- Add remove receiver functionality when achievement is unlocked

* Add achievements and accommodations for switching states
- Fix startup code to avoid clobbering achievements on state switch
- Add a few more achievements

* Add achievements, ids. Update names, keys for consistency

* Add play time achievements

* [WIP] Add more achievements

* Add more achievements. Add bulk achievement check signal

* [WIP] Add achievements. Start savefile migration

* Add achievements. Add savefile migration

* Remove superfluous achievement stat

* Update lock files, fix merge conflict
2021-03-10 07:33:39 +01:00
Polarbub
91cb53b6ce
Fix Dependency errors (#869)
* Add files via upload

* Fixed Dependence error

* Fixed Dependence errors

* Add files via upload

* Add files via upload
2020-10-31 12:07:25 +01:00
LeopoldTal
b9b8592a07
Build, sign, notarise, & upload on OS X (#687)
* sign & notarise darwin package

* upload bundle as github release

* allow unsigned build and full build with release

* deref darwin bundle symlinks only when building on win32

Windows [mangles symlinks](https://github.com/electron/electron-packager/issues/71). Currently we work around this by placing several copies of the frameworks in OS X app bundles (see 1e5aa3867d). However:

- This is invalid: the framework toplevel must [only contain symlinks](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html). `codesign` [refuses to sign](https://stackoverflow.com/questions/25969946/osx-10-9-5-code-signing-v2-signing-a-framework-with-bundle-format-is-ambiguou) this invalid structure.

- It seriously bloats the bundle.

Since there's no fix for the Windows misbehaviour, keep the workaround, but only when cross-building on win32 for darwin; and log a warning.
2020-09-27 23:14:43 +02:00
tobspr
6042fcba62 Properly implement sound and music volumes, debounce writes 2020-09-13 08:40:56 +02:00
tobspr
2203d5fc6a Improve saving speed by using crc32 instead of sha1 for checksum 2020-08-10 23:31:02 +02:00
Bjorn Stromberg
41c2cdeb81
There's no need to use npx in npm scripts (#555) 2020-08-10 07:33:25 +02:00
Bjorn Stromberg
997fabd52c
Remove more unused dependencies (#527)
* Remove more unused dependencies

* Remove gulp-jsbeautifier
2020-08-07 09:16:23 +02:00
Bjorn Stromberg
c47c7e0329
Let's explicitly list yarn as a devDependency (#487) 2020-07-27 11:16:16 +02:00
Bjorn Stromberg
3bae1c8ec3
Remove sloc, it appears to be unused. (#503) 2020-07-27 11:07:25 +02:00
Bjorn Stromberg
3af36c5948 - Update webpack from v4.31.0 to v4.43.0
- Update webpack-stream from v5.1.0 to v5.2.1
- Remove webpack-stream from shapez.io
2020-07-21 21:41:13 +09:00
Bjorn Stromberg
fa53a5d2e1 Update browser-sync from v2.24.6 to v2.26.10 2020-07-21 10:34:29 +09:00
Ivan Demchuk
2367d787a0 Fix yarn dev command 2020-06-13 18:12:37 +03:00
tobspr
6a588d23e5 Add tool to sync translations 2020-06-12 11:52:21 +02:00
tobspr
692eb36f50 Analyze sessions with logrocket 2020-06-03 14:32:02 +02:00
tobspr
604988c352 Change build scripts 2020-06-03 13:51:28 +02:00
tobspr
5cd4dba54a Cleanup first game experience 2020-06-01 19:58:36 +02:00
tobspr
56080ea25a Update changelog, again 2020-05-30 20:28:09 +02:00