DreamBerd icon indicating copy to clipboard operation
DreamBerd copied to clipboard

[Feature Request] `package` keyword for easier package management

Open 5GameMaker opened this issue 1 year ago • 2 comments

With package you can package your package more easier than ever before before!

===== companyname/username/packagename/src/main/db3/hello.db3 ==
package companyname.username.packagename.src.main.db3.hello!

union hello() => {
   print("hi")!
}!

export hello to "../../../../../../main.db3"!
=====

Keep in mind that if language extension changes, you need to change db3 part in your source code as well. Also package name and path must be the same and be in this exact format

If the author of a library forgot to export the library into your project, feel free to use reflection

===== forgor.db3 ==

const var pkg = Reflect.ofPackage(companyname/username/packagename/src/main/db3/hello.db3)!
pkg.toString += export hello to "../../../../../../forgor.db3"!

import hello!

hello()!

To install a package, you download, then install (first globally then locally to take advantage of caching (required)), then add, then enable, then add a reference to a package you want (must be in that exact order)!

db3pkgmngmt download mypackage db3pkgmngmt install -g mypackage db3pkgmngmt install mypackage db3pkgmngmt add mypackage db3pkgmngmt enable mypackage db3pkgmngmt reference add mypackage

If the commands seem too long, you can use aliases

dd mypackage dig mypackage di mypackage da mypackage de mypackage dra mypackage

If you want to remove a package, feel free to delete it

===== uninstall.db3 ==

delete package companyname.username.packagename.src.main.db3.hello!

Keep in mind that manually removing a package will cause universal collapse which might be problematic for your project in future

5GameMaker avatar Dec 06 '23 07:12 5GameMaker

( If you are a Linux user you might want to remove coreutils from your system )

5GameMaker avatar Dec 06 '23 07:12 5GameMaker

Keep in mind everything has to be in the nDreamBerd package, or else it will officially be owned by nDreamBerd, as stated here

thegatesdev avatar Dec 14 '23 13:12 thegatesdev