* 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.
Move the additional wrapping for getMainContentHTML into getInnerHTML
and call it from GameState super method. Also apply the same wrapping to
getInitialContent (if not null) to ensure equal treatment of legacy HTML
strings and modern JSX/TSX methods.
All modern browsers should support \1 as the compression prefix, even
outside of Electron or recent Chromium versions. Local storage /
IndexedDB platform wrappers were removed a while ago.
Includes prefixed document.hidden property with respective
visibilitychanged event and redundant support for navigator.language /
lack of navigator.languages check.
Quite hacky considering the complex indirection and minor differences in
the appearance of each state, as well as legacy code and need to support
HTML strings for now. Some methods could be improved, refactored or
deleted, but no major changes were made.
Mods and puzzles menu states are broken in this commit.
A previous commit has mistakenly changed the behavior of a condition
checking for standalone version. Instead of always being true, shapez
exports were only exposed if the game was built in development mode.
Prettier only takes the root .gitignore into account, which leads to
formatting of auto-generated files. Moving ignore patterns into the root
.gitignore file makes Prettier follow them and cleans up the workspace.
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
* Remove ad support, analytics and Wegame leftovers
The game may be somewhat broken in a few places, but it doesn't matter
for now. This is still not the end.
* Remove Steam SSO and demo stuff
Steam SSO is completely removed, a few things from demo like simplified
level sets are gone as well. Puzzle DLC on the other hand is now always
"owned" and will ask for a token to log in.
Removes
* Use shapez dialogs for Puzzle DLC token input
Yes, this sucks *a lot*. But it's a temporary measure, trust me :P
* Simplify HTML tasks
Removes the web (demo) index.html page and makes HTML tasks independent
of the build variant. This might not be the best solution, but it works
for now.
Restriction manager is completely removed as it's only useful for demo
version. Lots of other demo-related things are left, such as ad support
or extended telemetry. This should be cleaned up later.
* Update Signal
* Update modal_dialogs
* Inputs
* Update factories
* Update tracked state
* Changed let to const where possible
* Add HUD typings
* improvements to typings
* fix exports not being exposed to mods
* fix signal typings
* remove TypedSignal
* fix all reported type errors
---------
Co-authored-by: Thomas B <t.ferb1@gmail.com>
Co-authored-by: EmeraldBlock <yygengjunior@gmail.com>
* Remove deprecated TSLint config
* Remove jsconfig.json
jsconfig.json is an alternative name for tsconfig.json that has allowJs
set to true. Since the directory already contains a tsconfig.json file,
this file does nothing.
* Remove Gitpod configuration
Gitpod is not as useful in CE because we're focusing on standalone.
Also, the configuration was added just to promote the service and there
are other similar services which may be preferred by the user.
* Remove Travis CI configuration
Travis CI is not used in shapez anymore in favor of GitHub Actions. In
addition to that, CI setup for the community edition will be done once
the codebase is in a better condition.
* Remove CONTRIBUTORS and CONTRIBUTING.md
The contributors file is out of date and unneeded as GitHub now shows
all collaborators anyway - however it could be still used in the future
to show a list of contributors in the game. CONTRIBUTING.md contains the
text of CLA, which is not enforced in this repository.
* Replace VSC workspaces with regular settings files
VSCode workspaces don't provide much benefit in a source tree like
shapez. This commit also adds EditorConfig and ESLint VSCode extensions
to the recommended extensions list.
* Remove CI workflow for building the game
It hasn't been updated in a while and we don't need it for now. Once the
codebase is in a more managable state, a new workflow will be added.
* Remove some unused resources
There are still many resources left, but they will be removed along with
the relevant code later.