Skip to content

Commit fdd14a1

Browse files
committed
"sync"
1 parent 1a66c5a commit fdd14a1

File tree

9 files changed

+161
-21
lines changed

9 files changed

+161
-21
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
3+
MIT License
4+
5+
Copyright (c) 2022 Looker Data Sciences, Inc.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
*/
26+
module.exports = api => {
27+
api.cache.forever()
28+
return {
29+
presets: [
30+
require('@looker/babel-preset-styled-components'),
31+
require('@looker/babel-preset-typescript'),
32+
],
33+
}
34+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OWNERS

packages/visualizations-single-value/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Change Log
1+
# [1.0.0](https://github.com/looker-open-source/components/compare/22.16.0...1.0.0) (2022-10-13)
2+
3+
**Note:** Version bump only for package @looker/visualizations-single-value
24

3-
All notable changes to this project will be documented in this file.
4-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

66
## [0.1.14](https://github.com/looker-open-source/components/compare/@looker/[email protected]...@looker/[email protected]) (2022-05-23)
77

@@ -109,4 +109,4 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
109109

110110
## 0.1.1 (2021-11-05)
111111

112-
**Note:** Version bump only for package @looker/visualizations-single-value
112+
**Note:** Version bump only for package @looker/visualizations-single-value

packages/visualizations-single-value/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ This package stores the default Single Value visualization used within the Looke
44

55
## Installation
66

7-
If you are working with Looker Visualizations Components, you will likely not need to reference the this package directly. But if you would like to import `SingleValue` to extend or use outside of that context you can install it with Yarn or NPM:
7+
If you are working with Looker Visualizations Components, you will likely not need to reference the this package directly. But if you would like to import `SingleValue` to extend or use outside of that context you can install it with npm or Yarn:
88

9-
- **NPM:** `npm install @looker/visualizations-single-value`
10-
- **YARN:** `yarn add @looker/visualizations-single-value`
9+
- **npm:** `npm install @looker/visualizations-single-value`
10+
- **Yarn:** `yarn add @looker/visualizations-single-value`
1111

1212
You'll also need to satisfy a few peer dependencies - Looker/components, React, and Styled Components:
1313

14-
- **NPM:** `npm install @looker/components react react-dom styled-components`
15-
- **YARN:** `yarn add @looker/components react react-dom styled-components`
14+
- **npm:** `npm install @looker/components react react-dom styled-components`
15+
- **Yarn:** `yarn add @looker/components react react-dom styled-components`
1616

1717
## Getting Started
1818

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
3+
MIT License
4+
5+
Copyright (c) 2022 Looker Data Sciences, Inc.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
*/
26+
27+
const { config } = require('@looker/jest-config')
28+
29+
module.exports = config

packages/visualizations-single-value/package.json

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,45 @@
22
"name": "@looker/visualizations-single-value",
33
"license": "MIT",
44
"main": "src/index.ts",
5-
"version": "0.1.14",
5+
"version": "1.0.0",
6+
"sideEffects": false,
67
"publishConfig": {
7-
"access": "public"
8+
"access": "public",
9+
"registry": "https://registry.npmjs.org"
10+
},
11+
"repository": {
12+
"url": "looker-open-source/components",
13+
"directory": "packages/visualizations-single-value"
14+
},
15+
"files": [
16+
"src",
17+
"lib"
18+
],
19+
"scripts": {
20+
"test": "lk test",
21+
"coverage": "lk coverage",
22+
"prepublishOnly": "lk prepublishOnly"
823
},
9-
"sideEffects": false,
1024
"dependencies": {
11-
"@looker/visualizations-adapters": "^0.1.16",
25+
"@looker/visualizations-adapters": "^1.0.0",
1226
"numeral": "2.0.6"
1327
},
1428
"devDependencies": {
15-
"@looker/components-test-utils": "^1.5.26",
16-
"@looker/eslint-config-oss": "^1.7.21",
17-
"@looker/stylelint-config": "^1.5.19",
29+
"@looker/babel-preset-styled-components": "*",
30+
"@looker/babel-preset-typescript": "*",
31+
"@looker/components-scripts": "*",
32+
"@looker/components-test-utils": "*",
33+
"@looker/eslint-config-oss": "*",
34+
"@looker/jest-config": "*",
35+
"@looker/stylelint-config": "*",
1836
"@testing-library/react": "*",
1937
"@types/numeral": "2.0.2"
2038
},
2139
"peerDependencies": {
22-
"@looker/components": "1.4 - 3",
23-
"react": ">= 16.11.0",
24-
"react-dom": ">= 16.11.0",
25-
"styled-components": "^5.2"
40+
"@looker/components": "1.4 - 4",
41+
"react": "16.11.0 - 18",
42+
"react-dom": "16.11.0 - 18",
43+
"styled-components": "^5.3.1"
2644
},
2745
"eslintConfig": {
2846
"root": true,
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
3+
MIT License
4+
5+
Copyright (c) 2022 Looker Data Sciences, Inc.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
*/
26+
import React from 'react'
27+
import { renderWithTheme } from '@looker/components-test-utils'
28+
import { mockFields, mockData } from '@looker/visualizations-adapters'
29+
import { screen } from '@testing-library/react'
30+
import { SingleValue } from './SingleValue'
31+
32+
describe('SingleValue', () => {
33+
it('renders a single value', () => {
34+
renderWithTheme(
35+
<SingleValue
36+
config={{
37+
series: [
38+
{ color: '#f13136', label: 'orders', value_format: '0,0.[00]' },
39+
],
40+
type: 'single_value',
41+
}}
42+
data={mockData}
43+
fields={mockFields}
44+
/>
45+
)
46+
expect(screen.getByText('87')).toBeVisible()
47+
expect(screen.getByText('orders')).toBeVisible()
48+
})
49+
})

packages/visualizations-single-value/tsconfig.build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"extends": "../../tsconfig.build.json",
2+
"extends": "../tsconfig.build.json",
33
"compilerOptions": {
4+
"lib": ["es2022", "es6", "dom"],
45
"rootDir": "./src",
56
"outDir": "./lib"
67
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "./src"
5+
},
6+
"include": ["src", "types/*.d.ts"],
7+
"target": "es2017"
8+
}

0 commit comments

Comments
 (0)