Skip to content

Getting Started

Ucrash edited this page Apr 28, 2021 · 2 revisions

Requirements

To work with GDExt code you need:

Setup The Workspace

After you've cloned the repository, navigate into it's directory (in this wiki, we'll refer to it as ./editor). After that open command prompt window and type npm install This will install all of the required modules for GDExt.

How it's built

GDExt is built using Webpack and Electron.

Please note, that this repo does not contain any Electron-related code and runs in the browser, visit gdext/electron for the Electron app.

Here's how the file structure should look approximately:

File Structure of gdext/editor

I'll go over a few important files/directories:

  • /src - the source code directory, it contains all the scripts, styles and other assets for gdext.
  • /dist - the destination folder (generated on build), it contains the code generated by webpack to test in the browser. Do not edit the code in it directly!
  • /package.json and /package-lock.json - configuration files for Node.js
  • /webpack.config.js - configuration file for Webpack, contains the info about where to generate the destination code and what modules to use for file loading.
  • /chtml.js - a script that automatically creates the HTML file in the destination directory.
  • LICENSE and README.md - github stuff

Testing in Browser

To test the app in browser, open command prompt in the ./editor directory and run the following command:

npm run build

This will generate the destination folder and all of it's contents. After that, run:

npx http-server -p 8000 -c -1

This will setup a local http server. Finally open the browser of your choice and go to localhost:8000/dist. You should see something like this:

GDExt web version

Testing as Electron app

Before testing, please clone the gdext/electron repository to some directory (in this wiki, we'll refer to it as ./electron). Also, open command prompt both in ./editor and ./electron and type npm install to install all the modules.

After that, open command prompt in ./editor and type:

npm run build

Then, go into ./editor/dist and copy all the files in that directory over to ./electron/web (replacing the old files).

Finally, open command prompt in ./electron and type in the following:

npx electron .

A window should pop up with GDExt interface. To close it, either click the "X" button in the window itself, or press Ctrl+C in the command prompt and then type Y.

Didn't work?

If you've ran into a problem, try reading this page again and see if you've missed some steps.

See Also:

TODO: add more pages lol

Clone this wiki locally