{"id":14155130,"url":"https://github.com/HsiehShuJeng/projen-simple","last_synced_at":"2025-08-06T00:33:20.412Z","repository":{"id":37021576,"uuid":"367537914","full_name":"HsiehShuJeng/projen-simple","owner":"HsiehShuJeng","description":"An initial project for projen. It crafts a custom construct by Typescript then publishes the construct into 4 popular programming language repositories, i.e., npm, PyPI, Central Maven, and NuGet. ","archived":false,"fork":false,"pushed_at":"2024-04-13T00:58:41.000Z","size":3976,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-14T10:47:42.807Z","etag":null,"topics":["aws-apigateway","aws-cdk","aws-cdk-construct","aws-step-functions","csharp","java","jsii","maven","npm","nuget","projen","pypi","python","typescript"],"latest_commit_sha":null,"homepage":"","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/HsiehShuJeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-05-15T04:21:00.000Z","updated_at":"2024-08-01T02:20:16.457Z","dependencies_parsed_at":"2024-01-15T02:50:20.987Z","dependency_job_id":"b19bd14a-d9f9-414d-9d1f-a656dfcc7dc0","html_url":"https://github.com/HsiehShuJeng/projen-simple","commit_stats":{"total_commits":190,"total_committers":4,"mean_commits":47.5,"dds":0.09999999999999998,"last_synced_commit":"4115ffbb6855c651161a01015046529be868023f"},"previous_names":[],"tags_count":539,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HsiehShuJeng%2Fprojen-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HsiehShuJeng%2Fprojen-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HsiehShuJeng%2Fprojen-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HsiehShuJeng%2Fprojen-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HsiehShuJeng","download_url":"https://codeload.github.com/HsiehShuJeng/projen-simple/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215402929,"owners_count":15874020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aws-apigateway","aws-cdk","aws-cdk-construct","aws-step-functions","csharp","java","jsii","maven","npm","nuget","projen","pypi","python","typescript"],"created_at":"2024-08-17T08:02:11.455Z","updated_at":"2024-08-17T08:04:41.092Z","avatar_url":"https://github.com/HsiehShuJeng.png","language":"TypeScript","funding_links":[],"categories":["typescript"],"sub_categories":[],"readme":"# projen-simple  \n[![License](https://img.shields.io/badge/License-Apache%202.0-green)](https://opensource.org/licenses/Apache-2.0) ![Release](https://github.com/HsiehShuJeng/projen-simple/workflows/Release/badge.svg) [![npm downloads](https://img.shields.io/npm/dt/projen-statemachine-example?label=npm%20downloads\u0026style=plastic)](https://img.shields.io/npm/dt/projen-statemachine-example?label=npm%20downloads\u0026style=plastic) [![pypi downloads](https://img.shields.io/pypi/dm/scotthsieh-projen-statemachine?label=pypi%20downloads\u0026style=plastic)](https://img.shields.io/pypi/dm/scotthsieh-projen-statemachine?label=pypi%20downloads\u0026style=plastic) [![NuGet downloads](https://img.shields.io/nuget/dt/Projen.Statemachine?label=NuGet%20downloads\u0026style=plastic)](https://img.shields.io/nuget/dt/Projen.Statemachine?label=NuGet%20downloads\u0026style=plastic) [![repo languages](https://img.shields.io/github/languages/count/HsiehShuJeng/projen-simple?label=repo%20languages\u0026style=plastic)](https://img.shields.io/github/languages/count/HsiehShuJeng/projen-simple?label=repo%20languages\u0026style=plastic)  \n\n| npm (JS/TS) | PyPI (Python) | Maven (Java) | Go | NuGet |\n| --- | --- | --- | --- | --- |\n| [Link](https://www.npmjs.com/package/projen-simple) | [Link](https://pypi.org/project/scotthsieh_projen_statemachine/) | [Link](https://search.maven.org/artifact/io.github.hsiehshujeng/projen-statemachine) | [Link](https://github.com/HsiehShuJeng/projen-statemachine-go) | [Link](https://www.nuget.org/packages/Projen.Statemachine/) |  \n\nBuild a custom construct based on an example in an AWS Blog post and use [projen](https://github.com/projen/projen) to publish to 5 language repositories, i.e., npm, PyPI, Central Maven, NuGet, and Go.  \n\n# Architecture  \nThis library constrcution is referred to the first example in this AWS blog, [*Introducing Amazon API Gateway service integration for AWS Step Functions*](https://aws.amazon.com/tw/blogs/compute/introducing-amazon-api-gateway-service-integration-for-aws-step-functions/) written by Benjanmin Smith. After you deploy the stack with whatever programming language you like, i.e., Typescript, Python, Java, or C sharp, you'll get a view similar to the following diagram:  \n![image](https://raw.githubusercontent.com/HsiehShuJeng/projen-simple/main/images/designer_view.png)  \n\n# How to utilize polyglot packages and deploy     \n## TypeScript\n   ```bash\n   $ cdk --init language typescript\n   $ yarn add projen-statemachine-example\n   ```\n   ```typescript\n   import { StateMachineApiGatewayExample } from 'projen-statemachine-example';\n\n    export class TypescriptStack extends cdk.Stack {\n    constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {\n        super(scope, id, props);\n\n        const stageName = 'default';\n        const partPath = 'pets';\n        const exampleConstruct = new StateMachineApiGatewayExample(this, 'KerKer', {\n            stageName: stageName, partPath: partPath});\n\n        new cdk.CfnOutput(this, 'OStateMachine', {\n            value: exampleConstruct.stateMachine.stateMachineArn});\n        new cdk.CfnOutput(this, 'OExecutionOutput', {\n            value: exampleConstruct.executionInput, description: 'Sample input to StartExecution.'});\n    }\n   ```\n## Python  \n   ```bash\n   $ cdk init --language python\n   $ cat \u003c\u003cEOL \u003e requirements.txt\naws-cdk.core\nscotthsieh_projen_statemachine\nEOL\n   $ python -m pip install -r requirements.txt\n   ```\n   ```python\n   from aws_cdk import core as cdk\n   from scotthsieh_projen_statemachine import StateMachineApiGatewayExample\n\n   class PythonStack(cdk.Stack):\n       def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -\u003e None:\n            super().__init__(scope, construct_id, **kwargs)\n            \n            stage_name = 'default'\n            part_path = 'pets'\n            example_construct = StateMachineApiGatewayExample(\n                self, 'PythonStatemachne', stage_name=stage_name, part_path=part_path,\n            )\n\n            cdk.CfnOutput(self, \"OStateMachine\",\n                value=example_construct.state_machine.state_machine_arn\n            )\n            cdk.CfnOutput(self, \"OExecutionOutput\", value=example_construct.execution_input, description=\"Sample input to StartExecution.\")\n   ```\n## Java  \n   ```bash\n   $ cdk init --language java\n   $ mvn package\n   ```\n   ```xml\n   .\n   .\n   \u003cproperties\u003e\n        \u003cproject.build.sourceEncoding\u003eUTF-8\u003c/project.build.sourceEncoding\u003e\n        \u003ccustom.construct.version\u003e2.0.474\u003c/custom.construct.version\u003e\n        \u003ccdk.version\u003e2.149.0\u003c/cdk.version\u003e\n        \u003cjunit.version\u003e5.7.1\u003c/junit.version\u003e\n    \u003c/properties\u003e\n    .\n    .\n    \u003cdependencies\u003e\n        \u003c!-- AWS Cloud Development Kit --\u003e\n        .\n        .\n        .\n        \u003cdependency\u003e\n            \u003cgroupId\u003eio.github.hsiehshujeng\u003c/groupId\u003e\n            \u003cartifactId\u003eprojen-statemachine\u003c/artifactId\u003e\n            \u003cversion\u003e${custom.construct.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        .\n        .\n        .\n    \u003c/dependencies\u003e\n   ```\n   ```java\n   package com.myorg;\n\n   import software.amazon.awscdk.core.Construct;\n   import software.amazon.awscdk.core.CfnOutput;\n   import software.amazon.awscdk.core.CfnOutputProps;\n   import software.amazon.awscdk.core.Stack;\n   import software.amazon.awscdk.core.StackProps;\n   import io.github.hsiehshujeng.projen.statemachine.*;\n   \n   public class JavaStack extends Stack {\n       public JavaStack(final Construct scope, final String id) {\n           this(scope, id, null);\n        }\n\n        public JavaStack(final Construct scope, final String id, final StackProps props) {\n            super(scope, id, props);\n            \n            String stageName = \"default\";\n            String partPath = \"pets\";\n            StateMachineApiGatewayExample exampleConstruct = new StateMachineApiGatewayExample(this, \"KerKer\",\n                StateMachineApiGatewayExampleProps.builder()\n                    .stageName(stageName)\n                    .partPath(partPath)\n                    .build());\n\n            new CfnOutput(this, \"OStateMachine\",\n                CfnOutputProps.builder()\n                    .value(exampleConstruct.getStateMachine().getStateMachineArn())\n                    .build());\n            new CfnOutput(this, \"OExecutionOutput\", CfnOutputProps.builder()\n                .value(exampleConstruct.getExecutionInput())\n                .description(\"Sample input to StartExecution.\")\n                .build());\n        }\n    }\n   ```\n## C#  \n   ```bash\n   $ cdk init --language csharp\n   $ dotnet add src/Csharp package Projen.Statemachine --version 2.0.474\n   ```\n   ```cs\n   using Amazon.CDK;\n   using ScottHsieh.Examples;\n   \n   namespace Csharp\n   {\n       public class CsharpStack : Stack\n       {\n           internal CsharpStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props)\n           {\n               string stageName = \"default\";\n               string partPath = \"pets\";\n               \n               var exampleConstruct = new StateMachineApiGatewayExample(this, \"KerKer\", new StateMachineApiGatewayExampleProps\n               {\n                   StageName = stageName,\n                   PartPath = partPath\n               });\n               \n               new CfnOutput(this, \"OStateMachine\", new CfnOutputProps\n               {\n                   Value = exampleConstruct.StateMachine.StateMachineArn\n               });\n               new CfnOutput(this, \"OExecutionOutput\", new CfnOutputProps\n               {\n                   Value = exampleConstruct.ExecutionInput,\n                   Description = \"Sample input to StartExecution.\"\n               });\n           }\n       }\n    }\n```\n\n\n# References  \n* [jsii reference](https://github.com/cdklabs/jsii-release)  \n* [aws-cdk-go](https://github.com/aws/aws-cdk-go)  \n* [jsii](https://github.com/aws/jsii)  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHsiehShuJeng%2Fprojen-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHsiehShuJeng%2Fprojen-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHsiehShuJeng%2Fprojen-simple/lists"}