@powerlines/plugin-pulumi 0.2.202 → 0.2.203

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.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ const require_context_helpers = require('./powerlines/src/plugin-utils/context-helpers.cjs');
3
4
  let __pulumi_pulumi_automation = require("@pulumi/pulumi/automation");
4
5
  let __stryke_helpers_index = require("@stryke/helpers/index");
5
6
  let __stryke_path_join = require("@stryke/path/join");
6
7
  let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
7
8
  let defu = require("defu");
8
9
  defu = require_rolldown_runtime.__toESM(defu);
9
- let powerlines_plugin_utils_context_helpers = require("powerlines/plugin-utils/context-helpers");
10
10
 
11
11
  //#region src/index.ts
12
12
  /**
@@ -28,7 +28,7 @@ const plugin = (options = {}) => {
28
28
  }) } };
29
29
  },
30
30
  async configResolved() {
31
- if (!options.stack) this.config.deploy.pulumi.stackName ??= (0, __pulumi_pulumi_automation.fullyQualifiedStackName)((0, __stryke_string_format_kebab_case.kebabCase)((0, powerlines_plugin_utils_context_helpers.getOrganizationName)(this) || "default"), `${(0, powerlines_plugin_utils_context_helpers.getWorkspaceName)(this) ? `${(0, __stryke_string_format_kebab_case.kebabCase)((0, powerlines_plugin_utils_context_helpers.getWorkspaceName)(this))}-` : ""}${(0, __stryke_string_format_kebab_case.kebabCase)(this.config.name)}`, this.config.mode);
31
+ if (!options.stack) this.config.deploy.pulumi.stackName ??= (0, __pulumi_pulumi_automation.fullyQualifiedStackName)((0, __stryke_string_format_kebab_case.kebabCase)(require_context_helpers.getOrganizationName(this) || "default"), `${require_context_helpers.getWorkspaceName(this) ? `${(0, __stryke_string_format_kebab_case.kebabCase)(require_context_helpers.getWorkspaceName(this))}-` : ""}${(0, __stryke_string_format_kebab_case.kebabCase)(this.config.name)}`, this.config.mode);
32
32
  },
33
33
  deploy: {
34
34
  order: "post",
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
+ import { getOrganizationName, getWorkspaceName } from "./powerlines/src/plugin-utils/context-helpers.mjs";
1
2
  import { LocalWorkspace, fullyQualifiedStackName } from "@pulumi/pulumi/automation";
2
3
  import { omit } from "@stryke/helpers/index";
3
4
  import { joinPaths } from "@stryke/path/join";
4
5
  import { kebabCase } from "@stryke/string-format/kebab-case";
5
6
  import defu from "defu";
6
- import { getOrganizationName, getWorkspaceName } from "powerlines/plugin-utils/context-helpers";
7
7
 
8
8
  //#region src/index.ts
9
9
  /**
@@ -0,0 +1,49 @@
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
3
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
4
+
5
+ //#region ../powerlines/src/plugin-utils/context-helpers.ts
6
+ /**
7
+ * Get the organization name from the context
8
+ *
9
+ * @param context - The Powerlines plugin context.
10
+ * @returns The organization name or undefined if not found.
11
+ */
12
+ function getOrganizationName(context) {
13
+ let result;
14
+ if ((0, __stryke_type_checks_is_set_object.isSetObject)(context.workspaceConfig.organization)) result = context.workspaceConfig.organization.name;
15
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.workspaceConfig.organization)) result = context.workspaceConfig.organization;
16
+ if (!result && Array.isArray(context.packageJson.maintainers) && context.packageJson.maintainers.length > 0) {
17
+ if ((0, __stryke_type_checks_is_set_object.isSetObject)(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0].name;
18
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0];
19
+ }
20
+ if (!result && Array.isArray(context.packageJson.author) && context.packageJson.author.length > 0) {
21
+ if ((0, __stryke_type_checks_is_set_object.isSetObject)(context.packageJson.author[0])) result = context.packageJson.author[0].name;
22
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.packageJson.author[0])) result = context.packageJson.author[0];
23
+ }
24
+ if (!result && Array.isArray(context.packageJson.contributors) && context.packageJson.contributors.length > 0) {
25
+ if ((0, __stryke_type_checks_is_set_object.isSetObject)(context.packageJson.contributors[0])) result = context.packageJson.contributors[0].name;
26
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.packageJson.contributors[0])) result = context.packageJson.contributors[0];
27
+ }
28
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.packageJson.namespace)) result = context.packageJson.namespace.replace(/^@/, "");
29
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.packageJson.name)) result = context.packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
30
+ return result;
31
+ }
32
+ /**
33
+ * Get the organization name from the context
34
+ *
35
+ * @param context - The Powerlines plugin context.
36
+ * @returns The organization name or undefined if not found.
37
+ */
38
+ function getWorkspaceName(context) {
39
+ let result;
40
+ if ((0, __stryke_type_checks_is_set_string.isSetString)(context.workspaceConfig.name)) result = context.workspaceConfig.name;
41
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.workspaceConfig.namespace)) result = context.workspaceConfig.namespace.replace(/^@/, "");
42
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.packageJson.namespace)) result = context.packageJson.namespace.replace(/^@/, "");
43
+ if (!result && (0, __stryke_type_checks_is_set_string.isSetString)(context.packageJson.name)) result = context.packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
44
+ return result;
45
+ }
46
+
47
+ //#endregion
48
+ exports.getOrganizationName = getOrganizationName;
49
+ exports.getWorkspaceName = getWorkspaceName;
@@ -0,0 +1,47 @@
1
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
2
+ import { isSetString } from "@stryke/type-checks/is-set-string";
3
+
4
+ //#region ../powerlines/src/plugin-utils/context-helpers.ts
5
+ /**
6
+ * Get the organization name from the context
7
+ *
8
+ * @param context - The Powerlines plugin context.
9
+ * @returns The organization name or undefined if not found.
10
+ */
11
+ function getOrganizationName(context) {
12
+ let result;
13
+ if (isSetObject(context.workspaceConfig.organization)) result = context.workspaceConfig.organization.name;
14
+ if (!result && isSetString(context.workspaceConfig.organization)) result = context.workspaceConfig.organization;
15
+ if (!result && Array.isArray(context.packageJson.maintainers) && context.packageJson.maintainers.length > 0) {
16
+ if (isSetObject(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0].name;
17
+ if (!result && isSetString(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0];
18
+ }
19
+ if (!result && Array.isArray(context.packageJson.author) && context.packageJson.author.length > 0) {
20
+ if (isSetObject(context.packageJson.author[0])) result = context.packageJson.author[0].name;
21
+ if (!result && isSetString(context.packageJson.author[0])) result = context.packageJson.author[0];
22
+ }
23
+ if (!result && Array.isArray(context.packageJson.contributors) && context.packageJson.contributors.length > 0) {
24
+ if (isSetObject(context.packageJson.contributors[0])) result = context.packageJson.contributors[0].name;
25
+ if (!result && isSetString(context.packageJson.contributors[0])) result = context.packageJson.contributors[0];
26
+ }
27
+ if (!result && isSetString(context.packageJson.namespace)) result = context.packageJson.namespace.replace(/^@/, "");
28
+ if (!result && isSetString(context.packageJson.name)) result = context.packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
29
+ return result;
30
+ }
31
+ /**
32
+ * Get the organization name from the context
33
+ *
34
+ * @param context - The Powerlines plugin context.
35
+ * @returns The organization name or undefined if not found.
36
+ */
37
+ function getWorkspaceName(context) {
38
+ let result;
39
+ if (isSetString(context.workspaceConfig.name)) result = context.workspaceConfig.name;
40
+ if (!result && isSetString(context.workspaceConfig.namespace)) result = context.workspaceConfig.namespace.replace(/^@/, "");
41
+ if (!result && isSetString(context.packageJson.namespace)) result = context.packageJson.namespace.replace(/^@/, "");
42
+ if (!result && isSetString(context.packageJson.name)) result = context.packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
43
+ return result;
44
+ }
45
+
46
+ //#endregion
47
+ export { getOrganizationName, getWorkspaceName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-pulumi",
3
- "version": "0.2.202",
3
+ "version": "0.2.203",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to transform source code to be platform agnostic using pulumi.",
6
6
  "repository": {
@@ -129,9 +129,9 @@
129
129
  "typescript": "^5.9.3"
130
130
  },
131
131
  "devDependencies": {
132
- "@powerlines/plugin-plugin": "^0.12.173",
132
+ "@powerlines/plugin-plugin": "^0.12.174",
133
133
  "@types/node": "^24.10.9"
134
134
  },
135
135
  "publishConfig": { "access": "public" },
136
- "gitHead": "f7483367fc2dba244e8d11af31db5b1071e0a888"
136
+ "gitHead": "2852dab8ff7cad2d1aa4a44d7fd2479d62f65d47"
137
137
  }