Skip to content

Commit 286c0a8

Browse files
authored
migrate to vite and vitest (#240)
* migrate to vite and vitest * re-add the demo and update the vite configs * Update the start script docs
1 parent 0bf8a65 commit 286c0a8

32 files changed

+3517
-5525
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,4 @@ Procfile text
200200
*.*rc text
201201

202202
# Ignore files (like .npmignore or .gitignore)
203-
*.*ignore text
203+
*.*ignore text

.github/SECURITY.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
## Supported Versions
44

5-
| Version | Supported | Supported Until |
6-
| ------- | ------------------ | ----------------------------- |
7-
| > 4.0.0 | :white_check_mark: | Next major version + 6 months |
8-
| > 3.0.0 | :white_check_mark: | 01.06.22 |
9-
| < 3.0.0 | :x: | N / A |
5+
| Version | Supported | Supported Until |
6+
| -------- | ------------------ | ----------------------------- |
7+
| >= 5.0.0 | :white_check_mark: | Next major version + 6 months |
8+
| >= 4.0.0 | :white_check_mark: | Next major version + 6 months |
9+
| >= 3.0.0 | :white_check_mark: | 01.06.22 |
10+
| <= 3.0.0 | :x: | N / A |
1011

1112
## Reporting a Vulnerability
1213

1314
To report a security vulnerability please
14-
[open a new issue](https://github.com/jamesrweb/react-p5-wrapper/issues/new)
15-
with the label `security`. Security issues are a priority and we aim to resolve
16-
them within 48 hours. If a security vulnerability cannot be resolved by us, we
17-
will raise the issue upstream with relevant parties such as 3rd party package
15+
[open a new issue](https://github.com/p5-wrapper/react/issues/new) with the
16+
label `security`. Security issues are a priority, and we aim to resolve them
17+
within 48 hours. If a security vulnerability cannot be resolved by us, we will
18+
raise the issue upstream with relevant parties such as 3rd party package
1819
managers.
1920

2021
## Contacts

.github/SUPPORT.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ This repository is maintained by the @jamesrweb and the community, who all
44
volunteer their time.
55

66
We track bugs, user questions, suggestions and requests through
7-
[issues](https://github.com/jamesrweb/react-p5-wrapper/issues) raised via the
8-
project repository issues tab.
7+
[issues](https://github.com/p5-wrapper/react/issues) raised via the project
8+
repository issues tab.
99

1010
## Need help with something?
1111

1212
All questions should be raised in
13-
[an issue](https://github.com/jamesrweb/react-p5-wrapper/issues/new) with the
14-
`question` tag and the `help wanted` tag added to the issue.
13+
[an issue](https://github.com/p5-wrapper/react/issues/new) with the `question`
14+
tag and the `help wanted` tag added to the issue.
1515

1616
## Found a bug?
1717

1818
All bugs should be raised in
19-
[an issue](https://github.com/jamesrweb/react-p5-wrapper/issues/new) with the
20-
`bug` tag added to the issue.
19+
[an issue](https://github.com/p5-wrapper/react/issues/new) with the `bug` tag
20+
added to the issue.
2121

2222
## Though of a cool new feature?
2323

2424
All bugs should be raised in
25-
[an issue](https://github.com/jamesrweb/react-p5-wrapper/issues/new) with the
25+
[an issue](https://github.com/p5-wrapper/react/issues/new) with the
2626
`enhancement` tag added to the issue.
2727

2828
## Have questions about the project?
2929

3030
All questions should be raised in
31-
[an issue](https://github.com/jamesrweb/react-p5-wrapper/issues/new) with the
32-
`question` tag added to the issue.
31+
[an issue](https://github.com/p5-wrapper/react/issues/new) with the `question`
32+
tag added to the issue.

.github/workflows/CD.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ jobs:
2929
with:
3030
token: ${{ secrets.GH_TOKEN }}
3131

32-
- name: Build the components
33-
run: pnpm build:components
32+
- name: Build the component
33+
run: pnpm build:component
3434

3535
- uses: JS-DevTools/npm-publish@v1
3636
with:
37+
access: "public"
3738
token: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1+
# Logs
2+
logs
13
*.log
2-
coverage
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
310
node_modules
411
dist
5-
.DS_Store
12+
dist-ssr
13+
coverage
14+
*.local
15+
yarn.lock
616
package-lock.json
7-
.idea
17+
18+
# Editor directories and files
19+
.vscode/*
20+
!.vscode/extensions.json
21+
.idea
22+
.DS_Store
23+
*.suo
24+
*.ntvs*
25+
*.njsproj
26+
*.sln
27+
*.sw?

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = true

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ To try them out for yourself fork the repository, be sure you have
3939
git clone [email protected]:<your username>/react.git
4040
cd react
4141
pnpm install
42-
pnpm start
42+
pnpm preview
4343
```
4444

4545
Then just open `http://localhost:3001` in a browser.
@@ -58,7 +58,7 @@ package manager:
5858
### Javascript
5959

6060
```jsx
61-
import React from "react";
61+
import * as React from "react";
6262
import { ReactP5Wrapper } from "react-p5-wrapper";
6363

6464
function sketch(p5) {
@@ -93,7 +93,7 @@ first and only argument.
9393
#### Option 1: Declaring a sketch using the `P5CanvasInstance` type
9494

9595
```tsx
96-
import React from "react";
96+
import * as React from "react";
9797
import { P5CanvasInstance, ReactP5Wrapper } from "react-p5-wrapper";
9898

9999
function sketch(p5: P5CanvasInstance) {
@@ -129,7 +129,7 @@ that is that the `p5` argument passed to the sketch function is auto-typed as a
129129
> in a regular `function` declaration.
130130
131131
```tsx
132-
import React from "react";
132+
import * as React from "react";
133133
import { ReactP5Wrapper, Sketch } from "react-p5-wrapper";
134134

135135
const sketch: Sketch = p5 => {
@@ -285,7 +285,7 @@ export function App() {
285285
### Using abstracted setup and draw functions
286286

287287
```jsx
288-
import React from "react";
288+
import * as React from "react";
289289
import { ReactP5Wrapper } from "react-p5-wrapper";
290290

291291
function setup(p5) {
@@ -575,5 +575,5 @@ To build, watch and serve the examples which will also watch the component
575575
source, run:
576576

577577
```sh
578-
pnpm start
578+
pnpm preview
579579
```

config/jest/jest.config.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

config/jest/jest.environment.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)