diff --git a/.gitignore b/.gitignore index 33571f2..757b52b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ # dependencies node_modules/ -# testing -coverage/ - # production dist/ diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index e9ab9c5..0000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "arrowParens": "avoid", - "singleQuote": true, - "trailingComma": "all" -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 387f7e7..5e5b4ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,17 +9,3 @@ request. Read our `CONTRIBUTING.md` guide to get started. - `@sigmacomputing/plugin-types` has been merged with `@sigmacomputing/plugin` and will no longer received updates in the future. Please use only `@sigmacomputing/plugin` going forward. - -- All `react` exports (`SigmaClientProvider` and all hooks) have been moved to - a separate explicit export. This will allow better bundle splitting by not - including `react` specific code for plugins that do not use `react`. - - ```ts - // before - import { SigmaClientProvider, usePlugin } from '@sigmacomputing/plugin'; - - // after - import { SigmaClientProvider, usePlugin } from '@sigmacomputing/plugin/react'; - ``` - - All types can be imported from either `@sigmacomputing/plugin` or `@sigmacomputing/plugin/react` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c0e0f2b..f34d722 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Start by forking the `@sigmacomputing/plugin` repo and cloning it locally. -```shs +```sh git clone https://github.com/your-username/sigmacomputing-plugin.git ``` @@ -10,8 +10,10 @@ Navigate to the `sigmacomputing-plugin` directory and install the required dependencies with the following commands: ```sh -# Ensure you have node version 18 installed (suggestion: v18.16.1). +# Ensure you correct version of node installed nvm install +nvm use + yarn install ``` @@ -44,7 +46,17 @@ the following naming convention: | +-- [filename].ts ``` -Our unit test suite uses [jest](https://jestjs.io/) +Our unit test suite uses [vitest](https://vitest.dev/) + +### Run type check + +The plugin sdk uses typescript to ensure type safety across the codebase and +catch errors at compile time. Before submitting your contribution, run the +type checker to verify there are no type errors: + +```sh +yarn types +``` ## Submit a pull request @@ -52,9 +64,17 @@ Before submitting your contribution, run the test suite one last time with: ```sh yarn test +# Or in watch mode +yarn test:watch ``` Doing this prevents last-minute bugs and is also a great way to get your contribution merged faster once you submit your pull request. Failing to do so will lead to one of the maintainers mark the pull request with the Work in Progress label until all tests pass. + +You may need to setup playwright before running tests + +```sh +yarn playwright install +``` diff --git a/LICENSE b/LICENSE index f859819..f75cbe3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Sigma Computing +Copyright (c) 2026 Sigma Computing Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ff0dd47..efd2182 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ Before you start: > following command in your terminal: > > ```sh - > yarn && yarn start + > yarn && yarn dev > ``` 1. Create/open a workbook. diff --git a/package.json b/package.json index 153d831..2e46a28 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,11 @@ { "name": "@sigmacomputing/plugin", "version": "1.1.1", - "description": "Sigma Computing Plugin Client API", + "description": "Sigma Computing Plugin Client SDK", "license": "MIT", "homepage": "https://github.com/sigmacomputing/plugin", "type": "module", - "main": "./dist/cjs/index.cjs", - "module": "./dist/esm/index.js", - "types": "./dist/cjs/index.d.cts", - "unpkg": "./dist/umd/sigmacomputing-plugin.umd.js", - "jsdelivr": "./dist/umd/sigmacomputing-plugin.umd.js", - "exports": { - ".": { - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.cts", - "default": "./dist/cjs/index.cjs" - } - }, - "./package.json": "./package.json" - }, + "packageManager": "yarn@4.13.0", "repository": { "type": "git", "url": "https://github.com/sigmacomputing/plugin.git" @@ -31,15 +14,6 @@ "email": "support@sigmacomputing.com", "url": "https://github.com/sigmacomputing/plugin/issues" }, - "packageManager": "yarn@4.13.0", - "files": [ - "dist/**/*", - "src/**/*", - "!src/**/__tests__/**/*" - ], - "publishConfig": { - "access": "public" - }, "scripts": { "build": "tsdown", "build:watch": "tsdown --watch", @@ -74,5 +48,31 @@ "typescript": "^6.0.2", "unplugin-unused": "^0.5.7", "vitest": "^4.1.5" + }, + "main": "./dist/cjs/index.cjs", + "module": "./dist/esm/index.js", + "types": "./dist/cjs/index.d.cts", + "unpkg": "./dist/umd/sigmacomputing-plugin.umd.js", + "jsdelivr": "./dist/umd/sigmacomputing-plugin.umd.js", + "exports": { + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/**/*", + "src/**/*", + "!src/**/__tests__/**/*" + ], + "publishConfig": { + "access": "public" } } diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index d9c65da..0000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "./src" - }, - "include": ["src"], - "exclude": ["node_modules", "src/**/__tests__/**"] -}