@powerlines/plugin-react 0.1.46 → 0.1.48
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/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -0
- package/dist/components/react-optimized.cjs +1 -8
- package/dist/components/react-optimized.mjs +1 -0
- package/dist/components-ipRi4DSE.mjs +1 -0
- package/dist/index.cjs +67 -8
- package/dist/index.mjs +64 -0
- package/dist/plugin-Gb47Xzf6.mjs +1 -0
- package/dist/react-optimized-9J3fdCI2.mjs +1 -0
- package/dist/react-optimized-BO9knQDM.cjs +1 -0
- package/dist/runtime-BbUj49s9.mjs +1 -0
- package/dist/runtime-Bp9G0scd.cjs +0 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +1 -1
- package/dist/types/plugin.mjs +1 -0
- package/dist/types/runtime.cjs +1 -1
- package/dist/types/runtime.mjs +1 -0
- package/dist/types-CwXe_Ycf.mjs +1 -0
- package/dist/types-a8gm_IaQ.cjs +0 -0
- package/package.json +46 -35
- package/dist/chunk-FBBMZ4NC.cjs +0 -7
- package/dist/chunk-UCUR73HG.js +0 -7
- package/dist/components/index.d.cts +0 -6
- package/dist/components/index.d.ts +0 -6
- package/dist/components/index.js +0 -1
- package/dist/components/react-optimized.d.cts +0 -95
- package/dist/components/react-optimized.d.ts +0 -95
- package/dist/components/react-optimized.js +0 -8
- package/dist/fs-ECFlqnPg.d.cts +0 -378
- package/dist/fs-ECFlqnPg.d.ts +0 -378
- package/dist/index.d.cts +0 -62
- package/dist/index.d.ts +0 -62
- package/dist/index.js +0 -8
- package/dist/runtime-4U11u3by.d.ts +0 -1938
- package/dist/runtime-BW91guC1.d.cts +0 -1938
- package/dist/types/index.d.cts +0 -29
- package/dist/types/index.d.ts +0 -29
- package/dist/types/index.js +0 -1
- package/dist/types/plugin.d.cts +0 -1793
- package/dist/types/plugin.d.ts +0 -1793
- package/dist/types/runtime.d.cts +0 -35
- package/dist/types/runtime.d.ts +0 -35
- /package/dist/{types/plugin.js → components-BWLXb7a2.cjs} +0 -0
- /package/dist/{types/runtime.js → plugin-pBKbb5K9.cjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createComponent as e,createIntrinsic as t,memo as n,mergeProps as r}from"@alloy-js/core/jsx-runtime";import{For as i,List as a,Prose as o,Scope as s,Show as c,SourceDirectoryContext as l,SourceFileContext as u,childrenArray as d,code as f,createContext as p,getContext as m,refkey as h,splitProps as g,useContext as _,useFormatOptions as v,useScope as y}from"@alloy-js/core";import{isSetString as b}from"@stryke/type-checks/is-set-string";import{isUndefined as x}from"@stryke/type-checks/is-undefined";import S from"defu";import{isString as C}from"@stryke/type-checks/is-string";import{getUniqueBy as w}from"@stryke/helpers/get-unique";import{StormJSON as T}from"@stryke/json/storm-json";import{isNull as ee}from"@stryke/type-checks/is-null";import{appendPath as E}from"@stryke/path/append";import{FunctionDeclaration as D,ImportStatements as te,PackageContext as O,SourceFileContext as ne,TSModuleScope as re,getSourceDirectoryData as ie,useSourceFile as k}from"@alloy-js/typescript";import{isBoolean as A}from"@stryke/type-checks/is-boolean";var j=Object.defineProperty,M=Object.getOwnPropertyDescriptor,N=Object.getOwnPropertyNames,ae=Object.prototype.hasOwnProperty,P=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=N(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ae.call(e,s)&&s!==n&&j(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=M(t,s))||r.enumerable});return e},oe=(e,t,n,r)=>{r&&(j(e,Symbol.toStringTag,{value:`Module`}),n&&j(n,Symbol.toStringTag,{value:`Module`})),P(e,t,`default`),n&&P(n,t,`default`)};const F=p();function se(){return _(F)}function I(){return se()?.ref?.value}var L={};import*as R from"@deepkit/type";oe(L,R);function z(e,t){return V(e.type,t??e.getDefaultValue())}function B(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function V(e,t){return x(t)?`undefined`:ee(t)?`null`:e.kind===L.ReflectionKind.boolean?String(t).trim().toLowerCase()===`true`?`true`:`false`:e.kind===L.ReflectionKind.string||e.kind===L.ReflectionKind.literal&&C(e.literal)?B(t):e.kind===L.ReflectionKind.enum?H(e).kind===L.ReflectionKind.string?B(t):`${String(t)}`:e.kind===L.ReflectionKind.union?W(e)?B(t):`${String(t)}`:e.kind===L.ReflectionKind.array?B(T.stringify(t)):e.kind===L.ReflectionKind.object||e.kind===L.ReflectionKind.objectLiteral?T.stringify(t):e.kind===L.ReflectionKind.property||e.kind===L.ReflectionKind.parameter?V(e.type,t):String(t)}function H(e){if(e.kind!==L.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let t=w(e.values.filter(e=>e!=null),e=>C(e)?{kind:L.ReflectionKind.string}:{kind:L.ReflectionKind.number});if(t.length===0)throw Error(`No valid enum members could be found.`);return t[0]&&C(t[0])?{kind:L.ReflectionKind.string}:{kind:L.ReflectionKind.number}}function U(e){if(e.kind===L.ReflectionKind.union&&e.types.length>0)return w(e.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${e.kind}.`)}function W(e){return U(e).some(e=>e.kind===L.ReflectionKind.string||e.kind===L.ReflectionKind.literal&&C(e.literal))}function G(...e){return h(`powerlines`,...e)}function K(r){let[{children:i,heading:o}]=g(r,[`children`,`heading`]);return[`/**`,t(`align`,{string:` * `,get children(){return[t(`hbr`,{}),e(c,{get when(){return!x(o)},get children(){return[o,t(`hbr`,{}),e(c,{get when(){return n(()=>!x(i))()&&d(()=>i).length>0},get children(){return t(`hbr`,{})}})]}}),e(c,{get when(){return n(()=>!x(i))()&&d(()=>i).length>0},get children(){return e(a,{get children(){return d(()=>i)}})}})]}}),t(`hbr`,{}),` */`,t(`hbr`,{})]}function q(n){let[{children:r,tag:i}]=g(n,[`children`,`tag`]);return[`@${i} `,e(c,{get when(){return!!r},get children(){return t(`align`,{width:2,get children(){return e(o,{children:r})}})}}),t(`hbr`,{})]}function ce(t){let[{children:n},i]=g(t,[`children`]);return e(q,r(i,{tag:`title`,children:n}))}function le(t){let[{children:n},i]=g(t,[`children`]);return e(q,r(i,{tag:`domain`,children:n}))}function ue(t){let[{children:n},i]=g(t,[`children`]);return e(q,r(i,{tag:`alias`,children:n}))}function de(t){let[{children:n},i]=g(t,[`children`]);return e(q,r(i,{tag:`permission`,children:n}))}function fe(n){return[`@defaultValue `,e(c,{get when(){return!x(n.value)},get children(){return t(`align`,{width:2,get children(){return e(o,{get children(){return z(n.value)}})}})}}),t(`hbr`,{})]}function pe(n){return[`@remarks `,t(`hbr`,{}),e(a,{hardline:!0,get children(){return d(()=>n.children)}})]}function J(t){return e(q,r(t,{tag:`see`}))}function me(n){let[{tsx:r,fenced:i=!0,language:a,children:o}]=g(n,[`tsx`,`fenced`,`language`,`children`]);return[`@example `,t(`hbr`,{}),e(c,{when:i,get children(){return["```",a||(r?`tsx`:`ts`),t(`hbr`,{})]}}),o,e(c,{when:i,get children(){return[t(`hbr`,{}),"```"]}})]}function he(){return e(q,{tag:`readonly`})}function ge(){return e(q,{tag:`internal`})}function _e(){return e(q,{tag:`ignore`})}function ve(){return e(q,{tag:`hidden`})}function ye(t){let[{title:n,alias:r,permission:a,domain:o,readonly:s,internal:l,ignore:u,hidden:d,defaultValue:f}]=g(t,[`title`,`alias`,`permission`,`domain`,`readonly`,`internal`,`ignore`,`hidden`,`defaultValue`]);return[e(c,{get when(){return b(n)},get children(){return e(ce,{children:n})}}),e(c,{get when(){return!x(r)&&r.length>0},get children(){return e(i,{each:r??[],children:t=>e(ue,{children:t})})}}),e(c,{get when(){return b(o)},get children(){return e(le,{children:o})}}),e(c,{get when(){return!x(a)&&a.length>0},get children(){return e(i,{each:a??[],children:t=>e(de,{children:t})})}}),e(c,{when:s===!0,get children(){return e(he,{})}}),e(c,{when:l===!0,get children(){return e(ge,{})}}),e(c,{when:u===!0,get children(){return e(_e,{})}}),e(c,{when:d===!0,get children(){return e(ve,{})}}),e(c,{get when(){return!x(f)},get children(){return e(fe,{value:f})}})]}function be(t){return[`@param `,e(xe,{get name(){return t.name},get optional(){return t.optional},get defaultValue(){return t.defaultValue}}),e(Se,{get children(){return t.children}})]}function xe(t){return[e(c,{get when(){return t.optional},children:`[`}),n(()=>t.name),e(c,{get when(){return!!t.defaultValue},get children(){return[`=`,n(()=>t.defaultValue)]}}),e(c,{get when(){return t.optional},children:`]`})]}function Se(n){return e(c,{get when(){return!!n.children},get children(){return[` - `,t(`align`,{width:2,get children(){return e(o,{get children(){return n.children}})}})]}})}function Y(t){return e(q,r(t,{tag:`returns`}))}function Ce(t){return e(q,r(t,{tag:`throws`}))}function we(r){let[{children:i,name:o,prefix:s}]=g(r,[`children`,`name`,`prefix`]),l=I();return[`/**`,t(`align`,{string:` * `,get children(){return[t(`hbr`,{}),e(c,{get when(){return!!i},get children(){return[e(a,{hardline:!0,get children(){return d(()=>i)}}),t(`hbr`,{}),t(`hbr`,{})]}}),`@module `,n(()=>s||l?.config.output.builtinPrefix),`:`,o]}}),t(`hbr`,{}),` */`]}function X(n){let{variant:r=`double-slash`,children:i}=n,a=r===`slash-star`?`/* `:r===`slash-star-star`?`/** `:r===`triple-slash`?`/// `:r===`markdown`?`<!-- `:`// `;return[a,t(`align`,{string:a,get children(){return[e(o,{children:i}),r===`slash-star`||r===`slash-star-star`?` */ `:r===`markdown`?` -->`:``]}})]}function Te(n){let[{children:r,meta:i,path:a,header:o,preset:s,filetype:d,reference:f}]=g(n,[`children`,`meta`,`path`,`header`,`preset`,`filetype`,`reference`]),p=_(l),h={path:E(a,p.path),filetype:d,reference:f};p?.addContent(h);let y=v({printWidth:n.printWidth,tabWidth:n.tabWidth,useTabs:n.useTabs,insertFinalNewLine:n.insertFinalNewLine}),b=m();return b.meta=S({sourceFile:h,printOptions:y,output:{preset:s}},i??{}),e(u.Provider,{value:h,get children(){return[e(c,{when:o!==void 0,get children(){return[o,t(`hbr`,{})]}}),r]}})}function Ee(t){let[{children:n,path:i,imports:a,tsx:o,header:c},u]=g(t,[`children`,`path`,`imports`,`tsx`,`header`]),d=_(l),f=ie(d),p=E(i,d.path),m=new re(p,y());f.modules.add(m);let h=_(O);return h&&h.scope.addModule(m),t.export&&h&&(A(t.export)?h.scope.addExport(p,m):h.scope.addExport(t.export,m)),e(ne.Provider,{value:{scope:m},get children(){return e(s,{value:m,get children(){return e(Te,r(u,{path:p,get header(){return c??e(Z,{get children(){return e(Q,{imports:a,scope:m})}})},filetype:o?`tsx`:`typescript`,children:n}))}})}})}function Z(n){let{header:r,disableEslint:i=!0,disableBiome:a=!0,disablePrettier:o=!1,children:s}=n;return[e(c,{get when(){return!!r},get children(){return[r,t(`hbr`,{})]}}),t(`hbr`,{}),e(c,{get when(){return!!i},get children(){return[e(X,{variant:`slash-star`,children:`eslint-disable`}),t(`hbr`,{})]}}),e(c,{get when(){return!!o},get children(){return[e(X,{variant:`slash-star`,children:`prettier-ignore`}),t(`hbr`,{})]}}),e(c,{get when(){return!!a},get children(){return[e(X,{children:`biome-ignore lint: disable`}),t(`hbr`,{})]}}),e(c,{get when(){return!!i||!!o||!!a},get children(){return t(`hbr`,{})}}),e(c,{get when(){return!!s},get children(){return[s,t(`hbr`,{})]}}),e(X,{children:f`Generated by Powerlines`}),t(`hbr`,{}),e(X,{children:f`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),t(`hbr`,{})]}function Q(n){let{imports:r}=n,i=k(),a=n.scope??i.scope;return e(c,{get when(){return a.importedModules.size>0||!!r&&Object.keys(r).length>0},get children(){return[e(c,{get when(){return!!r&&Object.keys(r).length>0},get children(){return Object.entries(r??{}).map(([e,t])=>f`import ${t===null?``:t.filter(e=>!C(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!C(e)&&e.default).length>0&&t.filter(e=>C(e)||!e.default).length>0?`, `:``)+(t.filter(e=>C(e)||!e.default).length>0?`{ ${t.map(e=>C(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),e(c,{get when(){return a.importedModules.size>0},get children(){return e(te,{get records(){return a.importedModules}})}}),t(`hbr`,{})]}})}function $(t){let[{children:n,imports:i,id:a,description:o,tsx:s},c]=g(t,[`children`,`imports`,`id`,`description`,`tsx`]);return e(Ee,r({get header(){return e(Z,{get header(){return e(we,{name:a,children:o})},get children(){return e(Q,{imports:i})}})},meta:{builtin:{id:a}}},c,{path:`${a}${s?`.tsx`:`.ts`}`,children:n}))}const De=G(`isOptimizationEnabled`);function Oe(t){let[{override:n},i]=g(t,[`override`]),a=I();return e($,r(i,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return S({[`${a?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},i.imports??{})},get children(){return[e(K,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[e(J,{children:`https://react.dev/reference/react-compiler/gating`}),e(Y,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),e(D,{refkey:De,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:n===void 0?f`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:f`return ${n};`})]}}))}export{me as a,pe as c,G as d,z as f,I as h,ye as i,Y as l,F as m,$ as n,J as o,L as p,K as r,be as s,Oe as t,Ce as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(e,n,r,i)=>{i&&(t(e,Symbol.toStringTag,{value:`Module`}),r&&t(r,Symbol.toStringTag,{value:`Module`})),o(e,n,`default`),r&&o(r,n,`default`)},c=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`@alloy-js/core/jsx-runtime`),u=require(`@alloy-js/core`),d=require(`@stryke/type-checks/is-set-string`),f=require(`@stryke/type-checks/is-undefined`),p=require(`defu`);p=c(p);let m=require(`@stryke/type-checks/is-string`),h=require(`@stryke/helpers/get-unique`),g=require(`@stryke/json/storm-json`),ee=require(`@stryke/type-checks/is-null`),_=require(`@stryke/path/append`),v=require(`@alloy-js/typescript`),te=require(`@stryke/type-checks/is-boolean`);const y=(0,u.createContext)();function b(){return(0,u.useContext)(y)}function x(){return b()?.ref?.value}var S={};s(S,require(`@deepkit/type`));function C(e,t){return T(e.type,t??e.getDefaultValue())}function w(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function T(e,t){return(0,f.isUndefined)(t)?`undefined`:(0,ee.isNull)(t)?`null`:e.kind===S.ReflectionKind.boolean?String(t).trim().toLowerCase()===`true`?`true`:`false`:e.kind===S.ReflectionKind.string||e.kind===S.ReflectionKind.literal&&(0,m.isString)(e.literal)?w(t):e.kind===S.ReflectionKind.enum?E(e).kind===S.ReflectionKind.string?w(t):`${String(t)}`:e.kind===S.ReflectionKind.union?O(e)?w(t):`${String(t)}`:e.kind===S.ReflectionKind.array?w(g.StormJSON.stringify(t)):e.kind===S.ReflectionKind.object||e.kind===S.ReflectionKind.objectLiteral?g.StormJSON.stringify(t):e.kind===S.ReflectionKind.property||e.kind===S.ReflectionKind.parameter?T(e.type,t):String(t)}function E(e){if(e.kind!==S.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let t=(0,h.getUniqueBy)(e.values.filter(e=>e!=null),e=>(0,m.isString)(e)?{kind:S.ReflectionKind.string}:{kind:S.ReflectionKind.number});if(t.length===0)throw Error(`No valid enum members could be found.`);return t[0]&&(0,m.isString)(t[0])?{kind:S.ReflectionKind.string}:{kind:S.ReflectionKind.number}}function D(e){if(e.kind===S.ReflectionKind.union&&e.types.length>0)return(0,h.getUniqueBy)(e.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${e.kind}.`)}function O(e){return D(e).some(e=>e.kind===S.ReflectionKind.string||e.kind===S.ReflectionKind.literal&&(0,m.isString)(e.literal))}function k(...e){return(0,u.refkey)(`powerlines`,...e)}function A(e){let[{children:t,heading:n}]=(0,u.splitProps)(e,[`children`,`heading`]);return[`/**`,(0,l.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,l.createIntrinsic)(`hbr`,{}),(0,l.createComponent)(u.Show,{get when(){return!(0,f.isUndefined)(n)},get children(){return[n,(0,l.createIntrinsic)(`hbr`,{}),(0,l.createComponent)(u.Show,{get when(){return(0,l.memo)(()=>!(0,f.isUndefined)(t))()&&(0,u.childrenArray)(()=>t).length>0},get children(){return(0,l.createIntrinsic)(`hbr`,{})}})]}}),(0,l.createComponent)(u.Show,{get when(){return(0,l.memo)(()=>!(0,f.isUndefined)(t))()&&(0,u.childrenArray)(()=>t).length>0},get children(){return(0,l.createComponent)(u.List,{get children(){return(0,u.childrenArray)(()=>t)}})}})]}}),(0,l.createIntrinsic)(`hbr`,{}),` */`,(0,l.createIntrinsic)(`hbr`,{})]}function j(e){let[{children:t,tag:n}]=(0,u.splitProps)(e,[`children`,`tag`]);return[`@${n} `,(0,l.createComponent)(u.Show,{get when(){return!!t},get children(){return(0,l.createIntrinsic)(`align`,{width:2,get children(){return(0,l.createComponent)(u.Prose,{children:t})}})}}),(0,l.createIntrinsic)(`hbr`,{})]}function ne(e){let[{children:t},n]=(0,u.splitProps)(e,[`children`]);return(0,l.createComponent)(j,(0,l.mergeProps)(n,{tag:`title`,children:t}))}function M(e){let[{children:t},n]=(0,u.splitProps)(e,[`children`]);return(0,l.createComponent)(j,(0,l.mergeProps)(n,{tag:`domain`,children:t}))}function N(e){let[{children:t},n]=(0,u.splitProps)(e,[`children`]);return(0,l.createComponent)(j,(0,l.mergeProps)(n,{tag:`alias`,children:t}))}function P(e){let[{children:t},n]=(0,u.splitProps)(e,[`children`]);return(0,l.createComponent)(j,(0,l.mergeProps)(n,{tag:`permission`,children:t}))}function F(e){return[`@defaultValue `,(0,l.createComponent)(u.Show,{get when(){return!(0,f.isUndefined)(e.value)},get children(){return(0,l.createIntrinsic)(`align`,{width:2,get children(){return(0,l.createComponent)(u.Prose,{get children(){return C(e.value)}})}})}}),(0,l.createIntrinsic)(`hbr`,{})]}function I(e){return[`@remarks `,(0,l.createIntrinsic)(`hbr`,{}),(0,l.createComponent)(u.List,{hardline:!0,get children(){return(0,u.childrenArray)(()=>e.children)}})]}function L(e){return(0,l.createComponent)(j,(0,l.mergeProps)(e,{tag:`see`}))}function R(e){let[{tsx:t,fenced:n=!0,language:r,children:i}]=(0,u.splitProps)(e,[`tsx`,`fenced`,`language`,`children`]);return[`@example `,(0,l.createIntrinsic)(`hbr`,{}),(0,l.createComponent)(u.Show,{when:n,get children(){return["```",r||(t?`tsx`:`ts`),(0,l.createIntrinsic)(`hbr`,{})]}}),i,(0,l.createComponent)(u.Show,{when:n,get children(){return[(0,l.createIntrinsic)(`hbr`,{}),"```"]}})]}function z(){return(0,l.createComponent)(j,{tag:`readonly`})}function B(){return(0,l.createComponent)(j,{tag:`internal`})}function V(){return(0,l.createComponent)(j,{tag:`ignore`})}function H(){return(0,l.createComponent)(j,{tag:`hidden`})}function U(e){let[{title:t,alias:n,permission:r,domain:i,readonly:a,internal:o,ignore:s,hidden:c,defaultValue:p}]=(0,u.splitProps)(e,[`title`,`alias`,`permission`,`domain`,`readonly`,`internal`,`ignore`,`hidden`,`defaultValue`]);return[(0,l.createComponent)(u.Show,{get when(){return(0,d.isSetString)(t)},get children(){return(0,l.createComponent)(ne,{children:t})}}),(0,l.createComponent)(u.Show,{get when(){return!(0,f.isUndefined)(n)&&n.length>0},get children(){return(0,l.createComponent)(u.For,{each:n??[],children:e=>(0,l.createComponent)(N,{children:e})})}}),(0,l.createComponent)(u.Show,{get when(){return(0,d.isSetString)(i)},get children(){return(0,l.createComponent)(M,{children:i})}}),(0,l.createComponent)(u.Show,{get when(){return!(0,f.isUndefined)(r)&&r.length>0},get children(){return(0,l.createComponent)(u.For,{each:r??[],children:e=>(0,l.createComponent)(P,{children:e})})}}),(0,l.createComponent)(u.Show,{when:a===!0,get children(){return(0,l.createComponent)(z,{})}}),(0,l.createComponent)(u.Show,{when:o===!0,get children(){return(0,l.createComponent)(B,{})}}),(0,l.createComponent)(u.Show,{when:s===!0,get children(){return(0,l.createComponent)(V,{})}}),(0,l.createComponent)(u.Show,{when:c===!0,get children(){return(0,l.createComponent)(H,{})}}),(0,l.createComponent)(u.Show,{get when(){return!(0,f.isUndefined)(p)},get children(){return(0,l.createComponent)(F,{value:p})}})]}function W(e){return[`@param `,(0,l.createComponent)(G,{get name(){return e.name},get optional(){return e.optional},get defaultValue(){return e.defaultValue}}),(0,l.createComponent)(K,{get children(){return e.children}})]}function G(e){return[(0,l.createComponent)(u.Show,{get when(){return e.optional},children:`[`}),(0,l.memo)(()=>e.name),(0,l.createComponent)(u.Show,{get when(){return!!e.defaultValue},get children(){return[`=`,(0,l.memo)(()=>e.defaultValue)]}}),(0,l.createComponent)(u.Show,{get when(){return e.optional},children:`]`})]}function K(e){return(0,l.createComponent)(u.Show,{get when(){return!!e.children},get children(){return[` - `,(0,l.createIntrinsic)(`align`,{width:2,get children(){return(0,l.createComponent)(u.Prose,{get children(){return e.children}})}})]}})}function q(e){return(0,l.createComponent)(j,(0,l.mergeProps)(e,{tag:`returns`}))}function J(e){return(0,l.createComponent)(j,(0,l.mergeProps)(e,{tag:`throws`}))}function Y(e){let[{children:t,name:n,prefix:r}]=(0,u.splitProps)(e,[`children`,`name`,`prefix`]),i=x();return[`/**`,(0,l.createIntrinsic)(`align`,{string:` * `,get children(){return[(0,l.createIntrinsic)(`hbr`,{}),(0,l.createComponent)(u.Show,{get when(){return!!t},get children(){return[(0,l.createComponent)(u.List,{hardline:!0,get children(){return(0,u.childrenArray)(()=>t)}}),(0,l.createIntrinsic)(`hbr`,{}),(0,l.createIntrinsic)(`hbr`,{})]}}),`@module `,(0,l.memo)(()=>r||i?.config.output.builtinPrefix),`:`,n]}}),(0,l.createIntrinsic)(`hbr`,{}),` */`]}function X(e){let{variant:t=`double-slash`,children:n}=e,r=t===`slash-star`?`/* `:t===`slash-star-star`?`/** `:t===`triple-slash`?`/// `:t===`markdown`?`<!-- `:`// `;return[r,(0,l.createIntrinsic)(`align`,{string:r,get children(){return[(0,l.createComponent)(u.Prose,{children:n}),t===`slash-star`||t===`slash-star-star`?` */ `:t===`markdown`?` -->`:``]}})]}function re(e){let[{children:t,meta:n,path:r,header:i,preset:a,filetype:o,reference:s}]=(0,u.splitProps)(e,[`children`,`meta`,`path`,`header`,`preset`,`filetype`,`reference`]),c=(0,u.useContext)(u.SourceDirectoryContext),d={path:(0,_.appendPath)(r,c.path),filetype:o,reference:s};c?.addContent(d);let f=(0,u.useFormatOptions)({printWidth:e.printWidth,tabWidth:e.tabWidth,useTabs:e.useTabs,insertFinalNewLine:e.insertFinalNewLine}),m=(0,u.getContext)();return m.meta=(0,p.default)({sourceFile:d,printOptions:f,output:{preset:a}},n??{}),(0,l.createComponent)(u.SourceFileContext.Provider,{value:d,get children(){return[(0,l.createComponent)(u.Show,{when:i!==void 0,get children(){return[i,(0,l.createIntrinsic)(`hbr`,{})]}}),t]}})}function ie(e){let[{children:t,path:n,imports:r,tsx:i,header:a},o]=(0,u.splitProps)(e,[`children`,`path`,`imports`,`tsx`,`header`]),s=(0,u.useContext)(u.SourceDirectoryContext),c=(0,v.getSourceDirectoryData)(s),d=(0,_.appendPath)(n,s.path),f=new v.TSModuleScope(d,(0,u.useScope)());c.modules.add(f);let p=(0,u.useContext)(v.PackageContext);return p&&p.scope.addModule(f),e.export&&p&&((0,te.isBoolean)(e.export)?p.scope.addExport(d,f):p.scope.addExport(e.export,f)),(0,l.createComponent)(v.SourceFileContext.Provider,{value:{scope:f},get children(){return(0,l.createComponent)(u.Scope,{value:f,get children(){return(0,l.createComponent)(re,(0,l.mergeProps)(o,{path:d,get header(){return a??(0,l.createComponent)(Z,{get children(){return(0,l.createComponent)(Q,{imports:r,scope:f})}})},filetype:i?`tsx`:`typescript`,children:t}))}})}})}function Z(e){let{header:t,disableEslint:n=!0,disableBiome:r=!0,disablePrettier:i=!1,children:a}=e;return[(0,l.createComponent)(u.Show,{get when(){return!!t},get children(){return[t,(0,l.createIntrinsic)(`hbr`,{})]}}),(0,l.createIntrinsic)(`hbr`,{}),(0,l.createComponent)(u.Show,{get when(){return!!n},get children(){return[(0,l.createComponent)(X,{variant:`slash-star`,children:`eslint-disable`}),(0,l.createIntrinsic)(`hbr`,{})]}}),(0,l.createComponent)(u.Show,{get when(){return!!i},get children(){return[(0,l.createComponent)(X,{variant:`slash-star`,children:`prettier-ignore`}),(0,l.createIntrinsic)(`hbr`,{})]}}),(0,l.createComponent)(u.Show,{get when(){return!!r},get children(){return[(0,l.createComponent)(X,{children:`biome-ignore lint: disable`}),(0,l.createIntrinsic)(`hbr`,{})]}}),(0,l.createComponent)(u.Show,{get when(){return!!n||!!i||!!r},get children(){return(0,l.createIntrinsic)(`hbr`,{})}}),(0,l.createComponent)(u.Show,{get when(){return!!a},get children(){return[a,(0,l.createIntrinsic)(`hbr`,{})]}}),(0,l.createComponent)(X,{children:u.code`Generated by Powerlines`}),(0,l.createIntrinsic)(`hbr`,{}),(0,l.createComponent)(X,{children:u.code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "storm prepare" command`}),(0,l.createIntrinsic)(`hbr`,{})]}function Q(e){let{imports:t}=e,n=(0,v.useSourceFile)(),r=e.scope??n.scope;return(0,l.createComponent)(u.Show,{get when(){return r.importedModules.size>0||!!t&&Object.keys(t).length>0},get children(){return[(0,l.createComponent)(u.Show,{get when(){return!!t&&Object.keys(t).length>0},get children(){return Object.entries(t??{}).map(([e,t])=>u.code`import ${t===null?``:t.filter(e=>!(0,m.isString)(e)&&e.default).map(e=>e.alias?e.alias:e.name).join(`, `)+(t.filter(e=>!(0,m.isString)(e)&&e.default).length>0&&t.filter(e=>(0,m.isString)(e)||!e.default).length>0?`, `:``)+(t.filter(e=>(0,m.isString)(e)||!e.default).length>0?`{ ${t.map(e=>(0,m.isString)(e)?e:e.alias?`${e.name} as ${e.alias}`:e.name).join(`, `)} }`:``)} from "${e}";`)}}),(0,l.createComponent)(u.Show,{get when(){return r.importedModules.size>0},get children(){return(0,l.createComponent)(v.ImportStatements,{get records(){return r.importedModules}})}}),(0,l.createIntrinsic)(`hbr`,{})]}})}function $(e){let[{children:t,imports:n,id:r,description:i,tsx:a},o]=(0,u.splitProps)(e,[`children`,`imports`,`id`,`description`,`tsx`]);return(0,l.createComponent)(ie,(0,l.mergeProps)({get header(){return(0,l.createComponent)(Z,{get header(){return(0,l.createComponent)(Y,{name:r,children:i})},get children(){return(0,l.createComponent)(Q,{imports:n})}})},meta:{builtin:{id:r}}},o,{path:`${r}${a?`.tsx`:`.ts`}`,children:t}))}const ae=k(`isOptimizationEnabled`);function oe(e){let[{override:t},n]=(0,u.splitProps)(e,[`override`]),r=x();return(0,l.createComponent)($,(0,l.mergeProps)(n,{id:`react/optimized`,description:`A built-in module to provide access to environment configuration to determine React optimizations.`,get imports(){return(0,p.default)({[`${r?.config.output.builtinPrefix}:env`]:[`env`,`isDevelopment`]},n.imports??{})},get children(){return[(0,l.createComponent)(A,{heading:`A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.`,get children(){return[(0,l.createComponent)(L,{children:`https://react.dev/reference/react-compiler/gating`}),(0,l.createComponent)(q,{children:`A boolean indicating if the React compiler's optimizations should be used.`})]}}),(0,l.createComponent)(v.FunctionDeclaration,{refkey:ae,async:!1,export:!0,name:`isOptimizationEnabled`,returnType:`boolean`,children:t===void 0?u.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `:u.code`return ${t};`})]}}))}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return J}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
File without changes
|
package/dist/types/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../plugin-pBKbb5K9.cjs`),require(`../runtime-Bp9G0scd.cjs`),require(`../types-a8gm_IaQ.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../plugin-Gb47Xzf6.mjs";import"../runtime-BbUj49s9.mjs";import"../types-CwXe_Ycf.mjs";export{};
|
package/dist/types/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../plugin-pBKbb5K9.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../plugin-Gb47Xzf6.mjs";export{};
|
package/dist/types/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../runtime-Bp9G0scd.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../runtime-BbUj49s9.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for building a React application.",
|
|
6
6
|
"repository": {
|
|
@@ -38,81 +38,93 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"private": false,
|
|
41
|
-
"typings": "dist/index.d.
|
|
41
|
+
"typings": "dist/index.d.mts",
|
|
42
42
|
"main": "dist/index.cjs",
|
|
43
|
-
"module": "dist/index.
|
|
43
|
+
"module": "dist/index.mjs",
|
|
44
44
|
"exports": {
|
|
45
45
|
"./package.json": "./package.json",
|
|
46
46
|
".": {
|
|
47
|
-
"import": {
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/index.d.mts",
|
|
49
|
+
"default": "./dist/index.mjs"
|
|
50
|
+
},
|
|
48
51
|
"require": {
|
|
49
52
|
"types": "./dist/index.d.cts",
|
|
50
53
|
"default": "./dist/index.cjs"
|
|
51
54
|
},
|
|
52
|
-
"default": {
|
|
55
|
+
"default": {
|
|
56
|
+
"types": "./dist/index.d.mts",
|
|
57
|
+
"default": "./dist/index.mjs"
|
|
58
|
+
}
|
|
53
59
|
},
|
|
54
60
|
"./index": {
|
|
55
|
-
"import": {
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./dist/index.d.mts",
|
|
63
|
+
"default": "./dist/index.mjs"
|
|
64
|
+
},
|
|
56
65
|
"require": {
|
|
57
66
|
"types": "./dist/index.d.cts",
|
|
58
67
|
"default": "./dist/index.cjs"
|
|
59
68
|
},
|
|
60
|
-
"default": {
|
|
69
|
+
"default": {
|
|
70
|
+
"types": "./dist/index.d.mts",
|
|
71
|
+
"default": "./dist/index.mjs"
|
|
72
|
+
}
|
|
61
73
|
},
|
|
62
74
|
"./types": {
|
|
63
75
|
"import": {
|
|
64
|
-
"types": "./dist/types/index.d.
|
|
65
|
-
"default": "./dist/types/index.
|
|
76
|
+
"types": "./dist/types/index.d.mts",
|
|
77
|
+
"default": "./dist/types/index.mjs"
|
|
66
78
|
},
|
|
67
79
|
"require": {
|
|
68
80
|
"types": "./dist/types/index.d.cts",
|
|
69
81
|
"default": "./dist/types/index.cjs"
|
|
70
82
|
},
|
|
71
83
|
"default": {
|
|
72
|
-
"types": "./dist/types/index.d.
|
|
73
|
-
"default": "./dist/types/index.
|
|
84
|
+
"types": "./dist/types/index.d.mts",
|
|
85
|
+
"default": "./dist/types/index.mjs"
|
|
74
86
|
}
|
|
75
87
|
},
|
|
76
88
|
"./types/*": {
|
|
77
89
|
"import": {
|
|
78
|
-
"types": "./dist/types/*.d.
|
|
79
|
-
"default": "./dist/types/*.
|
|
90
|
+
"types": "./dist/types/*.d.mts",
|
|
91
|
+
"default": "./dist/types/*.mjs"
|
|
80
92
|
},
|
|
81
93
|
"require": {
|
|
82
94
|
"types": "./dist/types/*.d.cts",
|
|
83
95
|
"default": "./dist/types/*.cjs"
|
|
84
96
|
},
|
|
85
97
|
"default": {
|
|
86
|
-
"types": "./dist/types/*.d.
|
|
87
|
-
"default": "./dist/types/*.
|
|
98
|
+
"types": "./dist/types/*.d.mts",
|
|
99
|
+
"default": "./dist/types/*.mjs"
|
|
88
100
|
}
|
|
89
101
|
},
|
|
90
102
|
"./components": {
|
|
91
103
|
"import": {
|
|
92
|
-
"types": "./dist/components/index.d.
|
|
93
|
-
"default": "./dist/components/index.
|
|
104
|
+
"types": "./dist/components/index.d.mts",
|
|
105
|
+
"default": "./dist/components/index.mjs"
|
|
94
106
|
},
|
|
95
107
|
"require": {
|
|
96
108
|
"types": "./dist/components/index.d.cts",
|
|
97
109
|
"default": "./dist/components/index.cjs"
|
|
98
110
|
},
|
|
99
111
|
"default": {
|
|
100
|
-
"types": "./dist/components/index.d.
|
|
101
|
-
"default": "./dist/components/index.
|
|
112
|
+
"types": "./dist/components/index.d.mts",
|
|
113
|
+
"default": "./dist/components/index.mjs"
|
|
102
114
|
}
|
|
103
115
|
},
|
|
104
116
|
"./components/*": {
|
|
105
117
|
"import": {
|
|
106
|
-
"types": "./dist/components/*.d.
|
|
107
|
-
"default": "./dist/components/*.
|
|
118
|
+
"types": "./dist/components/*.d.mts",
|
|
119
|
+
"default": "./dist/components/*.mjs"
|
|
108
120
|
},
|
|
109
121
|
"require": {
|
|
110
122
|
"types": "./dist/components/*.d.cts",
|
|
111
123
|
"default": "./dist/components/*.cjs"
|
|
112
124
|
},
|
|
113
125
|
"default": {
|
|
114
|
-
"types": "./dist/components/*.d.
|
|
115
|
-
"default": "./dist/components/*.
|
|
126
|
+
"types": "./dist/components/*.d.mts",
|
|
127
|
+
"default": "./dist/components/*.mjs"
|
|
116
128
|
}
|
|
117
129
|
}
|
|
118
130
|
},
|
|
@@ -125,24 +137,23 @@
|
|
|
125
137
|
},
|
|
126
138
|
"dependencies": {
|
|
127
139
|
"@storm-software/config-tools": "^1.188.50",
|
|
128
|
-
"@stryke/cli": "^0.12.
|
|
129
|
-
"@stryke/convert": "^0.6.
|
|
130
|
-
"@stryke/fs": "^0.33.
|
|
131
|
-
"@stryke/path": "^0.
|
|
140
|
+
"@stryke/cli": "^0.12.19",
|
|
141
|
+
"@stryke/convert": "^0.6.13",
|
|
142
|
+
"@stryke/fs": "^0.33.9",
|
|
143
|
+
"@stryke/path": "^0.22.0",
|
|
132
144
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
133
|
-
"@powerlines/alloy": "^0.11.
|
|
134
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
135
|
-
"@powerlines/plugin-env": "^0.13.
|
|
136
|
-
"@powerlines/plugin-plugin": "^0.
|
|
145
|
+
"@powerlines/alloy": "^0.11.57",
|
|
146
|
+
"@powerlines/plugin-babel": "^0.12.57",
|
|
147
|
+
"@powerlines/plugin-env": "^0.13.54",
|
|
148
|
+
"@powerlines/plugin-plugin": "^0.12.0",
|
|
137
149
|
"@vitejs/plugin-react": "^5.1.1",
|
|
138
150
|
"defu": "^6.1.4",
|
|
139
|
-
"powerlines": "^0.
|
|
151
|
+
"powerlines": "^0.29.0"
|
|
140
152
|
},
|
|
141
153
|
"devDependencies": {
|
|
142
|
-
"@powerlines/nx": "^0.10.
|
|
143
|
-
"@storm-software/tsup": "^0.2.48",
|
|
154
|
+
"@powerlines/nx": "^0.10.48",
|
|
144
155
|
"@types/node": "^24.10.1"
|
|
145
156
|
},
|
|
146
157
|
"publishConfig": { "access": "public" },
|
|
147
|
-
"gitHead": "
|
|
158
|
+
"gitHead": "f65e5efb5fd5a7f5eab1936aec5a2807b931ae87"
|
|
148
159
|
}
|
package/dist/chunk-FBBMZ4NC.cjs
DELETED
package/dist/chunk-UCUR73HG.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from './react-optimized.cjs';
|
|
2
|
-
import '@alloy-js/core';
|
|
3
|
-
import '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import '../fs-ECFlqnPg.cjs';
|
|
5
|
-
import '@stryke/fs/resolve';
|
|
6
|
-
import '@stryke/types/base';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from './react-optimized.js';
|
|
2
|
-
import '@alloy-js/core';
|
|
3
|
-
import '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import '../fs-ECFlqnPg.js';
|
|
5
|
-
import '@stryke/fs/resolve';
|
|
6
|
-
import '@stryke/types/base';
|
package/dist/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from'./react-optimized';
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core from '@alloy-js/core';
|
|
2
|
-
import { Children as Children$1, SourceFileProps as SourceFileProps$1 } from '@alloy-js/core';
|
|
3
|
-
import { Children } from '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import { a as StoragePreset } from '../fs-ECFlqnPg.cjs';
|
|
5
|
-
import '@stryke/fs/resolve';
|
|
6
|
-
import '@stryke/types/base';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A type that represents the props of a component that can have children.
|
|
10
|
-
*/
|
|
11
|
-
interface ComponentProps {
|
|
12
|
-
children?: Children;
|
|
13
|
-
}
|
|
14
|
-
interface TypescriptFileImportItem {
|
|
15
|
-
name: string;
|
|
16
|
-
default?: boolean;
|
|
17
|
-
alias?: string;
|
|
18
|
-
type?: boolean;
|
|
19
|
-
}
|
|
20
|
-
type TypescriptFileImports = Record<string, null | Array<TypescriptFileImportItem | string>>;
|
|
21
|
-
|
|
22
|
-
interface TSDocModuleProps extends ComponentProps {
|
|
23
|
-
/**
|
|
24
|
-
* the prefix for the builtin module name
|
|
25
|
-
*
|
|
26
|
-
* @defaultValue "storm"
|
|
27
|
-
*/
|
|
28
|
-
prefix?: string;
|
|
29
|
-
/**
|
|
30
|
-
* The name of the module
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* import { MyModule } from "storm:my-module";
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
name: Children$1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
44
|
-
/**
|
|
45
|
-
* If true, indicates that the file is virtual and should not be written to disk.
|
|
46
|
-
*
|
|
47
|
-
* @defaultValue false
|
|
48
|
-
*/
|
|
49
|
-
preset?: StoragePreset;
|
|
50
|
-
/**
|
|
51
|
-
* The metadata associated with the source file.
|
|
52
|
-
*
|
|
53
|
-
* @remarks
|
|
54
|
-
* The values stored in the metadata will be available in the rendering context.
|
|
55
|
-
*/
|
|
56
|
-
meta?: Record<string, any>;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
type TypescriptFileProps = Omit<SourceFileProps, "filetype"> & ComponentProps & {
|
|
60
|
-
header?: Children$1;
|
|
61
|
-
imports?: TypescriptFileImports;
|
|
62
|
-
export?: boolean | string;
|
|
63
|
-
tsx?: boolean;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
67
|
-
/**
|
|
68
|
-
* The runtime module identifier.
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* This value will be included after the \`storm:\` prefix in the import statement.
|
|
72
|
-
*/
|
|
73
|
-
id: string;
|
|
74
|
-
/**
|
|
75
|
-
* The description for the builtin module.
|
|
76
|
-
*/
|
|
77
|
-
description?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Whether the file is a TSX file.
|
|
80
|
-
*
|
|
81
|
-
* @defaultValue false
|
|
82
|
-
*/
|
|
83
|
-
tsx?: boolean;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
|
|
87
|
-
override?: boolean;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
91
|
-
*/
|
|
92
|
-
declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core.Children;
|
|
93
|
-
declare type __ΩReactOptimizedBuiltinProps = any[];
|
|
94
|
-
|
|
95
|
-
export { ReactOptimizedBuiltin, type ReactOptimizedBuiltinProps, type __ΩReactOptimizedBuiltinProps };
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core from '@alloy-js/core';
|
|
2
|
-
import { Children as Children$1, SourceFileProps as SourceFileProps$1 } from '@alloy-js/core';
|
|
3
|
-
import { Children } from '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import { a as StoragePreset } from '../fs-ECFlqnPg.js';
|
|
5
|
-
import '@stryke/fs/resolve';
|
|
6
|
-
import '@stryke/types/base';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A type that represents the props of a component that can have children.
|
|
10
|
-
*/
|
|
11
|
-
interface ComponentProps {
|
|
12
|
-
children?: Children;
|
|
13
|
-
}
|
|
14
|
-
interface TypescriptFileImportItem {
|
|
15
|
-
name: string;
|
|
16
|
-
default?: boolean;
|
|
17
|
-
alias?: string;
|
|
18
|
-
type?: boolean;
|
|
19
|
-
}
|
|
20
|
-
type TypescriptFileImports = Record<string, null | Array<TypescriptFileImportItem | string>>;
|
|
21
|
-
|
|
22
|
-
interface TSDocModuleProps extends ComponentProps {
|
|
23
|
-
/**
|
|
24
|
-
* the prefix for the builtin module name
|
|
25
|
-
*
|
|
26
|
-
* @defaultValue "storm"
|
|
27
|
-
*/
|
|
28
|
-
prefix?: string;
|
|
29
|
-
/**
|
|
30
|
-
* The name of the module
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* import { MyModule } from "storm:my-module";
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
name: Children$1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
44
|
-
/**
|
|
45
|
-
* If true, indicates that the file is virtual and should not be written to disk.
|
|
46
|
-
*
|
|
47
|
-
* @defaultValue false
|
|
48
|
-
*/
|
|
49
|
-
preset?: StoragePreset;
|
|
50
|
-
/**
|
|
51
|
-
* The metadata associated with the source file.
|
|
52
|
-
*
|
|
53
|
-
* @remarks
|
|
54
|
-
* The values stored in the metadata will be available in the rendering context.
|
|
55
|
-
*/
|
|
56
|
-
meta?: Record<string, any>;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
type TypescriptFileProps = Omit<SourceFileProps, "filetype"> & ComponentProps & {
|
|
60
|
-
header?: Children$1;
|
|
61
|
-
imports?: TypescriptFileImports;
|
|
62
|
-
export?: boolean | string;
|
|
63
|
-
tsx?: boolean;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
|
|
67
|
-
/**
|
|
68
|
-
* The runtime module identifier.
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* This value will be included after the \`storm:\` prefix in the import statement.
|
|
72
|
-
*/
|
|
73
|
-
id: string;
|
|
74
|
-
/**
|
|
75
|
-
* The description for the builtin module.
|
|
76
|
-
*/
|
|
77
|
-
description?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Whether the file is a TSX file.
|
|
80
|
-
*
|
|
81
|
-
* @defaultValue false
|
|
82
|
-
*/
|
|
83
|
-
tsx?: boolean;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
|
|
87
|
-
override?: boolean;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Generates the `react/optimized` builtin module for the Powerlines project.
|
|
91
|
-
*/
|
|
92
|
-
declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core.Children;
|
|
93
|
-
declare type __ΩReactOptimizedBuiltinProps = any[];
|
|
94
|
-
|
|
95
|
-
export { ReactOptimizedBuiltin, type ReactOptimizedBuiltinProps, type __ΩReactOptimizedBuiltinProps };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import {a}from'../chunk-UCUR73HG.js';import {createComponent,mergeProps}from'@alloy-js/core/jsx-runtime';import {splitProps,code}from'@alloy-js/core';import {FunctionDeclaration}from'@alloy-js/typescript';import {usePowerlines}from'@powerlines/alloy/core/contexts/context';import {refkey}from'@powerlines/alloy/helpers/refkey';import {BuiltinFile}from'@powerlines/alloy/typescript/components/builtin-file';import {TSDoc,TSDocLink,TSDocReturns}from'@powerlines/alloy/typescript/components/tsdoc';import h from'defu';/*****************************************
|
|
2
|
-
*
|
|
3
|
-
* ⚡ Built by Storm Software
|
|
4
|
-
*
|
|
5
|
-
*****************************************/
|
|
6
|
-
|
|
7
|
-
const v=refkey("isOptimizationEnabled");function k(n){const[{override:t},i]=splitProps(n,["override"]),c=usePowerlines();return createComponent(BuiltinFile,mergeProps(i,{id:"react/optimized",description:"A built-in module to provide access to environment configuration to determine React optimizations.",get imports(){return h({[`${c?.config.output.builtinPrefix}:env`]:["env","isDevelopment"]},i.imports??{})},get children(){return [createComponent(TSDoc,{heading:"A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",get children(){return [createComponent(TSDocLink,{children:"https://react.dev/reference/react-compiler/gating"}),createComponent(TSDocReturns,{children:"A boolean indicating if the React compiler's optimizations should be used."})]}}),createComponent(FunctionDeclaration,{refkey:v,async:false,export:true,name:"isOptimizationEnabled",returnType:"boolean",children:t!==void 0?code`return ${t};`:code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `})]}}))}a(k,"ReactOptimizedBuiltin");
|
|
8
|
-
export{k as ReactOptimizedBuiltin};
|