@blotch/angular-lynx-native 22.3.1 → 22.3.2
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 +41 -15
- package/dist/android/project.d.ts +90 -1
- package/dist/android/project.d.ts.map +1 -1
- package/dist/android/project.js +369 -5
- package/dist/eject.d.ts +15 -1
- package/dist/eject.d.ts.map +1 -1
- package/dist/eject.js +13 -2
- package/dist/features.d.ts +70 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/features.js +115 -0
- package/dist/generate.d.ts +17 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +12 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/ios/build.d.ts.map +1 -1
- package/dist/ios/build.js +8 -2
- package/dist/ios/frameworks.d.ts +6 -5
- package/dist/ios/frameworks.d.ts.map +1 -1
- package/dist/ios/frameworks.js +46 -15
- package/dist/ios/project.d.ts +173 -11
- package/dist/ios/project.d.ts.map +1 -1
- package/dist/ios/project.js +767 -33
- package/dist/options.d.ts +140 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +127 -0
- package/dist/permissions.d.ts +18 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +63 -3
- package/package.json +1 -1
- package/templates/android/README.md +35 -2
- package/templates/android/angular-lynx.properties +2 -0
- package/templates/android/app/build.gradle.kts +51 -2
- package/templates/android/app/src/main/AndroidManifest.xml +14 -3
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BarcodeScannerModule.kt +144 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BiometricsModule.kt +433 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BitmapPresenter.kt +98 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BitmapRendererContext.kt +175 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/BluetoothModule.kt +1288 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/CalendarModule.kt +127 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/Canvas2DContext.kt +1557 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/Canvas2DOps.kt +63 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/CanvasFilter.kt +357 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/CanvasUI.kt +4 -3
- package/templates/android/app/src/main/java/dev/angularlynx/shell/FilePickerModule.kt +263 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/HapticsModule.kt +82 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/MainActivity.kt +376 -6
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ModuleBytes.kt +58 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/MotionModule.kt +332 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/NfcModule.kt +274 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/PermissionRequests.kt +25 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/PhotoLibraryModule.kt +168 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ShareTargetModule.kt +234 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ShellApplication.kt +6 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/ShellModule.kt +47 -3
- package/templates/android/app/src/main/java/dev/angularlynx/shell/StoreReviewModule.kt +66 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/SystemFontFamilies.kt +68 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/TrackingModule.kt +74 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/VideoFrameTarget.kt +429 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/VideoUI.kt +676 -0
- package/templates/android/app/src/main/java/dev/angularlynx/shell/WebGLContext.kt +128 -13
- package/templates/android/app/src/main/java/dev/angularlynx/shell/WebGLModule.kt +493 -65
- package/templates/android/app/src/main/java/dev/angularlynx/shell/WifiModule.kt +429 -0
- package/templates/android/app/src/main/res/values/biometrics.xml +9 -0
- package/templates/android/app/src/main/res/values/share_target.xml +11 -0
- package/templates/android/app/src/main/res/xml/backup_rules.xml +5 -3
- package/templates/android/app/src/main/res/xml/data_extraction_rules.xml +6 -3
- package/templates/android/build.gradle.kts +1 -1
- package/templates/android/gradle/wrapper/gradle-wrapper.properties +2 -2
- package/templates/ios/App/AngularLynxBitmapRendererContext.m +188 -0
- package/templates/ios/App/AngularLynxCanvas2DContext.m +2467 -0
- package/templates/ios/App/AngularLynxCanvas2DOps.h +61 -0
- package/templates/ios/App/AngularLynxVideo.h +37 -0
- package/templates/ios/App/AngularLynxVideo.m +435 -0
- package/templates/ios/App/AngularLynxWebGL.h +69 -7
- package/templates/ios/App/AngularLynxWebGL.m +538 -29
- package/templates/ios/App/AngularLynxWebGLContext.m +148 -46
- package/templates/ios/App/AppDelegate.swift +34 -2
- package/templates/ios/App/AppleSignInButton.swift +106 -0
- package/templates/ios/App/AppleSignInModule.swift +222 -0
- package/templates/ios/App/BarcodeScannerModule.swift +284 -0
- package/templates/ios/App/BiometricsModule.swift +256 -0
- package/templates/ios/App/BluetoothModule.swift +1086 -0
- package/templates/ios/App/CalendarModule.swift +158 -0
- package/templates/ios/App/FilePickerModule.swift +240 -0
- package/templates/ios/App/HapticsModule.swift +90 -0
- package/templates/ios/App/Info.plist +2 -0
- package/templates/ios/App/LynxViewController.swift +210 -6
- package/templates/ios/App/MotionModule.swift +430 -0
- package/templates/ios/App/NfcModule.swift +346 -0
- package/templates/ios/App/PhotoLibraryModule.swift +169 -0
- package/templates/ios/App/ShareTargetModule.swift +150 -0
- package/templates/ios/App/ShellModule.swift +17 -0
- package/templates/ios/App/StoreReviewModule.swift +61 -0
- package/templates/ios/App/TrackingModule.swift +121 -0
- package/templates/ios/App/WifiModule.swift +237 -0
- package/templates/ios/App/XElementRegistry.swift +13 -3
- package/templates/ios/ShareExtension/Info.plist +42 -0
- package/templates/ios/ShareExtension/ShareViewController.swift +387 -0
package/dist/features.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { existsSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* The file the build plugin writes beside the Lynx bundle
|
|
5
|
+
* (`@blotch/rsbuild-plugin-angular-lynx`'s native-features.ts, under the
|
|
6
|
+
* same name): which of the shells' optional native code the app needs, from
|
|
7
|
+
* what its main-thread modules name. The leading dot keeps copyBundle from
|
|
8
|
+
* copying it into the app.
|
|
9
|
+
*/
|
|
10
|
+
export const NATIVE_FEATURES_FILE = '.angular-lynx-native.json';
|
|
11
|
+
/** Everything: what an app gets when nothing says what it needs. */
|
|
12
|
+
export const ALL_NATIVE_FEATURES = {
|
|
13
|
+
canvas: true,
|
|
14
|
+
webgl: true,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* What the bundle in `bundleDir` needs, from NATIVE_FEATURES_FILE.
|
|
18
|
+
*
|
|
19
|
+
* Everything when there's no bundle (`ng serve --platform`'s development
|
|
20
|
+
* app, which loads its bundle from the dev server and gets every edit, so a
|
|
21
|
+
* canvas added while it runs has to draw), or no file or one this version
|
|
22
|
+
* can't read (a bundle from an older plugin or another build): leaving out
|
|
23
|
+
* code the app uses would leave it a blank canvas, while keeping what it
|
|
24
|
+
* doesn't use only costs size. For the same reason a file with
|
|
25
|
+
* `"canvas": true` and no `webgl`, from a plugin before #847, keeps WebGL.
|
|
26
|
+
*
|
|
27
|
+
* @param bundleDir - The rspeedy output folder, or undefined for the
|
|
28
|
+
* development app.
|
|
29
|
+
*/
|
|
30
|
+
export const readNativeFeatures = (bundleDir) => {
|
|
31
|
+
if (!bundleDir)
|
|
32
|
+
return ALL_NATIVE_FEATURES;
|
|
33
|
+
const file = path.join(bundleDir, NATIVE_FEATURES_FILE);
|
|
34
|
+
if (!existsSync(file))
|
|
35
|
+
return ALL_NATIVE_FEATURES;
|
|
36
|
+
try {
|
|
37
|
+
const features = JSON.parse(readFileSync(file, 'utf8'));
|
|
38
|
+
if (typeof features === 'object' && features !== null) {
|
|
39
|
+
const { canvas, webgl } = features;
|
|
40
|
+
if (canvas === false)
|
|
41
|
+
return { canvas: false, webgl: false };
|
|
42
|
+
if (canvas === true && webgl === false) {
|
|
43
|
+
return { canvas: true, webgl: false };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// An unreadable file says nothing, so the app gets everything.
|
|
49
|
+
}
|
|
50
|
+
return ALL_NATIVE_FEATURES;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Deletes `files` (relative to `dir`), each of which must be in the
|
|
54
|
+
* template: a renamed file would otherwise stay in every app unnoticed.
|
|
55
|
+
*/
|
|
56
|
+
export const removeTemplateFiles = (dir, files) => {
|
|
57
|
+
for (const file of files) {
|
|
58
|
+
const absolute = path.join(dir, file);
|
|
59
|
+
if (!existsSync(absolute)) {
|
|
60
|
+
throw new Error(`The template has no ${file} to leave out.`);
|
|
61
|
+
}
|
|
62
|
+
rmSync(absolute);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Takes out of a source file the lines between `// angular-lynx:<name>` and
|
|
67
|
+
* `// /angular-lynx:<name>`, the markers with them, wherever they are. The
|
|
68
|
+
* templates mark the few lines that use optional code, so the project still
|
|
69
|
+
* builds once it's gone.
|
|
70
|
+
*/
|
|
71
|
+
export const removeMarkedLines = (file, name) => {
|
|
72
|
+
const lines = readFileSync(file, 'utf8').split('\n');
|
|
73
|
+
const open = `// angular-lynx:${name}`;
|
|
74
|
+
const close = `// /angular-lynx:${name}`;
|
|
75
|
+
const kept = [];
|
|
76
|
+
let inside = false;
|
|
77
|
+
let blocks = 0;
|
|
78
|
+
for (const line of lines) {
|
|
79
|
+
const marker = line.trim();
|
|
80
|
+
if (marker === open && !inside) {
|
|
81
|
+
inside = true;
|
|
82
|
+
blocks++;
|
|
83
|
+
}
|
|
84
|
+
else if (marker === close && inside) {
|
|
85
|
+
inside = false;
|
|
86
|
+
}
|
|
87
|
+
else if (!inside) {
|
|
88
|
+
kept.push(line);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (inside || blocks === 0) {
|
|
92
|
+
throw new Error(`${file} has no complete ${open} … ${close} block to take out.`);
|
|
93
|
+
}
|
|
94
|
+
writeFileSync(file, kept.join('\n'));
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Takes out of the Wi-Fi module (`source`, the Swift or Kotlin file) what
|
|
98
|
+
* angular.json's `wifi` doesn't turn on: the whole file without either part,
|
|
99
|
+
* or the lines of the part that's off, between `// angular-lynx:wifi-read`
|
|
100
|
+
* (currentNetwork, and the location code behind it) or
|
|
101
|
+
* `// angular-lynx:wifi-join` (join and leave) markers. Each module's
|
|
102
|
+
* `methodLookup` or `@LynxMethod`s are in those lines too, so the runtime
|
|
103
|
+
* rejects a part that's off with `unavailable`.
|
|
104
|
+
*/
|
|
105
|
+
export const leaveOutWifi = (dir, wifi, source) => {
|
|
106
|
+
if (!wifi.join && !wifi.readCurrentNetwork) {
|
|
107
|
+
removeTemplateFiles(dir, [source]);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!wifi.readCurrentNetwork) {
|
|
111
|
+
removeMarkedLines(path.join(dir, source), 'wifi-read');
|
|
112
|
+
}
|
|
113
|
+
if (!wifi.join)
|
|
114
|
+
removeMarkedLines(path.join(dir, source), 'wifi-join');
|
|
115
|
+
};
|
package/dist/generate.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type NativeFeatures } from './features.ts';
|
|
1
2
|
import { type ResolvedApp } from './options.ts';
|
|
2
3
|
export type Platform = 'ios' | 'android';
|
|
3
4
|
/** The shell templates shipped in this package. */
|
|
@@ -15,6 +16,15 @@ export type PlatformGenerator = {
|
|
|
15
16
|
* true for `ng serve --platform`'s development app.
|
|
16
17
|
*/
|
|
17
18
|
readonly configure: (dir: string, app: ResolvedApp, projectRoot: string, development?: boolean) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Takes the shells' optional native code the app doesn't use out of the
|
|
21
|
+
* fresh copy, after `configure`: what the bundle doesn't name
|
|
22
|
+
* (`features`), and the modules for permissions the app doesn't ask for
|
|
23
|
+
* (`app`), such as biometrics. Eject keeps every feature unless its caller
|
|
24
|
+
* says otherwise (renderEjectedProject's `features`): an ejected project is
|
|
25
|
+
* the user's to grow.
|
|
26
|
+
*/
|
|
27
|
+
readonly leaveOut: (dir: string, features: NativeFeatures, app: ResolvedApp) => void;
|
|
18
28
|
/** Where the Lynx bundle and its assets go inside the native project. */
|
|
19
29
|
readonly bundleDir: (dir: string) => string;
|
|
20
30
|
};
|
|
@@ -46,7 +56,7 @@ export type PreparedProject = {
|
|
|
46
56
|
* the other. It gets no bundle (`bundleDir` undefined): it loads the bundle
|
|
47
57
|
* from the dev server.
|
|
48
58
|
*/
|
|
49
|
-
export declare const prepareProject: ({ platform, generator, projectRoot, workDir, app, bundleDir, packageVersion, development, }: {
|
|
59
|
+
export declare const prepareProject: ({ platform, generator, projectRoot, workDir, app, bundleDir, packageVersion, development, features, }: {
|
|
50
60
|
readonly platform: Platform;
|
|
51
61
|
readonly generator: PlatformGenerator;
|
|
52
62
|
readonly projectRoot: string;
|
|
@@ -61,6 +71,12 @@ export declare const prepareProject: ({ platform, generator, projectRoot, workDi
|
|
|
61
71
|
readonly packageVersion: string;
|
|
62
72
|
/** The development app `ng serve --platform` runs. */
|
|
63
73
|
readonly development?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The optional native code the app uses (readNativeFeatures), which is in
|
|
76
|
+
* the hash: an app that starts drawing on a canvas regenerates its project
|
|
77
|
+
* with the canvas code back in.
|
|
78
|
+
*/
|
|
79
|
+
readonly features?: NativeFeatures;
|
|
64
80
|
}) => PreparedProject;
|
|
65
81
|
/**
|
|
66
82
|
* Up to 22.2.2, native builds worked in `.angular-lynx/` at the project root.
|
package/dist/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAEzC,mDAAmD;AACnD,eAAO,MAAM,aAAa,QAEzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,0BAA0B,CAAC;AAIpD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,CAClB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,OAAO,KAClB,IAAI,CAAC;IACV,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,mCAAmC;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,GAAI,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAEzC,mD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AChC,sDAAsD;IACtD,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;CACpC,KAAG,eAkCH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,MAAM,EACnB,KAAK,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,KAC7B,IAUF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM,KAAG,IAqBrD,CAAC"}
|
package/dist/generate.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync, } from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { ALL_NATIVE_FEATURES } from "./features.js";
|
|
5
6
|
import { ICON_BACKGROUND_COLOR } from "./options.js";
|
|
6
7
|
/** The shell templates shipped in this package. */
|
|
7
8
|
export const TEMPLATES_DIR = fileURLToPath(new URL('../templates/', import.meta.url));
|
|
@@ -28,7 +29,7 @@ const HASH_FILE = '.angular-lynx-hash';
|
|
|
28
29
|
* the other. It gets no bundle (`bundleDir` undefined): it loads the bundle
|
|
29
30
|
* from the dev server.
|
|
30
31
|
*/
|
|
31
|
-
export const prepareProject = ({ platform, generator, projectRoot, workDir, app, bundleDir, packageVersion, development = false, }) => {
|
|
32
|
+
export const prepareProject = ({ platform, generator, projectRoot, workDir, app, bundleDir, packageVersion, development = false, features = ALL_NATIVE_FEATURES, }) => {
|
|
32
33
|
const ejectedDir = path.join(projectRoot, platform);
|
|
33
34
|
if (existsSync(path.join(ejectedDir, EJECT_MARKER))) {
|
|
34
35
|
if (bundleDir)
|
|
@@ -36,7 +37,13 @@ export const prepareProject = ({ platform, generator, projectRoot, workDir, app,
|
|
|
36
37
|
return { dir: ejectedDir, ejected: true, regenerated: false };
|
|
37
38
|
}
|
|
38
39
|
const dir = path.join(workDir, development ? `${platform}-dev` : platform);
|
|
39
|
-
const hash = inputHash({
|
|
40
|
+
const hash = inputHash({
|
|
41
|
+
platform,
|
|
42
|
+
app,
|
|
43
|
+
projectRoot,
|
|
44
|
+
packageVersion,
|
|
45
|
+
features,
|
|
46
|
+
});
|
|
40
47
|
const hashFile = path.join(dir, HASH_FILE);
|
|
41
48
|
const upToDate = existsSync(hashFile) && readFileSync(hashFile, 'utf8') === hash;
|
|
42
49
|
if (!upToDate) {
|
|
@@ -44,6 +51,7 @@ export const prepareProject = ({ platform, generator, projectRoot, workDir, app,
|
|
|
44
51
|
mkdirSync(dir, { recursive: true });
|
|
45
52
|
cpSync(path.join(TEMPLATES_DIR, platform), dir, { recursive: true });
|
|
46
53
|
generator.configure(dir, app, projectRoot, development);
|
|
54
|
+
generator.leaveOut(dir, features, app);
|
|
47
55
|
writeFileSync(hashFile, hash);
|
|
48
56
|
}
|
|
49
57
|
// Generated projects are build output. `ng new` already ignores Angular's
|
|
@@ -93,9 +101,9 @@ export const copyBundle = (from, to) => {
|
|
|
93
101
|
});
|
|
94
102
|
}
|
|
95
103
|
};
|
|
96
|
-
const inputHash = ({ platform, app, projectRoot, packageVersion, }) => {
|
|
104
|
+
const inputHash = ({ platform, app, projectRoot, packageVersion, features, }) => {
|
|
97
105
|
const hash = createHash('sha256');
|
|
98
|
-
hash.update(`${packageVersion}\n${platform}\n${JSON.stringify(app)}\n`);
|
|
106
|
+
hash.update(`${packageVersion}\n${platform}\n${JSON.stringify(app)}\n${JSON.stringify(features)}\n`);
|
|
99
107
|
for (const file of listFiles(path.join(TEMPLATES_DIR, platform))) {
|
|
100
108
|
hash.update(file.relative);
|
|
101
109
|
hash.update(readFileSync(file.absolute));
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { DevServerOptions, RunOptions } from './run.ts';
|
|
|
4
4
|
export type { Platform } from './generate.ts';
|
|
5
5
|
export { EJECT_MARKER, copyBundle, prepareProject } from './generate.ts';
|
|
6
6
|
export { renderEjectedProject } from './eject.ts';
|
|
7
|
+
export { ALL_NATIVE_FEATURES, NATIVE_FEATURES_FILE, type NativeFeatures, readNativeFeatures, } from './features.ts';
|
|
7
8
|
export { LYNX_IOS, FRAMEWORKS_ENV } from './ios/frameworks.ts';
|
|
8
9
|
export type { AndroidOptions, IosExportMethod, IosOptions, NativeAppOptions, Orientation, Permission, ResolvedApp, SplashOptions, } from './options.ts';
|
|
9
10
|
export { NativeConfigError, resolveAppOptions } from './options.ts';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,QAAQ,EAGd,MAAM,eAAe,CAAC;AASvB,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,cAAc,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG7D,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,cAAc,EACnB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/D,YAAY,EACV,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AACtB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|
@@ -5,6 +5,7 @@ import { buildAndroid, resolveAndroidSigning } from "./android/build.js";
|
|
|
5
5
|
import { writeAppLinkFile } from "./app-links.js";
|
|
6
6
|
import { startAndroidDevice } from "./android/run.js";
|
|
7
7
|
import { devBuildKey, recordDevBuild, reusableDevBuild } from "./dev-build.js";
|
|
8
|
+
import { readNativeFeatures } from "./features.js";
|
|
8
9
|
import { prepareProject, removeLegacyWorkDir, } from "./generate.js";
|
|
9
10
|
import { buildIos, missingTeamMessage, resolveIosSigning, } from "./ios/build.js";
|
|
10
11
|
import { resolveLynxFrameworks } from "./ios/frameworks.js";
|
|
@@ -15,6 +16,7 @@ import { NativeBuildError } from "./process.js";
|
|
|
15
16
|
import { splashWarnings } from "./splash.js";
|
|
16
17
|
export { EJECT_MARKER, copyBundle, prepareProject } from "./generate.js";
|
|
17
18
|
export { renderEjectedProject } from "./eject.js";
|
|
19
|
+
export { ALL_NATIVE_FEATURES, NATIVE_FEATURES_FILE, readNativeFeatures, } from "./features.js";
|
|
18
20
|
export { LYNX_IOS, FRAMEWORKS_ENV } from "./ios/frameworks.js";
|
|
19
21
|
export { NativeConfigError, resolveAppOptions } from "./options.js";
|
|
20
22
|
export { NativeBuildError } from "./process.js";
|
|
@@ -70,15 +72,20 @@ export const buildNativeApp = async (options) => {
|
|
|
70
72
|
if (target?.iPhone && !iosSigning) {
|
|
71
73
|
throw new NativeBuildError(await missingTeamMessage(target.iPhone.name));
|
|
72
74
|
}
|
|
75
|
+
const bundleDir = devServer ? undefined : options.bundleDir;
|
|
73
76
|
const project = prepareProject({
|
|
74
77
|
platform,
|
|
75
78
|
generator: platform === 'ios' ? iosGenerator : androidGenerator,
|
|
76
79
|
projectRoot,
|
|
77
80
|
workDir,
|
|
78
81
|
app,
|
|
79
|
-
bundleDir
|
|
82
|
+
bundleDir,
|
|
80
83
|
packageVersion: PACKAGE_VERSION,
|
|
81
84
|
development: !!devServer,
|
|
85
|
+
// The native code the bundle uses: an app that never draws on a canvas
|
|
86
|
+
// leaves the canvas, WebGL and video frame code out (issue #837), and
|
|
87
|
+
// one that draws only in 2D leaves out WebGL and ANGLE (issue #847).
|
|
88
|
+
features: readNativeFeatures(bundleDir),
|
|
82
89
|
});
|
|
83
90
|
if (devServer &&
|
|
84
91
|
project.ejected &&
|
package/dist/ios/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/ios/build.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/ios/build.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKlE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,WAAW,EAChB,MAAK,MAAM,CAAC,UAAwB,KACnC,UAAU,GAAG,SAwCf,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAU,8GAY5B;IACD,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,GAAG,EAA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import os from 'node:os';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { NativeBuildError, capture, run } from "../process.js";
|
|
6
6
|
import { escapeXml } from "../xml.js";
|
|
7
|
+
import { IOS_ENTITLEMENTS } from "./project.js";
|
|
7
8
|
/**
|
|
8
9
|
* Reads the signing options, and the App Store Connect API key from the
|
|
9
10
|
* environment variables they name. Returns undefined when signing isn't
|
|
@@ -278,8 +279,13 @@ const explainSigningFailure = (error, teamId) => {
|
|
|
278
279
|
}
|
|
279
280
|
// xcodebuild then also reports "No profiles for", which alone would point
|
|
280
281
|
// at the wrong fix.
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
// Each option that adds an entitlement names its capability as Xcode
|
|
283
|
+
// does, so the message can say which option a Personal Team can't sign.
|
|
284
|
+
const unsupported = /Personal development teams.*?do not support the (.+?) (?:capability|capabilities)/is.exec(error.message)?.[1];
|
|
285
|
+
const entitlement = unsupported &&
|
|
286
|
+
IOS_ENTITLEMENTS.find(({ capability }) => capability.toLowerCase() === unsupported.toLowerCase());
|
|
287
|
+
if (entitlement) {
|
|
288
|
+
return new NativeBuildError(`Team ${teamId} is a free Personal Team, which can't sign the ${entitlement.capability} capability that ${entitlement.option} adds. Set ios.teamId to a team in the paid Apple Developer Program, or leave ${entitlement.option} out of the configuration you build for this iPhone.\n\n${error.message}`);
|
|
283
289
|
}
|
|
284
290
|
if (/requires a development team|No profiles for/i.test(error.message)) {
|
|
285
291
|
return new NativeBuildError(`Xcode couldn't make a provisioning profile for team ${teamId}. Check that ios.teamId is a team your Apple ID in Xcode → Settings → Accounts belongs to, and for an .ipa that the team is in the paid Apple Developer Program.\n\n${error.message}`);
|
package/dist/ios/frameworks.d.ts
CHANGED
|
@@ -12,12 +12,13 @@ export declare const LYNX_IOS: {
|
|
|
12
12
|
readonly version: "4.1.0";
|
|
13
13
|
/**
|
|
14
14
|
* Counts rebuilds of one Lynx version whose frameworks changed (2 added
|
|
15
|
-
* XElement, 3 ANGLE); BUILD in the script.
|
|
16
|
-
* so a machine that cached an older zip
|
|
17
|
-
* linking frameworks the shell no longer
|
|
15
|
+
* XElement, 3 ANGLE, 4 SDWebImage's signed release); BUILD in the script.
|
|
16
|
+
* It's part of the cache folder, so a machine that cached an older zip
|
|
17
|
+
* downloads the new one instead of linking frameworks the shell no longer
|
|
18
|
+
* matches.
|
|
18
19
|
*/
|
|
19
|
-
readonly build:
|
|
20
|
-
readonly url: "https://github.com/Blotch-Smart-Frames/AngularLynx/releases/download/lynx-ios-4.1.0-
|
|
20
|
+
readonly build: 4;
|
|
21
|
+
readonly url: "https://github.com/Blotch-Smart-Frames/AngularLynx/releases/download/lynx-ios-4.1.0-4/lynx-ios-4.1.0-4.zip";
|
|
21
22
|
readonly sha256: string | undefined;
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameworks.d.ts","sourceRoot":"","sources":["../../src/ios/frameworks.ts"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;;IAEnB
|
|
1
|
+
{"version":3,"file":"frameworks.d.ts","sourceRoot":"","sources":["../../src/ios/frameworks.ts"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;;IAEnB;;;;;;OAMG;;;qBAIC,MAAM,GACN,SAAS;CACL,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gKAYtB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,kCAAmC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,cAAc,uLAGjB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,cAAc,gCAAgC,CAAC;AAS5D,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,GAChC,SAAS,MAAM,EACf,KAAK,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,KAC7B,OAAO,CAAC,MAAM,CAkEhB,CAAC;AAwCF,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAM5D,CAAC"}
|
package/dist/ios/frameworks.js
CHANGED
|
@@ -17,13 +17,14 @@ export const LYNX_IOS = {
|
|
|
17
17
|
version: '4.1.0',
|
|
18
18
|
/**
|
|
19
19
|
* Counts rebuilds of one Lynx version whose frameworks changed (2 added
|
|
20
|
-
* XElement, 3 ANGLE); BUILD in the script.
|
|
21
|
-
* so a machine that cached an older zip
|
|
22
|
-
* linking frameworks the shell no longer
|
|
20
|
+
* XElement, 3 ANGLE, 4 SDWebImage's signed release); BUILD in the script.
|
|
21
|
+
* It's part of the cache folder, so a machine that cached an older zip
|
|
22
|
+
* downloads the new one instead of linking frameworks the shell no longer
|
|
23
|
+
* matches.
|
|
23
24
|
*/
|
|
24
|
-
build:
|
|
25
|
-
url: 'https://github.com/Blotch-Smart-Frames/AngularLynx/releases/download/lynx-ios-4.1.0-
|
|
26
|
-
sha256: '
|
|
25
|
+
build: 4,
|
|
26
|
+
url: 'https://github.com/Blotch-Smart-Frames/AngularLynx/releases/download/lynx-ios-4.1.0-4/lynx-ios-4.1.0-4.zip',
|
|
27
|
+
sha256: '996d8f3ff10ad565fd2503c3946d9929c0cc3f4cb1dcabec04647f31d32044c9',
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* The frameworks the zip has from Lynx's pods. The frameworks build reads
|
|
@@ -78,7 +79,20 @@ export const resolveLynxFrameworks = async (logFile, log) => {
|
|
|
78
79
|
const dir = path.join(cacheRoot(), `${LYNX_IOS.version}-${LYNX_IOS.build}`);
|
|
79
80
|
const frameworks = path.join(dir, 'LynxFrameworks');
|
|
80
81
|
if (existsSync(path.join(dir, '.complete'))) {
|
|
81
|
-
|
|
82
|
+
// .complete says the download finished, not that the folder is still
|
|
83
|
+
// whole: before issue #1000, a build script deleted every file in it
|
|
84
|
+
// through a symlink and left the marker, and every iOS build then failed
|
|
85
|
+
// on a missing Info.plist. A damaged cache is downloaded again.
|
|
86
|
+
// SDWebImage's signature and manifest too: without them the app still
|
|
87
|
+
// builds, and only App Store Connect notices.
|
|
88
|
+
const missing = [
|
|
89
|
+
...missingFiles(frameworks),
|
|
90
|
+
...missingSdWebImageFiles(frameworks),
|
|
91
|
+
];
|
|
92
|
+
if (missing.length === 0) {
|
|
93
|
+
return frameworks;
|
|
94
|
+
}
|
|
95
|
+
log(`The cached Lynx ${LYNX_IOS.version} frameworks for iOS are missing ${missing.join(', ')}; downloading them again`);
|
|
82
96
|
}
|
|
83
97
|
if (!LYNX_IOS.sha256) {
|
|
84
98
|
throw new Error(`Prebuilt Lynx ${LYNX_IOS.version} frameworks for iOS aren't published yet. Build them with packages/native/scripts/build-lynx-ios-frameworks.sh from the AngularLynx repository, then set ${FRAMEWORKS_ENV} to the LynxFrameworks folder it creates.`);
|
|
@@ -113,18 +127,35 @@ export const resolveLynxFrameworks = async (logFile, log) => {
|
|
|
113
127
|
return frameworks;
|
|
114
128
|
};
|
|
115
129
|
const assertComplete = (dir, source) => {
|
|
116
|
-
const missing =
|
|
117
|
-
...IOS_FRAMEWORKS.filter((name) => !existsSync(path.join(dir, `${name}.xcframework`, 'Info.plist'))).map((name) => `${name}.xcframework`),
|
|
118
|
-
// A folder from before ANGLE (build 2) has every Lynx framework but
|
|
119
|
-
// these, and the shell wouldn't compile against it.
|
|
120
|
-
...(existsSync(path.join(dir, ANGLE_IOS_HEADERS, 'EGL/egl.h'))
|
|
121
|
-
? []
|
|
122
|
-
: [ANGLE_IOS_HEADERS]),
|
|
123
|
-
];
|
|
130
|
+
const missing = missingFiles(dir);
|
|
124
131
|
if (missing.length > 0) {
|
|
125
132
|
throw new Error(`${source} is missing ${missing.join(', ')}.`);
|
|
126
133
|
}
|
|
134
|
+
if (missingSdWebImageFiles(dir).length > 0) {
|
|
135
|
+
throw new Error(`${source} has an SDWebImage.xcframework without its publisher's signature and privacy manifest, which App Store Connect rejects (ITMS-91061, ITMS-91065). Rebuild it with packages/native/scripts/build-lynx-ios-frameworks.sh, which ships SDWebImage's signed release.`);
|
|
136
|
+
}
|
|
127
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* What a frameworks folder lacks of what the shell links and compiles against.
|
|
140
|
+
*/
|
|
141
|
+
const missingFiles = (dir) => [
|
|
142
|
+
...IOS_FRAMEWORKS.filter((name) => !existsSync(path.join(dir, `${name}.xcframework`, 'Info.plist'))).map((name) => `${name}.xcframework`),
|
|
143
|
+
// A folder from before ANGLE (build 2) has every Lynx framework but
|
|
144
|
+
// these, and the shell wouldn't compile against it.
|
|
145
|
+
...(existsSync(path.join(dir, ANGLE_IOS_HEADERS, 'EGL/egl.h'))
|
|
146
|
+
? []
|
|
147
|
+
: [ANGLE_IOS_HEADERS]),
|
|
148
|
+
];
|
|
149
|
+
/**
|
|
150
|
+
* What a frameworks folder lacks of SDWebImage's signature and privacy
|
|
151
|
+
* manifest. A folder from before build 4 has the SDWebImage compiled from its
|
|
152
|
+
* pod, without either. The app builds and runs with it, and App Store Connect
|
|
153
|
+
* then rejects it (ITMS-91061, ITMS-91065), so nothing should link it.
|
|
154
|
+
*/
|
|
155
|
+
const missingSdWebImageFiles = (dir) => [
|
|
156
|
+
'SDWebImage.xcframework/_CodeSignature',
|
|
157
|
+
'SDWebImage.xcframework/ios-arm64/SDWebImage.framework/PrivacyInfo.xcprivacy',
|
|
158
|
+
].filter((file) => !existsSync(path.join(dir, file)));
|
|
128
159
|
/** The Lynx version a frameworks folder was built from, if it says. */
|
|
129
160
|
export const readFrameworksVersion = (dir) => {
|
|
130
161
|
const versions = path.join(dir, 'VERSIONS');
|
package/dist/ios/project.d.ts
CHANGED
|
@@ -4,22 +4,130 @@ import { type ResolvedApp } from '../options.ts';
|
|
|
4
4
|
* Writes the app options into the iOS template: build settings go in
|
|
5
5
|
* Config/App.xcconfig (which App.xcodeproj reads), Info.plist entries go
|
|
6
6
|
* between the template's `angular-lynx:info` markers, the shortcuts
|
|
7
|
-
* become App/AppShortcuts.swift, the
|
|
8
|
-
* Config/App.entitlements, and the icon and the splash go in the asset
|
|
9
|
-
* catalog.
|
|
7
|
+
* become App/AppShortcuts.swift, the options that need a capability
|
|
8
|
+
* (IOS_ENTITLEMENTS) become Config/App.entitlements, and the icon and the splash go in the asset
|
|
9
|
+
* catalog. The barcode scanner's module stays only in an app with the
|
|
10
|
+
* `camera` permission, the Bluetooth module only in an app with the
|
|
11
|
+
* `bluetooth` permission, the store review module only in an app with
|
|
12
|
+
* `storeReview`, the calendar module only in one with `calendar`, the
|
|
13
|
+
* Sign in with Apple module only in one with `signInWithApple`, the
|
|
14
|
+
* tracking module only in one with `permissions.tracking`, the NFC module
|
|
15
|
+
* only in one with `permissions.nfc`, the motion module only in one with
|
|
16
|
+
* `motion`, the Share Extension, its target and
|
|
17
|
+
* its module only in one with `shareTarget`, and the Wi-Fi module only in
|
|
18
|
+
* one with `wifi`, with only the parts it turns on.
|
|
10
19
|
*/
|
|
20
|
+
/** LynxBarcodeScanner's module, which needs the `camera` permission. */
|
|
21
|
+
export declare const IOS_BARCODE_SCANNER_SOURCE = "App/BarcodeScannerModule.swift";
|
|
11
22
|
export declare const iosGenerator: PlatformGenerator;
|
|
23
|
+
/** The module behind `LynxStoreReview`, which only `storeReview` keeps. */
|
|
24
|
+
export declare const IOS_STORE_REVIEW_SOURCE = "App/StoreReviewModule.swift";
|
|
25
|
+
/** The module behind `LynxCalendar`, which only `calendar` keeps. */
|
|
26
|
+
export declare const IOS_CALENDAR_SOURCE = "App/CalendarModule.swift";
|
|
27
|
+
/**
|
|
28
|
+
* The module behind `LynxAppleSignIn` and the `<apple-sign-in-button>`
|
|
29
|
+
* element, which only `signInWithApple` keeps.
|
|
30
|
+
*/
|
|
31
|
+
export declare const IOS_APPLE_SIGN_IN_SOURCES: readonly ["App/AppleSignInModule.swift", "App/AppleSignInButton.swift"];
|
|
32
|
+
/** The module behind `LynxNfc`, which only `permissions.nfc` keeps. */
|
|
33
|
+
export declare const IOS_NFC_SOURCE = "App/NfcModule.swift";
|
|
34
|
+
/** The module behind `LynxWifi`, which only `wifi` keeps. */
|
|
35
|
+
export declare const IOS_WIFI_SOURCE = "App/WifiModule.swift";
|
|
36
|
+
/** The module behind `LynxMotion`, which only `motion` keeps. */
|
|
37
|
+
export declare const IOS_MOTION_SOURCE = "App/MotionModule.swift";
|
|
38
|
+
/**
|
|
39
|
+
* The module behind `LynxTracking`, which only an app with
|
|
40
|
+
* `permissions.tracking` keeps.
|
|
41
|
+
*/
|
|
42
|
+
export declare const IOS_TRACKING_SOURCE = "App/TrackingModule.swift";
|
|
43
|
+
/**
|
|
44
|
+
* The shell's biometrics module, `AngularLynxBiometrics` (LynxBiometrics, and
|
|
45
|
+
* the values LynxSecureStorage keeps behind Face ID or Touch ID), which only
|
|
46
|
+
* an app with `permissions.biometrics` keeps.
|
|
47
|
+
*/
|
|
48
|
+
export declare const IOS_BIOMETRICS_SOURCES: readonly ["App/BiometricsModule.swift"];
|
|
49
|
+
/**
|
|
50
|
+
* The shell's file picker module, `AngularLynxFilePicker` (LynxFilePicker),
|
|
51
|
+
* which only an app with `filePicker` keeps.
|
|
52
|
+
*/
|
|
53
|
+
export declare const IOS_FILE_PICKER_SOURCES: readonly ["App/FilePickerModule.swift"];
|
|
54
|
+
/**
|
|
55
|
+
* The shell's photo library module, `AngularLynxPhotoLibrary`
|
|
56
|
+
* (LynxPhotoLibrary), which only an app with `permissions.savePhotos` keeps.
|
|
57
|
+
*/
|
|
58
|
+
export declare const IOS_PHOTO_LIBRARY_SOURCES: readonly ["App/PhotoLibraryModule.swift"];
|
|
59
|
+
/**
|
|
60
|
+
* The shell's `<canvas>`, its `AngularLynxWebGL` module and its contexts, and
|
|
61
|
+
* `<video>`'s readable frames: about 176 kB of the executable. Swift reaches
|
|
62
|
+
* them only by name (NSClassFromString in LynxViewController and
|
|
63
|
+
* XElementRegistry), so without them the shell registers no canvas, keeps
|
|
64
|
+
* XElement's own `<video>`, and still builds: App/ is a synchronized folder,
|
|
65
|
+
* which compiles what's in it.
|
|
66
|
+
*/
|
|
67
|
+
export declare const IOS_CANVAS_SOURCES: readonly ["App/AngularLynxBitmapRendererContext.m", "App/AngularLynxCanvas2DContext.m", "App/AngularLynxCanvas2DOps.h", "App/AngularLynxVideo.h", "App/AngularLynxVideo.m", "App/AngularLynxWebGL.h", "App/AngularLynxWebGL.m", "App/AngularLynxWebGLContext.m", "App/AngularLynxWebGLOps.h"];
|
|
68
|
+
/**
|
|
69
|
+
* The WebGL2 context, which an app that draws only in 2D leaves out with
|
|
70
|
+
* ANGLE (issue #847).
|
|
71
|
+
*/
|
|
72
|
+
export declare const IOS_WEBGL_SOURCES: readonly ["App/AngularLynxWebGLContext.m", "App/AngularLynxWebGLOps.h"];
|
|
73
|
+
/**
|
|
74
|
+
* The project without the XCFrameworks named, which it then neither links
|
|
75
|
+
* nor embeds: ANGLE's, about 6 MB of an app, are only for WebGL. Each
|
|
76
|
+
* reference to a framework is one line of the project (its file, its build
|
|
77
|
+
* files, and their places in the group, the link phase and the embed phase).
|
|
78
|
+
*/
|
|
79
|
+
export declare const withoutFrameworks: (project: string, frameworks: readonly string[]) => string;
|
|
80
|
+
/**
|
|
81
|
+
* An entitlement's value, in the shapes Apple's entitlements take: a flag
|
|
82
|
+
* (`com.apple.developer.siri`), a string (`aps-environment`), or a list
|
|
83
|
+
* of strings (`com.apple.developer.associated-domains`).
|
|
84
|
+
*/
|
|
85
|
+
export type EntitlementValue = boolean | string | readonly string[];
|
|
86
|
+
/** The entitlements one option adds, by key. */
|
|
87
|
+
export type Entitlements = Readonly<Record<string, EntitlementValue>>;
|
|
88
|
+
/**
|
|
89
|
+
* Each option that needs an iOS capability, and the entitlements it adds to
|
|
90
|
+
* Config/App.entitlements. A feature that needs one (Wi-Fi, in-app
|
|
91
|
+
* purchases, push...) adds its entry here, rather than writing the file: the generator
|
|
92
|
+
* writes the file, and points the target at it, only when an entry adds
|
|
93
|
+
* something, and {@link mergeEntitlements} joins two options' lists under
|
|
94
|
+
* the same key, as Associated Domains holds both `applinks:` and
|
|
95
|
+
* `webcredentials:` domains.
|
|
96
|
+
*/
|
|
97
|
+
export declare const IOS_ENTITLEMENTS: readonly {
|
|
98
|
+
/** The angular.json option, named in the file's header and in errors. */
|
|
99
|
+
readonly option: string;
|
|
100
|
+
/**
|
|
101
|
+
* The capability's name as Xcode's signing errors give it, such as
|
|
102
|
+
* "Personal development teams ... do not support the Associated Domains
|
|
103
|
+
* capability", so the build can say which option to change.
|
|
104
|
+
*/
|
|
105
|
+
readonly capability: string;
|
|
106
|
+
readonly entitlements: (app: ResolvedApp) => Entitlements;
|
|
107
|
+
}[];
|
|
108
|
+
/**
|
|
109
|
+
* Joins the entitlements several options add into one dictionary, its keys
|
|
110
|
+
* sorted, as Xcode writes them. Two lists under one key become one, each
|
|
111
|
+
* value once, in the order the options name them. Two different flags or
|
|
112
|
+
* strings under one key can't both be signed, so they throw, naming the
|
|
113
|
+
* options.
|
|
114
|
+
*/
|
|
115
|
+
export declare const mergeEntitlements: (contributions: readonly {
|
|
116
|
+
readonly option: string;
|
|
117
|
+
readonly entitlements: Entitlements;
|
|
118
|
+
}[]) => Entitlements;
|
|
119
|
+
/** The app's entitlements, from every option that adds some. */
|
|
120
|
+
export declare const iosEntitlements: (app: ResolvedApp) => Entitlements;
|
|
12
121
|
export declare const xcconfig: (app: ResolvedApp) => string;
|
|
13
122
|
/**
|
|
14
|
-
* Config/App.entitlements: the
|
|
15
|
-
*
|
|
16
|
-
* once the domain's apple-app-site-association names the app (see
|
|
17
|
-
* appLinkFiles). iOS fetches that file through Apple's CDN when the app is
|
|
18
|
-
* installed.
|
|
123
|
+
* Config/App.entitlements: the capabilities the app's options ask for
|
|
124
|
+
* ({@link IOS_ENTITLEMENTS}), merged.
|
|
19
125
|
*
|
|
20
|
-
* Signing
|
|
21
|
-
* Personal Team can't sign Associated Domains
|
|
22
|
-
*
|
|
126
|
+
* Signing most of them needs a team in the paid Apple Developer Program: a
|
|
127
|
+
* free Personal Team can't sign Associated Domains, Sign in with Apple, NFC
|
|
128
|
+
* Tag Reading or App Groups (explainSigningFailure in build.ts names the
|
|
129
|
+
* option). The simulator app
|
|
130
|
+
* needs no team.
|
|
23
131
|
*/
|
|
24
132
|
export declare const entitlementsPlist: (app: ResolvedApp) => string;
|
|
25
133
|
/** What iOS shows the first time someone taps Save Image, without `savePhotos`. */
|
|
@@ -47,4 +155,58 @@ export declare const infoPlistEntries: (app: ResolvedApp, { development }?: {
|
|
|
47
155
|
* stores a saved shortcut under, so it comes from the ID alone.
|
|
48
156
|
*/
|
|
49
157
|
export declare const appShortcutsSwift: (app: ResolvedApp) => string;
|
|
158
|
+
/** LynxShareTarget's module in the app, which only `shareTarget` keeps. */
|
|
159
|
+
export declare const IOS_SHARE_TARGET_SOURCE = "App/ShareTargetModule.swift";
|
|
160
|
+
/**
|
|
161
|
+
* The Share Extension's folder: the extension's code and its Info.plist,
|
|
162
|
+
* which only `shareTarget` keeps, with the target the generator adds to the
|
|
163
|
+
* project for it ({@link withShareExtension}).
|
|
164
|
+
*/
|
|
165
|
+
export declare const IOS_SHARE_EXTENSION_DIR = "ShareExtension";
|
|
166
|
+
/**
|
|
167
|
+
* The App Group the app and its Share Extension share, where the extension
|
|
168
|
+
* leaves each share for the app: `group.` and the app's bundle ID, as Xcode
|
|
169
|
+
* names a new group.
|
|
170
|
+
*/
|
|
171
|
+
export declare const shareGroup: (app: ResolvedApp) => string;
|
|
172
|
+
/**
|
|
173
|
+
* The URL scheme the Share Extension opens the app with once it has left a
|
|
174
|
+
* share: one of the app's own, from its bundle ID, so no other app answers
|
|
175
|
+
* to it. SceneDelegate takes it for the share, never for a deep link.
|
|
176
|
+
*/
|
|
177
|
+
export declare const shareScheme: (app: ResolvedApp) => string;
|
|
178
|
+
/**
|
|
179
|
+
* The activation rule's keys for `mimeTypes`: which kinds of things in a
|
|
180
|
+
* share sheet show the app. Apple's rule can't name a MIME type, only kinds,
|
|
181
|
+
* so a type that isn't text, a link, an image or a video allows files, and
|
|
182
|
+
* the extension then checks each file's own type against the list.
|
|
183
|
+
*/
|
|
184
|
+
export declare const shareActivationRule: (mimeTypes: readonly string[]) => Record<string, boolean | number>;
|
|
185
|
+
/**
|
|
186
|
+
* The Share Extension's Info.plist entries, between its template's
|
|
187
|
+
* `angular-lynx:share-extension` markers: the extension point, the
|
|
188
|
+
* activation rule for `mimeTypes`, and what the extension reads (the types,
|
|
189
|
+
* the App Group and the app's share scheme).
|
|
190
|
+
*/
|
|
191
|
+
export declare const shareExtensionPlistEntries: (app: ResolvedApp) => string;
|
|
192
|
+
/**
|
|
193
|
+
* Config/ShareExtension.entitlements: the App Group alone, which is all the
|
|
194
|
+
* extension needs to leave a share where the app reads it.
|
|
195
|
+
*/
|
|
196
|
+
export declare const shareExtensionEntitlementsPlist: (app: ResolvedApp) => string;
|
|
197
|
+
/**
|
|
198
|
+
* The project with the Share Extension's target added: built from the
|
|
199
|
+
* synchronized ShareExtension/ folder, embedded in the app (Embed Foundation
|
|
200
|
+
* Extensions), and built before it. The target reads App.xcconfig, as the
|
|
201
|
+
* app's does, for the version, the team and the display name, and has
|
|
202
|
+
* settings of its own for its bundle ID (the app's, then `.ShareExtension`,
|
|
203
|
+
* as Apple requires), its Info.plist and its entitlements. It links none of
|
|
204
|
+
* Lynx's frameworks: it can't run Lynx.
|
|
205
|
+
*
|
|
206
|
+
* Xcode's project format has no includes, so the target's objects are
|
|
207
|
+
* written into the sections they belong to, and each list that names them
|
|
208
|
+
* (the project's targets, the app's build phases and dependencies, the
|
|
209
|
+
* groups) gets a line after a line of the template's it must find once.
|
|
210
|
+
*/
|
|
211
|
+
export declare const withShareExtension: (project: string, app: ResolvedApp) => string;
|
|
50
212
|
//# sourceMappingURL=project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/ios/project.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"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