@powerlines/plugin-open-feature 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +29 -1
- package/dist/components/features-builtin.cjs +96 -3
- package/dist/components/features-builtin.mjs +93 -3
- package/dist/components/features-builtin.mjs.map +1 -1
- package/dist/components/index.cjs +4 -1
- package/dist/components/index.mjs +3 -1
- package/dist/helpers/automd-generator.cjs +24 -1
- package/dist/helpers/automd-generator.mjs +22 -1
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/index.cjs +4 -1
- package/dist/helpers/index.mjs +3 -1
- package/dist/index.cjs +37 -1
- package/dist/index.mjs +32 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +6 -6
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
|
@@ -1,9 +1,102 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
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 {
|
|
2
59
|
await OpenFeature.setProviderAndWait(provider);
|
|
3
60
|
} catch (error) {
|
|
4
61
|
console.error("Failed to initialize provider: ", error);
|
|
5
|
-
} `
|
|
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 {
|
|
6
84
|
return client.getBooleanValue(featureId);
|
|
7
85
|
} catch (error) {
|
|
8
86
|
console.error("Failed to evaluate feature flag: ", error);
|
|
9
|
-
} `
|
|
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,10 +1,100 @@
|
|
|
1
|
-
import{createComponent
|
|
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 {
|
|
2
56
|
await OpenFeature.setProviderAndWait(provider);
|
|
3
57
|
} catch (error) {
|
|
4
58
|
console.error("Failed to initialize provider: ", error);
|
|
5
|
-
} `
|
|
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 {
|
|
6
81
|
return client.getBooleanValue(featureId);
|
|
7
82
|
} catch (error) {
|
|
8
83
|
console.error("Failed to evaluate feature flag: ", error);
|
|
9
|
-
} `
|
|
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 };
|
|
10
100
|
//# sourceMappingURL=features-builtin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
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 +1,24 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
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,2 +1,23 @@
|
|
|
1
|
-
import{joinPaths
|
|
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 };
|
|
2
23
|
//# sourceMappingURL=automd-generator.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
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;
|
package/dist/helpers/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1,37 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value
|
|
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.mjs
CHANGED
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
import{features
|
|
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 };
|
|
2
33
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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"}
|
package/dist/types/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-open-feature",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.82",
|
|
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.
|
|
161
|
-
"@powerlines/plugin-automd": "^0.1.
|
|
162
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
160
|
+
"@powerlines/plugin-alloy": "^0.26.77",
|
|
161
|
+
"@powerlines/plugin-automd": "^0.1.458",
|
|
162
|
+
"@powerlines/plugin-plugin": "^0.12.409",
|
|
163
163
|
"@storm-software/config-tools": "^1.190.1",
|
|
164
164
|
"@stryke/convert": "^0.7.3",
|
|
165
165
|
"@stryke/env": "^0.20.87",
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"@stryke/types": "^0.12.0",
|
|
172
172
|
"automd": "^0.4.3",
|
|
173
173
|
"defu": "^6.1.7",
|
|
174
|
-
"powerlines": "^0.46.
|
|
174
|
+
"powerlines": "^0.46.5",
|
|
175
175
|
"c12": "^3.3.4"
|
|
176
176
|
},
|
|
177
177
|
"devDependencies": {
|
|
@@ -180,5 +180,5 @@
|
|
|
180
180
|
"@types/node": "^25.6.0"
|
|
181
181
|
},
|
|
182
182
|
"publishConfig": { "access": "public" },
|
|
183
|
-
"gitHead": "
|
|
183
|
+
"gitHead": "9af888c54e58a82744cc334a6b80da52429fa0ac"
|
|
184
184
|
}
|