gatsby-admin

A visual interface to configure your Gatsby site.

This package will no longer receive updates.
Last updated 4 years ago by pieh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install gatsby-admin 
SYNC missed versions from official npm registry.

Gatsby Admin

A visual interface to configure your Gatsby site.

Architecture

The Gatsby Admin interface (this package) is a standard Gatsby site.

It uses theme-ui (with the strict-ui experimantal extension) and gatsby-interface for styling.

It fetches its data from the gatsby-recipes GraphQL server, which exposes all the information Admin needs about the locally running Gatsby site, using urql.

It also listens to the gatsby develop status server, which exposes information about whether you changed the config files and need to restart the develop process.

Service Discovery

gatsby develop automatically starts both the GraphQL and status server. However, both of these use random ports.

To discover where they are (and whether they are already running) there is a service discovery mechanism in gatsby-core-utils. It stores the ports of the running Gatsby site(s) at ~/.config/gatsby/sites/<pathhash>/<servername>.json.

Admin can then fetch localhost:8000/___services (where :8000 is the well-known port of the running site), which returns a list of all the random ports used by the site:

$ curl http://localhost:8000/___services | jq
{
  "developproxy": {
    "port": 8000
  },
  "developstatusserver": {
    "port": 60731
  },
  "recipesgraphqlserver": {
    "port": 50400
  }
}

That's how the Admin frontend knows to connect to localhost:50400/graphql to connect to the GraphQL server, and localhost:60731 to connect to the develop status server.

Production Deployment

To avoid clashing with the local site and potential issues with shadowing, gatsby develop statically serves the built files from the develop parent proxy.

To avoid issues with yarn, lerna, and circular dependencies, gatsby-admin copies its built files to gatsby/gatsby-admin-public which is then published to npm. While not an ideal solution, it fixes the issue and works relatively reliably.

Development

Running it locally

The easiest way to work on Admin locally is to develop Admin itself.

  1. Make sure to have the dependencies installed by running yarn in the root folder
  2. Start the develop process for the Admin site by running yarn workspace gatsby-admin run develop

If you see eslint errors you'll need to temporarily replace all references to ___loader with window.___loader in packages/gatsby-link/index.js.

Running it on a local site

To try Admin with one of your sites locally, use the gatsby-dev-cli to copy the local versions of gatsby, gatsby-cli, gatsby-recipes, gatsby-core-utils and gatsby-admin into your project:

# Make sure to build the latest local versions of all packages
~/gatsby
yarn run watch

~/my-gatsby-site
$ gatsby-dev --packages gatsby gatsby-cli gatsby-recipes gatsby-core-utils gatsby-admin

# In another tab, start your site with the Admin feature flag set
~/my-gatsby-site
$ GATSBY_EXPERIMENTAL_ENABLE_ADMIN=true gatsby develop

Then visit localhost:8000/\_\_\_admin and you should see Gatsby Admin for your site!

Current Tags

  • 0.16.0-abhi-pqr.380                                ...           abhi-pqr (3 years ago)
  • 0.1.66-admin-pkg.4                                ...           admin-pkg (4 years ago)
  • 1.0.0-alpha-9689ff.13                                ...           alpha-9689ff (3 years ago)
  • 0.12.0-alpha-agents-are-cool.0                                ...           alpha-agents-are-cool (4 years ago)
  • 0.13.0-alpha-defer-task-queues.14                                ...           alpha-defer-task-queues (4 years ago)
  • 0.11.0-alpha-hmr-fix.16                                ...           alpha-hmr-fix (4 years ago)
  • 0.12.0-alpha-inc-build-diag.1                                ...           alpha-inc-build-diag (4 years ago)
  • 0.16.0-alpha-lmdb.32                                ...           alpha-lmdb (3 years ago)
  • 0.18.0-alpha-log-state-slice-size.37                                ...           alpha-log-state-slice-size (3 years ago)
  • 0.20.0-alpha-node-manifest-windows-escape.30                                ...           alpha-node-manifest-windows-escape (3 years ago)
  • 1.0.0-alpha-page-gen.34                                ...           alpha-page-gen (3 years ago)
  • 0.14.0-alpha-parallel.53                                ...           alpha-parallel (4 years ago)
  • 0.16.0-alpha-parallel-query.75                                ...           alpha-parallel-query (3 years ago)
  • 0.19.0-alpha-pqr-bootstrap.29                                ...           alpha-pqr-bootstrap (3 years ago)
  • 0.19.0-alpha-pqr-debug.31                                ...           alpha-pqr-debug (3 years ago)
  • 0.21.0-alpha-pqr-waitjobs.4                                ...           alpha-pqr-waitjobs (3 years ago)
  • 0.21.0-alpha-pr32545.3                                ...           alpha-pr32545 (3 years ago)
  • 0.24.0-alpha-qe-sm.5                                ...           alpha-qe-sm (3 years ago)
  • 0.24.0-alpha-remote-fetch.79                                ...           alpha-remote-fetch (3 years ago)
  • 0.13.0-alpha-sharp-upgrade.15                                ...           alpha-sharp-upgrade (4 years ago)
  • 0.12.0-alpha-skip-page-data-write.17                                ...           alpha-skip-page-data-write (4 years ago)
  • 0.20.0-alpha-ssrr.36                                ...           alpha-ssr (3 years ago)
  • 0.14.0-alpha-webpack-fs-cache.33                                ...           alpha-webpack-fs-cache (4 years ago)
  • 0.1.93-autotruncate-long-paths.31                                ...           autotruncate-long-paths (4 years ago)
  • 0.9.0-blazing-fast.4                                ...           blazing-fast (4 years ago)
  • 0.10.0-cpb3.20                                ...           cbp3 (4 years ago)
  • 0.16.0-alpha-concurrent-features.0                                ...           concurrent-features (4 years ago)
  • 0.1.77-corejs3.34                                ...           corejs3 (4 years ago)
  • 0.22.0-coreutils.29                                ...           coreutils (3 years ago)
  • 0.5.0-create-gatsby.2                                ...           create-gatsby (4 years ago)
  • 0.23.0-debug-cache.7                                ...           debug-cache (3 years ago)
  • 0.1.143-debug-missing-sq.42                                ...           debug-missing-sq (4 years ago)
  • 0.5.0-dev-preload.24                                ...           dev-preload (4 years ago)
  • 0.5.0-dev-preload-and-chunk.25                                ...           dev-preload-and-chunk (4 years ago)
  • 0.1.139-dev-ssr-2.55                                ...           dev-ssr-2 (4 years ago)
  • 0.1.139-develop-ssr.9                                ...           develop-ssr (4 years ago)
  • 0.1.57-distributed-html.12                                ...           distributed-html (4 years ago)
  • 0.24.0-drupal-next.81                                ...           drupal-next (3 years ago)
  • 0.1.80-finish-plugin-activities.6                                ...           finish-plugin-activities (4 years ago)
  • 0.1.174-fix-white-preview.10                                ...           fix-white-preview (4 years ago)
  • 0.1.125-fix-wrong-success-set-status.1                                ...           fix-wrong-success-set-status (4 years ago)
  • 0.4.0-functions.13                                ...           functions (4 years ago)
  • 0.14.0-functions-next.16                                ...           functions-next (4 years ago)
  • 0.3.0-image-helpers.13                                ...           image-helpers (4 years ago)
  • 0.1.137-incbuild-collections.11                                ...           incbuild-collections (4 years ago)
  • 0.7.0-incbuilds-special.22                                ...           incbuilds-special (4 years ago)
  • 0.1.174-ink-compiled.12                                ...           ink-compiled (4 years ago)
  • 0.1.105-ink3.23                                ...           ink3 (4 years ago)
  • 0.1.77-ipc-develop.23                                ...           ipc-develop (4 years ago)
  • 0.1.141-jsx-transform.5                                ...           jsx-transform (4 years ago)
  • 0.24.4                                ...           latest (3 years ago)
  • 0.5.0-latest-dev-ssr.31                                ...           latest-dev-ssr (4 years ago)
  • 0.8.13                                ...           latest-v2 (4 years ago)
  • 0.25.0                                ...           latest-v3 (2 years ago)
  • 0.1.125-log-pending-activities.0                                ...           log-pending-activities (4 years ago)
  • 1.0.0-zz-next.1                                ...           next (3 years ago)
  • 0.15.0-alpha-node-manifest.73                                ...           node-manifest (3 years ago)
  • 0.23.0-alpha-node-manifests.26                                ...           node-manifests (3 years ago)
  • 0.1.86-oom-exit-code.13                                ...           oom-exit-code (4 years ago)
  • 1.0.0-alpha-page-gen.32                                ...           page-gen (3 years ago)
  • 0.1.92-pending-webpack-develop.35                                ...           pending-webpack-develop (4 years ago)
  • 0.8.5-pin-babel-7-12.3                                ...           pin-babel-7-12 (4 years ago)
  • 0.1.57-polyfills.11                                ...           polyfills (4 years ago)
  • 0.24.0-preview-resiliancy.11                                ...           preview-resiliancy (3 years ago)
  • 0.1.158-qod.21                                ...           qod (4 years ago)
  • 0.7.0-query-chunk-stats.74                                ...           query-chunk-stats (4 years ago)
  • 0.7.0-query-chunk-stats-base.70                                ...           query-chunk-stats-base (4 years ago)
  • 0.1.144-query-modules-debug-missing-sq.30                                ...           query-modules-debug-missing-sq (4 years ago)
  • 0.1.166-query-modules-debug-missing-sq.23                                ...           query-webpack-modules (4 years ago)
  • 0.10.0-alpha-reach-router.14                                ...           reach-router (4 years ago)
  • 0.1.54-recipes-renderer.75                                ...           recipes-renderer (4 years ago)
  • 0.8.4-runtime-tick.2                                ...           runtime-tick (4 years ago)
  • 0.1.147-socket-resend.5                                ...           socket-resend (4 years ago)
  • 0.1.151-stale-page-data.8                                ...           stale-page-data (4 years ago)
  • 0.1.153-static-image.135                                ...           static-image (4 years ago)
  • 0.1.93-static-queries-out-of-webpack.32                                ...           static-queries-out-of-webpack (4 years ago)
  • 0.1.102-static-query-fix.7                                ...           static-query-fix (4 years ago)
  • 0.1.87-static-query-template.8                                ...           static-query-template (4 years ago)
  • 0.1.69-structured-logs-websocket.564                                ...           structured-logs-websocket (4 years ago)
  • 0.1.137-stuck-diagnostics.39                                ...           stuck-diagnostics (4 years ago)
  • 0.15.0-telemetry-test.252                                ...           telemetry-test (3 years ago)
  • 0.3.0-telemetry-test2.327                                ...           telemetry-test2 (4 years ago)
  • 0.1.153-telemetry-testt.454                                ...           telemetry-testt (4 years ago)
  • 0.1.92-tracing-graphql-debug.16                                ...           tracing-graphql-debug (4 years ago)
  • 0.1.162-unifiedroutes.22                                ...           unifiedroutes (4 years ago)
  • 0.1.124-unifiedroutes-v2.16500                                ...           unifiedroutes-v2 (4 years ago)
  • 0.10.0-v3rc.5                                ...           v3rc (4 years ago)
  • 0.1.134-virtual-modules-in-dot-cache.5                                ...           virtual-modules-in-dot-cache (4 years ago)
  • 0.14.0-webpack-split-fix.8                                ...           webpack-split-fix (4 years ago)
  • 0.8.0-alpha-webpack5.17                                ...           webpack5 (4 years ago)
  • 0.12.0-alpha-wordpress.29                                ...           wordpress (4 years ago)

684 Versions

Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (29)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE