nexa-framework 0.7.6 → 0.7.8

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.
@@ -0,0 +1 @@
1
+ export declare function aiContext(): string;
@@ -0,0 +1,93 @@
1
+ export function aiContext() {
2
+ return `# Nexa Framework — AI Context
3
+
4
+ Framework frontend reactivo con Signals + Virtual DOM + SFC compiler (.nexa) + UI kit.
5
+
6
+ ## Paquetes
7
+ - \`nexa-framework\` — Core (reactividad + VDOM + SSR + async + directivas)
8
+ - \`nexa-ui-kit\` — 33 UI components
9
+ - \`@nexa/router\` — SPA router
10
+ - \`@nexa/state\` — State management
11
+
12
+ ## Reactividad
13
+ \`\`\`ts
14
+ signal<T>(init: T): Signal<T> // { value: T, peek(): T }
15
+ computed<T>(fn): Signal<T>
16
+ effect(fn): Effect
17
+ batch(fn): void
18
+ untracked<T>(fn): T
19
+ \`\`\`
20
+ Siempre usa \`.value\` para leer/escribir señales.
21
+
22
+ ## VDOM
23
+ \`\`\`ts
24
+ h(tag, props?, children?): VNode
25
+ mount(vnode, container): void
26
+ defineComponent({ props?, emits?, setup?, render? })
27
+ \`\`\`
28
+ Lifecycle: onMounted, onBeforeMount, onUpdated, onBeforeUpdate, onUnmounted, onBeforeUnmount
29
+ Provide/inject: provide(key, val), inject(key, default?)
30
+
31
+ ## SFC (.nexa)
32
+ \`\`\`html
33
+ <script setup>
34
+ const count = signal(0)
35
+ </script>
36
+ <template>
37
+ <p>{{ count.value }}</p>
38
+ <button @click="count = count + 1">+</button>
39
+ </template>
40
+ <style scoped>
41
+ p { color: blue; }
42
+ </style>
43
+ \`\`\`
44
+
45
+ ### Template directives
46
+ - {{ expr }}, :attr, @event, @event.prevent/.stop/.self
47
+ - v-if, v-else-if, v-else, v-for="item in items", v-show, v-model
48
+ - v-currency (formato moneda)
49
+ - #name para slots nombrados, scoped slots con { data }
50
+ - Asignaciones inline: @click="x = expr" compila a x.value = expr
51
+
52
+ ### Componentes UI (nexa-ui-kit)
53
+ NInput, NInputNumber(mode currency/props currency/locale), NPassword, NSelect, NMultiSelect,
54
+ NAutocomplete, NCheckbox, NSwitch, NRadio, NChips, NDatepicker,
55
+ NButton(variant/size/loading/block/disabled), NCard, NModal(size/closable), NBottomSheet, NTabs,
56
+ NDataTable(columns/paginator/selection/sort), NPaginator, NTreeMenu,
57
+ NAvatar, NTag, NBadge, NAlert, NToastContainer(useToast), NProgressBar, NSkeleton, NTooltip,
58
+ NForm(rules), NFormField, NVirtualList, NScrollView, NImage
59
+ v-model en inputs: <NInput v-model="signal" />
60
+
61
+ ### Router (@nexa/router)
62
+ createRouter({ routes: [{path, component}], mode: 'history'|'hash' })
63
+ router.navigate(path), router.beforeEach(guard)
64
+ RouterView, Link componentes de template
65
+ Señales: currentPath, params, query, loading
66
+
67
+ ### State (@nexa/state)
68
+ createStore({ key: val }) → { state: { key: Signal } }
69
+ defineStore(id, factory) → singleton composable
70
+ persist(key, initial) → Signal con localStorage
71
+
72
+ ### Async
73
+ defineAsyncComponent({ loader, loadingComponent, errorComponent, delay, timeout })
74
+ Suspense, ErrorBoundary
75
+
76
+ ### SSR
77
+ renderToString(vnode), hydrate(vnode, container)
78
+
79
+ ### Directives programáticas
80
+ vShow(el, signal), vModel(vnode, signal), vCurrency(vnode, signal, {currency?, locale?})
81
+
82
+ ### Testing
83
+ render(Component) → { container, baseElement, unmount }
84
+
85
+ ### Best Practices
86
+ 1. signal() para todo estado reactivo
87
+ 2. .value siempre (excepto peek() para leer sin tracking)
88
+ 3. Inline assignments: @click="x = expr" funciona (v0.7.6+)
89
+ 4. batch() para múltiples writes
90
+ 5. cleanup en effect()
91
+ 6. Max 200 líneas por componente
92
+ 7. Sin comentarios en código, arrow functions, early return, TDD`;
93
+ }
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export { signal, computed, effect, batch, untracked, } from 'nexa-reactivity';
2
2
  export type { Signal } from 'nexa-reactivity';
3
3
  export { h, hText, Fragment, Teleport, mount, defineComponent, provide, inject, onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted, vShow, vModel, vCurrency, renderToString, registerComponent, reloadComponent, injectStyle, Suspense, ErrorBoundary, Transition, createRenderer, domOptions, } from 'nexa-runtime';
4
4
  export type { VNode, Component } from 'nexa-runtime';
5
+ export { aiContext } from './ai-context.js';
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { signal, computed, effect, batch, untracked, } from 'nexa-reactivity';
2
2
  export { h, hText, Fragment, Teleport, mount, defineComponent, provide, inject, onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted, vShow, vModel, vCurrency, renderToString, registerComponent, reloadComponent, injectStyle, Suspense, ErrorBoundary, Transition, createRenderer, domOptions, } from 'nexa-runtime';
3
+ export { aiContext } from './ai-context.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexa-framework",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "nexa-reactivity": "0.7.6",
17
- "nexa-runtime": "0.7.6"
16
+ "nexa-runtime": "0.7.8",
17
+ "nexa-reactivity": "0.7.8"
18
18
  },
19
19
  "files": [
20
20
  "dist"