npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@emahuni/directus.distilled-app-internals

v2.1.0-app-13.11.2

Published

Distilled Directus App Internals. Selection of Composables, __utils__ and utils from Directus app for use in extensions and other code that works in Directus App Studio. The version of this package uses semver with an additional '-app-n.n.n' to denote the

Readme

@emahuni/directus.distilled-app-internals

A collection of composables and utility functions distilling core parts of the Directus App. This package exposes composables and utils from the Directus App source for use in Directus extensions and other integrations within Directus App Studio. The version of this package uses semver with an additional '-app-n.n.n' to denote the version of the distilled Directus App package that it directly correlates to.

Why

The Directus App internally uses a set of composables and utilities that power its components and various functionalities. However, these valuable resources are not exposed to the extensions ecosystem. This package digs into the source and exposes these internal composables and utilities so you can leverage the well-written Directus codebase to build your own extensions. As Directus matures, this package will be updated to reflect those changes.

Installation

Make sure you are using pnpm as your package manager:

pnpm add @emahuni/directus.distilled-app-internals

Usage

This package exports different modules that can be imported into your project using barrel files:

import { composable, utility, CONSTANT, specialUtility } from '@emahuni/directus.distilled-app-internals'

Importing Composables

If you prefer to be specific, i.e., not execute any non-composable in the process:

import { composable } from '@emahuni/directus.distilled-app-internals/composables'
// eg: import { useTemplateData } from '@emahuni/directus.distilled-app-internals/composables'

If you prefer to be even more specific, i.e., not execute any other composable code except what you really need (recommended):

import { composable } from '@emahuni/directus.distilled-app-internals/composables/composable'
// eg: import { useTemplateData } from '@emahuni/directus.distilled-app-internals/composables/use-template-data'
Exposed Composables Docs

Effort was made to document composables

Importing Constants

If you prefer to be specific, i.e., not execute anything else except the constants file in the process:

import { CONSTANT } from '@emahuni/directus.distilled-app-internals/constants'
// eg: import { FIELD_TYPES_SELECT } from '@emahuni/directus.distilled-app-internals/constants'
Exposed Constants Docs

Effort was made to document constants

Importing Utils

If you prefer to be specific, i.e., not execute any non-utility in the process:

import { utility } from '@emahuni/directus.distilled-app-internals/utils'
// eg: import { renderStringTemplate } from '@emahuni/directus.distilled-app-internals/utils'

If you prefer to be even more specific, i.e., not execute any other composable code except what you really need (recommended):

import { utility } from '@emahuni/directus.distilled-app-internals/utils'
// eg: import { renderStringTemplate } from '@emahuni/directus.distilled-app-internals/utils/render-string-template'
Exposed Utils Docs

Effort was made to document utils

Importing utils

If you prefer to be specific, i.e., not execute any non-special-utility in the process:

import { specialUtility } from '@emahuni/directus.distilled-app-internals/__utils__'
// eg: import { Focus } from '@emahuni/directus.distilled-app-internals/__utils__'

If you prefer to be even more specific, i.e., not execute any other special util code except what you really need (recommended):

import { specialUtility } from '@emahuni/directus.distilled-app-internals/__utils__/special-utility';
// eg: import { Focus } from '@emahuni/directus.distilled-app-internals/__utils__/focus'
Exposed _utils_ Docs

Effort was made to document __utils__

Build Issues

When building your extension that imports this library, you will sometimes get these errors (especially when building bundles, have not confirmed on other extension types):

"https" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/adapters/http.js", but could not be resolved – treating it as an external dependency.
"stream" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/helpers/formDataToStream.js", but could not be resolved – treating it as an external dependency.
"stream" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/adapters/http.js", but could not be resolved – treating it as an external dependency.
"stream" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/helpers/AxiosTransformStream.js", but could not be resolved – treating it as an external dependency.
"stream" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js", but could not be resolved – treating it as an external dependency.
"http" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/adapters/http.js", but could not be resolved – treating it as an external dependency.
"zlib" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/adapters/http.js", but could not be resolved – treating it as an external dependency.
"crypto" is imported by "../../../../../packages/libraries/directus.distilled-app-internals/node_modules/.pnpm/[email protected]/node_modules/axios/lib/platform/node/index.js", but could not be resolved – treating it as an external dependency.
⠋ Building Directus extension..."http" is imported by "http?commonjs-external", but could not be resolved – treating it as an external dependency.
"stream" is imported by "stream?commonjs-external", but could not be resolved – treating it as an external dependency.
"https" is imported by "https?commonjs-external", but could not be resolved – treating it as an external dependency.
✔ Done

The build will work, and the extension itself will work. However, the problem is when in development mode with a watch. It will hang on the second build after a watch trigger. This is happening because of the mixture of node and browser code... and the other is not compatible with node code. Especially when the code is importing something that imports @directus/composables.

Firstly, try to import the specific module you are trying to use, e.g.: Instead of import { useItem } from '@emahuni/directus.distilled-app-internals' do import { useItem } from '@emahuni/directus.distilled-app-internals/composable/use-item'. Note that this is an actual culprit that is doing this that you can test this with.

Then if that fails, use an extension.config.js file:

  1. Install rollup-plugin-node-polyfills: pnpm add -D rollup-plugin-node-polyfills
  2. Create the extension.config.js file in the root of your extension.
  3. Paste the following code in it:
import nodePolyfills from 'rollup-plugin-node-polyfills';

export default {
    plugins: [
        nodePolyfills()
    ],
};

I will update when I find a way around this.

Development

WIP or Not Doing

  • Removing more composables and utils that may actually be of no use in the extensions ecosystem.
  • Use more aggressive terser configuration to reduce dist size.
  • Certain composables and utils have been intentionally left out as they are App Studio specific and do not benefit the extension ecosystem.
  • A few composables and utils were exposed but with issues that I patched:
    • use-local-storage: This composable currently prevents the build process because of type issues, I have modified it by adding explicit type information.

Scripts

The package includes several scripts to help with building and development:

  • Build: Clean the distribution folder and build the package.

    pnpm run build
  • Development Watch: Clean the distribution folder and watch for changes.

    pnpm run dev
  • Sync Clone: Pulls the latest version of the Directus App from the source based on this packages version (* now broken needs fixing).

    pnpm run sync-clone

Build Process

The build process uses Vite and Rollup. The commands clean the dist folder using rimraf before building the bundle. Ensure you have all necessary dependencies installed via pnpm.

Contributing

Contributions are welcome! Please open an issue or submit a pull request with your improvements.

License

MIT

Author

Emmanuel Mahuni - GitHub | Email