@akanjs/devkit 2.4.0-rc.4 → 2.4.0-rc.5
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/akanConfig/akanConfig.test.ts +15 -7
- package/akanConfig/akanConfig.ts +24 -13
- package/package.json +2 -2
|
@@ -272,18 +272,26 @@ describe("AkanAppConfig", () => {
|
|
|
272
272
|
"@capacitor/ios",
|
|
273
273
|
"@capacitor/android",
|
|
274
274
|
"@capacitor/assets",
|
|
275
|
-
"@capacitor/app",
|
|
276
|
-
"@capacitor/device",
|
|
277
|
-
"@capacitor/keyboard",
|
|
278
|
-
"@capacitor/haptics",
|
|
279
|
-
"@capacitor/preferences",
|
|
280
|
-
"@capacitor/browser",
|
|
281
|
-
"capacitor-plugin-safe-area",
|
|
282
275
|
];
|
|
283
276
|
expect(config.getMobileRuntimePackages() as string[]).toEqual(expectedMobilePackages);
|
|
284
277
|
expect(config.getMissingMobileDependencySpecs()).toEqual(
|
|
285
278
|
expectedMobilePackages.map((lib) => `${lib}@${runtimeDependencies[lib as keyof typeof runtimeDependencies]}`),
|
|
286
279
|
);
|
|
280
|
+
expect(config.getMobileAppCapacitorPlugins()).toEqual([
|
|
281
|
+
"@capacitor-community/fcm",
|
|
282
|
+
"@capacitor/app",
|
|
283
|
+
"@capacitor/browser",
|
|
284
|
+
"@capacitor/camera",
|
|
285
|
+
"@capacitor/core",
|
|
286
|
+
"@capacitor/device",
|
|
287
|
+
"@capacitor/geolocation",
|
|
288
|
+
"@capacitor/haptics",
|
|
289
|
+
"@capacitor/inappbrowser",
|
|
290
|
+
"@capacitor/keyboard",
|
|
291
|
+
"@capacitor/preferences",
|
|
292
|
+
"@capacitor/push-notifications",
|
|
293
|
+
"capacitor-plugin-safe-area",
|
|
294
|
+
]);
|
|
287
295
|
});
|
|
288
296
|
|
|
289
297
|
test("normalizes multiple mobile targets and validates base paths", () => {
|
package/akanConfig/akanConfig.ts
CHANGED
|
@@ -52,17 +52,11 @@ const WORKSPACE_BARREL_FACETS = ["ui", "webkit", "common", "client", "server"] a
|
|
|
52
52
|
const SSR_RUNTIME_PACKAGES = ["react", "react-dom", "react-server-dom-webpack"] as const;
|
|
53
53
|
const NATIVE_RUNTIME_PACKAGES = ["sharp"] as const;
|
|
54
54
|
const DEFAULT_BACKEND_RUNTIME_PACKAGES = ["croner"] as const;
|
|
55
|
-
// Packages
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
// 3. the Capacitor plugins the framework loads unconditionally on every native boot — Device,
|
|
61
|
-
// Keyboard, Haptics and SafeArea (`Device.load`), App (CSR lifecycle), Preferences (storage),
|
|
62
|
-
// Browser (`CsrLink` navigation). Without them `npx cap sync` never registers the native
|
|
63
|
-
// plugin, so the JS bridge throws `Capacitor plugin "Device" is not available.` at runtime.
|
|
64
|
-
// Feature-gated plugins (camera, contacts, geolocation, push, fcm, updater, purchase) stay opt-in
|
|
65
|
-
// optional peers because they need app-specific native permissions/config before they can be used.
|
|
55
|
+
// Packages installed at the workspace root before a mobile target is built or started. All are
|
|
56
|
+
// declared only as optional peers, so a fresh workspace never auto-installs them. Covers the
|
|
57
|
+
// firebase client (push tokens) and the Capacitor toolchain — `@capacitor/cli` (`npx cap`),
|
|
58
|
+
// `@capacitor/assets` (`npx @capacitor/assets`) plus the `@capacitor/core`/`ios`/`android` runtime
|
|
59
|
+
// and native-platform packages that `npx cap add`/`sync` resolve from the workspace node_modules.
|
|
66
60
|
const MOBILE_RUNTIME_PACKAGES = [
|
|
67
61
|
"firebase",
|
|
68
62
|
"@capacitor/cli",
|
|
@@ -70,12 +64,26 @@ const MOBILE_RUNTIME_PACKAGES = [
|
|
|
70
64
|
"@capacitor/ios",
|
|
71
65
|
"@capacitor/android",
|
|
72
66
|
"@capacitor/assets",
|
|
67
|
+
] as const;
|
|
68
|
+
// Capacitor plugins that must be declared in the *app's* package.json (apps/<app>/package.json).
|
|
69
|
+
// `npx cap sync` discovers plugins by scanning the app directory's dependencies and registers their
|
|
70
|
+
// native code into the iOS/Android projects; packages present only in the workspace root are never
|
|
71
|
+
// registered, so the JS bridge throws `Capacitor plugin "Device" is not available.` at runtime.
|
|
72
|
+
// These are added on start-ios / start-android with a "*" range, letting bun resolve them to the
|
|
73
|
+
// version already hoisted at the workspace root instead of pinning a second source of truth.
|
|
74
|
+
const MOBILE_APP_CAPACITOR_PLUGINS = [
|
|
75
|
+
"@capacitor-community/fcm",
|
|
73
76
|
"@capacitor/app",
|
|
77
|
+
"@capacitor/browser",
|
|
78
|
+
"@capacitor/camera",
|
|
79
|
+
"@capacitor/core",
|
|
74
80
|
"@capacitor/device",
|
|
75
|
-
"@capacitor/
|
|
81
|
+
"@capacitor/geolocation",
|
|
76
82
|
"@capacitor/haptics",
|
|
83
|
+
"@capacitor/inappbrowser",
|
|
84
|
+
"@capacitor/keyboard",
|
|
77
85
|
"@capacitor/preferences",
|
|
78
|
-
"@capacitor/
|
|
86
|
+
"@capacitor/push-notifications",
|
|
79
87
|
"capacitor-plugin-safe-area",
|
|
80
88
|
] as const;
|
|
81
89
|
const DATABASE_MODE_RUNTIME_PACKAGES = {
|
|
@@ -420,6 +428,9 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
420
428
|
getMissingMobileDependencySpecs() {
|
|
421
429
|
return this.#getMissingDependencySpecs(this.getMobileRuntimePackages());
|
|
422
430
|
}
|
|
431
|
+
getMobileAppCapacitorPlugins() {
|
|
432
|
+
return [...MOBILE_APP_CAPACITOR_PLUGINS];
|
|
433
|
+
}
|
|
423
434
|
#getMissingDependencySpecs(libs: readonly string[]) {
|
|
424
435
|
const rootDependencies = {
|
|
425
436
|
...this.rootPackageJson.dependencies,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/devkit",
|
|
3
|
-
"version": "2.4.0-rc.
|
|
3
|
+
"version": "2.4.0-rc.5",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@langchain/openai": "^1.4.6",
|
|
33
33
|
"@tailwindcss/node": "^4.3.0",
|
|
34
34
|
"@trapezedev/project": "^7.1.4",
|
|
35
|
-
"akanjs": "2.4.0-rc.
|
|
35
|
+
"akanjs": "2.4.0-rc.5",
|
|
36
36
|
"chalk": "^5.6.2",
|
|
37
37
|
"commander": "^14.0.3",
|
|
38
38
|
"daisyui": "5.5.23",
|