Package Exports
- @fynixorg/types-fynix
- @fynixorg/types-fynix/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@fynixorg/types-fynix) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
TypeScript Fynix Plugin
A TypeScript language service plugin that enables full TypeScript support for Fynix (.fnx) single file components.
Features
- Module resolution for
.fnxfiles - TypeScript IntelliSense and autocomplete
- Type checking and error detection
- Go to definition and references
- Hover information
- Automatic transformation of
.fnxto.tsx
Installation
npm install typescript-fynix-pluginUsage
Add the plugin to your tsconfig.json:
{
"compilerOptions": {
"jsx": "react",
"moduleResolution": "node",
"plugins": [
{
"name": "typescript-fynix-plugin"
}
]
}
}Then restart your TypeScript server or reload your IDE.
What it does
This plugin allows you to import .fnx files in TypeScript:
import MyComponent from "./components/MyComponent.fnx";The plugin automatically:
- Resolves
.fnxfile imports - Transforms Fynix single file components to TypeScript/TSX
- Provides full TypeScript language features
Fynix File Format
Fynix files use a .fnx extension with this structure:
<logic setup="ts">
import { useState } from "react"; const [count, setCount] = useState(0);
</logic>
<view>
<div>
<h1>Count: {count}</h1>
<button onClick="{()" ="">setCount(count + 1)}>Increment</button>
</div>
</view>
<style scoped>
h1 {
color: blue;
}
</style>Requirements
- TypeScript >= 4.0.0
- Node.js >= 14.0.0
License
MIT
Author
Resty Gonzales restygonzales749@gmail.com