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: getting typescript/workspace to work - manual edits
- Loading branch information
1 parent
2a09c7e
commit 9c5a401
Showing
119 changed files
with
9,878 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
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 @@ | ||
/node_modules/ | ||
node_modules/ | ||
dist/ |
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,74 @@ | ||
{ | ||
"adlc": "0.0.0", | ||
"use_embedded_sys_loader": true, | ||
"runtimes": [ | ||
{ | ||
"ts_runtime": { | ||
"output_dir": "./generated/runtime", | ||
"npm_pkg_name": "@adl-lang/runtime" | ||
} | ||
} | ||
], | ||
"embedded_sys_loader" : { "just": { | ||
"path": "", | ||
"ts_opts": { | ||
"npm_pkg_name": "@adl-lang/sys", | ||
"npm_version": "1.0.0", | ||
"extra_dependencies": { | ||
"base64-js": "^1.5.1" | ||
}, | ||
"extra_dev_dependencies": { | ||
"tsconfig": "workspace:*", | ||
"typescript": "^4.9.3" | ||
} | ||
} | ||
}}, | ||
"use": [ | ||
{ | ||
"path": "./adl/lib", | ||
"ts_opts": { | ||
"npm_pkg_name": "@adl-lang/common", | ||
"extra_dev_dependencies": { | ||
"tsconfig": "workspace:*", | ||
"typescript": "^4.9.3" | ||
}, | ||
"runtime_opts": { | ||
"workspace_ref": "@adl-lang/runtime" | ||
}, | ||
"outputs": { | ||
"gen": { | ||
"output_dir": "./generated/common", | ||
"manifest": "./generated/common/.adl-manifest", | ||
"strip_first": true | ||
} | ||
}, | ||
"include_resolver": false | ||
} | ||
}, | ||
{ | ||
"path": "./adl/proj", | ||
"ts_opts": { | ||
"npm_pkg_name": "@adl-lang/protoclient", | ||
"generate_transitive": false, | ||
"extra_dependencies": { | ||
"base64-js": "^1.5.1" | ||
}, | ||
"extra_dev_dependencies": { | ||
"tsconfig": "workspace:*", | ||
"typescript": "^4.9.3" | ||
}, | ||
"runtime_opts": { | ||
"workspace_ref": "@adl-lang/runtime" | ||
}, | ||
"outputs": { | ||
"gen": { | ||
"output_dir": "./generated/protoclient", | ||
"manifest": "./generated/protoclient/.adl-manifest", | ||
"strip_first": true | ||
} | ||
}, | ||
"include_resolver": true | ||
} | ||
} | ||
] | ||
} |
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,12 @@ | ||
{ | ||
"path" : "github.com/adl-lang/adl/typescript/workspace/adl/lib", | ||
"global_alias": "common", | ||
"adlc": "0.0.0", | ||
"requires": [ | ||
{ | ||
"ref": { | ||
"alias": "sys" | ||
} | ||
} | ||
] | ||
} |
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,94 @@ | ||
module common { | ||
|
||
import common.strings.StringNE; | ||
import common.db.DbColumnType; | ||
|
||
/// A instant in time, represented as milliseconds from | ||
/// the epoch of "1970-01-01T00:00:00Z | ||
newtype Instant = Int64; | ||
|
||
/// A date in ISO8601 format | ||
newtype LocalDate = String = "1970-01-01"; | ||
|
||
/// A time in ISO8601 format | ||
newtype LocalTime = String = "00:00:00"; | ||
|
||
/// A datetime in ISO8601 format | ||
newtype LocalDateTime = String = "1970-01-01T00:00:00"; | ||
|
||
/// The day of the week | ||
union DayOfWeek { | ||
Void monday; | ||
Void tuesday; | ||
Void wednesday; | ||
Void thursday; | ||
Void friday; | ||
Void saturday; | ||
Void sunday; | ||
}; | ||
|
||
/// A duration in ISO8601 format | ||
@DbColumnType "interval" | ||
newtype Duration = String = "P1D"; | ||
|
||
/// An IANA timezone | ||
newtype Timezone = StringNE; | ||
|
||
/// A holder for paginated results | ||
struct Paginated<T> { | ||
|
||
/// The paginated items | ||
Vector<T> items; | ||
|
||
/// The offset used for this query | ||
Int64 current_offset; | ||
|
||
/// The size of the entire date set | ||
Int64 total_size; | ||
}; | ||
|
||
/// Empty Struct (Used mostly for Void RPC responses) | ||
struct Unit {}; | ||
|
||
/// Phantom type to capture a StringMap with a named string key type: | ||
type StringKeyMap<K,V> = StringMap<V>; | ||
|
||
/// Naming aid for strings used as keys | ||
type Key<T> = String; | ||
|
||
/// A value of type T along with the Key<T> | ||
struct WithKey<T> { | ||
Key<T> key; | ||
T value; | ||
}; | ||
|
||
/// Postgres array of strings type that is serialized in to a list of Strings | ||
@DbColumnType "text[]" | ||
newtype StringList = Vector<String>; | ||
|
||
// Postgres tsvector type for plain text searching | ||
@DbColumnType "tsvector" | ||
newtype TSVector = String; | ||
|
||
/// Postgres Geography type that is serialized using GeoJson | ||
// Maps to postgres database as 'geography' column | ||
// See https://postgis.net/workshops/postgis-intro/geography.html#casting-to-geometry | ||
@DbColumnType "geography" | ||
newtype GeographyGeoJson = String; | ||
|
||
/// Postgres Geometry type | ||
// Maps to postgres database as 'geometry' column | ||
// Serialise to/from WKT (Well Known Text) in the string | ||
@DbColumnType "geometry" | ||
newtype GeometryWKT = String; | ||
|
||
|
||
/// A floating point decimal value | ||
// | ||
// In principle, the json format allows numbers with arbitrary decimal precision. However | ||
// support for this is dependent on individual client libraries, and crucially the | ||
// JSON.parse() function in browsers converts json numbers to a binary floating point | ||
// double representation. Hence we take the safe option and serialize as JSON strings. | ||
@DbColumnType "numeric" | ||
newtype BigDecimal = String; | ||
}; |
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,82 @@ | ||
module common | ||
{ | ||
import adlc.config.java.*; | ||
import common.db.JavaDbCustomType; | ||
import sys.types.Set; | ||
|
||
annotation JavaPackage "au.com.helixta.adl.common"; | ||
|
||
annotation Instant JavaCustomType { | ||
"javaname" : "java.time.Instant", | ||
"helpers" : "au.com.helixta.adl.custom.InstantHelpers" | ||
}; | ||
|
||
annotation LocalDate JavaCustomType { | ||
"javaname" : "java.time.LocalDate", | ||
"helpers" : "au.com.helixta.adl.custom.LocalDateHelpers" | ||
}; | ||
|
||
annotation LocalTime JavaCustomType { | ||
"javaname" : "java.time.LocalTime", | ||
"helpers" : "au.com.helixta.adl.custom.LocalTimeHelpers" | ||
}; | ||
|
||
annotation LocalDateTime JavaCustomType { | ||
"javaname" : "java.time.LocalDateTime", | ||
"helpers" : "au.com.helixta.adl.custom.LocalDateTimeHelpers" | ||
}; | ||
|
||
annotation DayOfWeek JavaCustomType { | ||
"javaname" : "java.time.DayOfWeek", | ||
"helpers" : "au.com.helixta.adl.custom.DayOfWeekHelpers" | ||
}; | ||
|
||
annotation GeographyGeoJson JavaCustomType { | ||
"javaname" : "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryHelpers" | ||
}; | ||
|
||
annotation GeographyGeoJson JavaDbCustomType { | ||
"javaDbType": "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryHelpers" | ||
}; | ||
|
||
annotation GeometryWKT JavaCustomType { | ||
"javaname" : "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryWKTHelpers" | ||
}; | ||
|
||
annotation GeometryWKT JavaDbCustomType { | ||
"javaDbType" : "org.postgis.PGgeometry", | ||
"helpers": "au.com.helixta.adl.custom.PGgeometryWKTHelpers" | ||
}; | ||
|
||
annotation TSVector JavaDbCustomType { | ||
"javaDbType" : "String", | ||
"helpers": "au.com.helixta.adl.custom.TSVectorHelpers" | ||
}; | ||
|
||
annotation StringList JavaDbCustomType { | ||
"javaDbType" : "au.com.helixta.nofrills.sql.StringList", | ||
"helpers": "au.com.helixta.adl.custom.StringListHelpers" | ||
}; | ||
|
||
annotation StringList JavaCustomType { | ||
"javaname" : "au.com.helixta.nofrills.sql.StringList", | ||
"helpers": "au.com.helixta.adl.custom.StringListHelpers" | ||
}; | ||
|
||
annotation BigDecimal JavaCustomType { | ||
"javaname" : "java.math.BigDecimal", | ||
"helpers": "au.com.helixta.adl.custom.BigDecimalHelpers" | ||
}; | ||
|
||
annotation BigDecimal JavaDbCustomType { | ||
"javaDbType" : "java.math.BigDecimal", | ||
"helpers": "au.com.helixta.adl.custom.BigDecimalHelpers" | ||
}; | ||
|
||
/// Force adlc java runtime to include HashSetHelpers.java | ||
newtype SetStrings = Set<String>; | ||
|
||
}; |
Oops, something went wrong.