forked from adl-lang/adl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: define workspace and packaging defs
- Loading branch information
1 parent
8658ee9
commit 9285ba4
Showing
5 changed files
with
419 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// This is based on Golang's modules and workspace. | ||
// e.g. see https://go.dev/ref/mod#workspaces | ||
|
||
module adlc.packaging { | ||
|
||
/// Expected to live in a file named `adl.work.json` | ||
struct AdlWorkspace { | ||
/// Version | ||
String adlc; | ||
AdlPackageRefs use; | ||
}; | ||
|
||
type AdlPackageRefs = Vector<AdlPackageRef>; | ||
|
||
struct AdlPackageRef { | ||
/// must be a path to a directory directly under the folder containing the `adl.work.json` file. | ||
String root; | ||
Vector<GenOptions> genOptions; | ||
}; | ||
|
||
union GenOptions { | ||
TypescriptGenOptions tsgen; | ||
}; | ||
|
||
|
||
struct TypescriptGenOptions { | ||
ReferenceableScopeOption referenceable = "local"; | ||
// Vector<> searchDir; | ||
OutputOpts outputs; | ||
Bool includeRuntime; | ||
Nullable<String> runtimeDir; | ||
Bool generate_transitive; | ||
Bool include_resolver; | ||
TsStyle ts_style = "tsc"; | ||
ModuleSrc modules; | ||
Bool capitalize_branch_names_in_types; | ||
Bool capitalize_type_names; | ||
}; | ||
|
||
struct OutputOpts { | ||
String outputDir; | ||
Nullable<String> manifest = null; | ||
}; | ||
|
||
union TsStyle { | ||
Void tsc; | ||
Void deno; | ||
}; | ||
|
||
union ModuleSrc { | ||
Void all; | ||
Vector<String> modules; | ||
}; | ||
|
||
union ReferenceableScopeOption { | ||
/// Generated code will only be referred internal to the repo | ||
Void local; | ||
/// Generated code can be published via a package manager (e.g. npm) | ||
Void remote; | ||
}; | ||
|
||
/// Expected to live in a file named `adl.pkg.json` | ||
struct AdlPackage { | ||
PackageDirective pkg; | ||
/// Version | ||
String adlc; | ||
Vector<Require> requires = []; | ||
Vector<Exclude> excludes = []; | ||
Vector<Replace> replaces = []; | ||
Vector<Retract> retracts = []; | ||
}; | ||
|
||
struct PackageDirective { | ||
String path; | ||
Nullable<String> repo = null; | ||
}; | ||
|
||
struct Require { | ||
String path; | ||
String version; | ||
Bool indirect = false; | ||
}; | ||
|
||
struct Exclude { | ||
String path; | ||
String version; | ||
}; | ||
|
||
struct Replace { | ||
String path; | ||
Nullable<String> version; | ||
}; | ||
|
||
struct Retract { | ||
String version; | ||
Nullable<String> comment = null; | ||
}; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod config; | ||
pub mod config; | ||
pub mod packaging; |
Oops, something went wrong.