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

@xrmforge/devkit

v0.10.2

Published

Build orchestration and project tooling for Dynamics 365 WebResources

Readme

@xrmforge/devkit

npm version license

Build orchestration and project scaffolding for Dynamics 365 Web Resources. Wraps esbuild to produce IIFE bundles with named globals (the format D365 needs for form event binding) from a declarative config -- no esbuild.config.js, no build.mjs.

Part of XrmForge. This package powers xrmforge build and xrmforge init. Most users drive it through @xrmforge/cli; install it directly only to embed builds or scaffolding in your own tooling.


Installation

npm install --save-dev @xrmforge/devkit

Requirements: Node.js 20 or higher. Bundles esbuild as a dependency.


Declarative build config

Builds are driven by the build section of xrmforge.config.json. Each entry becomes one IIFE Web Resource exposed under a global namespace.

{
  "build": {
    "outDir": "./dist/contoso_/JS",   // default: ./dist
    "target": "es2020",                // default: es2020
    "sourcemap": true,                 // default: true
    "minify": true,                    // default: false
    "entries": {
      "account_form": {
        "input": "./src/forms/account-form.ts",  // required
        "namespace": "Contoso.AccountForm",        // required: D365 global for event binding
        "out": "Account/OnLoad.js"                 // optional: defaults to <entry-key>.js
      }
    }
  }
}

| Field | Required | Default | Notes | |-------|----------|---------|-------| | entries | yes | -- | Map of entry name to { input, namespace, out? }. Must be non-empty. | | entries.*.input | yes | -- | Path to the TypeScript source file. | | entries.*.namespace | yes | -- | Global namespace (e.g. Contoso.Account) D365 calls handlers through. | | entries.*.out | no | <key>.js | Output filename relative to outDir. | | outDir | no | ./dist | Output directory for bundles. | | target | no | es2020 | JavaScript target version. | | sourcemap | no | true | Emit source maps. | | minify | no | false | Minify output. | | bundler | no | esbuild | Currently only esbuild. | | external | no | [] | Modules to exclude from the bundle. |


Via the CLI (recommended)

xrmforge build              # build all entries (parallel)
xrmforge build --watch      # watch mode, ~10ms incremental rebuilds
xrmforge build --minify
xrmforge build --no-sourcemap

See @xrmforge/cli.


Programmatic API

import {
  build,
  watch,
  validateBuildConfig,
  resolveBuildConfig,
  scaffoldProject,
  BuildError,
  BuildErrorCode,
} from '@xrmforge/devkit';

// Validate + resolve a raw config (throws BuildError with CONFIG_INVALID on bad input)
const config = resolveBuildConfig(validateBuildConfig(rawConfigFromJson));

// One-shot build -> BuildResult (per-entry output paths, sizes, timings)
const result = await build(config);

// Watch mode for incremental rebuilds; returns a disposer to stop watching
const { dispose } = await watch(config, { onRebuild: (r) => console.log('rebuilt', r) });
// ... later:
await dispose();

// Scaffold a new project (the engine behind `xrmforge init`)
await scaffoldProject(/* ScaffoldConfig */);

| Export | Purpose | |--------|---------| | build(config, cwd?) | Run all entries once. Returns BuildResult. | | watch(config, options?) | Start watch mode (onRebuild callback). Returns { dispose } to stop. | | validateBuildConfig(raw) | Validate an untyped config; throws BuildError on failure. | | resolveBuildConfig(config) | Apply defaults, returning a ResolvedBuildConfig. | | scaffoldProject(config) | Generate a new project structure (xrmforge init). | | BuildError, BuildErrorCode | Structured build errors. |

Exported types: BuildConfig, BuildEntry, ResolvedBuildConfig, BuildResult, BuildResultEntry, ScaffoldConfig, ScaffoldResult.


Why IIFE?

D365 loads Web Resources via <script> tags and calls handlers by name (e.g. Contoso.AccountForm.onLoad). The IIFE format wraps your module and exposes its exports under the configured global namespace, so the form event system can reach them.

Documentation

Full guide -- building, shared libraries, deployment: XrmForge on GitHub.

License

MIT (c) XrmForge Contributors.