@powerlines/core 0.46.4 → 0.46.6

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.
@@ -45,7 +45,7 @@ const LOG_CATEGORIES = [
45
45
  const DEFAULT_DEVELOPMENT_LOG_LEVEL = {
46
46
  general: "debug",
47
47
  fs: "info",
48
- config: "info",
48
+ config: "warn",
49
49
  plugins: "debug",
50
50
  hooks: "debug",
51
51
  performance: "debug",
@@ -67,9 +67,9 @@ const DEFAULT_TEST_LOG_LEVEL = {
67
67
  babel: "warn"
68
68
  };
69
69
  const DEFAULT_PRODUCTION_LOG_LEVEL = {
70
- general: "info",
70
+ general: "warn",
71
71
  fs: "error",
72
- config: "warn",
72
+ config: "error",
73
73
  plugins: "warn",
74
74
  hooks: "warn",
75
75
  performance: "info",
@@ -25,7 +25,7 @@ declare const LOG_CATEGORIES: readonly ["general", "fs", "performance", "config"
25
25
  declare const DEFAULT_DEVELOPMENT_LOG_LEVEL: {
26
26
  readonly general: "debug";
27
27
  readonly fs: "info";
28
- readonly config: "info";
28
+ readonly config: "warn";
29
29
  readonly plugins: "debug";
30
30
  readonly hooks: "debug";
31
31
  readonly performance: "debug";
@@ -47,9 +47,9 @@ declare const DEFAULT_TEST_LOG_LEVEL: {
47
47
  readonly babel: "warn";
48
48
  };
49
49
  declare const DEFAULT_PRODUCTION_LOG_LEVEL: {
50
- readonly general: "info";
50
+ readonly general: "warn";
51
51
  readonly fs: "error";
52
- readonly config: "warn";
52
+ readonly config: "error";
53
53
  readonly plugins: "warn";
54
54
  readonly hooks: "warn";
55
55
  readonly performance: "info";
@@ -25,7 +25,7 @@ declare const LOG_CATEGORIES: readonly ["general", "fs", "performance", "config"
25
25
  declare const DEFAULT_DEVELOPMENT_LOG_LEVEL: {
26
26
  readonly general: "debug";
27
27
  readonly fs: "info";
28
- readonly config: "info";
28
+ readonly config: "warn";
29
29
  readonly plugins: "debug";
30
30
  readonly hooks: "debug";
31
31
  readonly performance: "debug";
@@ -47,9 +47,9 @@ declare const DEFAULT_TEST_LOG_LEVEL: {
47
47
  readonly babel: "warn";
48
48
  };
49
49
  declare const DEFAULT_PRODUCTION_LOG_LEVEL: {
50
- readonly general: "info";
50
+ readonly general: "warn";
51
51
  readonly fs: "error";
52
- readonly config: "warn";
52
+ readonly config: "error";
53
53
  readonly plugins: "warn";
54
54
  readonly hooks: "warn";
55
55
  readonly performance: "info";
@@ -43,7 +43,7 @@ const LOG_CATEGORIES = [
43
43
  const DEFAULT_DEVELOPMENT_LOG_LEVEL = {
44
44
  general: "debug",
45
45
  fs: "info",
46
- config: "info",
46
+ config: "warn",
47
47
  plugins: "debug",
48
48
  hooks: "debug",
49
49
  performance: "debug",
@@ -65,9 +65,9 @@ const DEFAULT_TEST_LOG_LEVEL = {
65
65
  babel: "warn"
66
66
  };
67
67
  const DEFAULT_PRODUCTION_LOG_LEVEL = {
68
- general: "info",
68
+ general: "warn",
69
69
  fs: "error",
70
- config: "warn",
70
+ config: "error",
71
71
  plugins: "warn",
72
72
  hooks: "warn",
73
73
  performance: "info",
@@ -1 +1 @@
1
- {"version":3,"file":"log-level.mjs","names":[],"sources":["../../src/constants/log-level.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\nexport const LogLevels = {\n SILENT: \"silent\",\n ERROR: \"error\",\n WARN: \"warn\",\n INFO: \"info\",\n DEBUG: \"debug\",\n TRACE: \"trace\"\n} as const;\n\nexport const LOG_LEVELS = [\n LogLevels.SILENT,\n LogLevels.ERROR,\n LogLevels.WARN,\n LogLevels.INFO,\n LogLevels.DEBUG,\n LogLevels.TRACE\n] as const;\n\nexport const LogCategories = {\n GENERAL: \"general\",\n FS: \"fs\",\n PERFORMANCE: \"performance\",\n CONFIG: \"config\",\n PLUGINS: \"plugins\",\n HOOKS: \"hooks\",\n ENV: \"env\",\n IPC: \"ipc\",\n BABEL: \"babel\",\n NETWORK: \"network\"\n} as const;\n\nexport const LOG_CATEGORIES_ARRAY = Object.values(LogCategories);\n\nexport const LOG_CATEGORIES = [\n LogCategories.GENERAL,\n LogCategories.FS,\n LogCategories.PERFORMANCE,\n LogCategories.CONFIG,\n LogCategories.PLUGINS,\n LogCategories.HOOKS,\n LogCategories.ENV,\n LogCategories.IPC,\n LogCategories.NETWORK,\n LogCategories.BABEL\n] as const;\n\nexport const DEFAULT_DEVELOPMENT_LOG_LEVEL = {\n general: \"debug\",\n fs: \"info\",\n config: \"info\",\n plugins: \"debug\",\n hooks: \"debug\",\n performance: \"debug\",\n env: \"info\",\n ipc: \"info\",\n network: \"debug\",\n babel: \"debug\"\n} as const;\n\nexport const DEFAULT_TEST_LOG_LEVEL = {\n general: \"info\",\n fs: \"warn\",\n config: \"warn\",\n plugins: \"warn\",\n hooks: \"warn\",\n performance: \"info\",\n env: \"warn\",\n ipc: \"warn\",\n network: \"warn\",\n babel: \"warn\"\n} as const;\n\nexport const DEFAULT_PRODUCTION_LOG_LEVEL = {\n general: \"info\",\n fs: \"error\",\n config: \"warn\",\n plugins: \"warn\",\n hooks: \"warn\",\n performance: \"info\",\n env: \"error\",\n ipc: \"error\",\n network: \"error\",\n babel: \"warn\"\n} as const;\n"],"mappings":";AAkBA,MAAa,YAAY;CACvB,QAAQ;CACR,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACR;AAED,MAAa,aAAa;CACxB,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACX;AAED,MAAa,gBAAgB;CAC3B,SAAS;CACT,IAAI;CACJ,aAAa;CACb,QAAQ;CACR,SAAS;CACT,OAAO;CACP,KAAK;CACL,KAAK;CACL,OAAO;CACP,SAAS;CACV;AAED,MAAa,uBAAuB,OAAO,OAAO,cAAc;AAEhE,MAAa,iBAAiB;CAC5B,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACf;AAED,MAAa,gCAAgC;CAC3C,SAAS;CACT,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,OAAO;CACP,aAAa;CACb,KAAK;CACL,KAAK;CACL,SAAS;CACT,OAAO;CACR;AAED,MAAa,yBAAyB;CACpC,SAAS;CACT,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,OAAO;CACP,aAAa;CACb,KAAK;CACL,KAAK;CACL,SAAS;CACT,OAAO;CACR;AAED,MAAa,+BAA+B;CAC1C,SAAS;CACT,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,OAAO;CACP,aAAa;CACb,KAAK;CACL,KAAK;CACL,SAAS;CACT,OAAO;CACR"}
1
+ {"version":3,"file":"log-level.mjs","names":[],"sources":["../../src/constants/log-level.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\nexport const LogLevels = {\n SILENT: \"silent\",\n ERROR: \"error\",\n WARN: \"warn\",\n INFO: \"info\",\n DEBUG: \"debug\",\n TRACE: \"trace\"\n} as const;\n\nexport const LOG_LEVELS = [\n LogLevels.SILENT,\n LogLevels.ERROR,\n LogLevels.WARN,\n LogLevels.INFO,\n LogLevels.DEBUG,\n LogLevels.TRACE\n] as const;\n\nexport const LogCategories = {\n GENERAL: \"general\",\n FS: \"fs\",\n PERFORMANCE: \"performance\",\n CONFIG: \"config\",\n PLUGINS: \"plugins\",\n HOOKS: \"hooks\",\n ENV: \"env\",\n IPC: \"ipc\",\n BABEL: \"babel\",\n NETWORK: \"network\"\n} as const;\n\nexport const LOG_CATEGORIES_ARRAY = Object.values(LogCategories);\n\nexport const LOG_CATEGORIES = [\n LogCategories.GENERAL,\n LogCategories.FS,\n LogCategories.PERFORMANCE,\n LogCategories.CONFIG,\n LogCategories.PLUGINS,\n LogCategories.HOOKS,\n LogCategories.ENV,\n LogCategories.IPC,\n LogCategories.NETWORK,\n LogCategories.BABEL\n] as const;\n\nexport const DEFAULT_DEVELOPMENT_LOG_LEVEL = {\n general: \"debug\",\n fs: \"info\",\n config: \"warn\",\n plugins: \"debug\",\n hooks: \"debug\",\n performance: \"debug\",\n env: \"info\",\n ipc: \"info\",\n network: \"debug\",\n babel: \"debug\"\n} as const;\n\nexport const DEFAULT_TEST_LOG_LEVEL = {\n general: \"info\",\n fs: \"warn\",\n config: \"warn\",\n plugins: \"warn\",\n hooks: \"warn\",\n performance: \"info\",\n env: \"warn\",\n ipc: \"warn\",\n network: \"warn\",\n babel: \"warn\"\n} as const;\n\nexport const DEFAULT_PRODUCTION_LOG_LEVEL = {\n general: \"warn\",\n fs: \"error\",\n config: \"error\",\n plugins: \"warn\",\n hooks: \"warn\",\n performance: \"info\",\n env: \"error\",\n ipc: \"error\",\n network: \"error\",\n babel: \"warn\"\n} as const;\n"],"mappings":";AAkBA,MAAa,YAAY;CACvB,QAAQ;CACR,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACR;AAED,MAAa,aAAa;CACxB,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACX;AAED,MAAa,gBAAgB;CAC3B,SAAS;CACT,IAAI;CACJ,aAAa;CACb,QAAQ;CACR,SAAS;CACT,OAAO;CACP,KAAK;CACL,KAAK;CACL,OAAO;CACP,SAAS;CACV;AAED,MAAa,uBAAuB,OAAO,OAAO,cAAc;AAEhE,MAAa,iBAAiB;CAC5B,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACd,cAAc;CACf;AAED,MAAa,gCAAgC;CAC3C,SAAS;CACT,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,OAAO;CACP,aAAa;CACb,KAAK;CACL,KAAK;CACL,SAAS;CACT,OAAO;CACR;AAED,MAAa,yBAAyB;CACpC,SAAS;CACT,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,OAAO;CACP,aAAa;CACb,KAAK;CACL,KAAK;CACL,SAAS;CACT,OAAO;CACR;AAED,MAAa,+BAA+B;CAC1C,SAAS;CACT,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,OAAO;CACP,aAAa;CACb,KAAK;CACL,KAAK;CACL,SAAS;CACT,OAAO;CACR"}
@@ -12,22 +12,31 @@ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-stri
12
12
  * @returns The organization name or undefined if not found.
13
13
  */
14
14
  function getOrganizationName(context) {
15
+ if ((0, _stryke_type_checks_is_set_string.isSetString)(context.config.organization)) return context.config.organization;
16
+ return getPackageJsonOrganization(context.packageJson);
17
+ }
18
+ /**
19
+ * Get the organization name from the `package.json` file
20
+ *
21
+ * @param packageJson - The `package.json` object to extract the organization name from.
22
+ * @returns The organization name or undefined if not found.
23
+ */
24
+ function getPackageJsonOrganization(packageJson) {
15
25
  let result;
16
- if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(context.config.organization)) result = context.config.organization;
17
- if (!result && Array.isArray(context.packageJson.maintainers) && context.packageJson.maintainers.length > 0) {
18
- if ((0, _stryke_type_checks_is_set_object.isSetObject)(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0].name;
19
- if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0];
26
+ if (Array.isArray(packageJson.maintainers) && packageJson.maintainers.length > 0) {
27
+ if ((0, _stryke_type_checks_is_set_object.isSetObject)(packageJson.maintainers[0])) result = packageJson.maintainers[0].name;
28
+ if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(packageJson.maintainers[0])) result = packageJson.maintainers[0];
20
29
  }
21
- if (!result && Array.isArray(context.packageJson.author) && context.packageJson.author.length > 0) {
22
- if ((0, _stryke_type_checks_is_set_object.isSetObject)(context.packageJson.author[0])) result = context.packageJson.author[0].name;
23
- if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(context.packageJson.author[0])) result = context.packageJson.author[0];
30
+ if (!result && Array.isArray(packageJson.author) && packageJson.author.length > 0) {
31
+ if ((0, _stryke_type_checks_is_set_object.isSetObject)(packageJson.author[0])) result = packageJson.author[0].name;
32
+ if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(packageJson.author[0])) result = packageJson.author[0];
24
33
  }
25
- if (!result && Array.isArray(context.packageJson.contributors) && context.packageJson.contributors.length > 0) {
26
- if ((0, _stryke_type_checks_is_set_object.isSetObject)(context.packageJson.contributors[0])) result = context.packageJson.contributors[0].name;
27
- if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(context.packageJson.contributors[0])) result = context.packageJson.contributors[0];
34
+ if (!result && Array.isArray(packageJson.contributors) && packageJson.contributors.length > 0) {
35
+ if ((0, _stryke_type_checks_is_set_object.isSetObject)(packageJson.contributors[0])) result = packageJson.contributors[0].name;
36
+ if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(packageJson.contributors[0])) result = packageJson.contributors[0];
28
37
  }
29
- if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(context.packageJson.namespace)) result = context.packageJson.namespace.replace(/^@/, "");
30
- if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(context.packageJson.name)) result = context.packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
38
+ if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(packageJson.namespace)) result = packageJson.namespace?.replace(/^@/, "");
39
+ if (!result && (0, _stryke_type_checks_is_set_string.isSetString)(packageJson.name)) result = packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
31
40
  return result;
32
41
  }
33
42
  /**
@@ -50,4 +59,5 @@ async function getWorkspaceName(context) {
50
59
 
51
60
  //#endregion
52
61
  exports.getOrganizationName = getOrganizationName;
62
+ exports.getPackageJsonOrganization = getPackageJsonOrganization;
53
63
  exports.getWorkspaceName = getWorkspaceName;
@@ -1,4 +1,5 @@
1
1
  import { UnresolvedContext } from "../types/context.cjs";
2
+ import { PackageJson } from "@stryke/types/package-json";
2
3
 
3
4
  //#region src/plugin-utils/context-helpers.d.ts
4
5
  /**
@@ -8,6 +9,13 @@ import { UnresolvedContext } from "../types/context.cjs";
8
9
  * @returns The organization name or undefined if not found.
9
10
  */
10
11
  declare function getOrganizationName(context: UnresolvedContext): string | undefined;
12
+ /**
13
+ * Get the organization name from the `package.json` file
14
+ *
15
+ * @param packageJson - The `package.json` object to extract the organization name from.
16
+ * @returns The organization name or undefined if not found.
17
+ */
18
+ declare function getPackageJsonOrganization(packageJson: PackageJson): string | undefined;
11
19
  /**
12
20
  * Get the organization name from the context
13
21
  *
@@ -16,5 +24,5 @@ declare function getOrganizationName(context: UnresolvedContext): string | undef
16
24
  */
17
25
  declare function getWorkspaceName(context: UnresolvedContext): Promise<string | undefined>;
18
26
  //#endregion
19
- export { getOrganizationName, getWorkspaceName };
27
+ export { getOrganizationName, getPackageJsonOrganization, getWorkspaceName };
20
28
  //# sourceMappingURL=context-helpers.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;AA6BA;;;;iBAAgB,mBAAA,CACd,OAAA,EAAS,iBAAA;AAkEX;;;;;;AAAA,iBAAsB,gBAAA,CACpB,OAAA,EAAS,iBAAA,GACR,OAAA"}
1
+ {"version":3,"file":"context-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;;AA8BA;;;;iBAAgB,mBAAA,CACd,OAAA,EAAS,iBAAA;AAeX;;;;;AA8DA;AA9DA,iBAAgB,0BAAA,CACd,WAAA,EAAa,WAAA;;;;;;;iBA6DO,gBAAA,CACpB,OAAA,EAAS,iBAAA,GACR,OAAA"}
@@ -1,4 +1,5 @@
1
1
  import { UnresolvedContext } from "../types/context.mjs";
2
+ import { PackageJson } from "@stryke/types/package-json";
2
3
 
3
4
  //#region src/plugin-utils/context-helpers.d.ts
4
5
  /**
@@ -8,6 +9,13 @@ import { UnresolvedContext } from "../types/context.mjs";
8
9
  * @returns The organization name or undefined if not found.
9
10
  */
10
11
  declare function getOrganizationName(context: UnresolvedContext): string | undefined;
12
+ /**
13
+ * Get the organization name from the `package.json` file
14
+ *
15
+ * @param packageJson - The `package.json` object to extract the organization name from.
16
+ * @returns The organization name or undefined if not found.
17
+ */
18
+ declare function getPackageJsonOrganization(packageJson: PackageJson): string | undefined;
11
19
  /**
12
20
  * Get the organization name from the context
13
21
  *
@@ -16,5 +24,5 @@ declare function getOrganizationName(context: UnresolvedContext): string | undef
16
24
  */
17
25
  declare function getWorkspaceName(context: UnresolvedContext): Promise<string | undefined>;
18
26
  //#endregion
19
- export { getOrganizationName, getWorkspaceName };
27
+ export { getOrganizationName, getPackageJsonOrganization, getWorkspaceName };
20
28
  //# sourceMappingURL=context-helpers.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;AA6BA;;;;iBAAgB,mBAAA,CACd,OAAA,EAAS,iBAAA;AAkEX;;;;;;AAAA,iBAAsB,gBAAA,CACpB,OAAA,EAAS,iBAAA,GACR,OAAA"}
1
+ {"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;;AA8BA;;;;iBAAgB,mBAAA,CACd,OAAA,EAAS,iBAAA;AAeX;;;;;AA8DA;AA9DA,iBAAgB,0BAAA,CACd,WAAA,EAAa,WAAA;;;;;;;iBA6DO,gBAAA,CACpB,OAAA,EAAS,iBAAA,GACR,OAAA"}
@@ -10,22 +10,31 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
10
10
  * @returns The organization name or undefined if not found.
11
11
  */
12
12
  function getOrganizationName(context) {
13
+ if (isSetString(context.config.organization)) return context.config.organization;
14
+ return getPackageJsonOrganization(context.packageJson);
15
+ }
16
+ /**
17
+ * Get the organization name from the `package.json` file
18
+ *
19
+ * @param packageJson - The `package.json` object to extract the organization name from.
20
+ * @returns The organization name or undefined if not found.
21
+ */
22
+ function getPackageJsonOrganization(packageJson) {
13
23
  let result;
14
- if (!result && isSetString(context.config.organization)) result = context.config.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];
24
+ if (Array.isArray(packageJson.maintainers) && packageJson.maintainers.length > 0) {
25
+ if (isSetObject(packageJson.maintainers[0])) result = packageJson.maintainers[0].name;
26
+ if (!result && isSetString(packageJson.maintainers[0])) result = packageJson.maintainers[0];
18
27
  }
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];
28
+ if (!result && Array.isArray(packageJson.author) && packageJson.author.length > 0) {
29
+ if (isSetObject(packageJson.author[0])) result = packageJson.author[0].name;
30
+ if (!result && isSetString(packageJson.author[0])) result = packageJson.author[0];
22
31
  }
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];
32
+ if (!result && Array.isArray(packageJson.contributors) && packageJson.contributors.length > 0) {
33
+ if (isSetObject(packageJson.contributors[0])) result = packageJson.contributors[0].name;
34
+ if (!result && isSetString(packageJson.contributors[0])) result = packageJson.contributors[0];
26
35
  }
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(/\/.*$/, "");
36
+ if (!result && isSetString(packageJson.namespace)) result = packageJson.namespace?.replace(/^@/, "");
37
+ if (!result && isSetString(packageJson.name)) result = packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
29
38
  return result;
30
39
  }
31
40
  /**
@@ -47,5 +56,5 @@ async function getWorkspaceName(context) {
47
56
  }
48
57
 
49
58
  //#endregion
50
- export { getOrganizationName, getWorkspaceName };
59
+ export { getOrganizationName, getPackageJsonOrganization, getWorkspaceName };
51
60
  //# sourceMappingURL=context-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.mjs","names":[],"sources":["../../src/plugin-utils/context-helpers.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 { tryGetWorkspaceConfig } from \"@storm-software/config-tools/get-config\";\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 (!result && isSetString(context.config.organization)) {\n result = context.config.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 async function getWorkspaceName(\n context: UnresolvedContext\n): Promise<string | undefined> {\n let result: string | undefined;\n\n const workspaceConfig = await tryGetWorkspaceConfig(true);\n if (workspaceConfig) {\n if (isSetString(workspaceConfig.name)) {\n result = workspaceConfig.name;\n }\n\n if (!result && isSetString(workspaceConfig.namespace)) {\n result = workspaceConfig.namespace.replace(/^@/, \"\");\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"],"mappings":";;;;;;;;;;;AA6BA,SAAgB,oBACd,SACoB;CACpB,IAAI;AACJ,KAAI,CAAC,UAAU,YAAY,QAAQ,OAAO,aAAa,CACrD,UAAS,QAAQ,OAAO;AAG1B,KACE,CAAC,UACD,MAAM,QAAQ,QAAQ,YAAY,YAAY,IAC9C,QAAQ,YAAY,YAAY,SAAS,GACzC;AACA,MAAI,YAAY,QAAQ,YAAY,YAAY,GAAG,CACjD,UAAU,QAAQ,YAAY,YAAY,GAAwB;AAGpE,MAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,YAAY,GAAG,CAC5D,UAAS,QAAQ,YAAY,YAAY;;AAI7C,KACE,CAAC,UACD,MAAM,QAAQ,QAAQ,YAAY,OAAO,IACzC,QAAQ,YAAY,OAAO,SAAS,GACpC;AACA,MAAI,YAAY,QAAQ,YAAY,OAAO,GAAG,CAC5C,UAAU,QAAQ,YAAY,OAAO,GAAwB;AAG/D,MAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,OAAO,GAAG,CACvD,UAAS,QAAQ,YAAY,OAAO;;AAIxC,KACE,CAAC,UACD,MAAM,QAAQ,QAAQ,YAAY,aAAa,IAC/C,QAAQ,YAAY,aAAa,SAAS,GAC1C;AACA,MAAI,YAAY,QAAQ,YAAY,aAAa,GAAG,CAClD,UAAU,QAAQ,YAAY,aAAa,GAAwB;AAGrE,MAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,aAAa,GAAG,CAC7D,UAAS,QAAQ,YAAY,aAAa;;AAI9C,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,UAAU,CACvD,UAAS,QAAQ,YAAY,UAAU,QAAQ,MAAM,GAAG;AAG1D,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,KAAK,CAClD,UAAS,QAAQ,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAG1E,QAAO;;;;;;;;AAST,eAAsB,iBACpB,SAC6B;CAC7B,IAAI;CAEJ,MAAM,kBAAkB,MAAM,sBAAsB,KAAK;AACzD,KAAI,iBAAiB;AACnB,MAAI,YAAY,gBAAgB,KAAK,CACnC,UAAS,gBAAgB;AAG3B,MAAI,CAAC,UAAU,YAAY,gBAAgB,UAAU,CACnD,UAAS,gBAAgB,UAAU,QAAQ,MAAM,GAAG;;AAIxD,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,UAAU,CACvD,UAAS,QAAQ,YAAY,UAAU,QAAQ,MAAM,GAAG;AAG1D,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,KAAK,CAClD,UAAS,QAAQ,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAG1E,QAAO"}
1
+ {"version":3,"file":"context-helpers.mjs","names":[],"sources":["../../src/plugin-utils/context-helpers.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 { tryGetWorkspaceConfig } from \"@storm-software/config-tools/get-config\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { PackageJson } from \"@stryke/types/package-json\";\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 if (isSetString(context.config.organization)) {\n return context.config.organization;\n }\n\n return getPackageJsonOrganization(context.packageJson);\n}\n\n/**\n * Get the organization name from the `package.json` file\n *\n * @param packageJson - The `package.json` object to extract the organization name from.\n * @returns The organization name or undefined if not found.\n */\nexport function getPackageJsonOrganization(\n packageJson: PackageJson\n): string | undefined {\n let result: string | undefined;\n if (\n Array.isArray(packageJson.maintainers) &&\n packageJson.maintainers.length > 0\n ) {\n if (isSetObject(packageJson.maintainers[0])) {\n result = (packageJson.maintainers[0] as { name: string }).name;\n }\n\n if (!result && isSetString(packageJson.maintainers[0])) {\n result = packageJson.maintainers[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(packageJson.author) &&\n packageJson.author.length > 0\n ) {\n if (isSetObject(packageJson.author[0])) {\n result = (packageJson.author[0] as { name: string }).name;\n }\n\n if (!result && isSetString(packageJson.author[0])) {\n result = packageJson.author[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(packageJson.contributors) &&\n packageJson.contributors.length > 0\n ) {\n if (isSetObject(packageJson.contributors[0])) {\n result = (packageJson.contributors[0] as { name: string }).name;\n }\n\n if (!result && isSetString(packageJson.contributors[0])) {\n result = packageJson.contributors[0];\n }\n }\n\n if (!result && isSetString(packageJson.namespace)) {\n result = packageJson.namespace?.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(packageJson.name)) {\n result = 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 async function getWorkspaceName(\n context: UnresolvedContext\n): Promise<string | undefined> {\n let result: string | undefined;\n\n const workspaceConfig = await tryGetWorkspaceConfig(true);\n if (workspaceConfig) {\n if (isSetString(workspaceConfig.name)) {\n result = workspaceConfig.name;\n }\n\n if (!result && isSetString(workspaceConfig.namespace)) {\n result = workspaceConfig.namespace.replace(/^@/, \"\");\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"],"mappings":";;;;;;;;;;;AA8BA,SAAgB,oBACd,SACoB;AACpB,KAAI,YAAY,QAAQ,OAAO,aAAa,CAC1C,QAAO,QAAQ,OAAO;AAGxB,QAAO,2BAA2B,QAAQ,YAAY;;;;;;;;AASxD,SAAgB,2BACd,aACoB;CACpB,IAAI;AACJ,KACE,MAAM,QAAQ,YAAY,YAAY,IACtC,YAAY,YAAY,SAAS,GACjC;AACA,MAAI,YAAY,YAAY,YAAY,GAAG,CACzC,UAAU,YAAY,YAAY,GAAwB;AAG5D,MAAI,CAAC,UAAU,YAAY,YAAY,YAAY,GAAG,CACpD,UAAS,YAAY,YAAY;;AAIrC,KACE,CAAC,UACD,MAAM,QAAQ,YAAY,OAAO,IACjC,YAAY,OAAO,SAAS,GAC5B;AACA,MAAI,YAAY,YAAY,OAAO,GAAG,CACpC,UAAU,YAAY,OAAO,GAAwB;AAGvD,MAAI,CAAC,UAAU,YAAY,YAAY,OAAO,GAAG,CAC/C,UAAS,YAAY,OAAO;;AAIhC,KACE,CAAC,UACD,MAAM,QAAQ,YAAY,aAAa,IACvC,YAAY,aAAa,SAAS,GAClC;AACA,MAAI,YAAY,YAAY,aAAa,GAAG,CAC1C,UAAU,YAAY,aAAa,GAAwB;AAG7D,MAAI,CAAC,UAAU,YAAY,YAAY,aAAa,GAAG,CACrD,UAAS,YAAY,aAAa;;AAItC,KAAI,CAAC,UAAU,YAAY,YAAY,UAAU,CAC/C,UAAS,YAAY,WAAW,QAAQ,MAAM,GAAG;AAGnD,KAAI,CAAC,UAAU,YAAY,YAAY,KAAK,CAC1C,UAAS,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAGlE,QAAO;;;;;;;;AAST,eAAsB,iBACpB,SAC6B;CAC7B,IAAI;CAEJ,MAAM,kBAAkB,MAAM,sBAAsB,KAAK;AACzD,KAAI,iBAAiB;AACnB,MAAI,YAAY,gBAAgB,KAAK,CACnC,UAAS,gBAAgB;AAG3B,MAAI,CAAC,UAAU,YAAY,gBAAgB,UAAU,CACnD,UAAS,gBAAgB,UAAU,QAAQ,MAAM,GAAG;;AAIxD,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,UAAU,CACvD,UAAS,QAAQ,YAAY,UAAU,QAAQ,MAAM,GAAG;AAG1D,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,KAAK,CAClD,UAAS,QAAQ,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAG1E,QAAO"}
@@ -0,0 +1,36 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
4
+ let _stryke_convert_to_array = require("@stryke/convert/to-array");
5
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
6
+ let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
7
+ let _stryke_helpers_omit = require("@stryke/helpers/omit");
8
+
9
+ //#region src/plugin-utils/format.ts
10
+ /**
11
+ * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
12
+ *
13
+ * @param config - The configuration object to format.
14
+ * @returns A formatted string representation of the configuration.
15
+ */
16
+ function formatConfig(config) {
17
+ return JSON.stringify(Object.fromEntries(Object.entries({
18
+ ...(0, _stryke_helpers_omit.omit)(config, [
19
+ "plugins",
20
+ "initialConfig",
21
+ "userConfig",
22
+ "inlineConfig",
23
+ "pluginConfig",
24
+ "environmentConfig"
25
+ ]),
26
+ resolve: {
27
+ ...config.resolve,
28
+ external: (config.resolve?.external ?? []).filter(Boolean).map((external) => (0, _stryke_type_checks_is_set_string.isSetString)(external) ? external : (0, _stryke_type_checks_is_regexp.isRegExp)(external) ? external.source : "<unknown-external>"),
29
+ noExternal: (config.resolve?.noExternal ?? []).filter(Boolean).map((noExternal) => (0, _stryke_type_checks_is_set_string.isSetString)(noExternal) ? noExternal : (0, _stryke_type_checks_is_regexp.isRegExp)(noExternal) ? noExternal.source : "<unknown-no-external>")
30
+ },
31
+ plugins: config.plugins ? (0, _stryke_convert_to_array.toArray)(config.plugins)?.flatMap((plugin) => (0, _stryke_convert_to_array.toArray)(plugin))?.map((plugin) => String((0, _stryke_type_checks_is_set_string.isSetString)(plugin) ? plugin : (0, _stryke_type_checks_is_set_object.isSetObject)(plugin) && (0, _stryke_type_checks_is_set_string.isSetString)(plugin.name) ? plugin.name : Array.isArray(plugin) && (0, _stryke_type_checks_is_set_string.isSetString)(plugin[0]) ? plugin[0] : "<function-plugin>")) : []
32
+ }).sort(([key1], [key2]) => key1.localeCompare(key2))), null, 4).replace(/"([^"]+)":/g, "$1:").replace(/,\s*$/g, "");
33
+ }
34
+
35
+ //#endregion
36
+ exports.formatConfig = formatConfig;
@@ -0,0 +1,11 @@
1
+ //#region src/plugin-utils/format.d.ts
2
+ /**
3
+ * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
4
+ *
5
+ * @param config - The configuration object to format.
6
+ * @returns A formatted string representation of the configuration.
7
+ */
8
+ declare function formatConfig(config: Record<string, any>): string;
9
+ //#endregion
10
+ export { formatConfig };
11
+ //# sourceMappingURL=format.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.cts","names":[],"sources":["../../src/plugin-utils/format.ts"],"mappings":";;AA+BA;;;;;iBAAgB,YAAA,CAAa,MAAA,EAAQ,MAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/plugin-utils/format.d.ts
2
+ /**
3
+ * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
4
+ *
5
+ * @param config - The configuration object to format.
6
+ * @returns A formatted string representation of the configuration.
7
+ */
8
+ declare function formatConfig(config: Record<string, any>): string;
9
+ //#endregion
10
+ export { formatConfig };
11
+ //# sourceMappingURL=format.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.mts","names":[],"sources":["../../src/plugin-utils/format.ts"],"mappings":";;AA+BA;;;;;iBAAgB,YAAA,CAAa,MAAA,EAAQ,MAAA"}
@@ -0,0 +1,35 @@
1
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
2
+ import { toArray } from "@stryke/convert/to-array";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+ import { isRegExp } from "@stryke/type-checks/is-regexp";
5
+ import { omit } from "@stryke/helpers/omit";
6
+
7
+ //#region src/plugin-utils/format.ts
8
+ /**
9
+ * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
10
+ *
11
+ * @param config - The configuration object to format.
12
+ * @returns A formatted string representation of the configuration.
13
+ */
14
+ function formatConfig(config) {
15
+ return JSON.stringify(Object.fromEntries(Object.entries({
16
+ ...omit(config, [
17
+ "plugins",
18
+ "initialConfig",
19
+ "userConfig",
20
+ "inlineConfig",
21
+ "pluginConfig",
22
+ "environmentConfig"
23
+ ]),
24
+ resolve: {
25
+ ...config.resolve,
26
+ external: (config.resolve?.external ?? []).filter(Boolean).map((external) => isSetString(external) ? external : isRegExp(external) ? external.source : "<unknown-external>"),
27
+ noExternal: (config.resolve?.noExternal ?? []).filter(Boolean).map((noExternal) => isSetString(noExternal) ? noExternal : isRegExp(noExternal) ? noExternal.source : "<unknown-no-external>")
28
+ },
29
+ plugins: config.plugins ? toArray(config.plugins)?.flatMap((plugin) => toArray(plugin))?.map((plugin) => String(isSetString(plugin) ? plugin : isSetObject(plugin) && isSetString(plugin.name) ? plugin.name : Array.isArray(plugin) && isSetString(plugin[0]) ? plugin[0] : "<function-plugin>")) : []
30
+ }).sort(([key1], [key2]) => key1.localeCompare(key2))), null, 4).replace(/"([^"]+)":/g, "$1:").replace(/,\s*$/g, "");
31
+ }
32
+
33
+ //#endregion
34
+ export { formatConfig };
35
+ //# sourceMappingURL=format.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.mjs","names":[],"sources":["../../src/plugin-utils/format.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 { toArray } from \"@stryke/convert/to-array\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { ResolveConfig, ResolvedConfig } from \"../types/config\";\n\n/**\n * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.\n *\n * @param config - The configuration object to format.\n * @returns A formatted string representation of the configuration.\n */\nexport function formatConfig(config: Record<string, any>): string {\n return JSON.stringify(\n Object.fromEntries(\n Object.entries({\n ...omit(config, [\n \"plugins\",\n \"initialConfig\",\n \"userConfig\",\n \"inlineConfig\",\n \"pluginConfig\",\n \"environmentConfig\"\n ]),\n resolve: {\n ...config.resolve,\n external: ((config.resolve as ResolveConfig)?.external ?? [])\n .filter(Boolean)\n .map(external =>\n isSetString(external)\n ? external\n : isRegExp(external)\n ? external.source\n : \"<unknown-external>\"\n ),\n noExternal: ((config.resolve as ResolveConfig)?.noExternal ?? [])\n .filter(Boolean)\n .map(noExternal =>\n isSetString(noExternal)\n ? noExternal\n : isRegExp(noExternal)\n ? noExternal.source\n : \"<unknown-no-external>\"\n )\n },\n plugins: config.plugins\n ? (toArray(config.plugins) as ResolvedConfig[\"plugins\"])\n ?.flatMap(plugin => toArray(plugin))\n ?.map(plugin =>\n String(\n isSetString(plugin)\n ? plugin\n : isSetObject(plugin) &&\n isSetString((plugin as { name: string }).name)\n ? (plugin as { name: string }).name\n : Array.isArray(plugin) && isSetString(plugin[0])\n ? plugin[0]\n : \"<function-plugin>\"\n )\n )\n : []\n }).sort(([key1], [key2]) => key1.localeCompare(key2))\n ),\n null,\n 4\n )\n .replace(/\"([^\"]+)\":/g, \"$1:\")\n .replace(/,\\s*$/g, \"\");\n}\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAgB,aAAa,QAAqC;AAChE,QAAO,KAAK,UACV,OAAO,YACL,OAAO,QAAQ;EACb,GAAG,KAAK,QAAQ;GACd;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EACF,SAAS;GACP,GAAG,OAAO;GACV,WAAY,OAAO,SAA2B,YAAY,EAAE,EACzD,OAAO,QAAQ,CACf,KAAI,aACH,YAAY,SAAS,GACjB,WACA,SAAS,SAAS,GAChB,SAAS,SACT,qBACP;GACH,aAAc,OAAO,SAA2B,cAAc,EAAE,EAC7D,OAAO,QAAQ,CACf,KAAI,eACH,YAAY,WAAW,GACnB,aACA,SAAS,WAAW,GAClB,WAAW,SACX,wBACP;GACJ;EACD,SAAS,OAAO,UACX,QAAQ,OAAO,QAAQ,EACpB,SAAQ,WAAU,QAAQ,OAAO,CAAC,EAClC,KAAI,WACJ,OACE,YAAY,OAAO,GACf,SACA,YAAY,OAAO,IACjB,YAAa,OAA4B,KAAK,GAC7C,OAA4B,OAC7B,MAAM,QAAQ,OAAO,IAAI,YAAY,OAAO,GAAG,GAC7C,OAAO,KACP,oBACT,CACF,GACH,EAAE;EACP,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK,cAAc,KAAK,CAAC,CACtD,EACD,MACA,EACD,CACE,QAAQ,eAAe,MAAM,CAC7B,QAAQ,UAAU,GAAG"}
@@ -9,6 +9,7 @@ const require_plugin_utils_context_helpers = require('./context-helpers.cjs');
9
9
  const require_plugin_utils_docs_helper = require('./docs-helper.cjs');
10
10
  const require_plugin_utils_extend = require('./extend.cjs');
11
11
  const require_plugin_utils_filter = require('./filter.cjs');
12
+ const require_plugin_utils_format = require('./format.cjs');
12
13
  const require_plugin_utils_get_config_path = require('./get-config-path.cjs');
13
14
  const require_plugin_utils_logging = require('./logging.cjs');
14
15
  const require_plugin_utils_modules = require('./modules.cjs');
@@ -33,12 +34,14 @@ exports.extendLogFn = require_plugin_utils_logging.extendLogFn;
33
34
  exports.extendLogger = require_plugin_utils_logging.extendLogger;
34
35
  exports.extractPluginHook = require_plugin_utils_helpers.extractPluginHook;
35
36
  exports.findInvalidPluginConfig = require_plugin_utils_helpers.findInvalidPluginConfig;
37
+ exports.formatConfig = require_plugin_utils_format.formatConfig;
36
38
  exports.formatPackageJson = require_plugin_utils_format_package_json.formatPackageJson;
37
39
  exports.getConfigPath = require_plugin_utils_get_config_path.getConfigPath;
38
40
  exports.getDependencyConfig = require_plugin_utils_build_helpers.getDependencyConfig;
39
41
  exports.getDocsOutputPath = require_plugin_utils_docs_helper.getDocsOutputPath;
40
42
  exports.getHookHandler = require_plugin_utils_helpers.getHookHandler;
41
43
  exports.getOrganizationName = require_plugin_utils_context_helpers.getOrganizationName;
44
+ exports.getPackageJsonOrganization = require_plugin_utils_context_helpers.getPackageJsonOrganization;
42
45
  exports.getTextColor = require_plugin_utils_logging.getTextColor;
43
46
  exports.getWorkspaceName = require_plugin_utils_context_helpers.getWorkspaceName;
44
47
  exports.isBuiltinModule = require_plugin_utils_modules.isBuiltinModule;
@@ -1,14 +1,15 @@
1
1
  import { GetDependencyConfigResult, __ΩGetDependencyConfigResult, getDependencyConfig } from "./build-helpers.cjs";
2
2
  import { CombinePluginsOptions, __ΩCombinePluginsOptions, combinePluginOptions, combinePlugins } from "./combine-plugins.cjs";
3
- import { getOrganizationName, getWorkspaceName } from "./context-helpers.cjs";
3
+ import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.cjs";
4
4
  import { getDocsOutputPath } from "./docs-helper.cjs";
5
5
  import { extend } from "./extend.cjs";
6
6
  import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter } from "./filter.cjs";
7
7
  import { formatPackageJson } from "./format-package-json.cjs";
8
+ import { formatConfig } from "./format.cjs";
8
9
  import { getConfigPath } from "./get-config-path.cjs";
9
10
  import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.cjs";
10
11
  import { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, createLogger, extendLogFn, extendLogger, getTextColor, isValidLogLevel, isValidLogLevelConfig, isVerbose, resolveLogLevel, withCustomLogger, withLogFn, withLogger } from "./logging.cjs";
11
12
  import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.cjs";
12
13
  import { isBuiltinModule } from "./modules.cjs";
13
14
  import { replacePathTokens } from "./paths.cjs";
14
- export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, merge, mergeConfig, normalizeFilter, patternToCodeFilter, patternToIdFilter, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
15
+ export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, merge, mergeConfig, normalizeFilter, patternToCodeFilter, patternToIdFilter, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
@@ -1,14 +1,15 @@
1
1
  import { GetDependencyConfigResult, __ΩGetDependencyConfigResult, getDependencyConfig } from "./build-helpers.mjs";
2
2
  import { CombinePluginsOptions, __ΩCombinePluginsOptions, combinePluginOptions, combinePlugins } from "./combine-plugins.mjs";
3
- import { getOrganizationName, getWorkspaceName } from "./context-helpers.mjs";
3
+ import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
4
4
  import { getDocsOutputPath } from "./docs-helper.mjs";
5
5
  import { extend } from "./extend.mjs";
6
6
  import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter } from "./filter.mjs";
7
7
  import { formatPackageJson } from "./format-package-json.mjs";
8
+ import { formatConfig } from "./format.mjs";
8
9
  import { getConfigPath } from "./get-config-path.mjs";
9
10
  import { GetHookHandlerReturnType, __ΩGetHookHandlerReturnType, addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
10
11
  import { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, createLogger, extendLogFn, extendLogger, getTextColor, isValidLogLevel, isValidLogLevelConfig, isVerbose, resolveLogLevel, withCustomLogger, withLogFn, withLogger } from "./logging.mjs";
11
12
  import { MergeResult, __ΩMergeResult, merge, mergeConfig } from "./merge.mjs";
12
13
  import { isBuiltinModule } from "./modules.mjs";
13
14
  import { replacePathTokens } from "./paths.mjs";
14
- export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, merge, mergeConfig, normalizeFilter, patternToCodeFilter, patternToIdFilter, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
15
+ export { CombinePluginsOptions, GetDependencyConfigResult, GetHookHandlerReturnType, MergeResult, __ΩCombinePluginsOptions, __ΩGetDependencyConfigResult, __ΩGetHookHandlerReturnType, __ΩMergeResult, addPluginHook, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, merge, mergeConfig, normalizeFilter, patternToCodeFilter, patternToIdFilter, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
@@ -4,12 +4,13 @@ import { getDependencyConfig } from "./build-helpers.mjs";
4
4
  import { addPluginHook, dedupeHooklist, extractPluginHook, findInvalidPluginConfig, getHookHandler, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey } from "./helpers.mjs";
5
5
  import { merge, mergeConfig } from "./merge.mjs";
6
6
  import { combinePluginOptions, combinePlugins } from "./combine-plugins.mjs";
7
- import { getOrganizationName, getWorkspaceName } from "./context-helpers.mjs";
7
+ import { getOrganizationName, getPackageJsonOrganization, getWorkspaceName } from "./context-helpers.mjs";
8
8
  import { getDocsOutputPath } from "./docs-helper.mjs";
9
9
  import { extend } from "./extend.mjs";
10
10
  import { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, patternToCodeFilter, patternToIdFilter } from "./filter.mjs";
11
+ import { formatConfig } from "./format.mjs";
11
12
  import { getConfigPath } from "./get-config-path.mjs";
12
13
  import { colorBackground, colorText, consoleLog, consoleLogger, createLogFn, createLogger, extendLogFn, extendLogger, getTextColor, isValidLogLevel, isValidLogLevelConfig, isVerbose, resolveLogLevel, withCustomLogger, withLogFn, withLogger } from "./logging.mjs";
13
14
  import { isBuiltinModule } from "./modules.mjs";
14
15
 
15
- export { addPluginHook, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, merge, mergeConfig, normalizeFilter, patternToCodeFilter, patternToIdFilter, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
16
+ export { addPluginHook, colorBackground, colorText, combinePluginOptions, combinePlugins, consoleLog, consoleLogger, createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, createLogFn, createLogger, dedupeHooklist, extend, extendLogFn, extendLogger, extractPluginHook, findInvalidPluginConfig, formatConfig, formatPackageJson, getConfigPath, getDependencyConfig, getDocsOutputPath, getHookHandler, getOrganizationName, getPackageJsonOrganization, getTextColor, getWorkspaceName, isBuiltinModule, isDuplicate, isPlugin, isPluginConfig, isPluginConfigObject, isPluginConfigTuple, isPluginHook, isPluginHookField, isPluginHookFunction, isPluginHookObject, isUnpluginHookField, isUnpluginHookKey, isValidLogLevel, isValidLogLevelConfig, isVerbose, merge, mergeConfig, normalizeFilter, patternToCodeFilter, patternToIdFilter, replacePathTokens, resolveLogLevel, withCustomLogger, withLogFn, withLogger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/core",
3
- "version": "0.46.4",
3
+ "version": "0.46.6",
4
4
  "private": false,
5
5
  "description": "An internal core package for Powerlines - please use the `powerlines` package for public usage.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -164,6 +164,10 @@
164
164
  "import": "./dist/plugin-utils/filter.mjs",
165
165
  "require": "./dist/plugin-utils/filter.cjs"
166
166
  },
167
+ "./plugin-utils/format": {
168
+ "import": "./dist/plugin-utils/format.mjs",
169
+ "require": "./dist/plugin-utils/format.cjs"
170
+ },
167
171
  "./plugin-utils/format-package-json": {
168
172
  "import": "./dist/plugin-utils/format-package-json.mjs",
169
173
  "require": "./dist/plugin-utils/format-package-json.cjs"
@@ -238,5 +242,5 @@
238
242
  "typescript": "^6.0.3"
239
243
  },
240
244
  "publishConfig": { "access": "public" },
241
- "gitHead": "2e5eff0d36cb4a1a54242017a16c5af5d9ce2cc3"
245
+ "gitHead": "610c4c943933458c5f433b9002d8c187625b2d3f"
242
246
  }