From e5529e26882182761adc17018f0c9c166d6f4026 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Sat, 30 Sep 2023 20:09:54 +0200 Subject: [PATCH 1/3] Update index.ts.template --- .../src/generators/init/files/index.ts.template | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/pulumi/src/generators/init/files/index.ts.template b/packages/pulumi/src/generators/init/files/index.ts.template index 5fa794ab..5d0da025 100644 --- a/packages/pulumi/src/generators/init/files/index.ts.template +++ b/packages/pulumi/src/generators/init/files/index.ts.template @@ -15,19 +15,3 @@ register({ import './pulumi' export * from './pulumi' - -import * as pulumi from '@pulumi/pulumi'; - -type ExportTypes = typeof import('./pulumi'); -type ExportTypesKey = keyof ExportTypes; -type ExportTypesValue = ExportTypes[TKey]; - -type StrongTypedStackReference = Omit & { - getOutput(name: pulumi.Input): ExportTypesValue; - requireOutput(name: pulumi.Input): ExportTypesValue; -}; - -export function getStackReference() { - const stack = pulumi.getStack(); - return new pulumi.StackReference(`organization/<%= name %>/${stack}`) as StrongTypedStackReference; -} From 925dd34c013c91fba5e15380a8c6118fff88ebce Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Sat, 30 Sep 2023 20:11:16 +0200 Subject: [PATCH 2/3] Create stack-reference.ts --- .../src/generators/init/files/stack-reference.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 packages/pulumi/src/generators/init/files/stack-reference.ts diff --git a/packages/pulumi/src/generators/init/files/stack-reference.ts b/packages/pulumi/src/generators/init/files/stack-reference.ts new file mode 100644 index 00000000..94b9fdf0 --- /dev/null +++ b/packages/pulumi/src/generators/init/files/stack-reference.ts @@ -0,0 +1,15 @@ +import * as pulumi from '@pulumi/pulumi'; + +type ExportTypes = typeof import('./pulumi'); +type ExportTypesKey = keyof ExportTypes; +type ExportTypesValue = ExportTypes[TKey]; + +type StrongTypedStackReference = Omit & { + getOutput(name: pulumi.Input): ExportTypesValue; + requireOutput(name: pulumi.Input): ExportTypesValue; +}; + +export function getStackReference() { + const stack = pulumi.getStack(); + return new pulumi.StackReference(`organization/<%= name %>/${stack}`) as StrongTypedStackReference; +} From e3feae8c81b77acffba4fabf41ba8b350c205fc7 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Sat, 30 Sep 2023 20:24:45 +0200 Subject: [PATCH 3/3] Rename stack-reference.ts to stack-reference.ts.template --- .../files/{stack-reference.ts => stack-reference.ts.template} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/pulumi/src/generators/init/files/{stack-reference.ts => stack-reference.ts.template} (100%) diff --git a/packages/pulumi/src/generators/init/files/stack-reference.ts b/packages/pulumi/src/generators/init/files/stack-reference.ts.template similarity index 100% rename from packages/pulumi/src/generators/init/files/stack-reference.ts rename to packages/pulumi/src/generators/init/files/stack-reference.ts.template