@astralsight/astroforge-core 0.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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/apis.d.mts +992 -0
- package/dist/apis.mjs +103 -0
- package/dist/components.d.mts +249 -0
- package/dist/components.mjs +49 -0
- package/dist/hooks.d.mts +12 -0
- package/dist/hooks.mjs +18 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +5 -0
- package/dist/jsx-runtime.d.mts +19 -0
- package/dist/jsx-runtime.mjs +11 -0
- package/dist/platform.d.mts +33 -0
- package/dist/platform.mjs +138 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AstroForge contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @astralsight/astroforge-core
|
|
2
|
+
|
|
3
|
+
AstroForge 用户侧 surface:JSX runtime、内置组件声明、hook 编译期标记、目标平台能力表。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @astralsight/astroforge-core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
通常不需要直接安装:`@astralsight/astroforge-rsbuild-plugin` 会把它作为依赖一并拉进来。`tsconfig.json` 把 `jsxImportSource` 指向 `@astralsight/astroforge-core` 之后,TSX 源码即可使用 `<View>` / `<Text>` 等内置组件与 `useState` / `useEffect` 等 hook。
|
|
12
|
+
|
|
13
|
+
## 设计要点
|
|
14
|
+
|
|
15
|
+
- **不依赖浏览器/React 调度器**:Vela / BlueOS 等 quick-app runtime 不提供 DOM。`useState` / `useEffect` 等 hook 在源码中只是编译期标记,由 `@astralsight/astroforge-rsbuild-plugin` 在 TSX → IR 阶段静态展开为厂商 runtime 期望的 `data` / `methods` / lifecycle。运行时执行任一 hook 将抛错。
|
|
16
|
+
- **多入口结构**:`@astralsight/astroforge-core/components`、`@astralsight/astroforge-core/apis`、`@astralsight/astroforge-core/platform`、`@astralsight/astroforge-core/jsx-runtime` 各自暴露独立子模块,方便按需 import 与 IDE 跳转。
|
|
17
|
+
|
|
18
|
+
详见仓库根目录 `docs/ir-contract.md` 与 `docs/vela-runtime-abi.md`。
|
|
19
|
+
|
|
20
|
+
## License
|
|
21
|
+
|
|
22
|
+
MIT
|