Skip to content

Commit e0ef1c7

Browse files
ashnaaryaAshna Arya
and
Ashna Arya
authored
[Vite] Instruct users to create plugins with Vite instead of CRA (#23)
Co-authored-by: Ashna Arya <[email protected]>
1 parent 2d08ac6 commit e0ef1c7

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,42 +67,52 @@ While you are not required to use React for your plugin, it must be written in
6767
Javascript and React is recommended. We support both a standard Javascript API
6868
and a React Hooks API.
6969

70-
#### Create a Project with React
70+
#### Create a Project with Vite
7171

7272
1. Open your terminal and navigate to the directory you want to create your
7373
project in.
74-
2. Create your new project. We recommend using Facebook’s
75-
[`create-react-app`](https://create-react-app.dev/).
74+
2. Create your new project. We recommend using
75+
[`create-vite`](https://www.npmjs.com/package/create-vite).
7676

7777
```sh
78-
npx create-react-app <my-cool-plugin>
78+
yarn create vite <my-cool-plugin>
79+
# or
80+
npm create vite@latest <my-cool-plugin>
7981
```
8082

81-
3. Navigate to the project's main directory.
83+
3. Then follow the prompts! You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Vite + Vue project, run:
84+
85+
```sh
86+
yarn create vite my-vue-app --template vue
87+
```
88+
89+
4. Navigate to the project's main directory.
8290

8391
```sh
8492
cd <my-cool-plugin>
8593
```
8694

87-
4. Use your package manager to install Sigma’s plugin library. We recommend
95+
5. Use your package manager to install Sigma’s plugin library. We recommend
8896
using `yarn`.
8997

9098
```sh
9199
yarn add @sigmacomputing/plugin
92100
```
93101

94-
5. Spin up your local development server.
102+
6. Spin up your local development server.
95103

96104
```sh
97-
yarn && yarn start
105+
yarn && yarn dev
98106
```
99107

100-
6. Start developing:
108+
7. Start developing:
101109

102110
- Get started with Sigma’s Plugin APIs.
103111
- Test your plugin directly in a Sigma workbook using the Sigma Plugin Dev
104112
Playground.
105-
- By default, Create React App dev servers run on http://localhost:3000.
113+
- By default, vite dev servers run on http://localhost:5173.
114+
115+
NOTE: Facebook's [create-react-app](https://github.com/facebook/create-react-app) is deprecated. You should use [vite](https://github.com/vitejs/vite) to setup your project.
106116

107117
## Testing your Plugin
108118

0 commit comments

Comments
 (0)