@powerlines/plugin-pulumi 0.2.26 → 0.2.27
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.
- package/dist/index-BgAdqTbb.d.mts +1 -0
- package/dist/index-CEgs-Dz2.d.cts +1 -0
- package/dist/index.cjs +1 -7
- package/dist/index.d.cts +7 -26
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plugin-Bvn-he2n.mjs +1 -0
- package/dist/plugin-DUz3nrhG.d.mts +1718 -0
- package/dist/plugin-DUz3nrhG.d.mts.map +1 -0
- package/dist/plugin-sXELxmtp.d.cts +1718 -0
- package/dist/plugin-sXELxmtp.d.cts.map +1 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +3 -23
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +1 -1
- package/dist/types/plugin.d.cts +2 -23
- package/dist/types/plugin.d.mts +2 -0
- package/dist/types/plugin.mjs +1 -0
- package/dist/types-B7VYa_Pp.mjs +1 -0
- package/dist/types-DHkg7xmX.cjs +0 -0
- package/package.json +45 -27
- package/dist/index-D5HXqQUj.d.cts +0 -1629
- package/dist/index-D5HXqQUj.d.ts +0 -1629
- package/dist/index.d.ts +0 -36
- package/dist/index.js +0 -7
- package/dist/types/index.d.ts +0 -23
- package/dist/types/index.js +0 -1
- package/dist/types/plugin.d.ts +0 -23
- /package/dist/{types/plugin.js → plugin-DHXHjv16.cjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* ⚡ Built by Storm Software
|
|
4
|
-
*
|
|
5
|
-
*****************************************/
|
|
6
|
-
|
|
7
|
-
var s=Object.defineProperty;var a=(i,t)=>s(i,"name",{value:t,configurable:true});const g=a((i={})=>({name:"pulumi",async config(){return {deploy:{pulumi:c__default.default(i,{projectName:this.config.name,workDir:join.joinPaths(this.artifactsPath,"infrastructure"),settings:{}})}}},async configResolved(){i.stack||(this.config.deploy.pulumi.stackName??=automation.fullyQualifiedStackName(kebabCase.kebabCase(contextHelpers.getOrganizationName(this)||"default"),`${contextHelpers.getWorkspaceName(this)?`${kebabCase.kebabCase(contextHelpers.getWorkspaceName(this))}-`:""}${kebabCase.kebabCase(this.config.name)}`,this.config.mode));},deploy:{order:"post",async handler(){if(this.info(`Deploying Pulumi stack: ${this.config.deploy.pulumi.stack?.name||this.config.deploy.pulumi.stackName}`),!i.stack&&!i.program&&!i.projectName||!i.workDir)throw new Error("Pulumi plugin requires either an inline program or a working directory to be specified.");let t=i.stack;t??=await automation.LocalWorkspace.createOrSelectStack(index.omit(this.config.deploy.pulumi,["options","settings"])),this.config.deploy.pulumi.settings&&Object.keys(this.config.deploy.pulumi.settings).length>0&&await t.workspace.saveStackSettings(t.name,this.config.deploy.pulumi.settings),await t.refresh({onOutput:this.debug.bind(this)}),this.config.deploy.pulumi.destroy&&await t.destroy({onOutput:this.debug.bind(this)});const u=await t.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${t.name} (v${u.summary.version}): ${u.summary.message}`);}}}),"plugin");var L=g;exports.default=L;exports.plugin=g;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});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));require(`./plugin-DHXHjv16.cjs`),require(`./types-DHkg7xmX.cjs`);let c=require(`@pulumi/pulumi/automation`),l=require(`@stryke/helpers/index`),u=require(`@stryke/path/join`),d=require(`@stryke/string-format/kebab-case`),f=require(`defu`);f=s(f);let p=require(`@stryke/type-checks/is-set-object`),m=require(`@stryke/type-checks/is-set-string`);function h(e){let t;return(0,p.isSetObject)(e.workspaceConfig.organization)&&(t=e.workspaceConfig.organization.name),!t&&(0,m.isSetString)(e.workspaceConfig.organization)&&(t=e.workspaceConfig.organization),!t&&Array.isArray(e.packageJson.maintainers)&&e.packageJson.maintainers.length>0&&((0,p.isSetObject)(e.packageJson.maintainers[0])&&(t=e.packageJson.maintainers[0].name),!t&&(0,m.isSetString)(e.packageJson.maintainers[0])&&(t=e.packageJson.maintainers[0])),!t&&Array.isArray(e.packageJson.author)&&e.packageJson.author.length>0&&((0,p.isSetObject)(e.packageJson.author[0])&&(t=e.packageJson.author[0].name),!t&&(0,m.isSetString)(e.packageJson.author[0])&&(t=e.packageJson.author[0])),!t&&Array.isArray(e.packageJson.contributors)&&e.packageJson.contributors.length>0&&((0,p.isSetObject)(e.packageJson.contributors[0])&&(t=e.packageJson.contributors[0].name),!t&&(0,m.isSetString)(e.packageJson.contributors[0])&&(t=e.packageJson.contributors[0])),!t&&(0,m.isSetString)(e.packageJson.namespace)&&(t=e.packageJson.namespace.replace(/^@/,``)),!t&&(0,m.isSetString)(e.packageJson.name)&&(t=e.packageJson.name.replace(/^@/,``).replace(/\/.*$/,``)),t}function g(e){let t;return(0,m.isSetString)(e.workspaceConfig.name)&&(t=e.workspaceConfig.name),!t&&(0,m.isSetString)(e.workspaceConfig.namespace)&&(t=e.workspaceConfig.namespace.replace(/^@/,``)),!t&&(0,m.isSetString)(e.packageJson.namespace)&&(t=e.packageJson.namespace.replace(/^@/,``)),!t&&(0,m.isSetString)(e.packageJson.name)&&(t=e.packageJson.name.replace(/^@/,``).replace(/\/.*$/,``)),t}const _=(e={})=>({name:`pulumi`,async config(){return{deploy:{pulumi:(0,f.default)(e,{projectName:this.config.name,workDir:(0,u.joinPaths)(this.artifactsPath,`infrastructure`),settings:{}})}}},async configResolved(){e.stack||(this.config.deploy.pulumi.stackName??=(0,c.fullyQualifiedStackName)((0,d.kebabCase)(h(this)||`default`),`${g(this)?`${(0,d.kebabCase)(g(this))}-`:``}${(0,d.kebabCase)(this.config.name)}`,this.config.mode))},deploy:{order:`post`,async handler(){if(this.info(`Deploying Pulumi stack: ${this.config.deploy.pulumi.stack?.name||this.config.deploy.pulumi.stackName}`),!e.stack&&!e.program&&!e.projectName||!e.workDir)throw Error(`Pulumi plugin requires either an inline program or a working directory to be specified.`);let t=e.stack;t??=await c.LocalWorkspace.createOrSelectStack((0,l.omit)(this.config.deploy.pulumi,[`options`,`settings`])),this.config.deploy.pulumi.settings&&Object.keys(this.config.deploy.pulumi.settings).length>0&&await t.workspace.saveStackSettings(t.name,this.config.deploy.pulumi.settings),await t.refresh({onOutput:this.debug.bind(this)}),this.config.deploy.pulumi.destroy&&await t.destroy({onOutput:this.debug.bind(this)});let n=await t.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${t.name} (v${n.summary.version}): ${n.summary.message}`)}}});var v=_;exports.default=v,exports.plugin=_;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import '@storm-software/config-tools/types';
|
|
6
|
-
import '@storm-software/config/types';
|
|
7
|
-
import '@stryke/types/base';
|
|
8
|
-
import '@stryke/types/configuration';
|
|
9
|
-
import '@stryke/types/file';
|
|
10
|
-
import 'vite';
|
|
11
|
-
import '@stryke/env/get-env-paths';
|
|
12
|
-
import '@stryke/http/fetch';
|
|
13
|
-
import '@stryke/types/package-json';
|
|
14
|
-
import 'jiti';
|
|
15
|
-
import 'magic-string';
|
|
16
|
-
import 'oxc-parser';
|
|
17
|
-
import 'semver';
|
|
18
|
-
import 'ts-morph';
|
|
19
|
-
import 'undici';
|
|
20
|
-
import 'unplugin';
|
|
21
|
-
import '@stryke/fs/resolve';
|
|
22
|
-
import '@stryke/types/tsconfig';
|
|
23
|
-
import 'typescript';
|
|
24
|
-
import '@stryke/types/array';
|
|
1
|
+
import { C as Plugin, S as __ΩPulumiPluginUserConfig, _ as __ΩPulumiPluginDeployConfig, a as PulumiPluginCreateStackOptions, b as __ΩPulumiPluginResolvedConfig, c as PulumiPluginOptions, d as PulumiPluginUserConfig, f as __ΩPulumiPluginBaseOptions, g as __ΩPulumiPluginCreateStackOptions, h as __ΩPulumiPluginCreateStackLocalOptions, i as PulumiPluginCreateStackLocalOptions, l as PulumiPluginResolvedConfig, m as __ΩPulumiPluginCreateStackInlineOptions, n as PulumiPluginContext, o as PulumiPluginDeployConfig, p as __ΩPulumiPluginContext, r as PulumiPluginCreateStackInlineOptions, s as PulumiPluginExistingStackOptions, t as PulumiPluginBaseOptions, u as PulumiPluginResolvedOptions, v as __ΩPulumiPluginExistingStackOptions, x as __ΩPulumiPluginResolvedOptions, y as __ΩPulumiPluginOptions } from "./plugin-sXELxmtp.cjs";
|
|
2
|
+
import "./index-CEgs-Dz2.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
25
5
|
|
|
26
6
|
/**
|
|
27
7
|
* A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
|
|
@@ -32,5 +12,6 @@ import '@stryke/types/array';
|
|
|
32
12
|
* @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
|
|
33
13
|
*/
|
|
34
14
|
declare const plugin: <TContext extends PulumiPluginContext = PulumiPluginContext>(options?: PulumiPluginOptions) => Plugin<TContext>;
|
|
35
|
-
|
|
36
|
-
export { PulumiPluginContext, PulumiPluginOptions, plugin as default, plugin };
|
|
15
|
+
//#endregion
|
|
16
|
+
export { PulumiPluginBaseOptions, PulumiPluginContext, PulumiPluginCreateStackInlineOptions, PulumiPluginCreateStackLocalOptions, PulumiPluginCreateStackOptions, PulumiPluginDeployConfig, PulumiPluginExistingStackOptions, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginResolvedOptions, PulumiPluginUserConfig, __ΩPulumiPluginBaseOptions, __ΩPulumiPluginContext, __ΩPulumiPluginCreateStackInlineOptions, __ΩPulumiPluginCreateStackLocalOptions, __ΩPulumiPluginCreateStackOptions, __ΩPulumiPluginDeployConfig, __ΩPulumiPluginExistingStackOptions, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginResolvedOptions, __ΩPulumiPluginUserConfig, plugin as default, plugin };
|
|
17
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAkDA;;;;;;;cAAa,0BACM,sBAAsB,+BAE9B,wBACR,OAAO"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { C as Plugin, S as __ΩPulumiPluginUserConfig, _ as __ΩPulumiPluginDeployConfig, a as PulumiPluginCreateStackOptions, b as __ΩPulumiPluginResolvedConfig, c as PulumiPluginOptions, d as PulumiPluginUserConfig, f as __ΩPulumiPluginBaseOptions, g as __ΩPulumiPluginCreateStackOptions, h as __ΩPulumiPluginCreateStackLocalOptions, i as PulumiPluginCreateStackLocalOptions, l as PulumiPluginResolvedConfig, m as __ΩPulumiPluginCreateStackInlineOptions, n as PulumiPluginContext, o as PulumiPluginDeployConfig, p as __ΩPulumiPluginContext, r as PulumiPluginCreateStackInlineOptions, s as PulumiPluginExistingStackOptions, t as PulumiPluginBaseOptions, u as PulumiPluginResolvedOptions, v as __ΩPulumiPluginExistingStackOptions, x as __ΩPulumiPluginResolvedOptions, y as __ΩPulumiPluginOptions } from "./plugin-DUz3nrhG.mjs";
|
|
2
|
+
import "./index-BgAdqTbb.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A package containing a Powerlines plugin to configure infrastructure and deploy a project using Pulumi IaC.
|
|
8
|
+
*
|
|
9
|
+
* @see https://www.pulumi.com
|
|
10
|
+
*
|
|
11
|
+
* @param options - The Pulumi plugin user configuration options.
|
|
12
|
+
* @returns A Powerlines plugin to configure infrastructure and deploy a project using Pulumi.
|
|
13
|
+
*/
|
|
14
|
+
declare const plugin: <TContext extends PulumiPluginContext = PulumiPluginContext>(options?: PulumiPluginOptions) => Plugin<TContext>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { PulumiPluginBaseOptions, PulumiPluginContext, PulumiPluginCreateStackInlineOptions, PulumiPluginCreateStackLocalOptions, PulumiPluginCreateStackOptions, PulumiPluginDeployConfig, PulumiPluginExistingStackOptions, PulumiPluginOptions, PulumiPluginResolvedConfig, PulumiPluginResolvedOptions, PulumiPluginUserConfig, __ΩPulumiPluginBaseOptions, __ΩPulumiPluginContext, __ΩPulumiPluginCreateStackInlineOptions, __ΩPulumiPluginCreateStackLocalOptions, __ΩPulumiPluginCreateStackOptions, __ΩPulumiPluginDeployConfig, __ΩPulumiPluginExistingStackOptions, __ΩPulumiPluginOptions, __ΩPulumiPluginResolvedConfig, __ΩPulumiPluginResolvedOptions, __ΩPulumiPluginUserConfig, plugin as default, plugin };
|
|
17
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAkDA;;;;;;;cAAa,0BACM,sBAAsB,+BAE9B,wBACR,OAAO"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./plugin-Bvn-he2n.mjs";import"./types-B7VYa_Pp.mjs";import{LocalWorkspace as e,fullyQualifiedStackName as t}from"@pulumi/pulumi/automation";import{omit as n}from"@stryke/helpers/index";import{joinPaths as r}from"@stryke/path/join";import{kebabCase as i}from"@stryke/string-format/kebab-case";import a from"defu";import{isSetObject as o}from"@stryke/type-checks/is-set-object";import{isSetString as s}from"@stryke/type-checks/is-set-string";function c(e){let t;return o(e.workspaceConfig.organization)&&(t=e.workspaceConfig.organization.name),!t&&s(e.workspaceConfig.organization)&&(t=e.workspaceConfig.organization),!t&&Array.isArray(e.packageJson.maintainers)&&e.packageJson.maintainers.length>0&&(o(e.packageJson.maintainers[0])&&(t=e.packageJson.maintainers[0].name),!t&&s(e.packageJson.maintainers[0])&&(t=e.packageJson.maintainers[0])),!t&&Array.isArray(e.packageJson.author)&&e.packageJson.author.length>0&&(o(e.packageJson.author[0])&&(t=e.packageJson.author[0].name),!t&&s(e.packageJson.author[0])&&(t=e.packageJson.author[0])),!t&&Array.isArray(e.packageJson.contributors)&&e.packageJson.contributors.length>0&&(o(e.packageJson.contributors[0])&&(t=e.packageJson.contributors[0].name),!t&&s(e.packageJson.contributors[0])&&(t=e.packageJson.contributors[0])),!t&&s(e.packageJson.namespace)&&(t=e.packageJson.namespace.replace(/^@/,``)),!t&&s(e.packageJson.name)&&(t=e.packageJson.name.replace(/^@/,``).replace(/\/.*$/,``)),t}function l(e){let t;return s(e.workspaceConfig.name)&&(t=e.workspaceConfig.name),!t&&s(e.workspaceConfig.namespace)&&(t=e.workspaceConfig.namespace.replace(/^@/,``)),!t&&s(e.packageJson.namespace)&&(t=e.packageJson.namespace.replace(/^@/,``)),!t&&s(e.packageJson.name)&&(t=e.packageJson.name.replace(/^@/,``).replace(/\/.*$/,``)),t}const u=(o={})=>({name:`pulumi`,async config(){return{deploy:{pulumi:a(o,{projectName:this.config.name,workDir:r(this.artifactsPath,`infrastructure`),settings:{}})}}},async configResolved(){o.stack||(this.config.deploy.pulumi.stackName??=t(i(c(this)||`default`),`${l(this)?`${i(l(this))}-`:``}${i(this.config.name)}`,this.config.mode))},deploy:{order:`post`,async handler(){if(this.info(`Deploying Pulumi stack: ${this.config.deploy.pulumi.stack?.name||this.config.deploy.pulumi.stackName}`),!o.stack&&!o.program&&!o.projectName||!o.workDir)throw Error(`Pulumi plugin requires either an inline program or a working directory to be specified.`);let t=o.stack;t??=await e.createOrSelectStack(n(this.config.deploy.pulumi,[`options`,`settings`])),this.config.deploy.pulumi.settings&&Object.keys(this.config.deploy.pulumi.settings).length>0&&await t.workspace.saveStackSettings(t.name,this.config.deploy.pulumi.settings),await t.refresh({onOutput:this.debug.bind(this)}),this.config.deploy.pulumi.destroy&&await t.destroy({onOutput:this.debug.bind(this)});let r=await t.up({onOutput:this.debug.bind(this)});this.info(`Successfully deployed ${t.name} (v${r.summary.version}): ${r.summary.message}`)}}});var d=u;export{d as default,u as plugin};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["result: string | undefined"],"sources":["../../powerlines/src/plugin-utils/context-helpers.ts","../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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Get the organization name from the context\n *\n * @param context - The Powerlines plugin context.\n * @returns The organization name or undefined if not found.\n */\nexport function getOrganizationName(\n context: UnresolvedContext\n): string | undefined {\n let result: string | undefined;\n if (isSetObject(context.workspaceConfig.organization)) {\n result = context.workspaceConfig.organization.name;\n }\n\n if (!result && isSetString(context.workspaceConfig.organization)) {\n result = context.workspaceConfig.organization;\n }\n\n if (\n !result &&\n Array.isArray(context.packageJson.maintainers) &&\n context.packageJson.maintainers.length > 0\n ) {\n if (isSetObject(context.packageJson.maintainers[0])) {\n result = (context.packageJson.maintainers[0] as { name: string }).name;\n }\n\n if (!result && isSetString(context.packageJson.maintainers[0])) {\n result = context.packageJson.maintainers[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(context.packageJson.author) &&\n context.packageJson.author.length > 0\n ) {\n if (isSetObject(context.packageJson.author[0])) {\n result = (context.packageJson.author[0] as { name: string }).name;\n }\n\n if (!result && isSetString(context.packageJson.author[0])) {\n result = context.packageJson.author[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(context.packageJson.contributors) &&\n context.packageJson.contributors.length > 0\n ) {\n if (isSetObject(context.packageJson.contributors[0])) {\n result = (context.packageJson.contributors[0] as { name: string }).name;\n }\n\n if (!result && isSetString(context.packageJson.contributors[0])) {\n result = context.packageJson.contributors[0];\n }\n }\n\n if (!result && isSetString(context.packageJson.namespace)) {\n result = context.packageJson.namespace.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(context.packageJson.name)) {\n result = context.packageJson.name.replace(/^@/, \"\").replace(/\\/.*$/, \"\");\n }\n\n return result;\n}\n\n/**\n * Get the organization name from the context\n *\n * @param context - The Powerlines plugin context.\n * @returns The organization name or undefined if not found.\n */\nexport function getWorkspaceName(\n context: UnresolvedContext\n): string | undefined {\n let result: string | undefined;\n if (isSetString(context.workspaceConfig.name)) {\n result = context.workspaceConfig.name;\n }\n\n if (!result && isSetString(context.workspaceConfig.namespace)) {\n result = context.workspaceConfig.namespace.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(context.packageJson.namespace)) {\n result = context.packageJson.namespace.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(context.packageJson.name)) {\n result = context.packageJson.name.replace(/^@/, \"\").replace(/\\/.*$/, \"\");\n }\n\n return result;\n}\n","/* -------------------------------------------------------------------\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} from \"@pulumi/pulumi/automation\";\nimport { omit } from \"@stryke/helpers/index\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport defu from \"defu\";\nimport {\n getOrganizationName,\n getWorkspaceName\n} from \"powerlines/plugin-utils/context-helpers\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport {\n PulumiPluginContext,\n PulumiPluginCreateStackInlineOptions,\n PulumiPluginCreateStackLocalOptions,\n PulumiPluginCreateStackOptions,\n PulumiPluginExistingStackOptions,\n PulumiPluginOptions\n} from \"./types/plugin\";\n\nexport * from \"./types\";\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 name: \"pulumi\",\n async config() {\n return {\n deploy: {\n pulumi: defu(options, {\n projectName: this.config.name,\n workDir: joinPaths(this.artifactsPath, \"infrastructure\"),\n settings: {}\n })\n }\n };\n },\n async configResolved() {\n if (!(options as PulumiPluginExistingStackOptions).stack) {\n (\n this.config.deploy.pulumi as PulumiPluginCreateStackOptions\n ).stackName ??= fullyQualifiedStackName(\n kebabCase(getOrganizationName(this) || \"default\"),\n `${\n getWorkspaceName(this)\n ? `${kebabCase(getWorkspaceName(this))}-`\n : \"\"\n }${kebabCase(this.config.name)}`,\n this.config.mode\n );\n }\n },\n deploy: {\n order: \"post\",\n async handler() {\n this.info(\n `Deploying Pulumi stack: ${\n (this.config.deploy.pulumi as PulumiPluginExistingStackOptions)\n .stack?.name ||\n (this.config.deploy.pulumi as PulumiPluginCreateStackOptions)\n .stackName\n }`\n );\n\n if (\n (!(options as PulumiPluginExistingStackOptions).stack &&\n !(options as PulumiPluginCreateStackInlineOptions).program &&\n !(options as PulumiPluginCreateStackInlineOptions).projectName) ||\n !(options as PulumiPluginCreateStackLocalOptions).workDir\n ) {\n throw new Error(\n `Pulumi plugin requires either an inline program or a working directory to be specified.`\n );\n }\n\n let stack = (options as PulumiPluginExistingStackOptions).stack;\n stack ??= await LocalWorkspace.createOrSelectStack(\n omit(this.config.deploy.pulumi as PulumiPluginCreateStackOptions, [\n \"options\",\n \"settings\"\n ]) as Parameters<typeof LocalWorkspace.createOrSelectStack>[0]\n );\n\n if (\n this.config.deploy.pulumi.settings &&\n Object.keys(this.config.deploy.pulumi.settings).length > 0\n ) {\n await stack.workspace.saveStackSettings(\n stack.name,\n this.config.deploy.pulumi.settings\n );\n }\n\n await stack.refresh({ onOutput: this.debug.bind(this) });\n\n if (this.config.deploy.pulumi.destroy) {\n await stack.destroy({ onOutput: this.debug.bind(this) });\n }\n\n const result = await stack.up({\n onOutput: this.debug.bind(this)\n });\n\n this.info(\n `Successfully deployed ${stack.name} (v${result.summary.version}): ${result.summary.message}`\n );\n }\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":"+bA4BA,SAAgB,EACd,EACoB,CACpB,IAAIA,EA2DJ,OA1DI,EAAY,EAAQ,gBAAgB,a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