Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pie-monorepo): DSW-2056 added pie-webc integration to react 17 e… #1610

Merged
merged 14 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/six-ducks-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wc-react17": minor
---

[Added] - pie-webc integration to react app
1 change: 1 addition & 0 deletions apps/examples/wc-react17/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
root: true,
extends: [
require.resolve('@justeattakeaway/eslint-config-pie/strict'),
],
Expand Down
43 changes: 21 additions & 22 deletions apps/examples/wc-react17/.gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.yarn/*

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
22 changes: 11 additions & 11 deletions apps/examples/wc-react17/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Getting Started with Create React App
# React + Vite

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

## Available Scripts
Currently, two official plugins are available:

In the project directory, you can run:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
## Available Scripts

The page will reload when you make changes.\
You may also see any lint errors in the console.
In the project directory, you can run:

### `yarn dev`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
Runs the app in the development mode.

The page will reload when you make changes.
You may also see any lint errors in the console.
13 changes: 13 additions & 0 deletions apps/examples/wc-react17/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
28 changes: 20 additions & 8 deletions apps/examples/wc-react17/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
{
"name": "wc-react17",
"version": "0.4.43",
"private": true,
"version": "0.4.43",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@justeattakeaway/pie-button": "0.47.8",
"@justeattakeaway/pie-css": "0.12.1",
"@lit/react": "1.0.2",
"@justeattakeaway/pie-webc": "0.5.13",
"@lit/react": "1.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-scripts": "5.0.1"
"react-dom": "17.0.2"
},
"scripts": {
"dev": "react-scripts start",
"build:examples": "react-scripts build"
"devDependencies": {
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@vitejs/plugin-react": "4.3.1",
"eslint": "8.57.0",
"eslint-plugin-react": "7.34.3",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-refresh": "0.4.7",
"vite": "5.3.4"
},
"browserslist": {
"production": [
Expand Down
43 changes: 0 additions & 43 deletions apps/examples/wc-react17/public/index.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PieButton } from '@justeattakeaway/pie-button/dist/react';
import { PieButton } from '@justeattakeaway/pie-webc/react/button.js';

import '@justeattakeaway/pie-css';
import './styles.css';
import './App.css';

function App () {
return (
Expand Down
10 changes: 0 additions & 10 deletions apps/examples/wc-react17/src/index.js

This file was deleted.

10 changes: 10 additions & 0 deletions apps/examples/wc-react17/src/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App.jsx";

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
7 changes: 7 additions & 0 deletions apps/examples/wc-react17/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
58 changes: 46 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11358,6 +11358,15 @@ __metadata:
languageName: node
linkType: hard

"@types/react-dom@npm:^17.0.2":
version: 17.0.25
resolution: "@types/react-dom@npm:17.0.25"
dependencies:
"@types/react": ^17
checksum: d1e582682478e0848c8d54ea3e89d02047bac6d916266b85ce63731b06987575919653ea7159d98fda47ade3362b8c4d5796831549564b83088e7aa9ce8b60ed
languageName: node
linkType: hard

"@types/react@npm:*, @types/react@npm:18.3.3, @types/react@npm:>=16":
version: 18.3.3
resolution: "@types/react@npm:18.3.3"
Expand All @@ -11368,6 +11377,17 @@ __metadata:
languageName: node
linkType: hard

"@types/react@npm:^17, @types/react@npm:^17.0.2":
version: 17.0.80
resolution: "@types/react@npm:17.0.80"
dependencies:
"@types/prop-types": "*"
"@types/scheduler": ^0.16
csstype: ^3.0.2
checksum: 1c27bfc42305d77ef0da55f8f6d4c4a3471aa02b294fcf29ea0f2cfb0bf02892e5a0a3bc7559fa4a5ba50697b2e31076cb5aa5987f69cfc2e880f6426edb8bdf
languageName: node
linkType: hard

"@types/resolve@npm:1.17.1":
version: 1.17.1
resolution: "@types/resolve@npm:1.17.1"
Expand Down Expand Up @@ -11400,6 +11420,13 @@ __metadata:
languageName: node
linkType: hard

"@types/scheduler@npm:^0.16":
version: 0.16.8
resolution: "@types/scheduler@npm:0.16.8"
checksum: 6c091b096daa490093bf30dd7947cd28e5b2cd612ec93448432b33f724b162587fed9309a0acc104d97b69b1d49a0f3fc755a62282054d62975d53d7fd13472d
languageName: node
linkType: hard

"@types/semver@npm:^7.3.12, @types/semver@npm:^7.3.4, @types/semver@npm:^7.5.0":
version: 7.5.8
resolution: "@types/semver@npm:7.5.8"
Expand Down Expand Up @@ -19184,12 +19211,12 @@ __metadata:
linkType: hard

"enhanced-resolve@npm:^5.10.0, enhanced-resolve@npm:^5.12.0, enhanced-resolve@npm:^5.14.1, enhanced-resolve@npm:^5.17.0":
version: 5.17.0
resolution: "enhanced-resolve@npm:5.17.0"
version: 5.17.1
resolution: "enhanced-resolve@npm:5.17.1"
dependencies:
graceful-fs: ^4.2.4
tapable: ^2.2.0
checksum: 1066000454da6a7aeabdbe1f433d912d1e39e6892142a78a37b6577aab27e0436091fa1399d857ad87085b1c3b73a0f811c8874da3dbdc40fbd5ebe89a5568e6
checksum: 4bc38cf1cea96456f97503db7280394177d1bc46f8f87c267297d04f795ac5efa81e48115a2f5b6273c781027b5b6bfc5f62b54df629e4d25fa7001a86624f59
languageName: node
linkType: hard

Expand Down Expand Up @@ -31759,9 +31786,9 @@ __metadata:
linkType: hard

"postcss-resolve-nested-selector@npm:^0.1.1":
version: 0.1.1
resolution: "postcss-resolve-nested-selector@npm:0.1.1"
checksum: b08fb76ab092a09ee01328bad620a01dcb445ac5eb02dd0ed9ed75217c2f779ecb3bf99a361c46e695689309c08c09f1a1ad7354c8d58c2c2c40d364657fcb08
version: 0.1.4
resolution: "postcss-resolve-nested-selector@npm:0.1.4"
checksum: 8de7abd1ae129233480ac123be243e2a722a4bb73fa54fb09cbbe6f10074fac960b9caadad8bc658982b96934080bd7b7f01b622ca7d5d78a25dc9c0532b17cb
languageName: node
linkType: hard

Expand Down Expand Up @@ -36584,8 +36611,8 @@ __metadata:
linkType: hard

"terser-webpack-plugin@npm:^1.4.3":
version: 1.4.5
resolution: "terser-webpack-plugin@npm:1.4.5"
version: 1.4.6
resolution: "terser-webpack-plugin@npm:1.4.6"
dependencies:
cacache: ^12.0.2
find-cache-dir: ^2.1.0
Expand All @@ -36598,7 +36625,7 @@ __metadata:
worker-farm: ^1.7.0
peerDependencies:
webpack: ^4.0.0
checksum: 02aada80927d3c8105d69cb00384d307b73aed67d180db5d20023a8d649149f3803ad50f9cd2ef9eb2622005de87e677198ecc5088f51422bfac5d4d57472d0e
checksum: 8b6c84df929383032edb25c949781dc55dc31ff85dda9ede25af49357077f615f0065101fcc567cd9c801c8cb1f158ce441fb193c18c6127d04a809a1e7d0d2b
languageName: node
linkType: hard

Expand Down Expand Up @@ -39237,12 +39264,19 @@ __metadata:
version: 0.0.0-use.local
resolution: "wc-react17@workspace:apps/examples/wc-react17"
dependencies:
"@justeattakeaway/pie-button": 0.47.8
"@justeattakeaway/pie-css": 0.12.1
"@lit/react": 1.0.2
"@justeattakeaway/pie-webc": 0.5.13
"@lit/react": 1.0.5
"@types/react": ^17.0.2
"@types/react-dom": ^17.0.2
"@vitejs/plugin-react": 4.3.1
eslint: 8.57.0
eslint-plugin-react: 7.34.3
eslint-plugin-react-hooks: 4.6.2
eslint-plugin-react-refresh: 0.4.7
react: 17.0.2
react-dom: 17.0.2
react-scripts: 5.0.1
vite: 5.3.4
languageName: unknown
linkType: soft

Expand Down
Loading