Skip to content

Commit

Permalink
Port to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed Feb 12, 2019
1 parent c340c42 commit 74de8aa
Show file tree
Hide file tree
Showing 92 changed files with 2,855 additions and 1,986 deletions.
18 changes: 0 additions & 18 deletions .blade.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/tmp

/dist
/node_modules
*.log
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/tests/
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
dist: trusty
sudo: false
cache:
- bundler
- yarn
script: bin/ci
before_script:
- yarn install
- yarn build
script: yarn test
addons:
apt:
sources:
Expand Down
5 changes: 4 additions & 1 deletion test/.vscode/launch.json → .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run All Tests",
"name": "Turbolinks: Debug browser tests",
"cwd": "${workspaceFolder}",
"port": 9229,
"outputCapture": "std",
Expand Down
36 changes: 36 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Turbolinks: Build dist directory",
"type": "shell",
"command": "yarn build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$tsc"
]
},
{
"label": "Turbolinks: Run tests",
"type": "shell",
"dependsOn": "Turbolinks: Build dist directory",
"command": "yarn test",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Turbolinks: Start dev server",
"type": "shell",
"dependsOn": "Turbolinks: Build dist directory",
"command": "yarn start",
"problemMatcher": []
}
]
}
11 changes: 0 additions & 11 deletions Gemfile

This file was deleted.

101 changes: 0 additions & 101 deletions Gemfile.lock

This file was deleted.

20 changes: 0 additions & 20 deletions LICENSE

This file was deleted.

21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Turbolinks works in all modern desktop and mobile browsers. It depends on the [H

## Installation

Include [`dist/turbolinks.js`](dist/turbolinks.js) in your application’s JavaScript bundle.

Turbolinks automatically initializes itself when loaded via a standalone `<script>` tag or a traditional concatenated JavaScript bundle. If you load Turbolinks as a CommonJS or AMD module, first require the module, then call the provided `start()` function.

### Installation Using Ruby on Rails
Expand Down Expand Up @@ -532,28 +530,27 @@ Please note that this project is released with a [Contributor Code of Conduct](C
## Building From Source
Turbolinks is written in [CoffeeScript](https://github.com/jashkenas/coffee-script) and compiled to JavaScript with [Blade](https://github.com/javan/blade). To build from source you’ll need a recent version of Ruby. From the root of your Turbolinks directory, issue the following commands to build the distributable files in `dist/`:
Turbolinks is written in [TypeScript](https://www.typescriptlang.org). To build from source, first make sure you have the [Yarn package manager](https://yarnpkg.com) installed. Then issue the following commands to build the distributable files in `dist/`:
```
$ gem install bundler
$ bundle install
$ bin/blade build
$ yarn install
$ yarn build
```
Include the resulting [`dist/turbolinks.js`](dist/turbolinks.js) file in your application’s JavaScript bundle.
## Running Tests
The Turbolinks test suite is written in [TypeScript](https://www.typescriptlang.org) with the [Intern testing library](https://theintern.io).
Turbolinks is tested with the [Intern testing library](https://theintern.io).
To run the tests, first make sure you have the [Yarn package manager](https://yarnpkg.com) installed. Follow the instructions for _Building From Source_ above, then run the following commands:
To run the test suite, follow the instructions for _Building From Source_ above, then run:
```
$ cd test
$ yarn install
$ yarn test
```
If you are testing changes to the Turbolinks source, remember to run `bin/blade build` before each test run.
If you are testing changes to the Turbolinks source, remember to run `yarn build` before each test run. Or, run `yarn watch` to build automatically as you work.
---
© 2018 Basecamp, LLC.
© 2019 Basecamp, LLC.
16 changes: 0 additions & 16 deletions bin/blade

This file was deleted.

7 changes: 0 additions & 7 deletions bin/ci

This file was deleted.

16 changes: 0 additions & 16 deletions bin/rackup

This file was deleted.

8 changes: 0 additions & 8 deletions config.ru

This file was deleted.

6 changes: 0 additions & 6 deletions dist/turbolinks.js

This file was deleted.

6 changes: 2 additions & 4 deletions test/intern.json → intern.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"functionalSuites": "suites/**/*.ts",
"basePath": "src/tests/",
"functionalSuites": "dist/tests.js",
"environments": [
{
"browserName": "chrome",
Expand All @@ -8,8 +9,5 @@
}
}
],
"plugins": [
"environment.js"
],
"defaultTimeout": 2500
}
26 changes: 19 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"name": "turbolinks",
"version": "5.2.0",
"version": "5.3.0-beta.0",
"description": "Turbolinks makes navigating your web application faster",
"module": "dist/index.js",
"main": "dist/turbolinks.js",
"types": "dist/index.d.ts",
"files": [
"dist",
"src"
"dist"
],
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/turbolinks/turbolinks.git"
Expand All @@ -24,5 +22,19 @@
"bugs": {
"url": "https://github.com/turbolinks/turbolinks/issues"
},
"homepage": "https://github.com/turbolinks/turbolinks#readme"
"homepage": "https://github.com/turbolinks/turbolinks#readme",
"devDependencies": {
"intern": "^4.4.1",
"leadfoot": "^1.7.6",
"rollup": "^1.1.2",
"rollup-plugin-typescript2": "^0.19.2",
"typescript": "^3.3.1"
},
"scripts": {
"clean": "rm -fr dist",
"build": "tsc -b && rollup -c",
"watch": "rollup -wc",
"start": "intern serveOnly",
"test": "NODE_OPTIONS=--inspect intern"
}
}
Loading

0 comments on commit 74de8aa

Please sign in to comment.