miaoda-expo-devkit 0.1.1-beta.125 → 0.1.1-beta.127

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/docs/patches.md CHANGED
@@ -66,6 +66,11 @@ lockfile。
66
66
  DevKit 内置文件;内容不同的项目定制 patch 会继续优先,并输出警告。项目中其他
67
67
  `patchedDependencies` 不受影响。迁移后必须重新生成并提交 `pnpm-lock.yaml`。
68
68
 
69
+ pnpm 10 在安装阶段会用根 `package.json#pnpm.patchedDependencies` 整体覆盖 hook 合并后的
70
+ 结果。因此当该字段存在时,hook 会把合并后的最终集合就地写回内存中的
71
+ `rootProjectManifest.pnpm.patchedDependencies`(hook 本身不写磁盘);该字段不存在时不会创建。
72
+ pnpm 11 不再读取 `package.json#pnpm`,无需此处理。
73
+
69
74
  ## 发布前验证
70
75
 
71
76
  发布前可用一条命令运行轻量集成测试:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miaoda-expo-devkit",
3
- "version": "0.1.1-beta.125",
3
+ "version": "0.1.1-beta.127",
4
4
  "description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -172,52 +172,5 @@
172
172
  "publishConfig": {
173
173
  "registry": "https://registry.npmjs.org/",
174
174
  "access": "public"
175
- },
176
- "clean-publish": {
177
- "fields": [
178
- "devDependencies",
179
- "scripts"
180
- ]
181
- },
182
- "devDependencies": {
183
- "@babel/core": "^7.26.0",
184
- "@babel/helper-module-imports": "^7.28.6",
185
- "@biomejs/biome": "^2.4.12",
186
- "@sentry/core": "10.49.0",
187
- "@sentry/react-native": "8.9.2",
188
- "@types/babel__core": "^7.20.5",
189
- "@types/babel__helper-module-imports": "^7.18.3",
190
- "@types/connect": "^3.4.38",
191
- "@types/lodash.throttle": "^4.1.9",
192
- "@types/node": "^25.0.0",
193
- "@types/semver": "^7.7.1",
194
- "@expo/schemer": "^2.1.4",
195
- "clean-publish": "^6.0.5",
196
- "expo-router": "55.0.5",
197
- "lucide-react-native": "^1.11.0",
198
- "lucide-react-native-v1-8": "npm:lucide-react-native@~1.8.0",
199
- "metro": "^0.83.0",
200
- "metro-cache": "^0.83.0",
201
- "metro-config": "^0.83.0",
202
- "metro-core": "^0.83.0",
203
- "metro-resolver": "^0.83.0",
204
- "oxlint": "^1.60.0",
205
- "react-native": "0.83.2",
206
- "semver": "^7.7.4",
207
- "tsup": "^8.5.1",
208
- "typescript": "~5.9.2",
209
- "vitest": "^4.1.5"
210
- },
211
- "scripts": {
212
- "build": "tsup",
213
- "typecheck": "tsc --noEmit && tsc -p tsconfig.check.json --noEmit",
214
- "test": "vitest run",
215
- "test:patches": "node scripts/test-patches.mjs",
216
- "patch:workspace": "node scripts/patch-workspace.mjs",
217
- "release": "pnpm run test && pnpm run build && clean-publish",
218
- "release:beta": "pnpm run test && pnpm run build && npm version prerelease --preid=beta && clean-publish --tag beta",
219
- "release:patch": "pnpm run test && pnpm run build && npm version patch && clean-publish",
220
- "release:minor": "pnpm run test && pnpm run build && npm version minor && clean-publish",
221
- "release:major": "pnpm run test && pnpm run build && npm version major && clean-publish"
222
175
  }
223
- }
176
+ }
package/pnpmfile.cjs CHANGED
@@ -195,6 +195,20 @@ function projectRequestsLegacySelector(config, selector) {
195
195
  }
196
196
  }
197
197
 
198
+ // updateConfig 合并出的 patchedDependencies 在 pnpm 10 下不会生效:安装阶段 pnpm 会用
199
+ // getOptionsFromRootManifest 重读 rootProjectManifest.pnpm,字段存在时其值整体覆盖 install 的 opts
200
+ // (即 hook 处理后的 config 展开出的安装选项),合并结果被丢弃。
201
+ // 所以必须把最终集合同步回该内存对象(hook 不写磁盘)。pnpm 11 不再读取 package.json#pnpm,迁移后可删除。
202
+ function syncRootManifestPatches(config, patchedDependencies) {
203
+ const pnpmSettings = config.rootProjectManifest?.pnpm;
204
+ const manifestPatches = pnpmSettings?.patchedDependencies;
205
+ const isPlainObject =
206
+ manifestPatches != null && typeof manifestPatches === 'object' && !Array.isArray(manifestPatches);
207
+ if (!isPlainObject) return;
208
+
209
+ pnpmSettings.patchedDependencies = { ...patchedDependencies };
210
+ }
211
+
198
212
  function applyManagedPatches(config) {
199
213
  const patchedDependencies = { ...config.patchedDependencies };
200
214
 
@@ -236,6 +250,8 @@ function applyManagedPatches(config) {
236
250
  );
237
251
  }
238
252
 
253
+ syncRootManifestPatches(config, patchedDependencies);
254
+
239
255
  const configuredMaxLength = Number.isFinite(config.virtualStoreDirMaxLength)
240
256
  ? config.virtualStoreDirMaxLength
241
257
  : 120;