@powerlines/plugin-pulumi 0.6.70 → 0.6.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
-
29
- exports.__toESM = __toESM;
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
package/dist/index.cjs CHANGED
@@ -1,65 +1 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- let _pulumi_pulumi_automation_index_js = require("@pulumi/pulumi/automation/index.js");
4
- let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
5
- let defu = require("defu");
6
- defu = require_runtime.__toESM(defu, 1);
7
- let powerlines_plugin_utils = require("powerlines/plugin-utils");
8
-
9
- //#region src/index.ts
10
- /**
11
- * A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
12
- *
13
- * @see https://www.pulumi.com
14
- *
15
- * @param options - The Pulumi plugin user configuration options.
16
- * @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
17
- */
18
- const plugin = (options = {}) => {
19
- return [{
20
- name: "pulumi",
21
- async config() {
22
- return { deploy: { pulumi: (0, defu.default)(options, {
23
- projectName: this.config.name,
24
- settings: {}
25
- }) } };
26
- },
27
- async configResolved() {
28
- const organizationName = (0, _stryke_string_format_kebab_case.kebabCase)((0, powerlines_plugin_utils.getOrganizationName)(this));
29
- const workspaceName = (0, _stryke_string_format_kebab_case.kebabCase)(await (0, powerlines_plugin_utils.getWorkspaceName)(this));
30
- const projectName = (0, _stryke_string_format_kebab_case.kebabCase)(this.config.name);
31
- this.config.pulumi.stackName ??= (0, _pulumi_pulumi_automation_index_js.fullyQualifiedStackName)(organizationName || workspaceName || projectName, `${workspaceName && workspaceName !== organizationName && workspaceName !== projectName ? `${workspaceName}-` : ""}${projectName}`, this.config.mode);
32
- },
33
- async deploy() {
34
- this.info(`Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`);
35
- this.pulumi ??= await _pulumi_pulumi_automation_index_js.LocalWorkspace.createOrSelectStack({
36
- ...this.config.pulumi,
37
- program: async () => {
38
- this.debug("Executing Pulumi program to define infrastructure resources.");
39
- await this.$$internal.callHook("pulumi:deploy", {
40
- sequential: true,
41
- result: "merge"
42
- }, {});
43
- this.debug("Pulumi program execution completed. Resources have been defined.");
44
- }
45
- });
46
- await this.pulumi.workspace.installPlugin("terraform-provider", "v1.0.2");
47
- if (this.config.pulumi.stackSettings && Object.keys(this.config.pulumi.stackSettings).length > 0) await this.pulumi.workspace.saveStackSettings(this.pulumi.name, this.config.pulumi.stackSettings);
48
- await this.pulumi.workspace.saveProjectSettings((0, defu.default)(this.config.pulumi.projectSettings ?? {}, {
49
- name: this.config.name,
50
- runtime: { name: "nodejs" },
51
- description: this.config.description,
52
- author: this.config.organization
53
- }));
54
- this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`);
55
- await this.pulumi.refresh({ onOutput: this.debug.bind(this) });
56
- if (this.config.pulumi.destroy) await this.pulumi.destroy({ onOutput: this.debug.bind(this) });
57
- const result = await this.pulumi.up({ onOutput: this.debug.bind(this) });
58
- this.info(`Successfully deployed ${this.pulumi.name} (v${result.summary.version}): ${result.summary.message}`);
59
- }
60
- }];
61
- };
62
-
63
- //#endregion
64
- exports.default = plugin;
65
- exports.plugin = plugin;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`@pulumi/pulumi/automation/index.js`),n=require(`@stryke/string-format/kebab-case`),r=require(`defu`);r=e.__toESM(r,1);let i=require(`powerlines/plugin-utils`);const a=(e={})=>[{name:`pulumi`,async config(){return{deploy:{pulumi:(0,r.default)(e,{projectName:this.config.name,settings:{}})}}},async configResolved(){let e=(0,n.kebabCase)((0,i.getOrganizationName)(this)),r=(0,n.kebabCase)(await(0,i.getWorkspaceName)(this)),a=(0,n.kebabCase)(this.config.name);this.config.pulumi.stackName??=(0,t.fullyQualifiedStackName)(e||r||a,`${r&&r!==e&&r!==a?`${r}-`:``}${a}`,this.config.mode)},async deploy(){this.info(`Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`),this.pulumi??=await t.LocalWorkspace.createOrSelectStack({...this.config.pulumi,program:async()=>{this.debug(`Executing Pulumi program to define infrastructure resources.`),await this.$$internal.callHook(`pulumi:deploy`,{sequential:!0,result:`merge`},{}),this.debug(`Pulumi program execution completed. Resources have been defined.`)}}),await this.pulumi.workspace.installPlugin(`terraform-provider`,`v1.0.2`),this.config.pulumi.stackSettings&&Object.keys(this.config.pulumi.stackSettings).length>0&&await this.pulumi.workspace.saveStackSettings(this.pulumi.name,this.config.pulumi.stackSettings),await this.pulumi.workspace.saveProjectSettings((0,r.default)(this.config.pulumi.projectSettings??{},{name:this.config.name,runtime:{name:`nodejs`},description:this.config.description,author:this.config.organization})),this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`),await this.pulumi.refresh({onOutput:this.debug.bind(this)}),this.config.pulumi.destroy&&await this.pulumi.destroy({onOutput:this.debug.bind(this)});let e=await this.pulumi.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${this.pulumi.name} (v${e.summary.version}): ${e.summary.message}`)}}];exports.default=a,exports.plugin=a;
package/dist/index.mjs CHANGED
@@ -1,62 +1,2 @@
1
- import { LocalWorkspace, fullyQualifiedStackName } from "@pulumi/pulumi/automation/index.js";
2
- import { kebabCase } from "@stryke/string-format/kebab-case";
3
- import defu from "defu";
4
- import { getOrganizationName, getWorkspaceName } from "powerlines/plugin-utils";
5
-
6
- //#region src/index.ts
7
- /**
8
- * A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
9
- *
10
- * @see https://www.pulumi.com
11
- *
12
- * @param options - The Pulumi plugin user configuration options.
13
- * @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
14
- */
15
- const plugin = (options = {}) => {
16
- return [{
17
- name: "pulumi",
18
- async config() {
19
- return { deploy: { pulumi: defu(options, {
20
- projectName: this.config.name,
21
- settings: {}
22
- }) } };
23
- },
24
- async configResolved() {
25
- const organizationName = kebabCase(getOrganizationName(this));
26
- const workspaceName = kebabCase(await getWorkspaceName(this));
27
- const projectName = kebabCase(this.config.name);
28
- this.config.pulumi.stackName ??= fullyQualifiedStackName(organizationName || workspaceName || projectName, `${workspaceName && workspaceName !== organizationName && workspaceName !== projectName ? `${workspaceName}-` : ""}${projectName}`, this.config.mode);
29
- },
30
- async deploy() {
31
- this.info(`Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`);
32
- this.pulumi ??= await LocalWorkspace.createOrSelectStack({
33
- ...this.config.pulumi,
34
- program: async () => {
35
- this.debug("Executing Pulumi program to define infrastructure resources.");
36
- await this.$$internal.callHook("pulumi:deploy", {
37
- sequential: true,
38
- result: "merge"
39
- }, {});
40
- this.debug("Pulumi program execution completed. Resources have been defined.");
41
- }
42
- });
43
- await this.pulumi.workspace.installPlugin("terraform-provider", "v1.0.2");
44
- if (this.config.pulumi.stackSettings && Object.keys(this.config.pulumi.stackSettings).length > 0) await this.pulumi.workspace.saveStackSettings(this.pulumi.name, this.config.pulumi.stackSettings);
45
- await this.pulumi.workspace.saveProjectSettings(defu(this.config.pulumi.projectSettings ?? {}, {
46
- name: this.config.name,
47
- runtime: { name: "nodejs" },
48
- description: this.config.description,
49
- author: this.config.organization
50
- }));
51
- this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`);
52
- await this.pulumi.refresh({ onOutput: this.debug.bind(this) });
53
- if (this.config.pulumi.destroy) await this.pulumi.destroy({ onOutput: this.debug.bind(this) });
54
- const result = await this.pulumi.up({ onOutput: this.debug.bind(this) });
55
- this.info(`Successfully deployed ${this.pulumi.name} (v${result.summary.version}): ${result.summary.message}`);
56
- }
57
- }];
58
- };
59
-
60
- //#endregion
61
- export { plugin as default, plugin };
1
+ import{LocalWorkspace as e,fullyQualifiedStackName as t}from"@pulumi/pulumi/automation/index.js";import{kebabCase as n}from"@stryke/string-format/kebab-case";import r from"defu";import{getOrganizationName as i,getWorkspaceName as a}from"powerlines/plugin-utils";const o=(o={})=>[{name:`pulumi`,async config(){return{deploy:{pulumi:r(o,{projectName:this.config.name,settings:{}})}}},async configResolved(){let e=n(i(this)),r=n(await a(this)),o=n(this.config.name);this.config.pulumi.stackName??=t(e||r||o,`${r&&r!==e&&r!==o?`${r}-`:``}${o}`,this.config.mode)},async deploy(){this.info(`Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`),this.pulumi??=await e.createOrSelectStack({...this.config.pulumi,program:async()=>{this.debug(`Executing Pulumi program to define infrastructure resources.`),await this.$$internal.callHook(`pulumi:deploy`,{sequential:!0,result:`merge`},{}),this.debug(`Pulumi program execution completed. Resources have been defined.`)}}),await this.pulumi.workspace.installPlugin(`terraform-provider`,`v1.0.2`),this.config.pulumi.stackSettings&&Object.keys(this.config.pulumi.stackSettings).length>0&&await this.pulumi.workspace.saveStackSettings(this.pulumi.name,this.config.pulumi.stackSettings),await this.pulumi.workspace.saveProjectSettings(r(this.config.pulumi.projectSettings??{},{name:this.config.name,runtime:{name:`nodejs`},description:this.config.description,author:this.config.organization})),this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`),await this.pulumi.refresh({onOutput:this.debug.bind(this)}),this.config.pulumi.destroy&&await this.pulumi.destroy({onOutput:this.debug.bind(this)});let t=await this.pulumi.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${this.pulumi.name} (v${t.summary.version}): ${t.summary.message}`)}}];export{o as default,o as plugin};
62
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n fullyQualifiedStackName,\n LocalWorkspace,\n ProjectSettings\n} from \"@pulumi/pulumi/automation\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport defu from \"defu\";\nimport { Plugin, PluginContext } from \"powerlines\";\nimport { getOrganizationName, getWorkspaceName } from \"powerlines/plugin-utils\";\nimport { Unstable_PulumiPluginContext } from \"./types/_internal\";\nimport { PulumiPluginContext, PulumiPluginOptions } from \"./types/plugin\";\nimport { DeployPulumiResult, PulumiOutputRecord } from \"./types/pulumi\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n pulumi?: PulumiPluginOptions;\n }\n\n interface BasePlugin<TContext extends PluginContext> {\n pulumi?: {\n /**\n * A hook that can be implemented to deploy Pulumi resources after the main build process. This allows you to define and manage your infrastructure as code using Pulumi, directly from your Powerlines plugin.\n *\n * @param this - The plugin context.\n * @param resources - An object containing the Pulumi resources' outputs that were added in earlier hook invocations.\n * @returns Optionally, the resources' outputs that were added during the Pulumi deployment that will be passed to the next hook invocation.\n */\n deploy?: (\n this: TContext,\n resources?: PulumiOutputRecord\n ) => MaybePromise<DeployPulumiResult>;\n };\n }\n}\n\n/**\n * A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.\n *\n * @see https://www.pulumi.com\n *\n * @param options - The Pulumi plugin user configuration options.\n * @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.\n */\nexport const plugin = <\n TContext extends PulumiPluginContext = PulumiPluginContext\n>(\n options: PulumiPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"pulumi\",\n async config() {\n return {\n deploy: {\n pulumi: defu(options, {\n projectName: this.config.name,\n settings: {}\n })\n }\n };\n },\n async configResolved() {\n const organizationName = kebabCase(getOrganizationName(this));\n const workspaceName = kebabCase(await getWorkspaceName(this));\n const projectName = kebabCase(this.config.name);\n\n this.config.pulumi.stackName ??= fullyQualifiedStackName(\n organizationName || workspaceName || projectName,\n `${\n workspaceName &&\n workspaceName !== organizationName &&\n workspaceName !== projectName\n ? `${workspaceName}-`\n : \"\"\n }${projectName}`,\n this.config.mode\n );\n },\n async deploy() {\n this.info(\n `Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`\n );\n\n this.pulumi ??= await LocalWorkspace.createOrSelectStack({\n ...(this.config.pulumi as Parameters<\n typeof LocalWorkspace.createOrSelectStack\n >[0]),\n program: async () => {\n this.debug(\n \"Executing Pulumi program to define infrastructure resources.\"\n );\n\n const resources = {} as PulumiOutputRecord;\n await (\n this as unknown as Unstable_PulumiPluginContext\n ).$$internal.callHook(\n \"pulumi:deploy\",\n {\n sequential: true,\n result: \"merge\"\n },\n resources\n );\n\n this.debug(\n \"Pulumi program execution completed. Resources have been defined.\"\n );\n }\n });\n await this.pulumi.workspace.installPlugin(\n \"terraform-provider\",\n \"v1.0.2\"\n );\n\n if (\n this.config.pulumi.stackSettings &&\n Object.keys(this.config.pulumi.stackSettings).length > 0\n ) {\n await this.pulumi.workspace.saveStackSettings(\n this.pulumi.name,\n this.config.pulumi.stackSettings\n );\n }\n\n await this.pulumi.workspace.saveProjectSettings(\n defu(this.config.pulumi.projectSettings ?? {}, {\n name: this.config.name,\n runtime: { name: \"nodejs\" },\n description: this.config.description,\n author: this.config.organization\n }) as ProjectSettings\n );\n\n this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`);\n\n await this.pulumi.refresh({ onOutput: this.debug.bind(this) });\n\n if (this.config.pulumi.destroy) {\n await this.pulumi.destroy({\n onOutput: this.debug.bind(this)\n });\n }\n\n const result = await this.pulumi.up({\n onOutput: this.debug.bind(this)\n });\n\n this.info(\n `Successfully deployed ${this.pulumi.name} (v${\n result.summary.version\n }): ${result.summary.message}`\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;AAgEA,MAAa,UAGX,UAA+B,EAAE,KACV;AACvB,QAAO,CACL;EACE,MAAM;EACN,MAAM,SAAS;AACb,UAAO,EACL,QAAQ,EACN,QAAQ,KAAK,SAAS;IACpB,aAAa,KAAK,OAAO;IACzB,UAAU,EAAE;IACb,CAAC,EACH,EACF;;EAEH,MAAM,iBAAiB;GACrB,MAAM,mBAAmB,UAAU,oBAAoB,KAAK,CAAC;GAC7D,MAAM,gBAAgB,UAAU,MAAM,iBAAiB,KAAK,CAAC;GAC7D,MAAM,cAAc,UAAU,KAAK,OAAO,KAAK;AAE/C,QAAK,OAAO,OAAO,cAAc,wBAC/B,oBAAoB,iBAAiB,aACrC,GACE,iBACA,kBAAkB,oBAClB,kBAAkB,cACd,GAAG,cAAc,KACjB,KACH,eACH,KAAK,OAAO,KACb;;EAEH,MAAM,SAAS;AACb,QAAK,KACH,wCAAwC,KAAK,OAAO,OAAO,YAC5D;AAED,QAAK,WAAW,MAAM,eAAe,oBAAoB;IACvD,GAAI,KAAK,OAAO;IAGhB,SAAS,YAAY;AACnB,UAAK,MACH,+DACD;AAGD,WACE,KACA,WAAW,SACX,iBACA;MACE,YAAY;MACZ,QAAQ;MACT,EACD,EAAS,CACV;AAED,UAAK,MACH,mEACD;;IAEJ,CAAC;AACF,SAAM,KAAK,OAAO,UAAU,cAC1B,sBACA,SACD;AAED,OACE,KAAK,OAAO,OAAO,iBACnB,OAAO,KAAK,KAAK,OAAO,OAAO,cAAc,CAAC,SAAS,EAEvD,OAAM,KAAK,OAAO,UAAU,kBAC1B,KAAK,OAAO,MACZ,KAAK,OAAO,OAAO,cACpB;AAGH,SAAM,KAAK,OAAO,UAAU,oBAC1B,KAAK,KAAK,OAAO,OAAO,mBAAmB,EAAE,EAAE;IAC7C,MAAM,KAAK,OAAO;IAClB,SAAS,EAAE,MAAM,UAAU;IAC3B,aAAa,KAAK,OAAO;IACzB,QAAQ,KAAK,OAAO;IACrB,CAAC,CACH;AAED,QAAK,KAAK,2BAA2B,KAAK,OAAO,OAAO,YAAY;AAEpE,SAAM,KAAK,OAAO,QAAQ,EAAE,UAAU,KAAK,MAAM,KAAK,KAAK,EAAE,CAAC;AAE9D,OAAI,KAAK,OAAO,OAAO,QACrB,OAAM,KAAK,OAAO,QAAQ,EACxB,UAAU,KAAK,MAAM,KAAK,KAAK,EAChC,CAAC;GAGJ,MAAM,SAAS,MAAM,KAAK,OAAO,GAAG,EAClC,UAAU,KAAK,MAAM,KAAK,KAAK,EAChC,CAAC;AAEF,QAAK,KACH,yBAAyB,KAAK,OAAO,KAAK,KACxC,OAAO,QAAQ,QAChB,KAAK,OAAO,QAAQ,UACtB;;EAEJ,CACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n fullyQualifiedStackName,\n LocalWorkspace,\n ProjectSettings\n} from \"@pulumi/pulumi/automation\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport defu from \"defu\";\nimport { Plugin, PluginContext } from \"powerlines\";\nimport { getOrganizationName, getWorkspaceName } from \"powerlines/plugin-utils\";\nimport { Unstable_PulumiPluginContext } from \"./types/_internal\";\nimport { PulumiPluginContext, PulumiPluginOptions } from \"./types/plugin\";\nimport { DeployPulumiResult, PulumiOutputRecord } from \"./types/pulumi\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n pulumi?: PulumiPluginOptions;\n }\n\n interface BasePlugin<TContext extends PluginContext> {\n pulumi?: {\n /**\n * A hook that can be implemented to deploy Pulumi resources after the main build process. This allows you to define and manage your infrastructure as code using Pulumi, directly from your Powerlines plugin.\n *\n * @param this - The plugin context.\n * @param resources - An object containing the Pulumi resources' outputs that were added in earlier hook invocations.\n * @returns Optionally, the resources' outputs that were added during the Pulumi deployment that will be passed to the next hook invocation.\n */\n deploy?: (\n this: TContext,\n resources?: PulumiOutputRecord\n ) => MaybePromise<DeployPulumiResult>;\n };\n }\n}\n\n/**\n * A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.\n *\n * @see https://www.pulumi.com\n *\n * @param options - The Pulumi plugin user configuration options.\n * @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.\n */\nexport const plugin = <\n TContext extends PulumiPluginContext = PulumiPluginContext\n>(\n options: PulumiPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"pulumi\",\n async config() {\n return {\n deploy: {\n pulumi: defu(options, {\n projectName: this.config.name,\n settings: {}\n })\n }\n };\n },\n async configResolved() {\n const organizationName = kebabCase(getOrganizationName(this));\n const workspaceName = kebabCase(await getWorkspaceName(this));\n const projectName = kebabCase(this.config.name);\n\n this.config.pulumi.stackName ??= fullyQualifiedStackName(\n organizationName || workspaceName || projectName,\n `${\n workspaceName &&\n workspaceName !== organizationName &&\n workspaceName !== projectName\n ? `${workspaceName}-`\n : \"\"\n }${projectName}`,\n this.config.mode\n );\n },\n async deploy() {\n this.info(\n `Creating resources for Pulumi stack: ${this.config.pulumi.stackName}`\n );\n\n this.pulumi ??= await LocalWorkspace.createOrSelectStack({\n ...(this.config.pulumi as Parameters<\n typeof LocalWorkspace.createOrSelectStack\n >[0]),\n program: async () => {\n this.debug(\n \"Executing Pulumi program to define infrastructure resources.\"\n );\n\n const resources = {} as PulumiOutputRecord;\n await (\n this as unknown as Unstable_PulumiPluginContext\n ).$$internal.callHook(\n \"pulumi:deploy\",\n {\n sequential: true,\n result: \"merge\"\n },\n resources\n );\n\n this.debug(\n \"Pulumi program execution completed. Resources have been defined.\"\n );\n }\n });\n await this.pulumi.workspace.installPlugin(\n \"terraform-provider\",\n \"v1.0.2\"\n );\n\n if (\n this.config.pulumi.stackSettings &&\n Object.keys(this.config.pulumi.stackSettings).length > 0\n ) {\n await this.pulumi.workspace.saveStackSettings(\n this.pulumi.name,\n this.config.pulumi.stackSettings\n );\n }\n\n await this.pulumi.workspace.saveProjectSettings(\n defu(this.config.pulumi.projectSettings ?? {}, {\n name: this.config.name,\n runtime: { name: \"nodejs\" },\n description: this.config.description,\n author: this.config.organization\n }) as ProjectSettings\n );\n\n this.info(`Deploying Pulumi stack: ${this.config.pulumi.stackName}`);\n\n await this.pulumi.refresh({ onOutput: this.debug.bind(this) });\n\n if (this.config.pulumi.destroy) {\n await this.pulumi.destroy({\n onOutput: this.debug.bind(this)\n });\n }\n\n const result = await this.pulumi.up({\n onOutput: this.debug.bind(this)\n });\n\n this.info(\n `Successfully deployed ${this.pulumi.name} (v${\n result.summary.version\n }): ${result.summary.message}`\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":"sQAgEA,MAAa,GAGX,EAA+B,EAAE,GAE1B,CACL,CACE,KAAM,SACN,MAAM,QAAS,CACb,MAAO,CACL,OAAQ,CACN,OAAQ,EAAK,EAAS,CACpB,YAAa,KAAK,OAAO,KACzB,SAAU,EAAE,CACb,CAAC,CACH,CACF,EAEH,MAAM,gBAAiB,CACrB,IAAM,EAAmB,EAAU,EAAoB,KAAK,CAAC,CACvD,EAAgB,EAAU,MAAM,EAAiB,KAAK,CAAC,CACvD,EAAc,EAAU,KAAK,OAAO,KAAK,CAE/C,KAAK,OAAO,OAAO,YAAc,EAC/B,GAAoB,GAAiB,EACrC,GACE,GACA,IAAkB,GAClB,IAAkB,EACd,GAAG,EAAc,GACjB,KACH,IACH,KAAK,OAAO,KACb,EAEH,MAAM,QAAS,CACb,KAAK,KACH,wCAAwC,KAAK,OAAO,OAAO,YAC5D,CAED,KAAK,SAAW,MAAM,EAAe,oBAAoB,CACvD,GAAI,KAAK,OAAO,OAGhB,QAAS,SAAY,CACnB,KAAK,MACH,+DACD,CAGD,MACE,KACA,WAAW,SACX,gBACA,CACE,WAAY,GACZ,OAAQ,QACT,CACD,EAAS,CACV,CAED,KAAK,MACH,mEACD,EAEJ,CAAC,CACF,MAAM,KAAK,OAAO,UAAU,cAC1B,qBACA,SACD,CAGC,KAAK,OAAO,OAAO,eACnB,OAAO,KAAK,KAAK,OAAO,OAAO,cAAc,CAAC,OAAS,GAEvD,MAAM,KAAK,OAAO,UAAU,kBAC1B,KAAK,OAAO,KACZ,KAAK,OAAO,OAAO,cACpB,CAGH,MAAM,KAAK,OAAO,UAAU,oBAC1B,EAAK,KAAK,OAAO,OAAO,iBAAmB,EAAE,CAAE,CAC7C,KAAM,KAAK,OAAO,KAClB,QAAS,CAAE,KAAM,SAAU,CAC3B,YAAa,KAAK,OAAO,YACzB,OAAQ,KAAK,OAAO,aACrB,CAAC,CACH,CAED,KAAK,KAAK,2BAA2B,KAAK,OAAO,OAAO,YAAY,CAEpE,MAAM,KAAK,OAAO,QAAQ,CAAE,SAAU,KAAK,MAAM,KAAK,KAAK,CAAE,CAAC,CAE1D,KAAK,OAAO,OAAO,SACrB,MAAM,KAAK,OAAO,QAAQ,CACxB,SAAU,KAAK,MAAM,KAAK,KAAK,CAChC,CAAC,CAGJ,IAAM,EAAS,MAAM,KAAK,OAAO,GAAG,CAClC,SAAU,KAAK,MAAM,KAAK,KAAK,CAChC,CAAC,CAEF,KAAK,KACH,yBAAyB,KAAK,OAAO,KAAK,KACxC,EAAO,QAAQ,QAChB,KAAK,EAAO,QAAQ,UACtB,EAEJ,CACF"}
@@ -1 +1 @@
1
- export { };
1
+ export{};
@@ -1 +1 @@
1
- export { };
1
+ export{};
@@ -1 +1 @@
1
- export { };
1
+ export{};
@@ -1 +1 @@
1
- export { };
1
+ export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-pulumi",
3
- "version": "0.6.70",
3
+ "version": "0.6.72",
4
4
  "private": false,
5
5
  "description": "A Powerlines plugin to deploy infrastructure using Pulumi.",
6
6
  "keywords": ["pulumi", "powerlines", "storm-software", "powerlines-plugin"],
@@ -126,13 +126,13 @@
126
126
  "@stryke/type-checks": "^0.6.2",
127
127
  "@stryke/types": "^0.11.4",
128
128
  "defu": "^6.1.7",
129
- "powerlines": "^0.43.25",
129
+ "powerlines": "^0.43.27",
130
130
  "typescript": "^6.0.3"
131
131
  },
132
132
  "devDependencies": {
133
- "@powerlines/plugin-plugin": "^0.12.380",
133
+ "@powerlines/plugin-plugin": "^0.12.382",
134
134
  "@types/node": "^25.6.0"
135
135
  },
136
136
  "publishConfig": { "access": "public" },
137
- "gitHead": "c478a1fad20edcf96f1c269ca73b4ed40658b732"
137
+ "gitHead": "ad851a239011b884c15b0444db518d74927fd13f"
138
138
  }