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

@abapify/adt-codegen

v0.3.6

Published

Code generation toolkit for SAP ADT APIs

Readme

@abapify/adt-codegen

version

Hook-based code generation toolkit for SAP ADT APIs.

Overview

The adt-codegen framework uses a hook-based architecture inspired by unplugin.

Key Concepts

1. Plugins Declare Hooks

export const myPlugin = definePlugin({
  name: 'my-plugin',

  hooks: {
    workspace(ws) {
      // Called for each workspace
    },

    collection(coll) {
      // Called for each collection
    },

    finalize(ctx) {
      // Called once at the end
    },
  },
});

2. Framework Orchestrates

The framework:

  • Checks which hooks are registered
  • Only iterates if hooks exist
  • Calls hooks in order: discoveryworkspacecollectiontemplateLinkfinalize

3. Simple Configuration

export default {
  discovery: {
    path: './discovery.xml',
  },
  output: {
    baseDir: './generated',
  },
  plugins: [
    workspaceSplitterPlugin,
    extractCollectionsPlugin,
    generateTypesPlugin,
  ],
};

Available Hooks

| Hook | Called | Context | | -------------- | ----------------- | ---------------------------------- | | discovery | Once at start | Parsed discovery XML | | workspace | Per workspace | Workspace data + helpers | | collection | Per collection | Collection data + parent workspace | | templateLink | Per template link | Link data + parent collection | | finalize | Once at end | All workspaces + global data |

Context Objects

WorkspaceContext

{
  title: string;
  folderName: string;
  dir: string;
  xml: any;
  data: Record<string, any>;  // Shared between plugins
  artifacts: Artifact[];       // Files to write
  logger: Logger;
  writeFile(name, content): Promise<void>;
}

CollectionContext

{
  href: string;
  title: string;
  accepts: string[];
  category: { term: string; scheme: string };
  templateLinks: TemplateLink[];
  workspace: WorkspaceContext;  // Parent
  data: Record<string, any>;
  logger: Logger;
}

Built-in Plugins

1. workspace-splitter

Writes workspace.xml for each workspace.

Hook: workspace

2. extract-collections

Extracts collection metadata and writes collections.json.

Hooks: workspace, collection, finalize

3. generate-types

Generates TypeScript types from collections.

Hook: collection, finalize

Example Output

generated/workspaces/
├── abap-cross-trace/
│   ├── workspace.xml           # From workspace-splitter
│   ├── collections.json        # From extract-collections
│   ├── traces.types.ts         # From generate-types
│   ├── activations.types.ts
│   └── components.types.ts
├── dictionary/
│   ├── workspace.xml
│   ├── collections.json
│   └── *.types.ts
└── ...

Creating Custom Plugins

import { definePlugin } from '@abapify/adt-codegen';

export const myCustomPlugin = definePlugin({
  name: 'my-custom-plugin',

  hooks: {
    collection(coll) {
      // Access parent workspace
      const ws = coll.workspace;

      // Store data for other plugins
      ws.data.myData = { ... };

      // Add artifacts to write
      ws.artifacts.push({
        file: 'my-file.ts',
        content: '...'
      });

      // Log progress
      coll.logger.info('Processing collection');
    }
  }
});

Benefits

Simple config - Just list plugins
Automatic orchestration - Framework handles iteration
Composable - Plugins share data via context
Efficient - Only iterates if hooks exist
Type-safe - Full TypeScript support
Extensible - Easy to add new plugins

Usage

# Run codegen
npx tsx src/cli.ts ./adt-codegen.config.ts

# Or programmatically
import { CodegenFramework } from '@abapify/adt-codegen';
import config from './adt-codegen.config';

const framework = new CodegenFramework(config);
await framework.run();

Next Steps

Potential new plugins:

  • generate-openapi - Convert to OpenAPI specs
  • generate-client - Generate TypeScript client
  • validate-endpoints - Validate against live SAP system
  • generate-docs - Generate documentation