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 10 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()],
})
Loading
Loading