|
|
3 năm trước cách đây | |
|---|---|---|
| .. | ||
| public | 4 năm trước cách đây | |
| src | 4 năm trước cách đây | |
| .env | 4 năm trước cách đây | |
| README.md | 4 năm trước cách đây | |
| package.json | 4 năm trước cách đây | |
| tsconfig.json | 4 năm trước cách đây | |
This app demonstrates how to import the Hue web components from within a React project to create a SQL Scratchpad.
It's based on a clean create-react-app project, relevant changes are:
The components are wrapped to set certain attributes/properties on elements that are required by the web components.
There are two ways to import the SQL Scratchpad:
cd tools/examples/components/sql-scratchpadnpm installnpm startIn the SQL Scratchpad project change the "gethue" dependency in package.json to
"gethue": "file:../../../../npm_dist",
Go to the Hue root folder cd ../../../../
npm install
npm run dev-webpack-npm
Go to the example project cd tools/examples/components/sql-scratchpad
npm install
npm start
It will monitor changes of the related Hue sources and update npm_dist when needed, if the SQL Scratchpad project doesn't pick up the changes a restart of the app might be needed.
npx create-react-app sql-scratchpad --template typescript"gethue": "file:../../../../npm_dist" to dependencies in package.jsonSKIP_PREFLIGHT_CHECK=true to .env (required when using local Hue package)