@storecraft/dashboard
v1.0.13
Published
Storecraft Official Dashboard
Downloads
105
Maintainers
Readme
Storecraft Official Dashboard
The Official storecraft
Dashboard 🏆,
- Leveraging
static rendering
/client side rendering
/swr
- Can be deployed into cost effective CDN
- Also available at
jsDelivr
CDN
Effectively, TWO Build Targets
- A
library
with
- Dashboard as
react
functional component - a
mount
function, that you can wrap for any framework of pure DOM.
- A website, with configurable backend endpoint.
Build is handled by Vite
npm i @storecraft/dashboard
Development
First, run the development server:
npm run dashboard:dev
# or
yarn dashboard:dev
# or
npm start
Open http://localhost:3000 with your browser to see the result.
Build / Export
Simply, run any of the following command
npm run dashboard:build
# or
yarn dashboard:build
Artifacts are in the dist
folder
dist
├── lib
│ ├── index.js // ES module
│ ├── index.cjs // common js
│ └── index.umd.cjs // UMD
├── website
│ ├── index.html
│ └── assets
Consuming via React
First,
npm i @storecraft/dashboard
Then,
import { Dashboard } from '@storecraft/dashboard'
export const Root = () => {
return (
<div className='w-screen h-screen'>
<Dashboard />
</div>
)
}
Consuming via jsDelivr
<script id='_storecraft_script_' type="module">
import { mountStorecraftDashboard } from 'https://cdn.jsdelivr.net/npm/@storecraft/dashboard@latest/dist/lib/index.min.js';
mountStorecraftDashboard(
document.getElementById('root'), false
);
</script>
Author: Tomer Shalev