Skip to content

Commit

Permalink
Add scala-js and scala-native installation (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
romanowski authored Oct 15, 2021
1 parent 408598d commit b04afc8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 13 deletions.
46 changes: 42 additions & 4 deletions website/docs/_advanced_install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DownloadButton from "../src/components/DownloadButton"
import {currentOs} from "../src/components/osUtils";

<SectionAbout title="Advanced Installation">
<div class="margin--lg"/>
<div className="margin--lg"/>
<Tabs
groupId="operating-systems-specific"
defaultValue={currentOs()}
Expand Down Expand Up @@ -232,7 +232,7 @@ brew install Virtuslab/scala-cli/scala-cli


<SectionAbout title="Standalone launcher">
<div class="margin--lg"/>
<div className="margin--lg"/>
<Tabs
defaultValue={currentOs() == 'win' ? 'windows' : 'macOS/Linux'}
groupId="specific-standalone-launcher"
Expand Down Expand Up @@ -268,7 +268,7 @@ Script to automatically download and cache standalone `scala-cli` launcher.


<SectionAbout title="Shell completions">
<div class="margin--lg"/>
<div className="margin--lg"/>
<Tabs
defaultValue={currentOs() == 'mac' ? 'zsh' : 'bash'}
groupId="shell-specific"
Expand All @@ -283,11 +283,31 @@ Script to automatically download and cache standalone `scala-cli` launcher.


Try the completions with

<Tabs groupId="shell-specific"
defaultValue="bash"
values={[
{label: 'Bash', value: 'bash'},
{label: 'zsh', value: 'zsh'},
]}>
<TabItem value="bash">

```
eval "$(scala-cli install completions --env --shell bash)"
scala-cli --<TAB>
```

</TabItem>
<TabItem value="zsh">

```
eval "$(scala-cli install completions --env)"
eval "$(scala-cli install completions --env --shell zsh)"
scala-cli --<TAB>
```

</TabItem>
</Tabs>

Install them on your system with
```bash
scala-cli install completions
Expand Down Expand Up @@ -315,4 +335,22 @@ scala-cli install completions --shell zsh

</TabItem>
</Tabs>
</div></div>

<div id="scala-js"/>
<SectionAbout title="Scala JS"/>
<div className="row"><div className="col col--9 col--offset-1 padding--lg advanced_install_methods">

To run Scala JS applications [Node.js](https://nodejs.org/) needs to be installed. Scala CLI at this moment does not manage Node.js however it may change in the future.

</div></div>

<div id="scala-native"/>
<SectionAbout title="Scala Native"/>
<div className="row"><div className="col col--9 col--offset-1 padding--lg advanced_install_methods">

[Clang](https://llvm.org/docs/GettingStarted.html#requirements) is required to compile and run Scala Native applications. Using some functionalities known from JDK (like using `java.util.zip` package) require additional packages to be installed.

Scala Native page contains detailed [installation guide](https://scala-native.readthedocs.io/en/latest/user/setup.html#installing-clang-and-runtime-dependencies).

</div></div>
12 changes: 6 additions & 6 deletions website/src/components/SectionAbout.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';

export default function SectionAbout(props){
return <div className="section-about__wrapper row">
<div className="col col--1 big-title pre-title">
&gt;_
</div>
export default function SectionAbout(props){
const id = props.title.toLowerCase().split(" ").join("-")
const link = <a href={"#" + id} >&gt;_</a>
return <div className="section-about__wrapper row" id={id}>
<div className="col col--1 big-title pre-title">{link}</div>
<div className="col col--3 big-title">
<span className="pre-title-mobile">&gt;_</span> {props.title}
<span className="pre-title-mobile">{link}</span> {props.title}
</div>
<div className="col col--8 description">
{props.children}
Expand Down
3 changes: 2 additions & 1 deletion website/src/components/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const featuresList = [
Scala CLI ships with all its dependencies
<br/>
No need to fluff with installing JVM or setting up PATH.
<i>some additional setup may be required for <a href="/install#scala-js">JS</a> and <a href="/install#scala-native">Native</a></i>
</p>
</ImageBox>,
<ImageBox image="universal_tool.svg" title="Universal tool" key="universal"
Expand All @@ -23,7 +24,7 @@ const featuresList = [
If you want to use older <b>version of Scala</b> or
run your code in <b>JS</b> or <b>Native</b> environments we've got you covered.
<br/>
<i>some additional <a href="TODO?">setup</a> may be required for JS and Native</i>
<i>some additional setup may be required for <a href="/install#scala-js">JS</a> and <a href="/install#scala-native">Native</a></i>
</p>
<p>Switching between platforms or Scala versions is as easy as changing a parameter.</p>
</ImageBox>,
Expand Down
6 changes: 4 additions & 2 deletions website/src/scss/components/section-about.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@
margin-bottom: 15px;
}

.pre-title-mobile{
.pre-title-mobile a{
color: #DE3D3B;
text-decoration: none;

@media ( min-width: 376px){
display: none;
}
}

&.pre-title{
&.pre-title a{
text-align: right;
padding-left: 20px;
color: #DE3D3B;
text-decoration: none;

@media ( max-width: 375px){
display: none;
Expand Down

0 comments on commit b04afc8

Please sign in to comment.