New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portalscript Category for require() #169

Closed
fiurthorn opened this Issue Jun 21, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@fiurthorn

fiurthorn commented Jun 21, 2018

require() a script with category "util/lib" and the Name BigNum as require("util/lib/BigNum").

@FabianTe

This comment has been minimized.

Collaborator

FabianTe commented Jun 22, 2018

Is it just me or does this need further information? What do you mean?

@fiurthorn

This comment has been minimized.

fiurthorn commented Jun 23, 2018

If you have a look to my transpiling support, you see I Set the PortalScriptCategory to the source directory.

This keep the original Import path and i über not to erweitern the Import require Name.

@tineheller

This comment has been minimized.

Collaborator

tineheller commented Jun 27, 2018

So let's say, there is a portalScript with name BigNum and category util/lib on server.
When you want to require this portalScript in another portalScript on server, you have to use

require("BigNum");

It is not possible to add a path in require, like so:

require("util/lib/BigNum");

And unfortunately it will not be possible to add this feature to our require function.
Was this your request?

@fiurthorn

This comment has been minimized.

fiurthorn commented Jun 27, 2018

fix this in the extention to rewrite the the name from toolbox/lib/posdata to toolbox.lib.posdata.

The request is to have a bigger namespace and less rename the original imports.

typescript:

import { xml2json, json2xml } from "toolbox/lib/posdata";

javascript:

var posdata_1 = require("toolbox.lib.posdata");

@fiurthorn fiurthorn closed this Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment