split typescript projects

pull/3030/head
mrkishi 5 years ago committed by Conduitry
parent 453b9ac2da
commit b0604b52a3

@ -37,8 +37,7 @@
"posttest": "agadoo internal/index.mjs", "posttest": "agadoo internal/index.mjs",
"prepublishOnly": "export PUBLISH=true && npm test && npm run create-stubs", "prepublishOnly": "export PUBLISH=true && npm test && npm run create-stubs",
"create-stubs": "node scripts/create-stubs.js", "create-stubs": "node scripts/create-stubs.js",
"tsd": "tsc -p . --emitDeclarationOnly", "tsd": "tsc -p src/compiler --emitDeclarationOnly && tsc -p src/runtime --emitDeclarationOnly",
"typecheck": "tsc -p . --noEmit",
"lint": "eslint \"{src,test}/**/*.{ts,js}\"" "lint": "eslint \"{src,test}/**/*.{ts,js}\""
}, },
"repository": { "repository": {

@ -1,4 +1,4 @@
import { assign } from '../../runtime/internal/index'; import { assign } from '../../runtime/internal/utils';
import Stats from '../Stats'; import Stats from '../Stats';
import parse from '../parse/index'; import parse from '../parse/index';
import render_dom from './render-dom/index'; import render_dom from './render-dom/index';

@ -0,0 +1,11 @@
{
"extends": "../../tsconfig.json",
"include": ["."],
"compilerOptions": {
"lib": ["es2017", "webworker"]
// TODO: remove mocha types from the whole project
// "types": ["node", "estree"]
}
}

@ -1,4 +1,5 @@
import { identity as linear, noop, now } from './utils'; import { identity as linear, noop } from './utils';
import { now } from './environment';
import { loop } from './loop'; import { loop } from './loop';
import { create_rule, delete_rule } from './style_manager'; import { create_rule, delete_rule } from './style_manager';
import { AnimationConfig } from '../animate'; import { AnimationConfig } from '../animate';

@ -0,0 +1,16 @@
export const is_client = typeof window !== 'undefined';
export let now: () => number = is_client
? () => window.performance.now()
: () => Date.now();
export let raf = cb => requestAnimationFrame(cb);
// used internally for testing
export function set_now(fn) {
now = fn;
}
export function set_raf(fn) {
raf = fn;
}

@ -1,6 +1,7 @@
export * from './animations'; export * from './animations';
export * from './await-block'; export * from './await-block';
export * from './dom'; export * from './dom';
export * from './environment';
export * from './keyed-each'; export * from './keyed-each';
export * from './lifecycle'; export * from './lifecycle';
export * from './loop'; export * from './loop';

@ -1,4 +1,4 @@
import { now, raf } from './utils'; import { now, raf } from './environment';
export interface Task { abort(): void; promise: Promise<void> } export interface Task { abort(): void; promise: Promise<void> }

@ -1,5 +1,5 @@
import { element } from './dom'; import { element } from './dom';
import { raf } from './utils'; import { raf } from './environment';
let stylesheet; let stylesheet;
let active = 0; let active = 0;

@ -1,4 +1,5 @@
import { identity as linear, is_function, noop, now, run_all } from './utils'; import { identity as linear, is_function, noop, run_all } from './utils';
import { now } from "./environment";
import { loop } from './loop'; import { loop } from './loop';
import { create_rule, delete_rule } from './style_manager'; import { create_rule, delete_rule } from './style_manager';
import { custom_event } from './dom'; import { custom_event } from './dom';

@ -89,20 +89,3 @@ export function once(fn) {
fn.call(this, ...args); fn.call(this, ...args);
}; };
} }
const is_client = typeof window !== 'undefined';
export let now: () => number = is_client
? () => window.performance.now()
: () => Date.now();
export let raf = cb => requestAnimationFrame(cb);
// used internally for testing
export function set_now(fn) {
now = fn;
}
export function set_raf(fn) {
raf = fn;
}

@ -0,0 +1,15 @@
{
"extends": "../../tsconfig.json",
"include": ["."],
"compilerOptions": {
"lib": ["es2015", "dom", "dom.iterable"],
"target": "es2015",
"types": [],
"baseUrl": ".",
"paths": {
"svelte/*": ["*"]
}
}
}

@ -0,0 +1,10 @@
{
"extends": "../tsconfig.json",
"include": ["."],
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noEmit": true
}
}

@ -1,33 +1,30 @@
{ {
"include": [],
"compilerOptions": { "compilerOptions": {
"target": "es2015", "rootDir": "src",
"module": "es6",
// target node v8+ (https://node.green/)
// the only missing feature is Array.prototype.values
"lib": ["es2017"],
"target": "es2017",
"declaration": true, "declaration": true,
"declarationDir": "types", "declarationDir": "types",
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noEmitOnError": true, "noEmitOnError": true,
"lib": [ "noErrorTruncation": true,
"es5",
"es6", // rollup takes care of these
"dom", "module": "esnext",
"es2015"
],
"importHelpers": true,
"moduleResolution": "node", "moduleResolution": "node",
"baseUrl": ".", "resolveJsonModule": true,
"paths": { "allowSyntheticDefaultImports": true,
"svelte/internal": ["./src/runtime/internal/index"],
"svelte/easing": ["./src/runtime/easing/index"], // TODO: error all the things
"svelte/motion": ["./src/runtime/motion/index"], //"strict": true,
"svelte/store": ["./src/runtime/store/index"] "noImplicitThis": true,
}, "noUnusedLocals": true,
"typeRoots": [ "noUnusedParameters": true
"node_modules/@types" }
]
},
"include": [
"src/**/*"
]
} }

Loading…
Cancel
Save