Skip to content

Commit

Permalink
add some explanatory comments to the generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
dherman committed Apr 16, 2024
1 parent 970aff8 commit 8830100
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgs/create-neon/data/templates/ts/index.cts.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// This module is the CJS entry point for the library.

// The Rust addon.
import * as addon from './load.cjs';

// Use this declaration to assign types to the addon's exports,
// which otherwise by default are `any`.
declare module "./load.cjs" {
function hello(): string;
}
Expand Down
2 changes: 2 additions & 0 deletions pkgs/create-neon/data/templates/ts/index.mts.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// This module is the ESM entry point for the library.

export * from './index.cjs';
7 changes: 7 additions & 0 deletions pkgs/create-neon/data/templates/ts/load.cts.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This module loads the platform-specific build of the addon on
// the current system. The supported platforms are registered in
// the `platforms` object below, whose entries can be managed by
// by the Neon CLI:
//
// https://www.npmjs.com/package/@neon-rs/cli

module.exports = require('@neon-rs/load').proxy({
platforms: {},
debug: () => require('../index.node')
Expand Down

0 comments on commit 8830100

Please sign in to comment.