Registry / aws / jsii-pacmak

jsii-pacmak

JSON →
library1.128.0jsnpmunverified

jsii-pacmak is a critical component of the `jsii` project, an AWS-developed code generation framework. Its core function is to generate and build ready-to-publish, language-specific packages (e.g., for Java, Python, .NET, Go, C#) from a TypeScript-defined `jsii` module. This capability allows developers to author libraries once in TypeScript and then consume them consistently across multiple programming languages, facilitating polyglot development for cloud constructs, notably within the AWS Cloud Development Kit (CDK). The package is currently at version 1.128.0 and is part of an actively maintained ecosystem, characterized by frequent patch and minor releases, often on a weekly or bi-weekly cadence, as seen in its recent release history. Its primary differentiator is its robust ability to bridge TypeScript definitions to fully functional APIs in various target languages, ensuring a uniform developer experience across the polyglot landscape.

npm install jsii-pacmak
INSTALL
IMPORT
SIG · JSII-PACMAK
J
jsii-pacmak
awsjavascriptv1.128.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
import { main } from 'jsii-pacmak'; // or const { main } = require('jsii-pacmak');
While primarily a CLI tool, the 'main' function is the programmatic entry point for direct integration, accepting an array of arguments similar to process.argv.
cli
npx jsii-pacmak [options]
import { cli } from 'jsii-pacmak'
jsii-pacmak is most commonly invoked as a command-line interface tool via `npx` or directly from `node_modules/.bin/jsii-pacmak`. There is no 'cli' symbol to import.

This quickstart demonstrates how to set up a basic `jsii` project, define a simple TypeScript class, and then use `jsii-pacmak` to generate language-specific packages (Java and Python in this example) ready for publishing.

mkdir my-jsii-lib cd my-jsii-lib npm init -y npm install jsii npm install -D typescript @types/node cat > tsconfig.json <<EOF { "compilerOptions": { "alwaysStrict": true, "declaration": true, "experimentalDecorators": true, "lib": ["es2018"], "module": "commonjs", "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, "noPropertyAccessFromIndexSignature": true, "noUnusedLocals": true, "noUnusedParameters": true, "resolveJsonModule": true, "strict": true, "strictBindCallApply": true, "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, "target": "es2018", "outDir": "lib" }, "include": ["src/**/*.ts"] } EOF mkdir src cat > src/index.ts <<EOF export interface MyProps { readonly message: string; } export class Greeter { public readonly greeting: string; constructor(props: MyProps) { this.greeting = `Hello, ${props.message} from jsii!`; } public sayHello(): string { return this.greeting; } } EOF # Configure package.json for jsii targets node -e "const pkg = require('./package.json'); pkg.jsii = { 'outdir': 'dist', 'targets': { 'java': { 'package': 'com.myorg.mylib', 'maven': { 'groupId': 'com.myorg', 'artifactId': 'mylib' } }, 'python': { 'distName': 'my-jsii-lib', 'module': 'my_jsii_lib' } } }; require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));" npx jsii npx jsii-pacmak
jsii-pacmak --version
Debug
Known issues
breakingjsii-pacmak requires Node.js version 14.17.0 or newer. Running with older Node.js versions will result in an error or unexpected behavior.
fix
Upgrade your Node.js installation to version 14.17.0 or higher. Use a Node.js version manager like `nvm` to easily switch versions (`nvm install 18` then `nvm use 18`).
affects: <1.0.0
gotchaThe `jsii-rosetta` peer dependency must be installed and meet the specified version requirements (currently `>=5.9.0`). Failure to do so can lead to issues with documentation generation or type translation, even if `jsii-pacmak` itself runs.
fix
Ensure `jsii-rosetta` is installed in your project: `npm install jsii-rosetta` or `yarn add jsii-rosetta`. Check your `package.json` for compatible versions.
affects: >=1.0.0
breakingWhen targeting Go, `jsii-pacmak` previously added `GOSUMDB=off` to the Go target environment. This has been removed in v1.127.0, which might affect build environments relying on this behavior, particularly those behind firewalls or in air-gapped networks.
fix
If your Go builds now fail due to sumdb issues, you may need to explicitly set `GOSUMDB=off` or configure `GOPRIVATE` and `GONOPROXY` environment variables in your build pipeline when invoking Go tools.
affects: >=1.127.0
gotchaUsing older Maven versions or specific configurations can lead to 'dependency ranges make Maven download too many files' issues, causing slow builds or network strain. This was addressed in v1.122.0 and v1.123.0 for `jsii-pacmak` and `java-runtime` respectively.
fix
Ensure you are using `jsii-pacmak` version 1.123.0 or newer. If issues persist, verify your Maven settings and consider adjusting dependency resolution strategies or using fixed versions where possible.
affects: <1.123.0
Errors
Common errors & fixes
Error: Node.js version 12.x.y is not supported. Please use >= 14.17.0.
Attempting to run `jsii-pacmak` with an unsupported Node.js version.
fix
Upgrade your Node.js environment to version 14.17.0 or newer using `nvm install 18 && nvm use 18` or similar tools.
`jsii-pacmak` command not found
The `jsii-pacmak` executable is not in your system's PATH or `npx` cannot locate it.
fix
Ensure `jsii-pacmak` is installed (`npm install jsii-pacmak`) and either run it with `npx jsii-pacmak` from your project root or add `$(npm bin)` to your PATH.
Peer dependency 'jsii-rosetta' is missing or incompatible.
The `jsii-rosetta` package, a required peer dependency, is not installed or its version does not satisfy `jsii-pacmak`'s requirements.
fix
Install the correct version of `jsii-rosetta`: `npm install jsii-rosetta@^5.9.0` (adjust version as needed per `jsii-pacmak`'s `package.json`).
error TS2307: Cannot find module 'my-jsii-lib' or its corresponding type declarations.
The TypeScript compilation of your jsii module failed because required modules are not found or paths are incorrect.
fix
Verify your `tsconfig.json` paths, `include` array, and ensure all dependencies are installed. Run `npx jsii` separately to compile the TypeScript code before running `jsii-pacmak`.
Upgrade
Version history
1.128.0latest on npm
Audit
Dependencies
jsii-rosettarequiredRequired for generating documentation and translating TypeScript to other languages.
Agent activity
15 hits · last 30 days
node
14
Resources