Skip to content

Commit

Permalink
Merge pull request #104 from oyvindberg/open-beta
Browse files Browse the repository at this point in the history
Open beta
  • Loading branch information
oyvindberg authored Jan 29, 2020
2 parents 2bc2270 + c786112 commit 030960d
Show file tree
Hide file tree
Showing 71 changed files with 941 additions and 364 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import scala.sys.process.stringToProcess

lazy val utils = project
.configure(baseSettings, publicationSettings)
.settings(libraryDependencies ++= Seq(Deps.ammoniteOps, Deps.osLib, Deps.sourcecode) ++ Deps.circe)
.settings(libraryDependencies ++= Seq(Deps.ammoniteOps, Deps.osLib, Deps.sourcecode, Deps.fst) ++ Deps.circe)

lazy val logging = project
.configure(baseSettings, publicationSettings)
Expand Down Expand Up @@ -38,7 +38,7 @@ lazy val `importer-portable` = project
buildInfoPackage := "org.scalablytyped.converter.internal",
buildInfoKeys := Seq[BuildInfoKey](
"gitSha" -> "git rev-parse -1 HEAD".!!.split("\n").last.trim,
"version" -> version.value
"version" -> version.value,
),
)

Expand Down Expand Up @@ -127,7 +127,7 @@ lazy val publicationSettings: Project => Project = _.settings(
</developer>
</developers>
),
bintrayRepository := "not-quite-public",
bintrayRepository := "converter",
resolvers += Resolver.bintrayRepo("oyvindberg", "not-quite-public"),
)

Expand Down
20 changes: 7 additions & 13 deletions docs/encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ The following points try to explain the big picture:

### Whatsup with naming?

Modules receive pretty long names, because we flatten the namespace.
The names should be predicable once you get the hang of it.

All the converted structures are put into a hierarchy:
- output package (typically `typings`, but it can be overriden with `stOutputPackage`)
- library name, for instance `react`
- if defined within a module, an abbreviated version of the module name with a `Mod` suffix. If the module is the top-level module in a library it is just called `mod`.
- if defined within (possibly several) typescript namespaces, all those names are kept
- finally the name of the thing itself.

for instance a typescript import such as this:
```typescript
import AnchorLong from "antd/es/anchor/AnchorLink";
Expand All @@ -24,16 +28,6 @@ will be in ScalablyTyped:
import typings.antd.esAnchorAnchorLinkMod.{default => AnchorLong}
```

A somewhat smart way of handling this is to bundle your commonly used imports somewhere, for instance:
```scala

package object myapp {
type AnchorLong = typings.antd.esAnchorAnchorLinkMod.default
val AnchorLong = typings.antd.esAnchorAnchorLinkMod.default
}

```

Note: Earlier we used `Lib` and `NS` as a suffixes for all library and namespace names, we now managed to drop them.
Migration should be easy with a search/replace of `typings.xxxLib => typings.xxx`.

Expand Down
Loading

0 comments on commit 030960d

Please sign in to comment.