Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
Add feedbacks for tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Aug 26, 2020
1 parent dd96738 commit a3b510d
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"test": "yarn jest",
"test:watch": "yarn lint:fix && yarn jest --watch",
"type": "yarn build --no-babel",
"type:nimbus": "nimbus typescript --build --reference-workspaces",
"prepare-release": "git checkout master && git pull --rebase origin master && yarn install && yarn test",
"prerelease": "yarn build",
"release": "yarn prepare-release && lerna publish && yarn postrelease",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computeMaxFontSize } from '../src';
import { computeMaxFontSize } from '@superset-ui/core/src';
import { addDummyFill, removeDummyFill, SAMPLE_TEXT } from './getBBoxDummyFill';

describe('computeMaxFontSize(input)', () => {
Expand All @@ -7,11 +7,11 @@ describe('computeMaxFontSize(input)', () => {
afterEach(removeDummyFill);

it('requires either idealFontSize or maxHeight', () => {
expect(() =>
expect(() => {
computeMaxFontSize({
text: SAMPLE_TEXT[0],
}),
).toThrow();
});
}).toThrow();
});
it('computes maximum font size for given maxWidth and maxHeight', () => {
expect(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { promiseTimeout } from '@superset-ui/core';
import { getMultipleTextDimensions } from '../src';
import { getMultipleTextDimensions, promiseTimeout } from '@superset-ui/core/src';
import { addDummyFill, removeDummyFill, SAMPLE_TEXT } from './getBBoxDummyFill';

describe('getMultipleTextDimension(input)', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mergeMargin } from '../src';
import { mergeMargin } from '@superset-ui/core/src';

describe('mergeMargin(margin1, margin2, mode?)', () => {
it('combines two given margin', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import parseLength from '../src/parseLength';
import { parseLength } from '@superset-ui/core/src';

describe('parseLength(input)', () => {
it('handles string "auto"', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import LazyFactory from '../../src/svg/LazyFactory';
import LazyFactory from '@superset-ui/core/src/dimension/svg/LazyFactory';

describe('LazyFactory', () => {
describe('createInContainer()', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getBBoxCeil from '../../src/svg/getBBoxCeil';
import createTextNode from '../../src/svg/createTextNode';
import getBBoxCeil from '@superset-ui/core/src/dimension/svg/getBBoxCeil';
import createTextNode from '@superset-ui/core/src/dimension/svg/createTextNode';

describe('getBBoxCeil(node, defaultDimension)', () => {
describe('returns default dimension if getBBox() is not available', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import updateTextNode from '../../src/svg/updateTextNode';
import createTextNode from '../../src/svg/createTextNode';
import updateTextNode from '@superset-ui/core/src/dimension/svg/updateTextNode';
import createTextNode from '@superset-ui/core/src/dimension/svg/createTextNode';

describe('updateTextNode(node, options)', () => {
it('handles empty options', () => {
Expand Down
3 changes: 3 additions & 0 deletions plugins/plugin-chart-choropleth-map/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
},
{
"path": "../../packages/superset-ui-style"
},
{
"path": "../../packages/superset-ui-color"
}
]
}
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ if (shouldRunTyping) {
// only run tsc for packages with ts files
scope = getPackages(glob, true);
run(`lerna exec --stream --concurrency 3 --scope ${scope} \
-- tsc --build`);
-- ../../scripts/tsc.sh --build`);
}
8 changes: 8 additions & 0 deletions scripts/tsc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
startTime=$(node -e 'console.log(Date.now())')
tscExitCode=$(tsc "$@")
duration=$(node -e "console.log('%ss', (Date.now() - $startTime) / 1000)")

if [ ! "$tscExitCode" ]; then
echo "compiled in ${duration}"
fi

0 comments on commit a3b510d

Please sign in to comment.