Rob S
Rob S
DDeno
Created by Rob S on 2/1/2025 in #help
Workspace documentation lacks explanation of `exports` member in deno.json
I was reading the documentation on workspaces and monorepos. It shows usage of the exports member ina deno.json file. The example shows it as a single string. There's no explanation of the exports member in the documenation for workspaces, monorepos, nor the "deno.json and package.json" help page, either. I am trying to understand how I can share commonly used enums across all of my microservices; but, I got confused. If my enums are declared in individual *.ts files (e.g. Statuses.ts, ExpirationTypes.ts, etc), how do I mark this up in my root-level and module-level deno.json files such that I can access the enums from within all modules? Specific example: I have an enum called Status.
export enum Status = {
OFF,
ON,
CANCELLED
}
export enum Status = {
OFF,
ON,
CANCELLED
}
I want to use this enum in multiple modules without copying the enum to those modules. My hypothetical workspace structure is as follows.
root
- deno.json
/modules
/common
deno.json
Statuses.ts
/authentication
deno.json
server.ts
root
- deno.json
/modules
/common
deno.json
Statuses.ts
/authentication
deno.json
server.ts
8 replies