{"id":14156338,"url":"https://github.com/cdklabs/jsii-srcmak","last_synced_at":"2026-05-11T21:02:35.109Z","repository":{"id":37051929,"uuid":"266835192","full_name":"cdklabs/jsii-srcmak","owner":"cdklabs","description":"Generate multi-language object-oriented source code from typescript","archived":false,"fork":false,"pushed_at":"2026-05-04T22:28:56.000Z","size":7256,"stargazers_count":22,"open_issues_count":1,"forks_count":10,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-05-05T00:24:37.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdklabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-25T17:04:26.000Z","updated_at":"2026-05-04T22:28:58.000Z","dependencies_parsed_at":"2024-01-02T01:38:42.911Z","dependency_job_id":"7e196382-c1b7-439a-af29-7e56719e89aa","html_url":"https://github.com/cdklabs/jsii-srcmak","commit_stats":{"total_commits":1347,"total_committers":16,"mean_commits":84.1875,"dds":0.5887156644394952,"last_synced_commit":"9dcd069ff2aecd73fcf3ac916fa60a14d7ff0a1f"},"previous_names":["aws/jsii-srcmak","eladb/jsii-srcmak"],"tags_count":1357,"template":false,"template_full_name":null,"purl":"pkg:github/cdklabs/jsii-srcmak","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fjsii-srcmak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fjsii-srcmak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fjsii-srcmak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fjsii-srcmak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdklabs","download_url":"https://codeload.github.com/cdklabs/jsii-srcmak/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdklabs%2Fjsii-srcmak/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32912661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-11T17:09:15.040Z","status":"ssl_error","status_checked_at":"2026-05-11T17:08:45.420Z","response_time":120,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-17T08:05:23.408Z","updated_at":"2026-05-11T21:02:35.071Z","avatar_url":"https://github.com/cdklabs.png","language":"TypeScript","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# jsii-srcmak\n\n\u003e Generates [jsii] source files for multiple languages from TypeScript.\n\n[jsii]: https://github.com/aws/jsii\n\n## Usage\n\nThis package can be either used as a library or through a CLI.\n\nThe library entry point is the `srcmak` function:\n\n```ts\nimport { srcmak } from 'jsii-srcmak';\nawait srcmak(srcdir[, options]);\n```\n\nThe CLI is `jsii-srcmak`:\n\n```bash\n$ jsii-srcmak srcdir [OPTIONS]\n```\n\nThe `srcdir` argument points to a directory tree that includes TypeScript files\nwhich will be translated through jsii to one of the supported languages.\n\n### Compile only\n\nIf called with no additional arguments, `srcmak` will only jsii-compile the source. If compilation fails, it will throw an error. This is a nice way to check if generated typescript code is jsii-compatible:\n\n```ts\nconst srcdir = generateSomeTypeScriptCode();\n\n// verify it is jsii-compatible (throws otherwise)\nawait srcmak(srcdir);\n```\n\nCLI:\n\n```bash\n$ jsii-srcmak /source/directory\n```\n\n### Python Output\n\nTo produce a Python module from your source, use the `python` option:\n\n```ts\nawait srcmak('srcdir', {\n  python: {\n    outdir: '/path/to/project/root',\n    moduleName: 'name.of.python.module'\n  }\n});\n```\n\nOr the `--python-*` switches in the CLI:\n\n```bash\n$ jsii-srcmak /src/dir --python-outdir=dir --python-module-name=module.name\n```\n\n* The `outdir`/`--python-outdir` option points to the root directory of your Python project.\n* The `moduleName`/`--python-module-name` option is the python module name. Dots (`.`) delimit submodules.\n\nThe output directory will include a python module that corresponds to the\noriginal module. This code depends on the following python modules:\n\n- [jsii](https://pypi.org/project/jsii/)\n\n### Java Output\n\nTo produce a Java module from your source, use the `java` option:\n\n```ts\nawait srcmak('srcdir', {\n  java: {\n    outdir: '/path/to/project/root',\n    package: 'hello.world'\n  }\n});\n```\n\nOr the `--java-*` switches in the CLI:\n\n```bash\n$ jsii-srcmak /src/dir --java-outdir=dir --java-package=hello.world\n```\n\n* The `outdir`/`--java-outdir` option points to the root directory of your Java project.\n* The `package`/`--java-package` option is the java package name.\n\nThe output directory will include a java module that corresponds to the\noriginal module. This code depends on the following maven package (should be defined directly or indirectly in the project's `pom.xml` file):\n\n- [jsii](https://mvnrepository.com/artifact/software.amazon.jsii)\n\nThe output directory will also include a tarball `generated@0.0.0.jsii.tgz` that must be bundled in your project.\n\n### C# Output\n\nTo produce a C# module from your source, use the `csharp` option:\n\n```ts\nawait srcmak('srcdir', {\n  csharp: {\n    outdir: '/path/to/project/root',\n    namespace: 'HelloWorld'\n  }\n});\n```\n\nOr the `--csharp-*` switches in the CLI:\n\n```bash\n$ jsii-srcmak /src/dir --csharp-outdir=dir --csharp-namespace=HelloWorld\n```\n\n* The `outdir`/`--csharp-outdir` option points to the root directory of your C# project.\n* The `package`/`--csharp-namespace` option is the C# root namespace.\n\nThe output directory will include a C# project that corresponds to the\noriginal module. This code depends on the following NuGet package (It is already defined as a dependency in the generated project):\n\n- [jsii](https://www.nuget.org/packages/Amazon.JSII.Runtime/)\n\nThe output directory will also include a tarball `generated@0.0.0.jsii.tgz` that must be bundled in your project (It is already included as an embedded resource in the generated project).\n\n### Go Output\n\nTo produce a Go module from your source, use the `golang` option:\n\n```ts\nawait srcmak('srcdir', {\n  golang: {\n    outdir: '/path/to/project/root',\n    moduleName: 'github.com/yourorg/your-root-project',\n    packageName: 'helloworld'\n  }\n});\n```\n\nOr the `--golang-*` switches in the CLI:\n\n```bash\n$ jsii-srcmak /src/dir --golang-outdir=dir --golang-module=\"github.com/yourorg/your-root-project\" --golang-package=\"helloworld\"\n```\n\n* The `outdir`/`--golang-outdir` option points to the root directory of your base Go project (where your `go.mod` is in, if you have one).\n* The `moduleName`/`--golang-module` option must match the Go module name of the project that includes the generated source code e.g. `github.com/yourorg/your-root-project`. This is currently required, because the generated code needs to reference a submodule which is generated in a nested directory (see also upstream issue https://github.com/aws/jsii/issues/2847 for more information).\n* The `packageName`/`--golang-package` is the package in which the generated Go code will be in. It will be placed in the submodule. So the import path becomes e.g. `github.com/yourorg/your-root-project/yourpackage`.\n\nThe output directory will include a directory named with the `packageName`/`--golang-package` containing the generated Go code.\nThis code depends on the following Go module:\n\n- [jsii-runtime-go](github.com/aws/jsii-runtime-go)\n\nwhich you need to include in your `go.mod`:\n```\nrequire github.com/aws/jsii-runtime-go v1.29.0 # update the version to match the jsii version used in your version of jsii-srcmak\n```\n\n\n#### Nested output directories\nIt is also possible to set the `outdir`/`--golang-outdir` option to a nested directory inside your Go project. For example, if you want to nest the generated code in a directory called `generated`.\nIn that case you need to append the subdirectory to the module name (e.g. `github.com/yourorg/your-root-project/generated`):\n\n```bash\n$ jsii-srcmak /src/dir --golang-outdir=~/projects/your-root-project/generated --golang-module=\"github.com/yourorg/your-root-project/generated\" --golang-package=\"helloworld\"\n```\nYour import path will then become e.g. `github.com/yourorg/your-root-project/generated/yourpackage`.\n\n### Entrypoint\n\nThe `entrypoint` option can be used to customize the name of the typescript entrypoint (default is `index.ts`).\n\nFor example, if the code's entry point is under `/srcdir/foobar/lib/index.ts` then I can specify:\n\n```ts\nawait srcmak('/srcdir', {\n  entrypoint: 'foobar/lib/index.ts'\n});\n```\n\nOr through the CLI:\n\n```bash\n$ jsii-srcmak /srcdir --entrypoint lib/main.ts\n```\n\n### Dependencies\n\nThe `deps` option can be used to specify a list of node module **directories** (must have a `package.json` file) which will be symlinked into the workspace when compiling your code.\n\nThis is required if your code references types from other modules.\n\nUse this idiom to resolve a set of modules directories from the calling process:\n\n```ts\nconst modules = [\n  '@types/node', // commonly needed\n  'foobar'       // a node module in *my* closure\n];\n\nconst getModuleDir = m =\u003e\n  path.dirname(require.resolve(`${m}/package.json`));\n\nawait srcmak('srcdir', {\n  deps: modules.map(getModuleDir)\n});\n```\n\nOr through the CLI:\n\n```bash\n$ jsii-srcmak /src/dir --dep node_modules/@types/node --dep node_modules/constructs\n```\n\n## Contributing\n\nTo build this project, you must first generate the `package.json`:\n\n```\nnpx projen\n```\n\nThen you can install your dependencies and build:\n\n```\nyarn install\nyarn build\n```\n\n## What's with this name?\n\nIt's a silly little pun that stems from another pun: jsii has `jsii-pacmak`\nwhich stands for \"package maker\". That's the tool that takes in a .jsii manifest\nand produces language-idiomatic *packages* from it. This tool produces *sources*\nfrom a .jsii manifest. Hence, \"source maker\". Yeah, it's lame.\n\n## License\n\nDistributed under the [Apache 2.0](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Fjsii-srcmak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdklabs%2Fjsii-srcmak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdklabs%2Fjsii-srcmak/lists"}