Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

astro-content-devtools

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-content-devtools

Browse Astro Content Collections, schemas and entry files in your browser

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-14.29%
Maintainers
1
Weekly downloads
 
Created
Source

astro-content-devtools 🔬

Browse Astro Content Collections, schemas and entry files in your browser.

Entry data preview in astro-content-devtools Schema preview in astro-content-devtools

Features

Browsing Astro Content Collections entry files can sometimes be a bit cumbersome, especially when you have a lot of them spread across multiple collections. Same goes for collection schemas which are written in TypeScript using Zod and can be hard to read for non-developers.

The Astro Content Devtools are available through an Astro component using SolidJS that you can add to your project and that will provide you with a UI to browse your content collections, schemas and entry files in your browser.

  • 🎈 Floating UI togglable with a button in the corner of the screen to show and hide the devtools.
  • 💾 Current state stored in localStorage to remember the toggle state, selected collection and entry file across reloads and navigation.
  • 📄 Preview the content of a collection entry, including the frontmatter and the body.
  • 🗜️ Filterable list of collection entry files.
  • 📏 Responsive and resizable UI.

[!WARNING]
The Astro Content Devtools are not compatible with Astro data content collections.

[!WARNING]
Now that Astro 4.0 has a built-in Dev Toolbar, this package should be refactored to a Dev Toolbar App.

Installation

Install the Astro Content Devtools package and its peer dependencies using your favorite package manager, e.g. with pnpm:

pnpm add -D astro-content-devtools @astrojs/solid-js solid-js

Update your Astro configuration to apply the SolidJS integration:

  import { defineConfig } from 'astro/config'
+ import solid from '@astrojs/solid-js'

  export default defineConfig({
    // …
+   integrations: [solid()],
  })

Temporarily load the Astro Content Devtools component, e.g. in a layout to make it available on all pages, and pass it the collections object from your content collections configuration:

  ---
+ import { AstroContentDevtools } from 'astro-content-devtools'
+ import { collections } from '../content/config'

  // …
  ---

  <!DOCTYPE html>
  <html lang="en">
    <head>
      <!-- … -->
    </head>
    <body>
      <slot />
+     <AstroContentDevtools collections={collections} />
    </body>
  </html>

License

Licensed under the MIT License, Copyright © HiDeoo.

See LICENSE for more information.

Keywords

FAQs

Package last updated on 04 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc