1.3.0 • Published 1 month ago

@storecraft/dashboard v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Storecraft Official Dashboard

The Official storecraft Dashboard šŸ†,

  • Leveraging static rendering / client side rendering / swr
  • Can be deployed into cost effective CDN
  • Also available at CDN like unpkg for consuming as a component.

Effectively, TWO Build Targets 1. A library with

  • Dashboard as react functional component
  • a mount function, that you can wrap for any framework of pure DOM.
  1. 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
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

Artifacts are in the dist folder

dist
ā”œā”€ā”€ /lib
ā”œā”€ā”€ā”€ā”¼ā”€ā”€ /src
│   │   ā”œā”€ā”€ index.js      // ES module
│   │   └── 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 is_backend_endpoint_editable={true} />
    </div>
  )
} 

Consuming via unpkg as UMD (smaller bundle)

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" sizes="any" type="image/svg+xml" href="/api/dashboard/favicon.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Storecraft - Next Gen Commerce-As-Code</title>
  </head>
  <body style="background-color: black">
    <div id="root"></div>
    <script 
      type="application/javascript"
      src="https://www.unpkg.com/@storecraft/dashboard@latest/dist/lib/src/index.umd.cjs">
    </script>

    <script>
      console.log({StorecraftDashboard});

      const show_configurable_endpoint = true;

      StorecraftDashboard.mountStorecraftDashboard(
        document.getElementById('root'), 
        show_configurable_endpoint
      );
    </script>
  </body>
</html>

Consuming via unpkg as ESM (bigger bundle)

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" sizes="any" type="image/svg+xml" href="/api/dashboard/favicon.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Storecraft - Next Gen Commerce-As-Code</title>
    <script type="module">
      import { mountStorecraftDashboard } from 'https://www.unpkg.com/@storecraft/dashboard@latest/dist/lib/src/index.js';

      const show_configurable_endpoint = true;

      mountStorecraftDashboard(
        document.getElementById('root'), 
        show_configurable_endpoint
      );
    </script>
  </head>
  <body style="background-color: black">
    <div id="root"></div>
  </body>
</html>
Author: Tomer Shalev
1.0.38

2 months ago

1.2.5

2 months ago

1.3.0

1 month ago

1.0.29

3 months ago

1.0.28

3 months ago

1.0.27

3 months ago

1.0.33

3 months ago

1.0.32

3 months ago

1.0.31

3 months ago

1.0.30

3 months ago

1.0.37

3 months ago

1.0.36

3 months ago

1.0.35

3 months ago

1.0.34

3 months ago

1.0.26

4 months ago

1.0.25

4 months ago

1.0.19

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

6 months ago

1.0.22

4 months ago

1.0.21

4 months ago

1.0.20

5 months ago

1.0.23

4 months ago

1.0.15

6 months ago

1.0.14

7 months ago

1.0.13

8 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

11 months ago

1.0.5

12 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago