@hyperfixi/core 3.3.0 → 4.0.1
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/README.md +57 -179
- package/dist/ast-utils/index.cjs +74 -806
- package/dist/ast-utils/index.d.ts +1 -1
- package/dist/ast-utils/index.mjs +74 -805
- package/dist/ast-utils/interchange/engine-positions.d.ts +3 -0
- package/dist/ast-utils/interchange/index.d.ts +1 -2
- package/dist/hyperfixi.js +19 -2
- package/dist/index.d.ts +2 -22
- package/dist/index.mjs +3 -29128
- package/dist/lsp-metadata.cjs +77 -73
- package/dist/lsp-metadata.d.ts +4 -4
- package/dist/lsp-metadata.mjs +77 -73
- package/dist/metadata.cjs +34 -266
- package/dist/metadata.d.ts +31 -26
- package/dist/metadata.mjs +34 -266
- package/dist/multilingual/index.cjs +16 -382
- package/dist/multilingual/index.d.ts +4 -32
- package/dist/multilingual/index.mjs +15 -377
- package/dist/reference/index.cjs +67 -216
- package/dist/reference/index.d.ts +0 -3
- package/dist/reference/index.mjs +68 -216
- package/dist/version.d.ts +1 -1
- package/package.json +13 -179
- package/dist/__test-utils__/context-builders.d.ts +0 -42
- package/dist/__test-utils__/error-testing.d.ts +0 -18
- package/dist/__test-utils__/index.d.ts +0 -6
- package/dist/__test-utils__/mock-types.d.ts +0 -57
- package/dist/__test-utils__/parser-context-mock.d.ts +0 -7
- package/dist/__test-utils__/parser-helpers.d.ts +0 -38
- package/dist/api/hyperscript-api.d.ts +0 -90
- package/dist/api/lokascript-api.d.ts +0 -9
- package/dist/ast/command-slots.d.ts +0 -140
- package/dist/ast/guards.d.ts +0 -15
- package/dist/ast/legacy.d.ts +0 -15
- package/dist/ast/nodes.d.ts +0 -243
- package/dist/ast-utils/interchange/from-core.d.ts +0 -12
- package/dist/ast-utils/interchange/to-core.d.ts +0 -8
- package/dist/behaviors/boosted.d.ts +0 -29
- package/dist/behaviors/history-swap.d.ts +0 -24
- package/dist/behaviors/index.cjs +0 -1155
- package/dist/behaviors/index.d.ts +0 -4
- package/dist/behaviors/index.mjs +0 -1145
- package/dist/bundle-generator/executor-core.d.ts +0 -4
- package/dist/bundle-generator/generator.d.ts +0 -4
- package/dist/bundle-generator/index.cjs +0 -2804
- package/dist/bundle-generator/index.d.ts +0 -6
- package/dist/bundle-generator/index.mjs +0 -2779
- package/dist/bundle-generator/parser-templates.d.ts +0 -6
- package/dist/bundle-generator/template-capabilities.d.ts +0 -12
- package/dist/bundle-generator/templates.d.ts +0 -12
- package/dist/bundle-generator/types.d.ts +0 -34
- package/dist/chunks/bridge-CI9SOl8u.js +0 -2
- package/dist/chunks/browser-modular-7CpI5VF2.js +0 -2
- package/dist/chunks/index-BwXDEK0m.js +0 -2
- package/dist/chunks/index-DQi2o8Lk.js +0 -2
- package/dist/chunks/index-uCOQ8Qn0.js +0 -2
- package/dist/commands/advanced/js.d.ts +0 -40
- package/dist/commands/animation/measure.d.ts +0 -43
- package/dist/commands/animation/settle.d.ts +0 -38
- package/dist/commands/animation/start-view-transition.d.ts +0 -38
- package/dist/commands/animation/take.d.ts +0 -41
- package/dist/commands/animation/transition.d.ts +0 -49
- package/dist/commands/async/fetch.d.ts +0 -61
- package/dist/commands/async/wait.d.ts +0 -51
- package/dist/commands/behaviors/install.d.ts +0 -40
- package/dist/commands/content/append.d.ts +0 -26
- package/dist/commands/content/insertion-base.d.ts +0 -60
- package/dist/commands/content/prepend.d.ts +0 -26
- package/dist/commands/control-flow/break.d.ts +0 -29
- package/dist/commands/control-flow/continue.d.ts +0 -29
- package/dist/commands/control-flow/exit.d.ts +0 -29
- package/dist/commands/control-flow/halt.d.ts +0 -39
- package/dist/commands/control-flow/if.d.ts +0 -58
- package/dist/commands/control-flow/repeat.d.ts +0 -50
- package/dist/commands/control-flow/return.d.ts +0 -33
- package/dist/commands/control-flow/signal-base.d.ts +0 -18
- package/dist/commands/control-flow/throw.d.ts +0 -34
- package/dist/commands/control-flow/unless.d.ts +0 -3
- package/dist/commands/data/clear.d.ts +0 -37
- package/dist/commands/data/decrement.d.ts +0 -3
- package/dist/commands/data/default.d.ts +0 -60
- package/dist/commands/data/get.d.ts +0 -35
- package/dist/commands/data/increment.d.ts +0 -42
- package/dist/commands/data/set.d.ts +0 -76
- package/dist/commands/decorators/index.d.ts +0 -14
- package/dist/commands/dom/add.d.ts +0 -44
- package/dist/commands/dom/close.d.ts +0 -32
- package/dist/commands/dom/dom-modification-base.d.ts +0 -48
- package/dist/commands/dom/empty.d.ts +0 -32
- package/dist/commands/dom/hide.d.ts +0 -28
- package/dist/commands/dom/make.d.ts +0 -34
- package/dist/commands/dom/open.d.ts +0 -34
- package/dist/commands/dom/process-partials.d.ts +0 -51
- package/dist/commands/dom/put.d.ts +0 -42
- package/dist/commands/dom/remove.d.ts +0 -46
- package/dist/commands/dom/reset.d.ts +0 -32
- package/dist/commands/dom/select.d.ts +0 -32
- package/dist/commands/dom/show.d.ts +0 -29
- package/dist/commands/dom/swap.d.ts +0 -65
- package/dist/commands/dom/toggle.d.ts +0 -69
- package/dist/commands/dom/visibility-base.d.ts +0 -22
- package/dist/commands/events/send.d.ts +0 -3
- package/dist/commands/events/trigger.d.ts +0 -49
- package/dist/commands/execution/blur.d.ts +0 -32
- package/dist/commands/execution/call.d.ts +0 -35
- package/dist/commands/execution/focus.d.ts +0 -32
- package/dist/commands/execution/pseudo-command.d.ts +0 -41
- package/dist/commands/helpers/attribute-manipulation.d.ts +0 -11
- package/dist/commands/helpers/attribute-target.d.ts +0 -9
- package/dist/commands/helpers/batch-dom-operations.d.ts +0 -12
- package/dist/commands/helpers/body-ops.d.ts +0 -10
- package/dist/commands/helpers/class-manipulation.d.ts +0 -11
- package/dist/commands/helpers/condition-helpers.d.ts +0 -4
- package/dist/commands/helpers/dom-mutation.d.ts +0 -16
- package/dist/commands/helpers/duration-parsing.d.ts +0 -8
- package/dist/commands/helpers/element-property-access.d.ts +0 -7
- package/dist/commands/helpers/element-resolution.d.ts +0 -16
- package/dist/commands/helpers/error-helpers.d.ts +0 -17
- package/dist/commands/helpers/event-helpers.d.ts +0 -13
- package/dist/commands/helpers/event-waiting.d.ts +0 -37
- package/dist/commands/helpers/index.d.ts +0 -32
- package/dist/commands/helpers/input-validator.d.ts +0 -23
- package/dist/commands/helpers/loop-executor.d.ts +0 -56
- package/dist/commands/helpers/numeric-target-parser.d.ts +0 -21
- package/dist/commands/helpers/property-target.d.ts +0 -20
- package/dist/commands/helpers/selector-type-detection.d.ts +0 -24
- package/dist/commands/helpers/slots.d.ts +0 -5
- package/dist/commands/helpers/smart-element.d.ts +0 -16
- package/dist/commands/helpers/style-manipulation.d.ts +0 -16
- package/dist/commands/helpers/target-elements.d.ts +0 -5
- package/dist/commands/helpers/temporal-modifiers.d.ts +0 -15
- package/dist/commands/helpers/url-argument-parser.d.ts +0 -13
- package/dist/commands/helpers/url-validation.d.ts +0 -7
- package/dist/commands/helpers/variable-access.d.ts +0 -13
- package/dist/commands/helpers/visibility-target-parser.d.ts +0 -15
- package/dist/commands/helpers/write-target.d.ts +0 -42
- package/dist/commands/index.cjs +0 -24168
- package/dist/commands/index.d.ts +0 -171
- package/dist/commands/index.mjs +0 -23981
- package/dist/commands/manifest.d.ts +0 -17
- package/dist/commands/navigation/go.d.ts +0 -58
- package/dist/commands/navigation/push-url.d.ts +0 -48
- package/dist/commands/navigation/replace-url.d.ts +0 -3
- package/dist/commands/navigation/scroll-to.d.ts +0 -43
- package/dist/commands/templates/render.d.ts +0 -47
- package/dist/commands/utility/beep.d.ts +0 -41
- package/dist/commands/utility/breakpoint.d.ts +0 -32
- package/dist/commands/utility/copy.d.ts +0 -41
- package/dist/commands/utility/log.d.ts +0 -36
- package/dist/commands/utility/pick.d.ts +0 -47
- package/dist/commands/utility/tell.d.ts +0 -39
- package/dist/compatibility/browser-bundle-classic.d.ts +0 -17
- package/dist/compatibility/browser-bundle-hybrid-complete.d.ts +0 -22
- package/dist/compatibility/browser-bundle-hybrid-hx.d.ts +0 -43
- package/dist/compatibility/browser-bundle-lite.d.ts +0 -15
- package/dist/compatibility/browser-bundle-modular.d.ts +0 -18
- package/dist/compatibility/browser-bundle-multilingual.d.ts +0 -19
- package/dist/compatibility/browser-bundle-semantic-complete.d.ts +0 -24
- package/dist/compatibility/browser-bundle-textshelf-minimal.d.ts +0 -16
- package/dist/compatibility/browser-bundle-textshelf-profile.d.ts +0 -18
- package/dist/compatibility/browser-modular.d.ts +0 -42
- package/dist/compatibility/browser-tests/helpers/semantic-page.d.ts +0 -3
- package/dist/compatibility/browser-tests/test-utils.d.ts +0 -21
- package/dist/compatibility/bundle-shell.d.ts +0 -13
- package/dist/compatibility/bundle-sources.d.ts +0 -4
- package/dist/compatibility/eval-hyperscript.d.ts +0 -16
- package/dist/compatibility/hyperscript-adapter.d.ts +0 -38
- package/dist/core/ast-property-utils.d.ts +0 -2
- package/dist/core/context.d.ts +0 -19
- package/dist/core/dom.d.ts +0 -15
- package/dist/core/evaluator-types.d.ts +0 -5
- package/dist/core/events.d.ts +0 -48
- package/dist/core/executor.d.ts +0 -34
- package/dist/core/expression-evaluator.d.ts +0 -6
- package/dist/core/expression-registry.d.ts +0 -8
- package/dist/core/scope-hooks.d.ts +0 -24
- package/dist/debug/debug-controller.d.ts +0 -62
- package/dist/debug/index.d.ts +0 -5
- package/dist/dom/attribute-processor.d.ts +0 -75
- package/dist/dom/detect-language.d.ts +0 -3
- package/dist/dom/minimal-attribute-processor.d.ts +0 -20
- package/dist/expressions/base-expression.d.ts +0 -27
- package/dist/expressions/bundles/common-expressions.d.ts +0 -10
- package/dist/expressions/bundles/core-expressions.d.ts +0 -8
- package/dist/expressions/bundles/full-expressions.d.ts +0 -11
- package/dist/expressions/bundles/index.d.ts +0 -7
- package/dist/expressions/collection/index.d.ts +0 -10
- package/dist/expressions/conversion/index.d.ts +0 -31
- package/dist/expressions/expression-tiers.d.ts +0 -13
- package/dist/expressions/index.cjs +0 -4331
- package/dist/expressions/index.d.ts +0 -13
- package/dist/expressions/index.mjs +0 -4312
- package/dist/expressions/logical/index.d.ts +0 -61
- package/dist/expressions/mathematical/index.d.ts +0 -80
- package/dist/expressions/positional/index.d.ts +0 -31
- package/dist/expressions/properties/index.d.ts +0 -27
- package/dist/expressions/property-access-utils.d.ts +0 -23
- package/dist/expressions/references/index.d.ts +0 -39
- package/dist/expressions/shared/comparison-utils.d.ts +0 -10
- package/dist/expressions/shared/index.d.ts +0 -10
- package/dist/expressions/shared/number-utils.d.ts +0 -8
- package/dist/expressions/shared/tracking.d.ts +0 -20
- package/dist/expressions/shared/validation-utils.d.ts +0 -13
- package/dist/expressions/special/index.d.ts +0 -78
- package/dist/expressions/type-helpers.d.ts +0 -11
- package/dist/expressions/type-registry.d.ts +0 -57
- package/dist/expressions/validation-helpers.d.ts +0 -15
- package/dist/htmx/hcon.d.ts +0 -9
- package/dist/htmx/htmx-attribute-processor.d.ts +0 -120
- package/dist/htmx/htmx-translator.d.ts +0 -22
- package/dist/htmx/i18n-hooks.d.ts +0 -18
- package/dist/htmx/i18n-orchestrator.d.ts +0 -16
- package/dist/htmx/index.d.ts +0 -3
- package/dist/htmx/lang-resolver.d.ts +0 -3
- package/dist/htmx/sse.d.ts +0 -60
- package/dist/htmx/ws.d.ts +0 -59
- package/dist/hyperfixi-browser-classic-i18n.js +0 -2
- package/dist/hyperfixi-browser.js +0 -2
- package/dist/hyperfixi-classic-i18n.js +0 -2
- package/dist/hyperfixi-hx-v4.js +0 -1
- package/dist/hyperfixi-hx.js +0 -1
- package/dist/hyperfixi-hybrid-complete.js +0 -1
- package/dist/hyperfixi-hybrid-hx.js +0 -1
- package/dist/hyperfixi-multilingual.js +0 -2
- package/dist/hyperfixi.mjs +0 -2
- package/dist/i18n/error-catalog.d.ts +0 -12
- package/dist/index.cjs +0 -29159
- package/dist/index.min.js +0 -2
- package/dist/lib/dom-globals-shim.d.ts +0 -2
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/morph-adapter.d.ts +0 -9
- package/dist/lib/swap-executor.d.ts +0 -12
- package/dist/lib/view-transitions.d.ts +0 -7
- package/dist/lokascript-browser-classic-i18n.js +0 -2
- package/dist/lokascript-browser.js +0 -2
- package/dist/lokascript-hybrid-complete.js +0 -1
- package/dist/lokascript-hybrid-hx.js +0 -1
- package/dist/lokascript-multilingual.js +0 -2
- package/dist/lse/index.cjs +0 -84
- package/dist/lse/index.d.ts +0 -15
- package/dist/lse/index.mjs +0 -71
- package/dist/multilingual/bridge.d.ts +0 -38
- package/dist/multilingual/schema-roles.d.ts +0 -3
- package/dist/parser/__types__/test-helpers.d.ts +0 -25
- package/dist/parser/command-grammar.d.ts +0 -14
- package/dist/parser/command-node-builder.d.ts +0 -46
- package/dist/parser/command-parsers/animation-commands.d.ts +0 -6
- package/dist/parser/command-parsers/async-commands.d.ts +0 -5
- package/dist/parser/command-parsers/control-flow-commands.d.ts +0 -7
- package/dist/parser/command-parsers/declared-commands.d.ts +0 -6
- package/dist/parser/command-parsers/dom-commands.d.ts +0 -11
- package/dist/parser/command-parsers/event-commands.d.ts +0 -4
- package/dist/parser/command-parsers/navigation-commands.d.ts +0 -6
- package/dist/parser/command-parsers/utility-commands.d.ts +0 -14
- package/dist/parser/command-parsers/variable-commands.d.ts +0 -12
- package/dist/parser/error-handler.d.ts +0 -34
- package/dist/parser/extensions.d.ts +0 -43
- package/dist/parser/full-parser.cjs +0 -7943
- package/dist/parser/full-parser.d.ts +0 -4
- package/dist/parser/full-parser.mjs +0 -7940
- package/dist/parser/helpers/ast-helpers.d.ts +0 -24
- package/dist/parser/helpers/parsing-helpers.d.ts +0 -19
- package/dist/parser/helpers/token-helpers.d.ts +0 -28
- package/dist/parser/hybrid/aliases.cjs +0 -44
- package/dist/parser/hybrid/aliases.d.ts +0 -7
- package/dist/parser/hybrid/aliases.mjs +0 -37
- package/dist/parser/hybrid/ast-types.cjs +0 -3
- package/dist/parser/hybrid/ast-types.d.ts +0 -97
- package/dist/parser/hybrid/ast-types.mjs +0 -2
- package/dist/parser/hybrid/index.cjs +0 -1185
- package/dist/parser/hybrid/index.d.ts +0 -6
- package/dist/parser/hybrid/index.mjs +0 -1175
- package/dist/parser/hybrid/parser-core.cjs +0 -1171
- package/dist/parser/hybrid/parser-core.d.ts +0 -69
- package/dist/parser/hybrid/parser-core.mjs +0 -1169
- package/dist/parser/hybrid/tokenizer.cjs +0 -255
- package/dist/parser/hybrid/tokenizer.d.ts +0 -9
- package/dist/parser/hybrid/tokenizer.mjs +0 -252
- package/dist/parser/hybrid-parser.cjs +0 -1249
- package/dist/parser/hybrid-parser.d.ts +0 -10
- package/dist/parser/hybrid-parser.mjs +0 -1242
- package/dist/parser/parser-constants.d.ts +0 -100
- package/dist/parser/parser-interface.d.ts +0 -12
- package/dist/parser/parser-types.d.ts +0 -164
- package/dist/parser/parser.d.ts +0 -165
- package/dist/parser/pratt-parser.d.ts +0 -41
- package/dist/parser/regex-parser.cjs +0 -422
- package/dist/parser/regex-parser.d.ts +0 -4
- package/dist/parser/regex-parser.mjs +0 -419
- package/dist/parser/runtime.d.ts +0 -14
- package/dist/parser/semantic-integration.d.ts +0 -17
- package/dist/parser/token-consumer.d.ts +0 -34
- package/dist/parser/token-predicates.d.ts +0 -77
- package/dist/parser/tokenizer.d.ts +0 -28
- package/dist/parser/types.d.ts +0 -105
- package/dist/performance/expression-cache.d.ts +0 -78
- package/dist/performance/integration.d.ts +0 -40
- package/dist/performance/production-monitor.d.ts +0 -67
- package/dist/registry/browser-types.cjs +0 -81
- package/dist/registry/browser-types.d.ts +0 -20
- package/dist/registry/browser-types.mjs +0 -76
- package/dist/registry/environment.cjs +0 -36
- package/dist/registry/environment.d.ts +0 -19
- package/dist/registry/environment.mjs +0 -30
- package/dist/registry/event-source-registry.d.ts +0 -54
- package/dist/registry/examples/server-commands.d.ts +0 -6
- package/dist/registry/examples/server-event-source.d.ts +0 -32
- package/dist/registry/index.cjs +0 -14055
- package/dist/registry/index.d.ts +0 -39
- package/dist/registry/index.mjs +0 -14039
- package/dist/registry/runtime-integration.d.ts +0 -23
- package/dist/registry/universal-types.cjs +0 -91
- package/dist/registry/universal-types.d.ts +0 -35
- package/dist/registry/universal-types.mjs +0 -86
- package/dist/runtime/cleanup-registry.d.ts +0 -47
- package/dist/runtime/command-adapter.d.ts +0 -69
- package/dist/runtime/environment.d.ts +0 -75
- package/dist/runtime/plugin.d.ts +0 -14
- package/dist/runtime/runtime-base.d.ts +0 -100
- package/dist/runtime/runtime-factory.d.ts +0 -29
- package/dist/runtime/runtime.d.ts +0 -20
- package/dist/runtime/temporal-modifiers.d.ts +0 -37
- package/dist/test-setup.d.ts +0 -28
- package/dist/test-utilities.d.ts +0 -39
- package/dist/types/base-types.d.ts +0 -231
- package/dist/types/code-fix.d.ts +0 -39
- package/dist/types/command-metadata.d.ts +0 -57
- package/dist/types/command-types.d.ts +0 -262
- package/dist/types/context-types.d.ts +0 -106
- package/dist/types/core-context.d.ts +0 -22
- package/dist/types/core.d.ts +0 -143
- package/dist/types/error-codes.d.ts +0 -207
- package/dist/types/expression-types.d.ts +0 -155
- package/dist/types/hooks.d.ts +0 -45
- package/dist/types/index.d.ts +0 -32
- package/dist/types/program.d.ts +0 -8
- package/dist/types/result.d.ts +0 -73
- package/dist/types/template-types.d.ts +0 -162
- package/dist/types/type-guards.d.ts +0 -24
- package/dist/types/unified-types.d.ts +0 -91
- package/dist/utils/beep.d.ts +0 -8
- package/dist/utils/debug-events.d.ts +0 -41
- package/dist/utils/debug.d.ts +0 -35
- package/dist/utils/dom-utils.d.ts +0 -16
- package/dist/utils/element-check.d.ts +0 -8
- package/dist/utils/keyboard-shortcuts.d.ts +0 -18
- package/dist/utils/performance.d.ts +0 -40
- package/dist/validation/command-pattern-validator.d.ts +0 -53
- package/dist/validation/common-validators.d.ts +0 -24
- package/dist/validation/lightweight-validators.d.ts +0 -113
- package/dist/validation/partial-validation-types.d.ts +0 -50
- package/dist/validation/partial-validator.d.ts +0 -6
- package/dist/validation/partial-warning-formatter.d.ts +0 -6
- package/dist/validation/validate-cli.d.ts +0 -41
- package/vocab/htmx/ar.js +0 -62
- package/vocab/htmx/bn.js +0 -65
- package/vocab/htmx/de.js +0 -83
- package/vocab/htmx/en.js +0 -24
- package/vocab/htmx/es.js +0 -79
- package/vocab/htmx/fr.js +0 -79
- package/vocab/htmx/he.js +0 -61
- package/vocab/htmx/hi.js +0 -81
- package/vocab/htmx/id.js +0 -76
- package/vocab/htmx/it.js +0 -79
- package/vocab/htmx/ja.js +0 -85
- package/vocab/htmx/ko.js +0 -81
- package/vocab/htmx/ms.js +0 -58
- package/vocab/htmx/pl.js +0 -80
- package/vocab/htmx/pt.js +0 -81
- package/vocab/htmx/qu.js +0 -83
- package/vocab/htmx/ru.js +0 -82
- package/vocab/htmx/sw.js +0 -79
- package/vocab/htmx/th.js +0 -67
- package/vocab/htmx/tl.js +0 -56
- package/vocab/htmx/tr.js +0 -86
- package/vocab/htmx/uk.js +0 -82
- package/vocab/htmx/vi.js +0 -59
- package/vocab/htmx/zh.js +0 -79
package/README.md
CHANGED
|
@@ -1,211 +1,89 @@
|
|
|
1
1
|
# @hyperfixi/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hyperscript for the browser, in any of 24 human languages, with the tooling around it.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Since 4.0 the engine is [`@hyperfixi/engine`](../engine/README.md): typed, built from modules,
|
|
6
|
+
and written against upstream [\_hyperscript](https://hyperscript.org)'s source, with upstream's own
|
|
7
|
+
test suite as its acceptance oracle. `@hyperfixi/core` re-exports it and adds the tooling on
|
|
8
|
+
subpaths. (Core's own parser and runtime were retired in 4.0; see
|
|
9
|
+
[MIGRATION.md](../../MIGRATION.md) for the move from 3.x.)
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
- 🚀 **High Performance** - Optimized tokenizer and parser for large expressions
|
|
9
|
-
- 🔧 **TypeScript First** - Complete type safety with comprehensive type definitions
|
|
10
|
-
- 🧪 **Thoroughly Tested** - Vitest unit suites plus Playwright browser tests
|
|
11
|
-
- 🌊 **Complete Command System** - All major commands implemented (PUT, SET, ADD, SHOW/HIDE, etc.)
|
|
12
|
-
- ⚡ **HTML Integration** - Automatic `_=""` attribute processing and event binding
|
|
13
|
-
- 🛡️ **Error Recovery** - Graceful handling of syntax errors with helpful guidance
|
|
11
|
+
## Install
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install @hyperfixi/core
|
|
19
|
-
# or
|
|
20
|
-
yarn add @hyperfixi/core
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Quick Start
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
import { hyperscript } from '@hyperfixi/core';
|
|
27
|
-
|
|
28
|
-
// Simple expression evaluation
|
|
29
|
-
const result = await hyperscript.eval('5 + 3 * 2'); // Returns 11
|
|
30
|
-
|
|
31
|
-
// DOM manipulation with commands
|
|
32
|
-
const button = document.getElementById('myButton');
|
|
33
|
-
const context = hyperscript.createContext(button);
|
|
34
|
-
|
|
35
|
-
await hyperscript.eval('hide me', context); // Hides the button
|
|
36
|
-
await hyperscript.eval('put "Hello World" into my innerHTML', context);
|
|
37
|
-
await hyperscript.eval('set my className to "active"', context);
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### HTML Integration (Automatic)
|
|
13
|
+
The script-tag bundle (34 KB gzipped). It installs as `window._hyperscript` and
|
|
14
|
+
`window.hyperfixi`, and reads the document when it is ready:
|
|
41
15
|
|
|
42
16
|
```html
|
|
43
|
-
|
|
44
|
-
<button _="on click
|
|
45
|
-
<div id="output"></div>
|
|
46
|
-
|
|
47
|
-
<!-- Complex interactions -->
|
|
48
|
-
<button _="on click set my innerHTML to 'Clicked!' then wait 1s then hide me">
|
|
49
|
-
Temporary Button
|
|
50
|
-
</button>
|
|
17
|
+
<script src="https://unpkg.com/@hyperfixi/core/dist/hyperfixi.js"></script>
|
|
18
|
+
<button _="on click toggle .active on me">Toggle</button>
|
|
51
19
|
```
|
|
52
20
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
HyperFixi includes a built-in debug control API for troubleshooting compilation and execution issues.
|
|
56
|
-
|
|
57
|
-
### Enable Debug Logging
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
// In browser console
|
|
61
|
-
hyperfixi.debugControl.enable(); // Enable detailed logging
|
|
62
|
-
// Reload page to see logs
|
|
63
|
-
|
|
64
|
-
hyperfixi.debugControl.disable(); // Disable logging
|
|
65
|
-
hyperfixi.debugControl.isEnabled(); // Check if enabled
|
|
66
|
-
hyperfixi.debugControl.status(); // Get detailed status
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Debug settings persist across page reloads via localStorage. Logs include:
|
|
70
|
-
|
|
71
|
-
- Parser selection (semantic vs traditional)
|
|
72
|
-
- Expression evaluation steps
|
|
73
|
-
- Command execution flow
|
|
74
|
-
- Event handling
|
|
75
|
-
|
|
76
|
-
### Compilation Metadata
|
|
21
|
+
`dist/hyperfixi.js` is the engine's `hyperfixi-hs.js`, the same file under core's name. For
|
|
22
|
+
hypermedia attributes, add [fixi](https://github.com/bigskysoftware/fixi) or htmx 4 beside it.
|
|
77
23
|
|
|
78
|
-
|
|
24
|
+
With a bundler, [`@hyperfixi/vite-plugin`](../vite-plugin/README.md) scans your templates and
|
|
25
|
+
builds an engine from only the modules they use.
|
|
79
26
|
|
|
80
|
-
|
|
81
|
-
const result = hyperscript.compileSync('toggle .active');
|
|
82
|
-
console.log(result.meta);
|
|
83
|
-
// { parser: 'traditional', language: 'en', timeMs: 0.4 }
|
|
27
|
+
## Use as a library
|
|
84
28
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// { parser: 'semantic', confidence: 1, language: 'es', directPath: true, timeMs: 1.2 }
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
`meta.parser` is `'semantic'` only when the multilingual front-end PRODUCED the
|
|
91
|
-
AST (a non-English program on the direct path). English is always parsed by the
|
|
92
|
-
core parser; `'traditional'` is what an English compile — or a non-English one
|
|
93
|
-
that fell back to its English rendering — reports.
|
|
94
|
-
|
|
95
|
-
## Runtime Hooks
|
|
96
|
-
|
|
97
|
-
HyperFixi provides a hooks system for observing and intercepting command execution:
|
|
98
|
-
|
|
99
|
-
```javascript
|
|
100
|
-
import { hyperscript } from '@hyperfixi/core';
|
|
101
|
-
|
|
102
|
-
// Create hooks for logging, analytics, or debugging
|
|
103
|
-
const hooks = {
|
|
104
|
-
beforeExecute: ctx => {
|
|
105
|
-
console.log(`Executing: ${ctx.commandName}`);
|
|
106
|
-
},
|
|
107
|
-
afterExecute: (ctx, result) => {
|
|
108
|
-
console.log(`Completed: ${ctx.commandName}`, result);
|
|
109
|
-
},
|
|
110
|
-
onError: (ctx, error) => {
|
|
111
|
-
console.error(`Error in ${ctx.commandName}:`, error);
|
|
112
|
-
return error; // Can transform or wrap the error
|
|
113
|
-
},
|
|
114
|
-
interceptCommand: (name, ctx) => {
|
|
115
|
-
// Return true to skip command execution
|
|
116
|
-
return name === 'disabled-command';
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
// Register hooks with the runtime
|
|
121
|
-
hyperscript.registerHooks('my-hooks', hooks);
|
|
29
|
+
```sh
|
|
30
|
+
npm install @hyperfixi/core
|
|
122
31
|
```
|
|
123
32
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
The runtime automatically tracks event listeners and observers for cleanup when elements are removed from the DOM. You can also manually trigger cleanup:
|
|
127
|
-
|
|
128
|
-
```javascript
|
|
129
|
-
// Clean up an element and all its descendants
|
|
130
|
-
hyperscript.cleanup(containerElement);
|
|
33
|
+
The root is `@hyperfixi/engine`, re-exported (ESM only):
|
|
131
34
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
// { elementsTracked: 5, listeners: 12, observers: 2, ... }
|
|
35
|
+
```ts
|
|
36
|
+
import { register, boot, everything } from '@hyperfixi/core';
|
|
135
37
|
|
|
136
|
-
//
|
|
137
|
-
|
|
38
|
+
register(...everything); // or only the modules a page needs: register(on, toggle)
|
|
39
|
+
boot(); // install as window._hyperscript and initialise the document
|
|
138
40
|
```
|
|
139
41
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
### Main Methods
|
|
145
|
-
|
|
146
|
-
- `hyperscript.compile(code)` - Compile hyperscript to AST
|
|
147
|
-
- `hyperscript.execute(ast, context)` - Execute compiled AST
|
|
148
|
-
- `hyperscript.eval(code, context)` - Compile and execute in one step
|
|
149
|
-
- `hyperscript.createContext(element)` - Create execution context
|
|
150
|
-
- `evalHyperScript(code, context)` - \_hyperscript compatibility API (a global in the `hyperfixi.js` browser bundle)
|
|
151
|
-
- `hyperscript.registerHooks(name, hooks)` - Register runtime hooks
|
|
152
|
-
- `hyperscript.cleanup(element)` - Clean up an element and its descendants
|
|
153
|
-
- `hyperscript.getDefaultRuntime().destroy()` - Full runtime shutdown
|
|
154
|
-
|
|
155
|
-
## Supported Features
|
|
42
|
+
`api` is the object shaped like upstream's `_hyperscript` (`evaluate`, `parse`, `process`,
|
|
43
|
+
`config`, `use(plugin)`), and `parse` / `evaluate` / `processNode` are also exported directly. See
|
|
44
|
+
the [engine's README](../engine/README.md) for modules and the public API.
|
|
156
45
|
|
|
157
|
-
|
|
46
|
+
## Subpaths
|
|
158
47
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
|
|
48
|
+
| Import | What it is |
|
|
49
|
+
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| `@hyperfixi/core/browser` | `dist/hyperfixi.js`, the script-tag bundle |
|
|
51
|
+
| `@hyperfixi/core/multilingual` | `parse(code, lang)`, `render(node, lang)`, `translate(code, from, to)` over [`@lokascript/semantic`](../semantic/README.md), loaded on first use |
|
|
52
|
+
| `@hyperfixi/core/ast-utils` | Analysis (complexity, smells, metrics), the interchange AST, `withEnginePositions`, and LSP diagnostics / symbols / hover / completions; the language server and MCP server use it |
|
|
53
|
+
| `@hyperfixi/core/lsp-metadata` | Keyword lists and hover docs for editors |
|
|
54
|
+
| `@hyperfixi/core/reference` | The commands, with syntax and examples |
|
|
55
|
+
| `@hyperfixi/core/metadata` | Package and bundle facts (version, size, command count) |
|
|
166
56
|
|
|
167
|
-
|
|
57
|
+
The reference and LSP data document the engine and are checked against its grammar
|
|
58
|
+
(`npm run verify:reference`): every keyword is an engine keyword, and every example parses on
|
|
59
|
+
the engine.
|
|
168
60
|
|
|
169
|
-
|
|
170
|
-
- **Logical**: `true and false`, `value > 10`, `x contains y`
|
|
171
|
-
- **Property Access**: `my property`, `element.property`, `object's method()`
|
|
172
|
-
- **Context Variables**: `me`, `it`, `you`, `result`
|
|
173
|
-
- **Type Conversion**: `"123" as Int`, `form as Values`
|
|
174
|
-
- **CSS Selectors**: `<button/>`, `closest <form/>`
|
|
61
|
+
## Hyperscript in other languages
|
|
175
62
|
|
|
176
|
-
|
|
63
|
+
Hyperscript written in any of 24 languages runs on the engine through
|
|
64
|
+
[`@lokascript/hyperscript-adapter`](../hyperscript-adapter/README.md), which translates each script
|
|
65
|
+
as the engine reads it:
|
|
177
66
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
See [EXAMPLES.md](./docs/EXAMPLES.md) for comprehensive usage examples.
|
|
67
|
+
```html
|
|
68
|
+
<script src="hyperfixi.js"></script>
|
|
69
|
+
<script src="browser.global.js"></script>
|
|
70
|
+
<!-- @lokascript/semantic -->
|
|
71
|
+
<script src="hyperscript-i18n-lite.global.js"></script>
|
|
72
|
+
<!-- @lokascript/hyperscript-adapter -->
|
|
185
73
|
|
|
186
|
-
|
|
74
|
+
<button lang="ko" _="클릭 할 때 .active 를 토글">토글</button>
|
|
75
|
+
```
|
|
187
76
|
|
|
188
|
-
|
|
77
|
+
## Development
|
|
189
78
|
|
|
190
79
|
```bash
|
|
191
|
-
#
|
|
192
|
-
npm run
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
npx playwright test
|
|
196
|
-
|
|
197
|
-
# Run only expression compatibility tests
|
|
198
|
-
npx playwright test --grep "Expression Tests"
|
|
80
|
+
npm run build --prefix packages/core # library entry + subpaths (build the engine first)
|
|
81
|
+
npm run build:browser --prefix packages/core # dist/hyperfixi.js, copied from the engine
|
|
82
|
+
npm test --prefix packages/core # unit tests (ast-utils, multilingual, dist charset)
|
|
83
|
+
npm run verify:reference --prefix packages/core
|
|
84
|
+
cd packages/core && npx playwright test browser-tests/ # the browser suite, on the engine's bundle
|
|
199
85
|
```
|
|
200
86
|
|
|
201
|
-
Compatibility is validated via Playwright browser tests:
|
|
202
|
-
|
|
203
|
-
- **Gallery examples** — real hyperscript patterns load and execute without errors
|
|
204
|
-
- **Bundle compatibility matrix** — each bundle size correctly supports its documented features
|
|
205
|
-
- **Command/expression tests** — individual commands and expressions verified in browser context
|
|
206
|
-
|
|
207
|
-
Run `cd packages/core && npx playwright test` for the full browser test suite.
|
|
208
|
-
|
|
209
87
|
## License
|
|
210
88
|
|
|
211
|
-
MIT
|
|
89
|
+
MIT
|