New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@workadventure/upload-maps

Package Overview
Dependencies
Maintainers
0
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workadventure/upload-maps

It is a package for uploading map in self hosted version.

1.7.0
latest
Source
npm
Version published
Weekly downloads
71
-61.62%
Maintainers
0
Weekly downloads
 
Created
Source

🚀 Map Upload package for WorkAdventure

Join Community Badge visitors

This package is designed to help you upload maps to the map storage of WorkAdventure.

🔧 Installation

To install this package, use the following command:

npm install @workadventure/upload-maps

📄 Usage

This guide will walk you through the process of uploading your custom map to the map storage. You can also refer to the WorkAdventure documentation for more details.

To use this package, import it into your project and run the command in your terminal:

npm run upload

It will ask you a few questions:

  • Map Storage URL (stored in MAP_STORAGE_URL in the .env file)

    For SaaS users, you can find it in the admin panel under Developers -> API keys / Zapier.

  • API Key (stored in MAP_STORAGE_API_KEY in the .env.secret file)

    For SaaS users, you can generate this in the admin panel, under Developers -> API keys / Zapier.

  • Upload Directory (stored in UPLOAD_DIRECTORY in the .env file)

    If you have GitHub and forked the repository, the directory will default to your GitHub username and repository name. Otherwise, specify a custom name.

Alternatively, you can use flags to upload your map, though the secret variables won't be saved in the .env or .env.secret files. Available flags include:

  • -u: Map storage URL
  • -k: API Key
  • -d: Upload directory

Example:

npm run upload -- -u your-map-storage-url -k your-api-key -d your-directory

After answering these questions, the script will start to upload your maps. You need to see something like this at the end: Upload done successfully!.

🛠️ How it works

When you run npm run upload, the following steps are executed:

  • Build Phase:

    • Tilesets are optimized and chunked, removing any unused tiles.
    • Scripts in the map are compiled (from TypeScript to JavaScript) and bundled into a single file.
    • The result is written in the dist directory.
    • The public directory content is copied to the dist directory.
  • Upload Phase:

    • A ZIP file of the dist directory is created and sent to the WorkAdventure map-storage server.
    • The server unzips and stores the files in your configured directory, creating .wam files for each .tmj file if needed.

[!TIP] You can skip the build phase and only upload the current state of your project with the command: npm run upload-only

[!WARNING] The WorkAdventure server only stores the built map you upload. It does not store your original files. To update your map, make sure to keep the original files locally. If you need to make changes, update your files and run the upload command again.

❓ Need Help

If you have any questions or need further assistance, don't hesitate to ask either by email or Discord!

FAQs

Package last updated on 09 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts