-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from cyclejs-community/typescript
Typescript
- Loading branch information
Showing
12 changed files
with
117 additions
and
52 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = { | ||
basics: [ | ||
'@cycle/[email protected]' | ||
], | ||
language: { | ||
javascript: [], | ||
typescript: [] | ||
}, | ||
streamLib: { | ||
xstream: [ | ||
'@cycle/[email protected]', | ||
'[email protected]' | ||
], | ||
rxjs: [ | ||
'@cycle/[email protected]', | ||
'[email protected]' | ||
], | ||
most: [ | ||
'@cycle/[email protected]', | ||
'[email protected]' | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
xstream: { | ||
run: '@cycle/run', | ||
import: 'import xs from \'xstream\'', | ||
stream: 'xs' | ||
}, | ||
rxjs: { | ||
run: '@cycle/rxjs-run', | ||
import: 'import Rx from \'rxjs/Rx\'', | ||
stream: 'Rx.Observable' | ||
}, | ||
most: { | ||
run: '@cycle/most-run', | ||
import: 'import * as most from \'most\'', | ||
stream: 'most' | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = { | ||
xstream: { | ||
run: '@cycle/run', | ||
import: 'import xs from \'xstream\'', | ||
typeImport: 'import {Stream} from \'xstream\'', | ||
stream: 'xs', | ||
streamType: 'Stream' | ||
}, | ||
rxjs: { | ||
run: '@cycle/rxjs-run', | ||
import: 'import Rx from \'rxjs/Rx\'', | ||
typeImport: 'import {Observable} from \'rxjs\'', | ||
stream: 'Rx.Observable', | ||
streamType: 'Observable' | ||
}, | ||
most: { | ||
run: '@cycle/most-run', | ||
import: 'import * as most from \'most\'', | ||
typeImport: 'import {Stream} from \'most\'', | ||
stream: 'most', | ||
streamType: 'Stream' | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = replacements => `// import assert from 'assert' | ||
// describe('App', function () { | ||
// it('should test something', function () { | ||
// // TODO: Add your tests here | ||
// }) | ||
// }) | ||
` |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = replacements => `${replacements.import} | ||
import {Sources, Sinks} from './interfaces' | ||
export function App(sources : Sources) : Sinks { | ||
const vtree$ = ${replacements.stream}.of( | ||
<div>My Awesome Cycle.js app</div> | ||
) | ||
return { | ||
DOM: vtree$ | ||
} | ||
} | ||
` |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = replacements => `import {run} from '${replacements.run}' | ||
import {makeDOMDriver} from '@cycle/dom' | ||
import {Component} from './interfaces' | ||
import {App} from './app' | ||
const main : Component = App | ||
const drivers = { | ||
DOM: makeDOMDriver('#root') | ||
} | ||
run(main, drivers) | ||
` |
13 changes: 13 additions & 0 deletions
13
packages/cycle-scripts/template/src/typescript/interfaces.ts
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = replacements => `${replacements.import} | ||
import {DOMSource, VNode} from '@cycle/dom' | ||
export type Sources = { | ||
DOM : DOMSource; | ||
} | ||
export type Sinks = { | ||
DOM : ${replacements.streamType}<VNode>; | ||
} | ||
export type Component = (s : Sources) => Sinks; | ||
` |