@sigmacomputing/plugin 1.0.0-rc.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,6 +14,13 @@ Plugins are built using Sigma’s Plugin API. This API communicates data and
14
14
  interaction events between a Sigma workbook and the plugin. Plugins are hosted
15
15
  by their developer and rendered in an iframe in Sigma.
16
16
 
17
+ #### Warning: Breaking Changes
18
+
19
+ `@sigmacomputing/plugin` has moved to https://github.com/sigmacomputing/plugin and
20
+ is now open source. Please read our
21
+ [CHANGELOG.md](https://github.com/sigmacomputing/plugin/blob/main/CHANGELOG.md)
22
+ to review any breaking changes that have been made.
23
+
17
24
  ## Requirements
18
25
 
19
26
  To test your plugin in Sigma Plugin Dev Playground, you must:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigmacomputing/plugin",
3
- "version": "1.0.0-rc.3",
3
+ "version": "1.0.0",
4
4
  "description": "Sigma Computing Plugin Client API",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/sigmacomputing/plugin",
package/.gitignore DELETED
@@ -1,30 +0,0 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- node_modules/
5
-
6
- # testing
7
- coverage/
8
-
9
- # production
10
- dist/
11
-
12
- # misc
13
- .DS_Store
14
- .env.local
15
- .envrc
16
- eslint_output.json
17
- tsc_output
18
-
19
- npm-debug.log*
20
- yarn-debug.log*
21
- yarn-error.log*
22
-
23
- # vim
24
- *.swp
25
-
26
- # IDE files
27
- .idea
28
-
29
- # typescript
30
- tsconfig*.tsbuildinfo
package/.lintstagedrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "*.{js,ts,tsx}": "yarn prettier --write"
3
- }
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v16.13.1
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "arrowParens": "avoid",
3
- "singleQuote": true,
4
- "trailingComma": "all"
5
- }
package/CHANGELOG.md DELETED
@@ -1,25 +0,0 @@
1
- ## v1.0.0 (September 2nd, 2022)
2
-
3
- `@sigmacomputing/plugin` has moved to https://github.com/sigmacomputing/plugin and
4
- is now open source. Feel free to create an issue or contribute by opening a pull
5
- request. Read out `CONTRIBUTING.md` guide to get started.
6
-
7
- #### Breaking Changes
8
-
9
- - `@sigmacomputing/plugin-types` has been merged with `@sigmacomputing/plugin`
10
- and will no longer received updates in the future. Please use only
11
- `@sigmacomputing/plugin` going forward.
12
-
13
- - All `react` exports (`SigmaClientProvider` and all hooks) have been moved to
14
- a separate explicit export. This will allow better bundle splitting by not
15
- including `react` specific code for plugins that do not use `react`.
16
-
17
- ```ts
18
- // before
19
- import { SigmaClientProvider, usePlugin } from '@sigmacomputing/plugin';
20
-
21
- // after
22
- import { SigmaClientProvider, usePlugin } from '@sigmacomputing/plugin/react';
23
- ```
24
-
25
- All types can be imported from either `@sigmacomputing/plugin` or `@sigmacomputing/plugin/react`
package/CONTRIBUTING.md DELETED
@@ -1,60 +0,0 @@
1
- ## Initial setup
2
-
3
- Start by forking the `@sigmacomputing/plugin` repo and cloning it locally.
4
-
5
- ```shs
6
- git clone https://github.com/your-username/sigmacomputing-plugin.git
7
- ```
8
-
9
- Navigate to the `sigmacomputing-plugin` directory and install the required
10
- dependencies with the following commands:
11
-
12
- ```sh
13
- # Ensure you have node version 16 installed (suggestion: v16.13.1).
14
- nvm install
15
- yarn install
16
- ```
17
-
18
- ## Start Developing
19
-
20
- You can run any of the scripts located in the `package.json` using:
21
-
22
- ```sh
23
- yarn <script-name>
24
- ```
25
-
26
- For example, you can run the build process with
27
-
28
- ```sh
29
- yarn build
30
- # Or in watch mode
31
- yarn build:watch
32
- ```
33
-
34
- ### Add tests
35
-
36
- Unit tests ensure that `@sigmacomputing/plugin` doesn't break accidentally. If
37
- your code can regress in non-obvious ways, include unit tests with your PR. Use
38
- the following naming convention:
39
-
40
- ```
41
- +-- parentFolder
42
- | +-- __tests__
43
- | +-- [filename].test.ts
44
- | +-- [filename].ts
45
- ```
46
-
47
- Our unit test suite uses [jest](https://jestjs.io/)
48
-
49
- ## Submit a pull request
50
-
51
- Before submitting your contribution, run the test suite one last time with:
52
-
53
- ```sh
54
- yarn test
55
- ```
56
-
57
- Doing this prevents last-minute bugs and is also a great way to get your
58
- contribution merged faster once you submit your pull request. Failing to do so
59
- will lead to one of the maintainers mark the pull request with the Work in
60
- Progress label until all tests pass.
@@ -1,54 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
4
- y="0px" viewBox="0 0 841.9 595.3" style="enable-background:new 0 0 841.9 595.3;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0 {
7
- fill: #00C3AF;
8
- }
9
-
10
- .st1 {
11
- fill: #FFFFFF;
12
- }
13
- </style>
14
- <g>
15
- <g>
16
- <polygon class="st0" points="279.2,379.8 205.4,347.7 253.1,347.7 " />
17
- <polygon class="st0" points="233.3,315.1 285.6,379.2 264.8,281.4 " />
18
- <polygon class="st0" points="164.4,246.8 229.5,311.3 261,277.7 " />
19
- <polygon class="st0" points="289.8,247.5 265.4,273.6 241.8,266.1 " />
20
- <polygon class="st0" points="295,249.8 281.1,263.8 318.8,264.5 " />
21
- </g>
22
- <g>
23
- <g>
24
- <path class="st1" d="M372.1,291.1h15v60.2h-15V291.1z" />
25
- </g>
26
- <g>
27
- <path class="st1" d="M459.7,291.1v51.7c0,27.1-12.8,38.8-33,38.8c-12.1,0-22.7-6.7-27.8-17.7l12.1-5.7c2.9,5.9,9.3,9.8,15.7,9.8
28
- c11.3,0,18.4-6.7,18.4-23.8v-0.9c-4.2,6.2-12.3,9.3-19.5,9.3c-15.5,0-28.9-12.2-28.9-31.5c0-19.3,13.3-31.3,28.8-31.3
29
- c7.6,0,15.5,3,19.6,9.2v-7.9H459.7z M444.8,321c0-10.6-8.6-17.3-17-17.3c-9.1,0-16.5,7.2-16.5,17.3s7.4,17.5,16.5,17.5
30
- C436.8,338.5,444.8,331.6,444.8,321z" />
31
- </g>
32
- <g>
33
- <path class="st1" d="M567.5,317.5v33.8h-14.8v-32.6c0-9.7-5-14.4-12-14.4c-8.6,0-14.1,6.4-13.4,17.3l-0.1-0.5v30.3h-15v-32.6
34
- c0-9.7-5-14.4-11.5-14.4c-7,0-13.9,3.9-13.9,15.3v31.7h-15v-60.2h15v10.3c2.2-7.6,10.4-11.6,17.9-11.6c8.8,0,16,4.1,19.5,11.9
35
- c4.8-9.5,14.2-11.9,20.2-11.9C559.5,289.8,567.5,300,567.5,317.5z" />
36
- </g>
37
- <g>
38
- <path class="st1"
39
- d="M312.1,332.6H327c0,4.1,3.8,8,10.5,8c6.3,0,10.4-2.7,10.4-6.6c0-3.4-2.7-4.9-7.5-5.9l-8.5-2.1
40
- c-14.3-3.6-18-10.8-18-18.4c0-9.4,9.8-17.7,23.7-17.7c11.3,0,24.1,5.3,24,18.8h-15.1c0-4.3-4-6.8-8.5-6.8c-4.9,0-8.3,2.6-8.3,6.3
41
- c0,3.1,3.1,4.9,6.8,5.7l10.2,2.6c14.3,3.5,16.9,12,16.9,17.5c0,12.2-13,18.7-25.9,18.7C325.1,352.7,312.4,345.5,312.1,332.6z" />
42
- </g>
43
- <g>
44
- <ellipse class="st1" cx="379.6" cy="276.5" rx="9" ry="9.3" />
45
- </g>
46
- <g>
47
- <path class="st1" d="M632.6,315.3v36h-14.7v-8c-4,5.5-12.6,9.3-20.6,9.3c-12.5,0-21.5-7.3-21.5-18.7c0-12.1,10.4-18.8,23.7-18.8
48
- c6.8,0,13.7,1.7,18.4,4.3v-3.6c0-7.6-5.2-12.9-13.6-12.9c-7.2,0-14,2.7-17.1,6.4l-8.1-8.5c4.9-6.6,15.1-11,26.1-11
49
- C621.1,289.8,632.6,298.8,632.6,315.3z M617.9,331.8v-2.4c-3.9-2.4-10.1-4-15.8-4c-8.2,0-12.3,3.6-12.3,7.9
50
- c0,4.3,3.9,7.1,10.3,7.1C606.6,340.4,614.3,337.1,617.9,331.8z" />
51
- </g>
52
- </g>
53
- </g>
54
- </svg>
@@ -1,50 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
4
- y="0px" viewBox="0 0 841.9 595.3" style="enable-background:new 0 0 841.9 595.3;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0 {
7
- fill: #00C3AF;
8
- }
9
- </style>
10
- <g>
11
- <g>
12
- <polygon class="st0" points="255.8,388.4 153.6,344 219.7,344 " />
13
- <polygon class="st0" points="192.3,298.8 264.6,387.6 235.9,252.2 " />
14
- <polygon class="st0" points="96.9,204.4 187,293.7 230.6,247.1 " />
15
- <polygon class="st0" points="270.4,205.3 236.6,241.4 204.1,231 " />
16
- <polygon class="st0" points="277.6,208.4 258.5,227.8 310.6,228.8 " />
17
- </g>
18
- <g>
19
- <g>
20
- <path d="M384.4,265.7h20.7V349h-20.7V265.7z" />
21
- </g>
22
- <g>
23
- <path d="M505.6,265.7v71.6c0,37.5-17.8,53.7-45.6,53.7c-16.7,0-31.4-9.3-38.5-24.4l16.7-7.9c4,8.2,12.9,13.6,21.8,13.6
24
- c15.7,0,25.4-9.3,25.4-33v-1.2c-5.7,8.6-17.1,12.8-27,12.8c-21.4,0-40.1-17-40.1-43.5c0-26.8,18.5-43.4,39.9-43.4
25
- c10.5,0,21.4,4.1,27.2,12.7v-10.9H505.6z M485,307c0-14.6-11.8-23.9-23.5-23.9c-12.5,0-22.8,10-22.8,23.9s10.3,24.3,22.8,24.3
26
- C473.9,331.3,485,321.7,485,307z" />
27
- </g>
28
- <g>
29
- <path d="M654.8,302.2V349h-20.5v-45.1c0-13.4-7-20-16.6-20c-12,0-19.4,8.9-18.6,23.9L599,307V349h-20.7v-45.1
30
- c0-13.4-7-20-15.9-20c-9.6,0-19.3,5.4-19.3,21.2V349h-20.7v-83.3h20.7v14.3c3-10.5,14.5-16.1,24.8-16.1
31
- c12.1,0,22.1,5.7,26.9,16.4c6.6-13.2,19.6-16.4,28-16.4C643.8,263.9,654.8,278,654.8,302.2z" />
32
- </g>
33
- <g>
34
- <path d="M301.4,323.1h20.6c0,5.7,5.3,11.1,14.5,11.1c8.7,0,14.3-3.7,14.3-9.1c0-4.6-3.8-6.8-10.4-8.2l-11.7-2.9
35
- c-19.8-5-24.9-15-24.9-25.5c0-13,13.6-24.4,32.8-24.4c15.7,0,33.4,7.3,33.2,26.1h-20.9c0-5.9-5.5-9.5-11.7-9.5
36
- c-6.8,0-11.5,3.6-11.5,8.7c0,4.3,4.3,6.8,9.4,7.9l14.2,3.6c19.8,4.8,23.4,16.6,23.4,24.3c0,17-17.9,25.9-35.9,25.9
37
- C319.3,351,301.7,341,301.4,323.1z" />
38
- </g>
39
- <g>
40
- <ellipse cx="394.7" cy="245.4" rx="12.4" ry="12.9" />
41
- </g>
42
- <g>
43
- <path d="M744.9,299.2V349h-20.4v-11.1c-5.6,7.7-17.5,12.8-28.5,12.8c-17.3,0-29.7-10.2-29.7-25.9c0-16.8,14.4-26.1,32.8-26.1
44
- c9.3,0,19,2.3,25.5,5.9v-5c0-10.5-7.1-17.8-18.9-17.8c-10,0-19.4,3.7-23.6,8.9L670.9,279c6.8-9.1,20.9-15.2,36.2-15.2
45
- C729,263.9,744.9,276.4,744.9,299.2z M724.6,322v-3.4c-5.4-3.4-13.9-5.5-21.9-5.5c-11.4,0-17,5-17,10.9c0,5.9,5.4,9.8,14.3,9.8
46
- C708.9,333.8,719.6,329.3,724.6,322z" />
47
- </g>
48
- </g>
49
- </g>
50
- </svg>
package/jest.config.ts DELETED
@@ -1,22 +0,0 @@
1
- import path from 'path';
2
- import { Config } from '@jest/types';
3
-
4
- const config: Config.InitialOptions = {
5
- globals: {
6
- 'ts-jest': {
7
- tsconfig: path.resolve(__dirname, 'tsconfig.json'),
8
- isolatedModules: true,
9
- },
10
- },
11
-
12
- preset: 'ts-jest',
13
- testEnvironment: 'jsdom',
14
- testMatch: ['<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}'],
15
-
16
- watchPlugins: [
17
- 'jest-watch-typeahead/filename',
18
- 'jest-watch-typeahead/testname',
19
- ],
20
- };
21
-
22
- export default config;
@@ -1,30 +0,0 @@
1
- import { initialize } from '../initialize';
2
-
3
- describe('initialize', () => {
4
- let originalAddEventListener: any;
5
- let originalRemoveEventListener: any;
6
-
7
- beforeAll(() => {
8
- originalAddEventListener = window.addEventListener;
9
- originalRemoveEventListener = window.removeEventListener;
10
- window.addEventListener = jest.fn();
11
- window.removeEventListener = jest.fn();
12
- });
13
-
14
- beforeEach(() => {
15
- jest.resetAllMocks();
16
- });
17
-
18
- it('should initialize and be destroyable', () => {
19
- const client = initialize();
20
- expect(window.addEventListener).toHaveBeenCalled();
21
-
22
- client.destroy();
23
- expect(window.removeEventListener).toHaveBeenCalled();
24
- });
25
-
26
- afterAll(() => {
27
- window.addEventListener = originalAddEventListener;
28
- window.removeEventListener = originalRemoveEventListener;
29
- });
30
- });
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src"
6
- },
7
- "include": ["src"],
8
- "exclude": ["node_modules", "src/**/__tests__/**"]
9
- }
package/tsconfig.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": ["ESNext", "DOM", "DOM.Iterable"],
4
- "module": "CommonJS",
5
- "moduleResolution": "node",
6
- "target": "ES2015",
7
-
8
- "baseUrl": "./",
9
- "paths": {
10
- "*": ["src/*"]
11
- },
12
-
13
- "declaration": true,
14
- "declarationMap": true,
15
-
16
- "jsx": "react-jsx",
17
- "downlevelIteration": true,
18
- "noImplicitAny": true,
19
- "strict": true,
20
-
21
- "allowSyntheticDefaultImports": true,
22
- "esModuleInterop": true,
23
- "forceConsistentCasingInFileNames": true,
24
- "skipLibCheck": true,
25
- "resolveJsonModule": true,
26
-
27
- "plugins": [
28
- {
29
- "transform": "typescript-transform-paths",
30
- "exclude": ["**/node_modules/**"],
31
- "afterDeclarations": true
32
- }
33
- ]
34
- },
35
- "include": ["src", "jest.config.ts"]
36
- }