ZEP Guidebook (EN)
  • Hello ZEP Script
  • ZEP Script
    • 💻ZEP Script Guide
      • ZEP Script Development Guide
        • JavaScript Development Tips
        • ZEP Script Deployment Guide
        • TypeScript Development Tips
      • Explore ZEP Script
        • Tutorials
          • Displaying a Message
          • Changing Avatar Image
          • Using HTML
          • Communicating with an External API
          • Creating a 2-Second Stun Effect
        • ZEP Script Example Code
          • Timer
          • Zombie Game
          • Paintman Game
          • Hangul Quiz Game
          • Avoid Poop Game
          • Boxing Game
          • Sidebar App
          • Race
      • ZEP Script FAQ
      • Appendix
        • ZEP Script Use Cases
        • Understanding Spaces and Maps
        • JavaScript Keycode List
        • Understanding Sprite Sheets
        • TileEffectType Detailed Explanation
        • What are Reference Coordinates?
        • Communicating with an External API
        • How to Use URL Query Strings
        • How to Change the Mobile Interaction Button
        • Grammar Available for Widgets
        • Object Interaction with ZEP Script
        • Object npcProperty
    • 📘ZEP Script API
      • API Summary
      • ScriptApp
        • Lifecycle
        • Field
        • Storage
        • Event Listeners
        • Callbacks
        • Methods
      • ScriptMap
        • Field
        • Methods
      • ScriptPlayer
        • Field
        • Methods
      • ScriptWidget
        • Field
        • Event Listeners
        • Methods
  • Others
    • Homepage
    • FAQ
    • Twitter
    • Discord
Powered by GitBook
On this page
  • ⭐ Things to Note When Developing in TypeScript
  • 1. Install node.js
  • 2. Create the Project Folder
  • 3. Browse the Folder Structure
  • 4. Create a JavaScript Build
  • 5. Create a Compressed File
  • 6. Deploy a Project

Was this helpful?

  1. ZEP Script
  2. ZEP Script Guide
  3. ZEP Script Development Guide

TypeScript Development Tips

PreviousZEP Script Deployment GuideNextExplore ZEP Script

Last updated 2 years ago

Was this helpful?

⭐ Things to Note When Developing in TypeScript

When developing with TypeScript, you must put the Script keyword in front of the App, Map, Player, or Widget keywords.

// When developing in JavaScript
App.sayToAll("Hello World!");

// When developing in TypeScript
ScriptApp.sayToAll("Hello World!");

1. Install node.js

Visit to download and install node.js.

We recommend installing the LTS version, which is the most stable version.

2. Create the Project Folder

A sample project for developing in ZEP Script can be downloaded through the CLI.

The CLI can be run from the terminal for MacOS, Windows PowerShell in windows, or the terminal environment provided since Windows 11.

Running PowerShell on Windows

Shift + right-click in the empty space of the folder in which main.js is located.

Choose Open PowerShell window here or Open command window here.

A Windows PowerShell or Command Prompt window will launch as follows:

Enter the command to create the project folder as follows:

npx zep-script init MyZepApp --npm

If the message Project {Folder Name} initialized successfully is displayed as seen above, the environment for developing ZEP Script with TypeScript is now ready.

3. Browse the Folder Structure

If you go to the created project folder, you can see the files as follows:

The res folder is an abbreviation of "resources" and is where you put images or html files needed for the app.

The main.ts file created here is where you write the app development code.

This main.ts file contains sample code as seen below. You can refer to this code for development.

With the exception of the main.ts file and res folder, the remaining files and folders are configuration files for developing ZEP Script with TypeScript, and you do not need to modify them separately during development.

4. Create a JavaScript Build

Since ZEP Script can only be executed through JavaScript, it must go through a build process that converts TypeScript to JavaScript.

Open a command window in the folder where the main.js file is located and enter the following command to create a new build.

npx zep-script build

If the build is created successfully, you can see that a folder named dist has been created.

The dist folder contains the main.js file that was created by converting the TypeScript code written in the main.ts into JavaScript.

5. Create a Compressed File

To distribute an app created with ZEP Script, you need to create a zip file that contains the main.js file and the images and html files to be used in the app.

Open a command window in the root of your project’s folder and enter the following command to create a compressed file.

npx zep-script archive

If the compression process was successful, you can check that a compressed file has been created in the folder as follows:

Finally, after creating the zip file, you’re ready to deploy the app.

6. Deploy a Project

  1. Deploy on a website

You can deploy your app by uploading the zip file created above.

2. Deploy using CLI

You can deploy the zip file created by using CLI.

Open the zep-script.json file in the project folder and run the app to upload.

(Make sure to create the zep-script.json file.)

{
    "appId": "Zjkgoj",  // app ID
    "name": "Template", // app name
    "description": "Template application" , // app description
    "type": "normal" // app type( "normal" or "minigame" or "sidebar" )
}

⭐ appID: Enter the ID of the app to upload.

  • To change an existing app, access https://zep.us/me/apps/, select an app to upload, and then enter the text appended to apps/ in the address bar. (E.g., "Zjkgoj" for the reference image below)

Once set, run PowerShell in the project folder path and enter a command for deployment as below.

npm run deploy or npx zep-script publish

When the email input section appears below, enter the email address of the account that owns the app to be deployed.

When you see the message saying, Sending login code to your email, go to the mailbox of the email you entered above. Check the verification code and enter it to the command window to start deploying.

The deploy process is complete when a green checkmark appears on the left of Publishing… as shown below.

Refer to the and distribute your app!

You can see your app has been deployed in the page as described above in the zep-script.json file.

For more information about the library, please refer to the contents of the GitHub repository below.

💻
ZEP Script Deployment Guide
My Apps
zep-script-sdk/packages/zep-script-cli at main · zep-us/zep-script-sdk
https://nodejs.org/en/