Skip to content

OLD V4 NPM Ready

Damian A. Pastorini edited this page Dec 17, 2019 · 1 revision

UPDATE!

The version 4.0.0-beta.0 version was published on NPM so I will be updating this documentation over the next days.

https://www.npmjs.com/package/reldens

Alright!

Here are the steps to run the project with the new V4 NPM-ready branch:

https://github.com/damian-pastorini/reldens/tree/v4.0.0

The steps will be:

  1. Clone the project and checkout the v4.0.0.0-npm-setup-v1 branch.
  2. Get into the project folder and run $ npm link, this command will make the project available as if it was really installed using NPM.
  3. Get out of the cloned project folder and create a new folder anywhere outside (I've called it "my-first-npm-test"), so in my case my test structure ended up like:
/my-reldens-game
/my-reldens-game/reldens-cloned > this is the repository cloned folder
/my-reldens-game/my-first-npm-test
  1. Get into the my-first-npm-test folder, and run $ npm link reldens, which will make reldens available.
  2. Copy the sample index.js file from /node_modules/reldens/theme/project-index.js.sample into my-first-npm-test/index.js.
  3. Create a package.json file like:
{
  "name": "reldens-skeleton",
  "version": "0.1.0",
  "description": "Reldens - Skeleton",
  "main": "index.js",
  "scripts": {
    "start": "node ."
  },
  "engines": {
    "node": "13.1.0"
  },
  "license": "MIT",
  "dependencies": {
    "reldens": "^4.0.0"
  }
}

  1. You need to prepare the database, so you can get the full SQL file from:

node_modules/reldens/migrations/production/reldens-install-v4.0.0.sql

Or you can give it a try to Knex migrations IMPORTANT: I've been having some issues trying the following using knex so if you can just deploy the SQL install file that will be easier for you:

Copy the knexfile.js.sample from node_modules/reldens/knexfile.js.sample into your project root folder as /knexfile.js, and run $ npm install knex && npm install mysql and after install Knex then run $ knex migrate:up --env production

  1. Setup your .env file, you can copy the sample one from ./node_modules/reldens/.env.sample.

  2. Run $ npm install.

  3. Run $ npm start or $ node ., the project should start normally and you should be able to register / login in the game. AFTER you login for the first time you will note the missing example NPC and doors, that's because you need to specify the theme custom classes, for this matter there's a file copied automatically into your project, check: theme/packages/server.js if you have this file you can go and edit your index file and remove the comments from the lines where the customClasses are imported and pass as properties to the server manager.

FINALLY! That should be all! I'm just realizing what a mess I did because NPM, in any case most of these steps can be really simplified by using some scripts, but for now, this is what I've got.