From dfe7ac412f97f62316964f52727adf987f259ae3 Mon Sep 17 00:00:00 2001 From: Anton Mokhovikov Date: Thu, 8 Apr 2021 15:34:22 -0700 Subject: [PATCH 1/4] Codegen change & Version Bump --- python/rpdk/typescript/__init__.py | 2 +- python/rpdk/typescript/codegen.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/python/rpdk/typescript/__init__.py b/python/rpdk/typescript/__init__.py index c3fd9ef..d708f49 100644 --- a/python/rpdk/typescript/__init__.py +++ b/python/rpdk/typescript/__init__.py @@ -1,5 +1,5 @@ import logging -__version__ = "0.5.0" +__version__ = "1.0.0" logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/python/rpdk/typescript/codegen.py b/python/rpdk/typescript/codegen.py index 459525d..84c55bb 100644 --- a/python/rpdk/typescript/codegen.py +++ b/python/rpdk/typescript/codegen.py @@ -22,11 +22,9 @@ LOG = logging.getLogger(__name__) EXECUTABLE = "cfn" -SUPPORT_LIB_NAME = "cfn-rpdk" -SUPPORT_LIB_VERSION = "0.5.0" +SUPPORT_LIB_NAME = "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib" +SUPPORT_LIB_VERSION = "^1.0.0" MAIN_HANDLER_FUNCTION = "TypeFunction" -REPO_URL = "https://github.com/eduardomourar/cloudformation-cli-typescript-plugin" -REPO_RELEASE_SUFFIX = f"v{SUPPORT_LIB_VERSION}/cfn-rpdk-{SUPPORT_LIB_VERSION}.tgz" def validate_no(value): @@ -40,7 +38,6 @@ class TypescriptLanguagePlugin(LanguagePlugin): ENTRY_POINT = "dist/handlers.entrypoint" TEST_ENTRY_POINT = "dist/handlers.testEntrypoint" CODE_URI = "./" - SUPPORT_LIB_URI = f"{REPO_URL}/releases/download/{REPO_RELEASE_SUFFIX}" def __init__(self): self.env = self._setup_jinja_env( @@ -65,7 +62,7 @@ def _init_from_project(self, project): self._use_docker = project.settings.get("useDocker", True) self.package_root = project.root / "src" self._build_command = project.settings.get("buildCommand", None) - self._lib_path = project.settings.get("supportLibrary", self.SUPPORT_LIB_URI) + self._lib_path = SUPPORT_LIB_VERSION def _init_settings(self, project): LOG.debug("Writing settings") From b441e025ad62ff228844f3fbf7c1459fe28456df Mon Sep 17 00:00:00 2001 From: Anton Mokhovikov Date: Thu, 8 Apr 2021 15:58:37 -0700 Subject: [PATCH 2/4] Codegen change & Version Bump + templates --- python/rpdk/typescript/templates/handlers.ts | 2 +- python/rpdk/typescript/templates/models.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/rpdk/typescript/templates/handlers.ts b/python/rpdk/typescript/templates/handlers.ts index 60300c3..1862c4e 100644 --- a/python/rpdk/typescript/templates/handlers.ts +++ b/python/rpdk/typescript/templates/handlers.ts @@ -10,7 +10,7 @@ import { ProgressEvent, ResourceHandlerRequest, SessionProxy, -} from '{{lib_name}}'; +} from '@amazon-web-services-cloudformation/{{lib_name}}'; import { ResourceModel } from './models'; interface CallbackContext extends Record {} diff --git a/python/rpdk/typescript/templates/models.ts b/python/rpdk/typescript/templates/models.ts index f61bcbe..201fe71 100644 --- a/python/rpdk/typescript/templates/models.ts +++ b/python/rpdk/typescript/templates/models.ts @@ -1,5 +1,5 @@ // This is a generated file. Modifications will be overwritten. -import { BaseModel, Dict, integer, Integer, Optional, transformValue } from '{{lib_name}}'; +import { BaseModel, Dict, integer, Integer, Optional, transformValue } from '@amazon-web-services-cloudformation/{{lib_name}}'; import { Exclude, Expose, Type, Transform } from 'class-transformer'; {% for model, properties in models.items() %} From 1a275dceca8dc6fdab6dfaaea5b3e56d4b1b49fb Mon Sep 17 00:00:00 2001 From: Anton Mokhovikov Date: Thu, 8 Apr 2021 16:03:54 -0700 Subject: [PATCH 3/4] Changing target lib version --- python/rpdk/typescript/codegen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/rpdk/typescript/codegen.py b/python/rpdk/typescript/codegen.py index 84c55bb..4d2eed2 100644 --- a/python/rpdk/typescript/codegen.py +++ b/python/rpdk/typescript/codegen.py @@ -23,7 +23,7 @@ EXECUTABLE = "cfn" SUPPORT_LIB_NAME = "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib" -SUPPORT_LIB_VERSION = "^1.0.0" +SUPPORT_LIB_VERSION = "^1.0.1" MAIN_HANDLER_FUNCTION = "TypeFunction" From a9504a568f06b0de569606901a995df972e096dd Mon Sep 17 00:00:00 2001 From: Anton Mokhovikov Date: Thu, 8 Apr 2021 16:15:35 -0700 Subject: [PATCH 4/4] fix unittest --- python/rpdk/typescript/codegen.py | 4 +++- python/rpdk/typescript/templates/handlers.ts | 2 +- python/rpdk/typescript/templates/models.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/rpdk/typescript/codegen.py b/python/rpdk/typescript/codegen.py index 4d2eed2..b23c7ae 100644 --- a/python/rpdk/typescript/codegen.py +++ b/python/rpdk/typescript/codegen.py @@ -22,7 +22,9 @@ LOG = logging.getLogger(__name__) EXECUTABLE = "cfn" -SUPPORT_LIB_NAME = "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib" +SUPPORT_LIB_NAME = ( + "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib" +) SUPPORT_LIB_VERSION = "^1.0.1" MAIN_HANDLER_FUNCTION = "TypeFunction" diff --git a/python/rpdk/typescript/templates/handlers.ts b/python/rpdk/typescript/templates/handlers.ts index 1862c4e..60300c3 100644 --- a/python/rpdk/typescript/templates/handlers.ts +++ b/python/rpdk/typescript/templates/handlers.ts @@ -10,7 +10,7 @@ import { ProgressEvent, ResourceHandlerRequest, SessionProxy, -} from '@amazon-web-services-cloudformation/{{lib_name}}'; +} from '{{lib_name}}'; import { ResourceModel } from './models'; interface CallbackContext extends Record {} diff --git a/python/rpdk/typescript/templates/models.ts b/python/rpdk/typescript/templates/models.ts index 201fe71..f61bcbe 100644 --- a/python/rpdk/typescript/templates/models.ts +++ b/python/rpdk/typescript/templates/models.ts @@ -1,5 +1,5 @@ // This is a generated file. Modifications will be overwritten. -import { BaseModel, Dict, integer, Integer, Optional, transformValue } from '@amazon-web-services-cloudformation/{{lib_name}}'; +import { BaseModel, Dict, integer, Integer, Optional, transformValue } from '{{lib_name}}'; import { Exclude, Expose, Type, Transform } from 'class-transformer'; {% for model, properties in models.items() %}