Compile-time GUID generation library. This can be used for networking remote purposes, or for general compile-time hash requirements.
This transformer makes use of the uuid
jsdoc tag. By default it will use hashids
for the generated strings.
/**
* @uuid
*/
export const enum UUID {
A = "Test",
B = "Test2",
C = "Test3"
}
So now
/**
* @uuid
*/
export const enum UUID {
A = "Test",
B = "Test2",
C = "Test3"
}
const test = UUID.A;
which will compile to
local test = "TDr8PURNna"
Will reverse hashed enums, e.g.
/**
* @uuid
*/
export const enum Test {
RemoteName1 = "SomethingGoesHereLol",
RemoteName2 = "AnotherThingGoesHere",
}
const uuids = $debugUUIDs<typeof Test>(); // NOTE: MUST BE `typeof EnumNameHere`.
local uuids = {
["9QiYxp4Qy60"] = "RemoteName1",
["0Ysr4LNVO9x"] = "RemoteName2",
}
Whether or not the transformer's output is verbose, this can also be toggled using --verbose
to rbxtsc.
Whether or not to generate the UUIDs on compile - will default to true, overridden by environments
.
The environments this transformer will run the generators on - defaults to production
.
The type of strings to generate per UUID use - This can be hashids
, uuidv4
or string
.