breaking up grafana into multiple packages poc

This commit is contained in:
Torkel Ödegaard 2018-12-20 16:56:46 +01:00
parent f089c7ee5e
commit 6e66b2b906
8 changed files with 66 additions and 6 deletions

View File

@ -1,11 +1,15 @@
{
"name": "grafana-ui",
"name": "@grafana/ui",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"main": "dist/index.js",
"types": "dist/types",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "tsc --noEmit"
},
"author": "",
"license": "ISC"
"license": "ISC",
"devDependencies": {
"typescript": "^3.2.2"
}
}

View File

@ -1,11 +1,16 @@
export { Other } from './other';
import { TimeSeries } from '../types';
export class Google {
data: TimeSeries;
hello() {
return 'hello';
}
}
class Singleton {
constructor(private state) {}
constructor(private state: string) {}
hello() {
return this.state;

View File

@ -0,0 +1,5 @@
export class Other {
static hello() {
return "hello from other";
}
}

View File

@ -0,0 +1,36 @@
{
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"exclude": [
"dist"
],
"scripts": {
"build": "tsc"
},
"compilerOptions": {
"moduleResolution": "node",
"target": "es5",
"lib": ["es6", "dom"],
"jsx": "react",
"module": "esnext",
"outDir": "dist",
"declaration": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"noEmitHelpers": true,
"removeComments": false,
"inlineSourceMap": false,
"sourceMap": true,
"noEmitOnError": false,
"emitDecoratorMetadata": false,
"experimentalDecorators": true,
"declaration": true,
"declarationDir": "./dist/types",
"noImplicitAny": true,
"strictNullChecks": true
}
}

View File

@ -0,0 +1,4 @@
export interface TimeSeries {
name: string;
}

View File

@ -15,6 +15,7 @@ import { PanelOptionSection } from './PanelOptionSection';
import { PanelModel } from '../panel_model';
import { DashboardModel } from '../dashboard_model';
import { PanelPlugin } from 'app/types/plugins';
import { TimeSeries } from '@grafana/ui/types';
interface Props {
panel: PanelModel;

View File

@ -26,7 +26,7 @@ import * as ticks from 'app/core/utils/ticks';
import impressionSrv from 'app/core/services/impression_srv';
import builtInPlugins from './built_in_plugins';
import * as d3 from 'd3';
import * as grafanaUI from 'grafana-ui';
import * as grafanaUI from '@grafana/ui';
// rxjs
import { Observable } from 'rxjs/Observable';

View File

@ -14544,6 +14544,11 @@ typescript@^3.0.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.1.tgz#3362ba9dd1e482ebb2355b02dfe8bcd19a2c7c96"
integrity sha512-Veu0w4dTc/9wlWNf2jeRInNodKlcdLgemvPsrNpfu5Pq39sgfFjvIIgTsvUHCoLBnMhPoUA+tFxsXjU6VexVRQ==
typescript@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5"
integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==
ua-parser-js@^0.7.18:
version "0.7.19"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b"