expo-bbase 1.3.5 → 1.4.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 +18 -1
- package/dist/index.js +30 -41
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/templates/assets/adaptive-icon.png +0 -0
- package/templates/assets/favicon.png +0 -0
- package/templates/assets/fonts/Nunito-Bold.ttf +0 -0
- package/templates/assets/icon.png +0 -0
- package/templates/assets/splash-icon.png +0 -0
package/README.md
CHANGED
|
@@ -129,8 +129,10 @@ npx expo-bbase add . -m bottom-sheet,flashlist
|
|
|
129
129
|
- **Expo SDK 54** + New Architecture
|
|
130
130
|
- **Expo Router v5** — 文件路由
|
|
131
131
|
- **NativeWind v4** — Tailwind CSS for React Native
|
|
132
|
-
- **TypeScript** — 类型安全
|
|
132
|
+
- **TypeScript** — 类型安全 + `@/*` 路径别名
|
|
133
133
|
- **react-native-svg** — SVG 支持
|
|
134
|
+
- **Reanimated 4 + Gesture Handler + Worklets** — 动画/手势(默认包含,不再需要单独选)
|
|
135
|
+
- **assets/** — 默认图标 + Nunito-Bold 字体
|
|
134
136
|
|
|
135
137
|
所有依赖版本与 Expo SDK 54 的 `bundledNativeModules.json` 对齐。
|
|
136
138
|
|
|
@@ -182,6 +184,12 @@ my-app/
|
|
|
182
184
|
├── types/ # 类型定义
|
|
183
185
|
├── global.css # NativeWind CSS 变量 (light/dark)
|
|
184
186
|
├── assets/ # 静态资源
|
|
187
|
+
│ ├── icon.png # App 图标
|
|
188
|
+
│ ├── adaptive-icon.png # Android 自适应图标
|
|
189
|
+
│ ├── splash-icon.png # 启动画面
|
|
190
|
+
│ ├── favicon.png # Web favicon
|
|
191
|
+
│ └── fonts/
|
|
192
|
+
│ └── Nunito-Bold.ttf # 默认字体
|
|
185
193
|
├── app.json # Expo 配置
|
|
186
194
|
├── babel.config.js # Babel 配置 (NativeWind + Reanimated)
|
|
187
195
|
├── metro.config.js # Metro 配置 (withNativeWind)
|
|
@@ -231,6 +239,15 @@ MIT
|
|
|
231
239
|
|
|
232
240
|
## 更新日志
|
|
233
241
|
|
|
242
|
+
### v1.4.0
|
|
243
|
+
- 🔧 **动画依赖默认包含**:`react-native-reanimated`、`react-native-worklets`、`react-native-gesture-handler` 加入基础依赖,不再需要用户单独选择,彻底解决 `Cannot find module 'react-native-worklets/plugin'` 报错
|
|
244
|
+
- 🖼️ **assets 目录内置**:自动生成 `assets/` 目录(icon.png、adaptive-icon.png、splash-icon.png、favicon.png、fonts/Nunito-Bold.ttf),app.json 恢复图标引用
|
|
245
|
+
- ⚙️ **tsconfig.json 升级**:继承 `expo/tsconfig.base`,`@/*` 路径别名开箱即用
|
|
246
|
+
- 🔧 **babel.config.js 简化**:移除 `reanimated: false, worklets: false` 禁用标志(因包已默认安装)
|
|
247
|
+
|
|
248
|
+
### v1.3.5
|
|
249
|
+
- 🔧 **修复 Facebook 登录模块**:移除已废弃的 `expo-facebook`(SDK 54 不再包含),改用 `expo-auth-session` + `expo-web-browser` 实现 Facebook OAuth 登录
|
|
250
|
+
|
|
234
251
|
### v1.3.4
|
|
235
252
|
- 🔧 **目录结构修复**:去除 `src/` 层,模块文件(`modules/`、`api/`、`stores/` 等)与 `app/` 平级
|
|
236
253
|
- 📝 修正 Facebook 登录模块描述(SDK 54 不再支持 `expo-facebook`,改用 `expo-auth-session`)
|
package/dist/index.js
CHANGED
|
@@ -1719,29 +1719,12 @@ var i18n_default = i18nModule;
|
|
|
1719
1719
|
var animationModule = {
|
|
1720
1720
|
id: "animation",
|
|
1721
1721
|
name: "\u52A8\u753B/\u624B\u52BF",
|
|
1722
|
-
description: "Reanimated 4 + Gesture Handler + Worklets",
|
|
1722
|
+
description: "Reanimated 4 + Gesture Handler + Worklets\uFF08\u5DF2\u9ED8\u8BA4\u5305\u542B\uFF0C\u6B64\u6A21\u5757\u4EC5\u6DFB\u52A0\u5C01\u88C5\u4EE3\u7801\uFF09",
|
|
1723
1723
|
defaultChecked: false,
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
"react-native-gesture-handler": "~2.28.0",
|
|
1727
|
-
"react-native-worklets": "~0.5.1"
|
|
1728
|
-
},
|
|
1724
|
+
// Dependencies are already included in base package.json
|
|
1725
|
+
dependencies: {},
|
|
1729
1726
|
devDependencies: {},
|
|
1730
1727
|
files: [
|
|
1731
|
-
{
|
|
1732
|
-
path: "babel.config.js",
|
|
1733
|
-
content: `module.exports = function (api) {
|
|
1734
|
-
api.cache(true);
|
|
1735
|
-
return {
|
|
1736
|
-
presets: [
|
|
1737
|
-
["babel-preset-expo", { jsxImportSource: "nativewind" }],
|
|
1738
|
-
"nativewind/babel",
|
|
1739
|
-
],
|
|
1740
|
-
plugins: [],
|
|
1741
|
-
};
|
|
1742
|
-
};
|
|
1743
|
-
`
|
|
1744
|
-
},
|
|
1745
1728
|
{
|
|
1746
1729
|
path: "modules/animation/index.ts",
|
|
1747
1730
|
content: lines(
|
|
@@ -1798,9 +1781,6 @@ var animationModule = {
|
|
|
1798
1781
|
)
|
|
1799
1782
|
}
|
|
1800
1783
|
],
|
|
1801
|
-
// When animation module is selected, babel.config.js is overwritten above
|
|
1802
|
-
// to re-enable babel-preset-expo's auto-detection of reanimated/worklets plugins
|
|
1803
|
-
// (since those packages will be installed as dependencies)
|
|
1804
1784
|
babelPlugins: []
|
|
1805
1785
|
};
|
|
1806
1786
|
var animation_default = animationModule;
|
|
@@ -3179,7 +3159,7 @@ SplashScreen.preventAutoHideAsync();
|
|
|
3179
3159
|
export default function RootLayout() {
|
|
3180
3160
|
const colorScheme = useColorScheme();
|
|
3181
3161
|
const [loaded] = useFonts({
|
|
3182
|
-
|
|
3162
|
+
NunitoBold: require("../assets/fonts/Nunito-Bold.ttf"),
|
|
3183
3163
|
});
|
|
3184
3164
|
|
|
3185
3165
|
useEffect(() => {
|
|
@@ -3527,7 +3507,9 @@ export {};
|
|
|
3527
3507
|
"version": "1.0.0",
|
|
3528
3508
|
"orientation": "portrait",
|
|
3529
3509
|
"userInterfaceStyle": "light",
|
|
3510
|
+
"icon": "./assets/icon.png",
|
|
3530
3511
|
"splash": {
|
|
3512
|
+
"image": "./assets/splash-icon.png",
|
|
3531
3513
|
"resizeMode": "contain",
|
|
3532
3514
|
"backgroundColor": "#ffffff"
|
|
3533
3515
|
},
|
|
@@ -3536,8 +3518,15 @@ export {};
|
|
|
3536
3518
|
"bundleIdentifier": "com.${projectName}.app"
|
|
3537
3519
|
},
|
|
3538
3520
|
"android": {
|
|
3521
|
+
"adaptiveIcon": {
|
|
3522
|
+
"foregroundImage": "./assets/adaptive-icon.png",
|
|
3523
|
+
"backgroundColor": "#ffffff"
|
|
3524
|
+
},
|
|
3539
3525
|
"package": "com.${projectName}.app"
|
|
3540
3526
|
},
|
|
3527
|
+
"web": {
|
|
3528
|
+
"favicon": "./assets/favicon.png"
|
|
3529
|
+
},
|
|
3541
3530
|
"plugins": [
|
|
3542
3531
|
"expo-router",
|
|
3543
3532
|
"expo-splash-screen"
|
|
@@ -3550,25 +3539,14 @@ export {};
|
|
|
3550
3539
|
{
|
|
3551
3540
|
path: "tsconfig.json",
|
|
3552
3541
|
content: `{
|
|
3542
|
+
"extends": "expo/tsconfig.base",
|
|
3553
3543
|
"compilerOptions": {
|
|
3554
|
-
"target": "ESNext",
|
|
3555
|
-
"module": "ESNext",
|
|
3556
|
-
"moduleResolution": "bundler",
|
|
3557
|
-
"lib": ["ESNext"],
|
|
3558
3544
|
"strict": true,
|
|
3559
|
-
"jsx": "react-jsx",
|
|
3560
|
-
"esModuleInterop": true,
|
|
3561
|
-
"skipLibCheck": true,
|
|
3562
|
-
"forceConsistentCasingInFileNames": true,
|
|
3563
|
-
"resolveJsonModule": true,
|
|
3564
|
-
"isolatedModules": true,
|
|
3565
|
-
"noEmit": true,
|
|
3566
3545
|
"paths": {
|
|
3567
3546
|
"@/*": ["./*"]
|
|
3568
3547
|
}
|
|
3569
3548
|
},
|
|
3570
|
-
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
|
|
3571
|
-
"exclude": ["node_modules"]
|
|
3549
|
+
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts", "nativewind-env.d.ts"]
|
|
3572
3550
|
}
|
|
3573
3551
|
`
|
|
3574
3552
|
},
|
|
@@ -3579,7 +3557,8 @@ export {};
|
|
|
3579
3557
|
module.exports = {
|
|
3580
3558
|
content: [
|
|
3581
3559
|
"./app/**/*.{js,jsx,ts,tsx}",
|
|
3582
|
-
"./
|
|
3560
|
+
"./components/**/*.{js,jsx,ts,tsx}",
|
|
3561
|
+
"./modules/**/*.{js,jsx,ts,tsx}",
|
|
3583
3562
|
],
|
|
3584
3563
|
presets: [require("nativewind/preset")],
|
|
3585
3564
|
theme: {
|
|
@@ -3643,7 +3622,7 @@ module.exports = withNativeWind(config, { input: "./global.css" });
|
|
|
3643
3622
|
api.cache(true);
|
|
3644
3623
|
return {
|
|
3645
3624
|
presets: [
|
|
3646
|
-
["babel-preset-expo", { jsxImportSource: "nativewind"
|
|
3625
|
+
["babel-preset-expo", { jsxImportSource: "nativewind" }],
|
|
3647
3626
|
"nativewind/babel",
|
|
3648
3627
|
],
|
|
3649
3628
|
plugins: [],
|
|
@@ -3772,7 +3751,7 @@ function generateLoginTabsTemplates(projectName) {
|
|
|
3772
3751
|
"export default function RootLayout() {",
|
|
3773
3752
|
" const colorScheme = useColorScheme();",
|
|
3774
3753
|
" const [loaded] = useFonts({",
|
|
3775
|
-
'
|
|
3754
|
+
' NunitoBold: require("../assets/fonts/Nunito-Bold.ttf"),',
|
|
3776
3755
|
" });",
|
|
3777
3756
|
"",
|
|
3778
3757
|
" useEffect(() => {",
|
|
@@ -4194,10 +4173,14 @@ function generateBasePackageJson(projectName) {
|
|
|
4194
4173
|
"expo-constants": "~18.0.13",
|
|
4195
4174
|
"expo-status-bar": "~3.0.9",
|
|
4196
4175
|
"expo-splash-screen": "~31.0.13",
|
|
4176
|
+
"expo-font": "~14.0.11",
|
|
4197
4177
|
react: "19.1.0",
|
|
4198
4178
|
"react-native": "0.81.5",
|
|
4199
4179
|
"react-native-safe-area-context": "~5.6.0",
|
|
4200
4180
|
"react-native-screens": "~4.16.0",
|
|
4181
|
+
"react-native-reanimated": "~4.1.1",
|
|
4182
|
+
"react-native-worklets": "~0.5.1",
|
|
4183
|
+
"react-native-gesture-handler": "~2.28.0",
|
|
4201
4184
|
nativewind: "^4.1.0",
|
|
4202
4185
|
tailwindcss: "^3.4.0",
|
|
4203
4186
|
"react-native-svg": "^15.8.0"
|
|
@@ -4211,7 +4194,7 @@ function generateBasePackageJson(projectName) {
|
|
|
4211
4194
|
|
|
4212
4195
|
// src/index.ts
|
|
4213
4196
|
var import_execa = require("execa");
|
|
4214
|
-
var CLI_VERSION = "1.
|
|
4197
|
+
var CLI_VERSION = "1.4.1";
|
|
4215
4198
|
var CONFIG_FILE = ".expo-bbase.json";
|
|
4216
4199
|
async function run() {
|
|
4217
4200
|
const program = new import_commander.Command();
|
|
@@ -4338,6 +4321,12 @@ async function createProject(projectName) {
|
|
|
4338
4321
|
await writeFile(filePath, content);
|
|
4339
4322
|
}
|
|
4340
4323
|
}
|
|
4324
|
+
spinner.text = "Copying assets...";
|
|
4325
|
+
const assetsSource = import_path2.default.join(__dirname, "..", "templates", "assets");
|
|
4326
|
+
const assetsTarget = import_path2.default.join(targetDir, "assets");
|
|
4327
|
+
if (import_fs_extra2.default.existsSync(assetsSource)) {
|
|
4328
|
+
import_fs_extra2.default.copySync(assetsSource, assetsTarget);
|
|
4329
|
+
}
|
|
4341
4330
|
spinner.text = "Generating package.json...";
|
|
4342
4331
|
const pkgJson = generateBasePackageJson(projectName);
|
|
4343
4332
|
const allDeps = {};
|