Skip to content

Commit fecccf0

Browse files
JohanAhlenromainr
authored andcommitted
[frontend] Add the query editor component to the SQL Scratchpad example
1 parent 064499d commit fecccf0

File tree

15 files changed

+451
-91
lines changed

15 files changed

+451
-91
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SKIP_PREFLIGHT_CHECK=true
Lines changed: 21 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,29 @@
1-
# Getting Started with Create React App
1+
# Getting Started with SQL Scratchpad
22

3-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
3+
This projects demonstrates how you can use the Hue web components from within a React project to
4+
create a SQL Scratchpad.
45

5-
## Available Scripts
6+
It's based on a clean create-react-app project, relevant changes are:
67

7-
In the project directory, you can run:
8+
- gethue dependency in package.json, note that this can also be pulled in from the npm repo by specifing a version > 4.9)
9+
- "components" folder with React wrappers around the Hue web components
10+
- App.tsx using the React wrappers
811

9-
### `npm start`
12+
We wrap the web components to be able to set certain attributes/properties on the web component elements that are required by the web components.
1013

11-
Runs the app in the development mode.\
12-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
14+
## To run this project
1315

14-
The page will reload if you make edits.\
15-
You will also see any lint errors in the console.
16+
### In the Hue root folder:
17+
1. `npm install`
18+
2. `npm run webpack-npm`
19+
20+
### In this project folder:
21+
3. `npm install`
22+
4. `npm start`
23+
5. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
1624

17-
### `npm test`
25+
## Base project creation steps (for reference)
1826

19-
Launches the test runner in the interactive watch mode.\
20-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21-
22-
### `npm run build`
23-
24-
Builds the app for production to the `build` folder.\
25-
It correctly bundles React in production mode and optimizes the build for the best performance.
26-
27-
The build is minified and the filenames include the hashes.\
28-
Your app is ready to be deployed!
29-
30-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31-
32-
### `npm run eject`
33-
34-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35-
36-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37-
38-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39-
40-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41-
42-
## Learn More
43-
44-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45-
46-
To learn React, check out the [React documentation](https://reactjs.org/).
27+
1. `npx create-react-app sql-scratchpad --template typescript`
28+
2. add `"gethue": "file:../../../../npm_dist"` to dependencies in package.json
29+
3. add `SKIP_PREFLIGHT_CHECK=true` to .env (required when running inside nested Hue folder)

tools/examples/components/sql-scratchpad/package-lock.json

Lines changed: 234 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/examples/components/sql-scratchpad/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@types/node": "^12.20.4",
1111
"@types/react": "^17.0.2",
1212
"@types/react-dom": "^17.0.1",
13+
"gethue": "file:../../../../npm_dist",
1314
"react": "^17.0.1",
1415
"react-dom": "^17.0.1",
1516
"react-scripts": "4.0.3",
-5.22 KB
Binary file not shown.
-9.44 KB
Binary file not shown.

tools/examples/components/sql-scratchpad/public/manifest.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@
66
"src": "favicon.ico",
77
"sizes": "64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
9-
},
10-
{
11-
"src": "logo192.png",
12-
"type": "image/png",
13-
"sizes": "192x192"
14-
},
15-
{
16-
"src": "logo512.png",
17-
"type": "image/png",
18-
"sizes": "512x512"
199
}
2010
],
2111
"start_url": ".",

0 commit comments

Comments
 (0)