Skip to content
Online Swift Playground
HTML Swift CSS JavaScript Shell Dockerfile
Branch: master
Clone or download

Latest commit

Latest commit fd9279f May 10, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml Oct 7, 2019
.vscode Add VSCode settings Jan 31, 2018
Frameworks Initial commit Jan 8, 2018
OnlinePlayground Update deps May 10, 2020
Sources Swift 5.1 dependencies Update. Fix Docker image. Sep 25, 2019
Tests Initial commit Jan 8, 2018
Views svg asset May 10, 2020
config Initial commit Jan 8, 2018
frontend This addresses #16. Added bindings for the COMMAND + ENTER (Mac) and … Oct 17, 2019
static svg asset May 10, 2020
.babelrc Update 4.2 snapshot Jul 23, 2018
.cfignore Initial commit Jan 8, 2018
.dockerignore Install nvm+node+npm in Docker. Generate app.js Jun 11, 2018
.gitignore Update Monaco. Install with MonacoWebpackPlugin Jun 10, 2018
BuildVersioningForSSL.xcconfig Initial commit Jan 8, 2018
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Jan 8, 2018
CONTRIBUTING.md Initial commit Jan 8, 2018
Dockerfile Swift 5.1 dependencies Update. Fix Docker image. Sep 25, 2019
LICENSE.txt Specify CC-BY-NC-4.0 License Jan 21, 2018
Package.resolved Swift 5.1 dependencies Update. Fix Docker image. Sep 25, 2019
Package.swift Swift 5.1 dependencies Update. Fix Docker image. Sep 25, 2019
README.md Swift 5.1 dependencies Update. Fix Docker image. Sep 25, 2019
bootstrap.sh Add Swift 5.1 Sep 22, 2019
kubernetes-deployment.yaml 4.2 Release Sep 26, 2018
package-lock.json svg asset May 10, 2020
package.json Update deps May 10, 2020
run.sh Update deps May 10, 2020
webpack.config.js Update Monaco. Install with MonacoWebpackPlugin Jun 10, 2018

README.md

SwiftPlayground.run

Platform Twitter

Online Swift Playground. Implemented in Swift.

TBA. Checkout http://SwiftPlayground.run

SwiftPlayground.run

Installation & Run

$ git clone https://github.com/krzyzanowskim/OnlineSwiftPlayground.git
$ cd OnlineSwiftPlayground
$ ./run.sh

The run.sh script will generate Xcode project (on macOS) and bootstrap the environment. run.sh needs npm to be installed to work properly. Bootstraping involves

  1. Download Swift Toochains supported by the playground
  2. Pre-build support module using the toolchains
  3. Install dependencies
  4. Launches web server on localhost on port 8080

Now you could access playground pointing web browser to 127.0.0.1:8080.

Development

Xcode

Generate Xcode project

$ swift package generate-xcodeproj

React

Web user interface is build with React and webpack.

$ npm run build

Docker

krzyzanowskim/onlineswiftplayground

Download the latest image:

$ docker pull krzyzanowskim/onlineswiftplayground

or build docker image by yourself:

$ git clone https://github.com/krzyzanowskim/OnlineSwiftPlayground.git
$ cd OnlineSwiftPlayground
$ docker build . -t krzyzanowskim/onlineswiftplayground

then run container:

$ docker run -d -p 8080:8080 --name onlineswiftplayground -t krzyzanowskim/onlineswiftplayground

and wait until docker container is up (usually several seconds).

Playground is available at http://localhost:8080. If the docker setup uses VirtualBox, the you can get the IP address from docker-machine ip command.

$ open http://$(docker-machine ip):8080

Config

Third party frameworks should be copied to Frameworks directory (Frameworks are for macOS host only)

See config/ for GitHub auth. sample config.

Author

SwiftPlayground.run is owned and maintained by Marcin Krzyzanowski

You can follow me on Twitter at @krzyzanowskim for project updates and releases.

License

Creative Commons Attribution Non Commercial 4.0. See LICENSE file.

You can’t perform that action at this time.