@powerlines/plugin-open-feature 0.1.221 → 0.1.223

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.
@@ -1 +1 @@
1
- {"version":3,"file":"features-builtin.d.mts","names":[],"sources":["../../src/components/features-builtin.tsx"],"mappings":";;;KA+BY,oBAAA,GAAuB,IAAI,CAAC,gBAAA;;AAAxC;;iBAKgB,eAAA,CAAgB,KAAA,EAAO,oBAAoB,4BAAA,QAAA"}
1
+ {"version":3,"file":"features-builtin.d.mts","names":[],"sources":["../../src/components/features-builtin.tsx"],"mappings":""}
@@ -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":";;;;;;;;;;;;AA4BA,SAAS,gBAAuB,OAAC;CACjC,MAAO,CAAA,YAEP;CAKA,OAAO,gBAAS,aAAuB,WAAA;EACrC,IAAM;EACJ,aAAU;CACZ,GAAG,MAAA;EACD,IAAA,UAAA;iBAEC,2BAA8B;IAAA,sBAE3B;IAAC;KACJ,MAAA;KACK,MAAA;IACJ;IAAA;KACI,MAAI;KACR,MAAS;IACP;IAAA;KACE,MAAE;KACF,MAAI;IACN;GAAC,EACH,GAAG,WAAW,CAAC,CAAA;EACjB;EACA,IAAI,WAAE;GACJ,OAAG;IAAA,gBAAA,OAAA;KACD,SAAS;KACT,IAAA,WAAA;MACD,OAAM,gBAAsB,YAAS;OACnC,MAAA;OACG,UAAI;MACN,CAAA;KACF;IACF,CAAC;IAAA,gBAAA,qBAAA;KACC,MAAM;KACN,UAAA;KACA,OAAA;KACA,YAAY,CAAA;MACV,MAAA;MACA,MAAM;KACR,CAAC;KACD,UAAE,IAAA;;;;;IAKJ,CAAC;IAAG,gBAAe,SAAU,CAAA,CAAA;IAAA,gBAAwB,gBAAM;KACzD,MAAG;KACH,UAAA;KACD,SAAS;KACT,KAAA;KACC,MAAM;KACN,UAAA,IAAA;IACF,CAAC;IAAC,gBAAA,SAAA,CAAA,CAAA;IAAA,gBAAA,qBAAA;KACA,MAAK;KACL,UAAM;KACN,OAAM;KACN,YAAA,CAAA;MACD,MAAS;MACT,MAAA;KACC,CAAA;KACA,YAAA;KACA,UAAA,IAAA;;;;;IAKF,CAAC;IAAG,gBAAA,SAAA,CAAA,CAAA;IAAA,gBAAA,MAAA;KACF,IAAC,OAAA;MACD,OAAA,QAAY,QAAQ;KACpB;KACS;IACX,CAAC;GAAC;EACJ;CACF,CAAC,CAAC;AACJ"}
1
+ {"version":3,"file":"features-builtin.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"automd-generator.d.mts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":";;;;;AA6BA;;;;cAAa,QAAA,GAAY,OAAA,EAAS,iBAAiB,sBAAA,SAAA"}
1
+ {"version":3,"file":"automd-generator.d.mts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":""}
@@ -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":";;;;;;;;;;;AA6BA,MAAa,YAAW,YAAU,gBAAiB;CACjD,MAAA;CACA,MAAM,WAAW;EACf,MAAM,kBAAW,UAAA,kBAAA,QAAA,OAAA,IAAA,GAAA,aAAA;EACjB,IAAE,CAAA,QAAM,GAAA,WAAkB,eAAS,GACjC,OAAE,EACA,UAAU,GACZ;EAGF,OAAI,EACF,UAAI,MAFY,QAAW,GAAA,KAAA,eAAkB,KAE9B,GACjB;CACF"}
1
+ {"version":3,"file":"automd-generator.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;YAgCY,MAAA;IACR,WAAA,GAAc,wBAAwB;EAAA;AAAA;;;;cAO7B,MAAA,oBACM,wBAAA,GAA2B,wBAAA,EAE5C,OAAA,GAAS,wBAAA,KA0BJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":""}
@@ -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":";;;;;;;;;;;;CA6BA,OAAO;EAAA;;GAEP,MAAQ,UAAQ;IACd,KAAS,MAAC,2EAAO;IACf,OAAA,OAAc,MAAA,gBAAwB,iBAAA,CAAA,CAAA,CAAA;GACxC;EACF;EAAA;;GAEE,SAAA;IACG,OAAA,EACH,QAAA,KAAA,QAAA,UAAA,CAAA,GAAA,EACK,YAAe,EACX,UAAQ,SAAA,IAAA,EAClB,EACC,CAAO,EACJ;GACH;EACA;EAAE,OAAA,QAAA,MAAA;CAAA;AACJ"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
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
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-open-feature",
3
- "version": "0.1.221",
3
+ "version": "0.1.223",
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",
158
158
  "@openfeature/core": "^1.10.0",
159
159
  "@openfeature/server-sdk": "^1.21.0",
160
- "@powerlines/plugin-alloy": "0.26.216",
161
- "@powerlines/plugin-automd": "0.1.584",
162
- "@powerlines/plugin-plugin": "0.12.535",
160
+ "@powerlines/plugin-alloy": "0.26.218",
161
+ "@powerlines/plugin-automd": "0.1.586",
162
+ "@powerlines/plugin-plugin": "0.12.537",
163
163
  "@storm-software/config-tools": "^1.190.40",
164
164
  "@stryke/convert": "^0.7.15",
165
165
  "@stryke/env": "^0.20.102",
@@ -171,7 +171,7 @@
171
171
  "@stryke/types": "^0.12.12",
172
172
  "automd": "^0.4.3",
173
173
  "defu": "^6.1.7",
174
- "powerlines": "0.47.123",
174
+ "powerlines": "0.47.125",
175
175
  "c12": "^3.3.4"
176
176
  },
177
177
  "devDependencies": {
@@ -180,5 +180,5 @@
180
180
  "@types/node": "^25.9.1"
181
181
  },
182
182
  "publishConfig": { "access": "public" },
183
- "gitHead": "f8de1000ffda8a49be7fccbb6f53890449f7bdd3"
183
+ "gitHead": "30ba301952db7af53c07d369bd22f650e5ca9c45"
184
184
  }