@powerlines/plugin-open-feature 0.1.54 → 0.1.56

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.
Files changed (41) hide show
  1. package/package.json +6 -6
  2. package/dist/_virtual/_rolldown/runtime.cjs +0 -29
  3. package/dist/components/features-builtin.cjs +0 -102
  4. package/dist/components/features-builtin.d.cts +0 -12
  5. package/dist/components/features-builtin.d.cts.map +0 -1
  6. package/dist/components/features-builtin.d.mts +0 -12
  7. package/dist/components/features-builtin.d.mts.map +0 -1
  8. package/dist/components/features-builtin.mjs +0 -100
  9. package/dist/components/features-builtin.mjs.map +0 -1
  10. package/dist/components/index.cjs +0 -4
  11. package/dist/components/index.d.cts +0 -2
  12. package/dist/components/index.d.mts +0 -2
  13. package/dist/components/index.mjs +0 -3
  14. package/dist/helpers/automd-generator.cjs +0 -24
  15. package/dist/helpers/automd-generator.d.cts +0 -14
  16. package/dist/helpers/automd-generator.d.cts.map +0 -1
  17. package/dist/helpers/automd-generator.d.mts +0 -14
  18. package/dist/helpers/automd-generator.d.mts.map +0 -1
  19. package/dist/helpers/automd-generator.mjs +0 -23
  20. package/dist/helpers/automd-generator.mjs.map +0 -1
  21. package/dist/helpers/index.cjs +0 -4
  22. package/dist/helpers/index.d.cts +0 -2
  23. package/dist/helpers/index.d.mts +0 -2
  24. package/dist/helpers/index.mjs +0 -3
  25. package/dist/index.cjs +0 -37
  26. package/dist/index.d.cts +0 -16
  27. package/dist/index.d.cts.map +0 -1
  28. package/dist/index.d.mts +0 -16
  29. package/dist/index.d.mts.map +0 -1
  30. package/dist/index.mjs +0 -33
  31. package/dist/index.mjs.map +0 -1
  32. package/dist/types/index.cjs +0 -0
  33. package/dist/types/index.d.cts +0 -2
  34. package/dist/types/index.d.mts +0 -2
  35. package/dist/types/index.mjs +0 -1
  36. package/dist/types/plugin.cjs +0 -0
  37. package/dist/types/plugin.d.cts +0 -36
  38. package/dist/types/plugin.d.cts.map +0 -1
  39. package/dist/types/plugin.d.mts +0 -36
  40. package/dist/types/plugin.d.mts.map +0 -1
  41. package/dist/types/plugin.mjs +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-open-feature",
3
- "version": "0.1.54",
3
+ "version": "0.1.56",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin for managing Open Feature feature flags at runtime.",
6
6
  "keywords": [
@@ -157,9 +157,9 @@
157
157
  "@alloy-js/typescript": "0.23.0-dev.4",
158
158
  "@openfeature/core": "^1.10.0",
159
159
  "@openfeature/server-sdk": "^1.21.0",
160
- "@powerlines/plugin-alloy": "^0.26.48",
161
- "@powerlines/plugin-automd": "^0.1.430",
162
- "@powerlines/plugin-plugin": "^0.12.381",
160
+ "@powerlines/plugin-alloy": "^0.26.51",
161
+ "@powerlines/plugin-automd": "^0.1.432",
162
+ "@powerlines/plugin-plugin": "^0.12.383",
163
163
  "@storm-software/config-tools": "^1.189.78",
164
164
  "@stryke/convert": "^0.7.0",
165
165
  "@stryke/env": "^0.20.84",
@@ -171,7 +171,7 @@
171
171
  "@stryke/types": "^0.11.4",
172
172
  "automd": "^0.4.3",
173
173
  "defu": "^6.1.7",
174
- "powerlines": "^0.43.26",
174
+ "powerlines": "^0.43.28",
175
175
  "c12": "^3.3.4"
176
176
  },
177
177
  "devDependencies": {
@@ -181,5 +181,5 @@
181
181
  "vite": "^8.0.10"
182
182
  },
183
183
  "publishConfig": { "access": "public" },
184
- "gitHead": "cbea63c5784c5ae5522d50e7ddfbe3b47440cf77"
184
+ "gitHead": "efeaec793549f37c700f2e876bf6097c37375c46"
185
185
  }
@@ -1,29 +0,0 @@
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,102 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
- let _alloy_js_core = require("@alloy-js/core");
5
- let _alloy_js_typescript = require("@alloy-js/typescript");
6
- let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
7
- let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
8
- let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
9
- let defu = require("defu");
10
- defu = require_runtime.__toESM(defu);
11
-
12
- //#region src/components/features-builtin.tsx
13
- /**
14
- * Generates the feature flags module for the Powerlines project.
15
- */
16
- function FeaturesBuiltin(props) {
17
- const [{ children, imports }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "imports"]);
18
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
19
- id: "features",
20
- description: "The runtime feature flags module provides an interface to define environment configuration parameters."
21
- }, rest, {
22
- get imports() {
23
- return (0, defu.default)({ "@openfeature/server-sdk": [
24
- { name: "OpenFeature" },
25
- {
26
- name: "Provider",
27
- type: true
28
- },
29
- {
30
- name: "ProviderWrapper",
31
- type: true
32
- },
33
- {
34
- name: "ServerProviderStatus",
35
- type: true
36
- }
37
- ] }, imports ?? {});
38
- },
39
- get children() {
40
- return [
41
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
42
- heading: "A function to set the OpenFeature providers to be used in the application. This function should be called at the entry point of the application to ensure that the providers are registered before any feature flag evaluations occur.",
43
- get children() {
44
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
45
- name: "provider",
46
- children: `The provider wrapper containing the OpenFeature provider to set. The provider should be an instance of a class that implements the OpenFeature Provider interface, wrapped in a ProviderWrapper to include any necessary metadata about the provider's status.`
47
- });
48
- }
49
- }),
50
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
51
- name: "setFeatureProvider",
52
- "export": true,
53
- async: true,
54
- parameters: [{
55
- name: "provider",
56
- type: "ProviderWrapper<Provider, ServerProviderStatus>"
57
- }],
58
- children: _alloy_js_core.code`try {
59
- await OpenFeature.setProviderAndWait(provider);
60
- } catch (error) {
61
- console.error("Failed to initialize provider: ", error);
62
- } `
63
- }),
64
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
65
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
66
- name: "client",
67
- "export": true,
68
- "const": true,
69
- doc: "The Open Feature runtime client to provide feature flag evaluations.",
70
- type: "ReturnType<typeof OpenFeature.getClient>",
71
- children: _alloy_js_core.code`OpenFeature.getClient(); `
72
- }),
73
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
74
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
75
- name: "feature",
76
- "export": true,
77
- async: true,
78
- parameters: [{
79
- name: "featureId",
80
- type: "string"
81
- }],
82
- returnType: "Promise<boolean>",
83
- children: _alloy_js_core.code`try {
84
- return client.getBooleanValue(featureId);
85
- } catch (error) {
86
- console.error("Failed to evaluate feature flag: ", error);
87
- } `
88
- }),
89
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
90
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
91
- get when() {
92
- return Boolean(children);
93
- },
94
- children
95
- })
96
- ];
97
- }
98
- }));
99
- }
100
-
101
- //#endregion
102
- exports.FeaturesBuiltin = FeaturesBuiltin;
@@ -1,12 +0,0 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
3
-
4
- //#region src/components/features-builtin.d.ts
5
- type FeaturesBuiltinProps = Omit<BuiltinFileProps, "id">;
6
- /**
7
- * Generates the feature flags module for the Powerlines project.
8
- */
9
- declare function FeaturesBuiltin(props: FeaturesBuiltinProps): _$_alloy_js_core0.Children;
10
- //#endregion
11
- export { FeaturesBuiltin, FeaturesBuiltinProps };
12
- //# sourceMappingURL=features-builtin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features-builtin.d.cts","names":[],"sources":["../../src/components/features-builtin.tsx"],"mappings":";;;;KA+BY,oBAAA,GAAuB,IAAA,CAAK,gBAAA;;;AAAxC;iBAKgB,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,iBAAA,CAAA,QAAA"}
@@ -1,12 +0,0 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
3
-
4
- //#region src/components/features-builtin.d.ts
5
- type FeaturesBuiltinProps = Omit<BuiltinFileProps, "id">;
6
- /**
7
- * Generates the feature flags module for the Powerlines project.
8
- */
9
- declare function FeaturesBuiltin(props: FeaturesBuiltinProps): _$_alloy_js_core0.Children;
10
- //#endregion
11
- export { FeaturesBuiltin, FeaturesBuiltinProps };
12
- //# sourceMappingURL=features-builtin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features-builtin.d.mts","names":[],"sources":["../../src/components/features-builtin.tsx"],"mappings":";;;;KA+BY,oBAAA,GAAuB,IAAA,CAAK,gBAAA;;;AAAxC;iBAKgB,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,iBAAA,CAAA,QAAA"}
@@ -1,100 +0,0 @@
1
- import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import { Show, code, splitProps } from "@alloy-js/core";
3
- import { FunctionDeclaration, VarDeclaration } from "@alloy-js/typescript";
4
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
5
- import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
6
- import { TSDoc, TSDocParam } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
7
- import defu from "defu";
8
-
9
- //#region src/components/features-builtin.tsx
10
- /**
11
- * Generates the feature flags module for the Powerlines project.
12
- */
13
- function FeaturesBuiltin(props) {
14
- const [{ children, imports }, rest] = splitProps(props, ["children", "imports"]);
15
- return createComponent(BuiltinFile, mergeProps({
16
- id: "features",
17
- description: "The runtime feature flags module provides an interface to define environment configuration parameters."
18
- }, rest, {
19
- get imports() {
20
- return defu({ "@openfeature/server-sdk": [
21
- { name: "OpenFeature" },
22
- {
23
- name: "Provider",
24
- type: true
25
- },
26
- {
27
- name: "ProviderWrapper",
28
- type: true
29
- },
30
- {
31
- name: "ServerProviderStatus",
32
- type: true
33
- }
34
- ] }, imports ?? {});
35
- },
36
- get children() {
37
- return [
38
- createComponent(TSDoc, {
39
- heading: "A function to set the OpenFeature providers to be used in the application. This function should be called at the entry point of the application to ensure that the providers are registered before any feature flag evaluations occur.",
40
- get children() {
41
- return createComponent(TSDocParam, {
42
- name: "provider",
43
- children: `The provider wrapper containing the OpenFeature provider to set. The provider should be an instance of a class that implements the OpenFeature Provider interface, wrapped in a ProviderWrapper to include any necessary metadata about the provider's status.`
44
- });
45
- }
46
- }),
47
- createComponent(FunctionDeclaration, {
48
- name: "setFeatureProvider",
49
- "export": true,
50
- async: true,
51
- parameters: [{
52
- name: "provider",
53
- type: "ProviderWrapper<Provider, ServerProviderStatus>"
54
- }],
55
- children: code`try {
56
- await OpenFeature.setProviderAndWait(provider);
57
- } catch (error) {
58
- console.error("Failed to initialize provider: ", error);
59
- } `
60
- }),
61
- createComponent(Spacing, {}),
62
- createComponent(VarDeclaration, {
63
- name: "client",
64
- "export": true,
65
- "const": true,
66
- doc: "The Open Feature runtime client to provide feature flag evaluations.",
67
- type: "ReturnType<typeof OpenFeature.getClient>",
68
- children: code`OpenFeature.getClient(); `
69
- }),
70
- createComponent(Spacing, {}),
71
- createComponent(FunctionDeclaration, {
72
- name: "feature",
73
- "export": true,
74
- async: true,
75
- parameters: [{
76
- name: "featureId",
77
- type: "string"
78
- }],
79
- returnType: "Promise<boolean>",
80
- children: code`try {
81
- return client.getBooleanValue(featureId);
82
- } catch (error) {
83
- console.error("Failed to evaluate feature flag: ", error);
84
- } `
85
- }),
86
- createComponent(Spacing, {}),
87
- createComponent(Show, {
88
- get when() {
89
- return Boolean(children);
90
- },
91
- children
92
- })
93
- ];
94
- }
95
- }));
96
- }
97
-
98
- //#endregion
99
- export { FeaturesBuiltin };
100
- //# sourceMappingURL=features-builtin.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features-builtin.mjs","names":[],"sources":["../../src/components/features-builtin.tsx"],"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 { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocParam\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport type FeaturesBuiltinProps = Omit<BuiltinFileProps, \"id\">;\n\n/**\n * Generates the feature flags module for the Powerlines project.\n */\nexport function FeaturesBuiltin(props: FeaturesBuiltinProps) {\n const [{ children, imports }, rest] = splitProps(props, [\n \"children\",\n \"imports\"\n ]);\n\n // const context = usePowerlines<OpenFeaturePluginContext>();\n\n return (\n <BuiltinFile\n id=\"features\"\n description=\"The runtime feature flags module provides an interface to define environment configuration parameters.\"\n {...rest}\n imports={defu(\n {\n \"@openfeature/server-sdk\": [\n { name: \"OpenFeature\" },\n { name: \"Provider\", type: true },\n { name: \"ProviderWrapper\", type: true },\n { name: \"ServerProviderStatus\", type: true }\n ]\n },\n imports ?? {}\n )}>\n <TSDoc heading=\"A function to set the OpenFeature providers to be used in the application. This function should be called at the entry point of the application to ensure that the providers are registered before any feature flag evaluations occur.\">\n <TSDocParam name=\"provider\">\n {`The provider wrapper containing the OpenFeature provider to set. The provider should be an instance of a class that implements the OpenFeature Provider interface, wrapped in a ProviderWrapper to include any necessary metadata about the provider's status.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n name=\"setFeatureProvider\"\n export\n async\n parameters={[\n {\n name: \"provider\",\n type: \"ProviderWrapper<Provider, ServerProviderStatus>\"\n }\n ]}>\n {code`try {\n await OpenFeature.setProviderAndWait(provider);\n } catch (error) {\n console.error(\"Failed to initialize provider: \", error);\n } `}\n </FunctionDeclaration>\n <Spacing />\n <VarDeclaration\n name=\"client\"\n export\n const\n doc=\"The Open Feature runtime client to provide feature flag evaluations.\"\n type=\"ReturnType<typeof OpenFeature.getClient>\">\n {code`OpenFeature.getClient(); `}\n </VarDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"feature\"\n export\n async\n parameters={[\n {\n name: \"featureId\",\n type: \"string\"\n }\n ]}\n returnType=\"Promise<boolean>\">\n {code`try {\n return client.getBooleanValue(featureId);\n } catch (error) {\n console.error(\"Failed to evaluate feature flag: \", error);\n } `}\n </FunctionDeclaration>\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA4BA,SAAS,gBAAuB,OAAC;CACjC,MAAO,CAAA,YAEP;AAKA,QAAO,gBAAS,aAAuB,WAAA;EACrC,IAAM;EACJ,aAAU;EACX,EAAE,MAAA;EACD,IAAA,UAAA;iBAEC,2BAA8B;IAAA,uBAE1B;IAAA;KACJ,MAAA;KACK,MAAA;KACJ;IAAA;KACI,MAAI;KACR,MAAS;KACP;IAAA;KACE,MAAE;KACF,MAAI;KACL;IAAC,EACH,EAAE,WAAW,EAAC,CAAA;;EAEjB,IAAI,WAAE;AACJ,UAAG;IAAA,gBAAA,OAAA;KACD,SAAS;KACT,IAAA,WAAA;AACD,aAAM,gBAAsB,YAAS;OACnC,MAAA;OACG,UAAI;OACN,CAAA;;KAEH,CAAA;IAAA,gBAAA,qBAAA;KACC,MAAM;KACN,UAAA;KACA,OAAA;KACA,YAAY,CAAA;MACV,MAAA;MACA,MAAM;MACP,CAAC;KACF,UAAE,IAAA;;;;;KAKH,CAAC;IAAE,gBAAe,SAAU,EAAA,CAAA;IAAA,gBAAwB,gBAAM;KACzD,MAAG;KACH,UAAA;KACD,SAAS;KACT,KAAA;KACC,MAAM;KACN,UAAA,IAAA;KACD,CAAC;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,qBAAA;KACA,MAAK;KACL,UAAM;KACN,OAAM;KACN,YAAA,CAAA;MACD,MAAS;MACT,MAAA;MACC,CAAA;KACA,YAAA;KACA,UAAA,IAAA;;;;;KAKD,CAAC;IAAE,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACF,IAAC,OAAA;AACD,aAAA,QAAY,SAAQ;;KAEX;KACV,CAAC;IAAC;;EAEN,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_components_features_builtin = require('./features-builtin.cjs');
3
-
4
- exports.FeaturesBuiltin = require_components_features_builtin.FeaturesBuiltin;
@@ -1,2 +0,0 @@
1
- import { FeaturesBuiltin, FeaturesBuiltinProps } from "./features-builtin.cjs";
2
- export { FeaturesBuiltin, FeaturesBuiltinProps };
@@ -1,2 +0,0 @@
1
- import { FeaturesBuiltin, FeaturesBuiltinProps } from "./features-builtin.mjs";
2
- export { FeaturesBuiltin, FeaturesBuiltinProps };
@@ -1,3 +0,0 @@
1
- import { FeaturesBuiltin } from "./features-builtin.mjs";
2
-
3
- export { FeaturesBuiltin };
@@ -1,24 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let _stryke_path_join_paths = require("@stryke/path/join-paths");
4
- let automd = require("automd");
5
- let powerlines_plugin_utils = require("powerlines/plugin-utils");
6
-
7
- //#region src/helpers/automd-generator.ts
8
- /**
9
- * AutoMD generator to generate feature flags documentation
10
- *
11
- * @param context - The generator context.
12
- * @returns The generated documentation content.
13
- */
14
- const features = (context) => (0, automd.defineGenerator)({
15
- name: "features",
16
- async generate() {
17
- const featuresDocFile = (0, _stryke_path_join_paths.joinPaths)((0, powerlines_plugin_utils.getDocsOutputPath)(context.config.root), "features.md");
18
- if (!context.fs.existsSync(featuresDocFile)) return { contents: "" };
19
- return { contents: await context.fs.read(featuresDocFile) || "" };
20
- }
21
- });
22
-
23
- //#endregion
24
- exports.features = features;
@@ -1,14 +0,0 @@
1
- import * as _$automd from "automd";
2
- import { UnresolvedContext } from "powerlines";
3
-
4
- //#region src/helpers/automd-generator.d.ts
5
- /**
6
- * AutoMD generator to generate feature flags documentation
7
- *
8
- * @param context - The generator context.
9
- * @returns The generated documentation content.
10
- */
11
- declare const features: (context: UnresolvedContext) => _$automd.Generator;
12
- //#endregion
13
- export { features };
14
- //# sourceMappingURL=automd-generator.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"automd-generator.d.cts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":";;;;;;;AA6BA;;;cAAa,QAAA,GAAY,OAAA,EAAS,iBAAA,KAAiB,QAAA,CAAA,SAAA"}
@@ -1,14 +0,0 @@
1
- import * as _$automd from "automd";
2
- import { UnresolvedContext } from "powerlines";
3
-
4
- //#region src/helpers/automd-generator.d.ts
5
- /**
6
- * AutoMD generator to generate feature flags documentation
7
- *
8
- * @param context - The generator context.
9
- * @returns The generated documentation content.
10
- */
11
- declare const features: (context: UnresolvedContext) => _$automd.Generator;
12
- //#endregion
13
- export { features };
14
- //# sourceMappingURL=automd-generator.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"automd-generator.d.mts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":";;;;;;;AA6BA;;;cAAa,QAAA,GAAY,OAAA,EAAS,iBAAA,KAAiB,QAAA,CAAA,SAAA"}
@@ -1,23 +0,0 @@
1
- import { joinPaths } from "@stryke/path/join-paths";
2
- import { defineGenerator } from "automd";
3
- import { getDocsOutputPath } from "powerlines/plugin-utils";
4
-
5
- //#region src/helpers/automd-generator.ts
6
- /**
7
- * AutoMD generator to generate feature flags documentation
8
- *
9
- * @param context - The generator context.
10
- * @returns The generated documentation content.
11
- */
12
- const features = (context) => defineGenerator({
13
- name: "features",
14
- async generate() {
15
- const featuresDocFile = joinPaths(getDocsOutputPath(context.config.root), "features.md");
16
- if (!context.fs.existsSync(featuresDocFile)) return { contents: "" };
17
- return { contents: await context.fs.read(featuresDocFile) || "" };
18
- }
19
- });
20
-
21
- //#endregion
22
- export { features };
23
- //# sourceMappingURL=automd-generator.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"automd-generator.mjs","names":[],"sources":["../../src/helpers/automd-generator.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 { joinPaths } from \"@stryke/path/join-paths\";\nimport { defineGenerator } from \"automd\";\nimport { UnresolvedContext } from \"powerlines\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\n\n/**\n * AutoMD generator to generate feature flags documentation\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const features = (context: UnresolvedContext) =>\n defineGenerator({\n name: \"features\",\n async generate() {\n const featuresDocFile = joinPaths(\n getDocsOutputPath(context.config.root),\n \"features.md\"\n );\n\n if (!context.fs.existsSync(featuresDocFile)) {\n return {\n contents: \"\"\n };\n }\n\n const contents = await context.fs.read(featuresDocFile);\n\n return {\n contents: contents || \"\"\n };\n }\n });\n"],"mappings":";;;;;;;;;;;AA6BA,MAAa,YAAW,YAAU,gBAAiB;CACjD,MAAA;CACA,MAAM,WAAW;EACf,MAAM,kBAAW,UAAA,kBAAA,QAAA,OAAA,KAAA,EAAA,cAAA;AACjB,MAAE,CAAA,QAAM,GAAA,WAAkB,gBAAS,CACjC,QAAE,EACA,UAAU,IACX;AAGH,SAAI,EACF,UAAI,MAFY,QAAW,GAAA,KAAA,gBAAkB,IAE9B,IAChB"}
@@ -1,4 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_helpers_automd_generator = require('./automd-generator.cjs');
3
-
4
- exports.features = require_helpers_automd_generator.features;
@@ -1,2 +0,0 @@
1
- import { features } from "./automd-generator.cjs";
2
- export { features };
@@ -1,2 +0,0 @@
1
- import { features } from "./automd-generator.mjs";
2
- export { features };
@@ -1,3 +0,0 @@
1
- import { features } from "./automd-generator.mjs";
2
-
3
- export { features };
package/dist/index.cjs DELETED
@@ -1,37 +0,0 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_helpers_automd_generator = require('./helpers/automd-generator.cjs');
4
- const require_components_features_builtin = require('./components/features-builtin.cjs');
5
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
- let defu = require("defu");
7
- defu = require_runtime.__toESM(defu);
8
- let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
9
- let _powerlines_plugin_automd = require("@powerlines/plugin-automd");
10
- _powerlines_plugin_automd = require_runtime.__toESM(_powerlines_plugin_automd);
11
-
12
- //#region src/index.tsx
13
- /**
14
- * A Powerlines plugin to inject environment variables into the source code.
15
- */
16
- const plugin = (options = {}) => {
17
- return [
18
- {
19
- name: "open-feature",
20
- async prepare() {
21
- this.debug(`Preparing the Feature Flags runtime artifacts for the Powerlines project.`);
22
- return (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_features_builtin.FeaturesBuiltin, {}));
23
- }
24
- },
25
- {
26
- name: "open-feature:automd-generator",
27
- config() {
28
- return { automd: (0, defu.default)(options.automd ?? {}, { generators: { features: require_helpers_automd_generator.features(this) } }) };
29
- }
30
- },
31
- (0, _powerlines_plugin_automd.default)(options.automd)
32
- ];
33
- };
34
-
35
- //#endregion
36
- exports.default = plugin;
37
- exports.plugin = plugin;
package/dist/index.d.cts DELETED
@@ -1,16 +0,0 @@
1
- import { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig } from "./types/plugin.cjs";
2
- import { Plugin } from "powerlines";
3
-
4
- //#region src/index.d.ts
5
- declare module "powerlines" {
6
- interface Config {
7
- openFeature?: OpenFeaturePluginOptions;
8
- }
9
- }
10
- /**
11
- * A Powerlines plugin to inject environment variables into the source code.
12
- */
13
- declare const plugin: <TContext extends OpenFeaturePluginContext = OpenFeaturePluginContext>(options?: OpenFeaturePluginOptions) => Plugin<TContext>[];
14
- //#endregion
15
- export { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig, plugin as default, plugin };
16
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAgCY,MAAA;IACR,WAAA,GAAc,wBAAA;EAAA;AAAA;;;;cAOL,MAAA,oBACM,wBAAA,GAA2B,wBAAA,EAE5C,OAAA,GAAS,wBAAA,KA0BJ,MAAA,CAAO,QAAA"}
package/dist/index.d.mts DELETED
@@ -1,16 +0,0 @@
1
- import { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig } from "./types/plugin.mjs";
2
- import { Plugin } from "powerlines";
3
-
4
- //#region src/index.d.ts
5
- declare module "powerlines" {
6
- interface Config {
7
- openFeature?: OpenFeaturePluginOptions;
8
- }
9
- }
10
- /**
11
- * A Powerlines plugin to inject environment variables into the source code.
12
- */
13
- declare const plugin: <TContext extends OpenFeaturePluginContext = OpenFeaturePluginContext>(options?: OpenFeaturePluginOptions) => Plugin<TContext>[];
14
- //#endregion
15
- export { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig, plugin as default, plugin };
16
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAgCY,MAAA;IACR,WAAA,GAAc,wBAAA;EAAA;AAAA;;;;cAOL,MAAA,oBACM,wBAAA,GAA2B,wBAAA,EAE5C,OAAA,GAAS,wBAAA,KA0BJ,MAAA,CAAO,QAAA"}
package/dist/index.mjs DELETED
@@ -1,33 +0,0 @@
1
- import { features } from "./helpers/automd-generator.mjs";
2
- import { FeaturesBuiltin } from "./components/features-builtin.mjs";
3
- import { createComponent } from "@alloy-js/core/jsx-runtime";
4
- import defu from "defu";
5
- import { render } from "@powerlines/plugin-alloy/render";
6
- import automd from "@powerlines/plugin-automd";
7
-
8
- //#region src/index.tsx
9
- /**
10
- * A Powerlines plugin to inject environment variables into the source code.
11
- */
12
- const plugin = (options = {}) => {
13
- return [
14
- {
15
- name: "open-feature",
16
- async prepare() {
17
- this.debug(`Preparing the Feature Flags runtime artifacts for the Powerlines project.`);
18
- return render(this, createComponent(FeaturesBuiltin, {}));
19
- }
20
- },
21
- {
22
- name: "open-feature:automd-generator",
23
- config() {
24
- return { automd: defu(options.automd ?? {}, { generators: { features: features(this) } }) };
25
- }
26
- },
27
- automd(options.automd)
28
- ];
29
- };
30
-
31
- //#endregion
32
- export { plugin as default, plugin };
33
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"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 { render } from \"@powerlines/plugin-alloy/render\";\nimport automd from \"@powerlines/plugin-automd\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { FeaturesBuiltin } from \"./components/features-builtin\";\nimport { features } from \"./helpers/automd-generator\";\nimport type {\n OpenFeaturePluginContext,\n OpenFeaturePluginOptions\n} from \"./types/plugin\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n openFeature?: OpenFeaturePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to inject environment variables into the source code.\n */\nexport const plugin = <\n TContext extends OpenFeaturePluginContext = OpenFeaturePluginContext\n>(\n options: OpenFeaturePluginOptions = {}\n) => {\n return [\n {\n name: \"open-feature\",\n async prepare() {\n this.debug(\n `Preparing the Feature Flags runtime artifacts for the Powerlines project.`\n );\n\n return render(this, <FeaturesBuiltin />);\n }\n },\n {\n name: \"open-feature:automd-generator\",\n config() {\n return {\n automd: defu(options.automd ?? {}, {\n generators: {\n features: features(this)\n }\n })\n };\n }\n },\n automd(options.automd)\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AA6BA,QAAO;EAAA;;GAEP,MAAQ,UAAQ;AACd,SAAS,MAAC,4EAAO;AACf,WAAA,OAAc,MAAA,gBAAwB,iBAAA,EAAA,CAAA,CAAA;;GAE1C;EAAA;;GAEE,SAAA;AACG,WAAA,EACH,QAAA,KAAA,QAAA,UAAA,EAAA,EAAA,EACK,YAAe,EACX,UAAQ,SAAA,KAAA,EAClB,EACQ,CAAC,EACL;;GAEF;EAAC,OAAA,QAAA,OAAA;EAAA"}
File without changes
@@ -1,2 +0,0 @@
1
- import { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig } from "./plugin.cjs";
2
- export { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig };
@@ -1,2 +0,0 @@
1
- import { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig } from "./plugin.mjs";
2
- export { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig };
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1,36 +0,0 @@
1
- import { Provider, ProviderWrapper, ServerProviderStatus } from "@openfeature/server-sdk";
2
- import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "@powerlines/plugin-alloy/types";
3
- import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
4
- import { BabelPluginContext, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
5
-
6
- //#region src/types/plugin.d.ts
7
- interface OpenFeaturePluginOptions {
8
- /**
9
- * A path to the type definition for the expected env configuration parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `":"` or `"#"` character. For example: `"./src/types/env.ts#ConfigConfiguration"`.
10
- */
11
- providers?: Map<string, ProviderWrapper<Provider, ServerProviderStatus>>;
12
- /**
13
- * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
14
- *
15
- * @remarks
16
- * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
17
- */
18
- automd?: AutoMDPluginOptions;
19
- /**
20
- * Alloy configuration options to use when injecting environment variables into the source code.
21
- *
22
- * @remarks
23
- * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
24
- */
25
- alloy?: AlloyPluginOptions;
26
- }
27
- type OpenFeaturePluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
28
- openFeature: OpenFeaturePluginOptions;
29
- };
30
- type OpenFeaturePluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
31
- openFeature: OpenFeaturePluginOptions;
32
- };
33
- interface OpenFeaturePluginContext<TResolvedConfig extends OpenFeaturePluginResolvedConfig = OpenFeaturePluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {}
34
- //#endregion
35
- export { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig };
36
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;UAoCiB,wBAAA;;AAAjB;;EAIE,SAAA,GAAY,GAAA,SAAY,eAAA,CAAgB,QAAA,EAAU,oBAAA;EAAV;;;;;;EAQxC,MAAA,GAAS,mBAAA;EAQiB;;;;;;EAA1B,KAAA,GAAQ,kBAAA;AAAA;AAAA,KAGE,2BAAA,GAA8B,qBAAA,GACxC,qBAAA;EACE,WAAA,EAAa,wBAAA;AAAA;AAAA,KAGL,+BAAA,GAAkC,yBAAA,GAC5C,yBAAA;EACE,WAAA,EAAa,wBAAA;AAAA;AAAA,UAGA,wBAAA,yBACS,+BAAA,GACtB,+BAAA,UAGA,kBAAA,CAAmB,eAAA,GACnB,kBAAA,CAAmB,eAAA"}
@@ -1,36 +0,0 @@
1
- import { Provider, ProviderWrapper, ServerProviderStatus } from "@openfeature/server-sdk";
2
- import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "@powerlines/plugin-alloy/types";
3
- import { AutoMDPluginOptions } from "@powerlines/plugin-automd/types/plugin";
4
- import { BabelPluginContext, BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types";
5
-
6
- //#region src/types/plugin.d.ts
7
- interface OpenFeaturePluginOptions {
8
- /**
9
- * A path to the type definition for the expected env configuration parameters. This value can include both a path to the typescript file and the name of the type definition to use separated by a `":"` or `"#"` character. For example: `"./src/types/env.ts#ConfigConfiguration"`.
10
- */
11
- providers?: Map<string, ProviderWrapper<Provider, ServerProviderStatus>>;
12
- /**
13
- * AutoMD configuration options to allow injecting environment variables documentation into a markdown file such as a README.md.
14
- *
15
- * @remarks
16
- * The README.md file should contain the `<!-- automd:env --><!-- /automd -->` comment block where the documentation will be injected.
17
- */
18
- automd?: AutoMDPluginOptions;
19
- /**
20
- * Alloy configuration options to use when injecting environment variables into the source code.
21
- *
22
- * @remarks
23
- * This option allows you to customize the Alloy transformation process used to inject environment variables into the source code. If not provided, the plugin will use default Alloy settings.
24
- */
25
- alloy?: AlloyPluginOptions;
26
- }
27
- type OpenFeaturePluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
28
- openFeature: OpenFeaturePluginOptions;
29
- };
30
- type OpenFeaturePluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
31
- openFeature: OpenFeaturePluginOptions;
32
- };
33
- interface OpenFeaturePluginContext<TResolvedConfig extends OpenFeaturePluginResolvedConfig = OpenFeaturePluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {}
34
- //#endregion
35
- export { OpenFeaturePluginContext, OpenFeaturePluginOptions, OpenFeaturePluginResolvedConfig, OpenFeaturePluginUserConfig };
36
- //# sourceMappingURL=plugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;UAoCiB,wBAAA;;AAAjB;;EAIE,SAAA,GAAY,GAAA,SAAY,eAAA,CAAgB,QAAA,EAAU,oBAAA;EAAV;;;;;;EAQxC,MAAA,GAAS,mBAAA;EAQiB;;;;;;EAA1B,KAAA,GAAQ,kBAAA;AAAA;AAAA,KAGE,2BAAA,GAA8B,qBAAA,GACxC,qBAAA;EACE,WAAA,EAAa,wBAAA;AAAA;AAAA,KAGL,+BAAA,GAAkC,yBAAA,GAC5C,yBAAA;EACE,WAAA,EAAa,wBAAA;AAAA;AAAA,UAGA,wBAAA,yBACS,+BAAA,GACtB,+BAAA,UAGA,kBAAA,CAAmB,eAAA,GACnB,kBAAA,CAAmB,eAAA"}
@@ -1 +0,0 @@
1
- export { };