start converting to typescript

pull/573/head
Rich-Harris 7 years ago
parent 4e58bd06ff
commit 25aa02c4fd

@ -74,9 +74,11 @@
"rollup-plugin-commonjs": "^7.0.0", "rollup-plugin-commonjs": "^7.0.0",
"rollup-plugin-json": "^2.1.0", "rollup-plugin-json": "^2.1.0",
"rollup-plugin-node-resolve": "^2.0.0", "rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-typescript": "^0.8.1",
"rollup-watch": "^3.2.2", "rollup-watch": "^3.2.2",
"source-map": "^0.5.6", "source-map": "^0.5.6",
"source-map-support": "^0.4.8" "source-map-support": "^0.4.8",
"typescript": "^2.3.2"
}, },
"nyc": { "nyc": {
"include": [ "include": [

@ -1,10 +1,10 @@
import nodeResolve from 'rollup-plugin-node-resolve'; import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs'; import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json'; import json from 'rollup-plugin-json';
import buble from 'rollup-plugin-buble'; import typescript from 'rollup-plugin-typescript';
export default { export default {
entry: 'src/index.js', entry: 'src/index.ts',
moduleName: 'svelte', moduleName: 'svelte',
targets: [ targets: [
{ dest: 'compiler/svelte.js', format: 'umd' } { dest: 'compiler/svelte.js', format: 'umd' }
@ -13,12 +13,10 @@ export default {
nodeResolve({ jsnext: true, module: true }), nodeResolve({ jsnext: true, module: true }),
commonjs(), commonjs(),
json(), json(),
buble({ typescript({
include: 'src/**', include: 'src/**',
exclude: 'src/shared/**', exclude: 'src/shared/**',
target: { typescript: require( 'typescript' )
node: 4
}
}) })
], ],
sourceMap: true sourceMap: true

@ -20,9 +20,9 @@ export default {
} }
}) })
], ],
external: [ path.resolve( 'src/index.js' ), 'fs', 'path' ], external: [ path.resolve( 'src/index.ts' ), 'fs', 'path' ],
paths: { paths: {
[ path.resolve( 'src/index.js' ) ]: '../compiler/svelte.js' [ path.resolve( 'src/index.ts' ) ]: '../compiler/svelte.js'
}, },
sourceMap: true sourceMap: true
}; };

@ -1,6 +1,6 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import { compile } from '../index.js'; import { compile } from '../index.ts';
function capitalise ( name ) { function capitalise ( name ) {
return name[0].toUpperCase() + name.slice( 1 ); return name[0].toUpperCase() + name.slice( 1 );

@ -0,0 +1,10 @@
{
"compilerOptions": {
"types" : ["node"],
"noImplicitAny": true,
"diagnostics": true,
"noImplicitThis": true,
"noEmitOnError": true
},
"target": "ES5"
}

@ -811,6 +811,10 @@ commondir@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
compare-versions@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-2.0.1.tgz#1edc1f93687fd97a325c59f55e45a07db106aca6"
concat-map@0.0.1: concat-map@0.0.1:
version "0.0.1" version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@ -2477,7 +2481,17 @@ rollup-plugin-node-resolve@^2.0.0:
builtin-modules "^1.1.0" builtin-modules "^1.1.0"
resolve "^1.1.6" resolve "^1.1.6"
rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2: rollup-plugin-typescript@^0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript/-/rollup-plugin-typescript-0.8.1.tgz#2ff7eecc21cf6bb2b43fc27e5b688952ce71924a"
dependencies:
compare-versions "2.0.1"
object-assign "^4.0.1"
rollup-pluginutils "^1.3.1"
tippex "^2.1.1"
typescript "^1.8.9"
rollup-pluginutils@^1.3.1, rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2:
version "1.5.2" version "1.5.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
dependencies: dependencies:
@ -2733,6 +2747,10 @@ through@^2.3.6:
version "2.3.8" version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
tippex@^2.1.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tippex/-/tippex-2.3.1.tgz#a2fd5b7087d7cbfb20c9806a6c16108c2c0fafda"
to-fast-properties@^1.0.1: to-fast-properties@^1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320"
@ -2775,6 +2793,14 @@ typedarray@^0.0.6:
version "0.0.6" version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
typescript@^1.8.9:
version "1.8.10"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-1.8.10.tgz#b475d6e0dff0bf50f296e5ca6ef9fbb5c7320f1e"
typescript@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984"
uglify-js@^2.6: uglify-js@^2.6:
version "2.8.22" version "2.8.22"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0"

Loading…
Cancel
Save