-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Parsers load at runtime within a few seconds of the first content query on a project -SDK / Description structure updated to match optic-markdown 0.1.0 spec -Tests updated
- Loading branch information
Aidan Cunniffe
committed
Mar 4, 2018
1 parent
488e452
commit 3b4ee6e
Showing
31 changed files
with
154 additions
and
161 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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
.idea/ | ||
target/ | ||
project/target/ | ||
config.yaml | ||
|
||
arrow/target/ | ||
common/target/ | ||
|
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
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 @@ | ||
testParser: "/Users/aidancunniffe/Developer/knack/parsers/javascript-lang/target/scala-2.12/es7_2.12-0.1.0.jar" | ||
testParser: "server/src/main/resources/es7_2.12-0.1.0.jar" |
67 changes: 0 additions & 67 deletions
67
core/src/main/scala-2.12/com/opticdev/core/cli/Installer.scala
This file was deleted.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ class SGConstructorSpec extends TestBase with TestPackageProviders { | |
lazy val projectFile = new ProjectFile(File("test-examples/resources/example_packages/express/optic.yaml")) | ||
|
||
it("can resolve all dependencies in a project file") { | ||
assert(SGConstructor.dependenciesForProjectFile(projectFile).get.toString == """Tree(Vector(Leaf(OpticMDPackage({"metadata":{"name":"express-js","author":"optic","version":"0.1.0"},"dependencies":{"optic:rest":"0.1.0"},"lenses":[{"name":"Parameter","scope":"internal","schema":"optic:rest/parameter","snippet":{"name":"Parameter","language":"es7","version":"es6","block":"req.query.name"},"rules":[],"variables":[],"subcontainers":[],"components":[{"type":"code","finder":{"type":"stringFinder","rule":"entire","string":"query","occurrence":0},"propertyPath":["in"]},{"type":"code","finder":{"type":"stringFinder","rule":"entire","string":"name","occurrence":0},"propertyPath":["name"]}]},{"name":"Example Route","scope":"public","schema":"optic:rest/route","snippet":{"name":"Example Route","language":"es7","block":"app.get('url', function (req, res) {\n //:callback \n})"},"rules":[{"type":"children","finder":{"type":"stringFinder","rule":"starting","string":"{","occurrence":0},"ruleType":"any"}],"variables":[],"subcontainers":[{"name":"callback","subcontainer":true,"pulls":[],"childrenRule":"any","schemaComponents":[{"type":"schema","schema":"optic:rest/parameter","propertyPath":["parameters"],"mapUnique":true}]}],"components":[{"type":"code","finder":{"type":"stringFinder","rule":"entire","string":"get","occurrence":0},"propertyPath":["method"]},{"type":"code","finder":{"type":"stringFinder","rule":"containing","string":"url","occurrence":0},"propertyPath":["url"]},{"type":"schema","schema":"parameter","mapUnique":true,"propertyPath":["parameters"],"location":{"type":"InParent","finder":null},"options":{"lookupTable":null,"invariant":false,"parser":null,"mutator":null}}]}]},Map(PackageRef(optic:rest,0.1.0) -> PackageRef(optic:rest,0.1.0))),Tree(Vector(Leaf(OpticMDPackage({"metadata":{"name":"rest","author":"optic","version":"0.1.0"},"schemas":[{"id":"route","definition":{"title":"Route","version":"1.0.0","type":"object","required":["method","url"],"properties":{"method":{"type":"string"},"url":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/parameter"}}},"definitions":{"parameter":{"title":"Parameter","version":"1.0.0","slug":"js-example-route-parameter","type":"object","required":["in","name"],"properties":{"in":{"type":"string"},"name":{"type":"string"}}}}}},{"id":"parameter","definition":{"title":"Parameter","version":"1.0.0","type":"object","required":["in","name"],"properties":{"in":{"type":"string"},"name":{"type":"string"}}}}]},Map()),Tree(Vector())))))))""") | ||
assert(SGConstructor.dependenciesForProjectFile(projectFile).get.toString == """Tree(Vector(Leaf(OpticMDPackage({"metadata":{"name":"express-js","author":"optic","version":"0.1.0"},"dependencies":["optic:[email protected]"],"lenses":[{"name":"Parameter","scope":"internal","schema":"optic:rest/parameter","snippet":{"name":"Parameter","language":"es7","version":"es6","block":"req.query.name"},"rules":[],"variables":[],"subcontainers":[],"components":[{"type":"code","finder":{"type":"stringFinder","rule":"entire","string":"query","occurrence":0},"propertyPath":["in"]},{"type":"code","finder":{"type":"stringFinder","rule":"entire","string":"name","occurrence":0},"propertyPath":["name"]}]},{"name":"Example Route","scope":"public","schema":"optic:rest/route","snippet":{"name":"Example Route","language":"es7","block":"app.get('url', function (req, res) {\n //:callback \n})"},"rules":[{"type":"children","finder":{"type":"stringFinder","rule":"starting","string":"{","occurrence":0},"ruleType":"any"}],"variables":[],"subcontainers":[{"name":"callback","subcontainer":true,"pulls":[],"childrenRule":"any","schemaComponents":[{"type":"schema","schema":"optic:rest/parameter","propertyPath":["parameters"],"mapUnique":true}]}],"components":[{"type":"code","finder":{"type":"stringFinder","rule":"entire","string":"get","occurrence":0},"propertyPath":["method"]},{"type":"code","finder":{"type":"stringFinder","rule":"containing","string":"url","occurrence":0},"propertyPath":["url"]},{"type":"schema","schema":"parameter","mapUnique":true,"propertyPath":["parameters"],"location":{"type":"InParent","finder":null},"options":{"lookupTable":null,"invariant":false,"parser":null,"mutator":null}}]}]},Map(PackageRef(optic:rest,0.1.0) -> PackageRef(optic:rest,0.1.0))),Tree(Vector(Leaf(OpticMDPackage({"metadata":{"name":"rest","author":"optic","version":"0.1.0"},"schemas":[{"id":"route","definition":{"title":"Route","version":"1.0.0","type":"object","required":["method","url"],"properties":{"method":{"type":"string"},"url":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/parameter"}}},"definitions":{"parameter":{"title":"Parameter","version":"1.0.0","slug":"js-example-route-parameter","type":"object","required":["in","name"],"properties":{"in":{"type":"string"},"name":{"type":"string"}}}}}},{"id":"parameter","definition":{"title":"Parameter","version":"1.0.0","type":"object","required":["in","name"],"properties":{"in":{"type":"string"},"name":{"type":"string"}}}}]},Map()),Tree(Vector())))))))""") | ||
} | ||
|
||
it("can compile dependencies") { | ||
|
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 |
---|---|---|
|
@@ -53,7 +53,7 @@ class FileAccumulatorSpec extends AkkaTestFixture("FileAccumulatorTest") with Ge | |
|
||
it("map unique schemas finds valid + distinct instances") { | ||
|
||
val sourceGear = sourceGearFromDescription("/Users/aidancunniffe/Developer/knack/optic-core/test-examples/resources/example_packages/optic:[email protected]") | ||
val sourceGear = sourceGearFromDescription("test-examples/resources/example_packages/optic:[email protected]") | ||
val result = sourceGear.parseFile(File("test-examples/resources/example_source/ExampleExpress.js")) | ||
|
||
implicit val sourceGearContext = SGContext(sourceGear.fileAccumulator, result.get.astGraph, SourceParserManager.installedParsers.head, null) | ||
|
Oops, something went wrong.