@nativescript/ios 9.1.0-alpha.19 → 9.1.0-alpha.20
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/framework/__PROJECT_NAME__.xcodeproj/project.pbxproj +1 -1
- package/framework/internal/metadata-generator-arm64/bin/build-step-metadata-generator.py +11 -1
- package/framework/internal/metadata-generator-arm64/bin/objc-metadata-generator +0 -0
- package/framework/internal/metadata-generator-x86_64/bin/build-step-metadata-generator.py +11 -1
- package/framework/internal/metadata-generator-x86_64/bin/objc-metadata-generator +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +7 -5
- package/types/ns-nativeclass.d.ts +43 -0
- package/types/ns-runtime.d.ts +15 -1
|
@@ -85,13 +85,23 @@ conf_build_dir = env("CONFIGURATION_BUILD_DIR")
|
|
|
85
85
|
sdk_root = env("SDKROOT")
|
|
86
86
|
src_root = env("SRCROOT")
|
|
87
87
|
deployment_target_flag_name = env_or_empty("DEPLOYMENT_TARGET_CLANG_FLAG_NAME") or default_deployment_target_flag_name
|
|
88
|
-
|
|
88
|
+
# Xcode does not export MACCATALYST_DEPLOYMENT_TARGET unless the project sets it,
|
|
89
|
+
# so fall back to the iOS deployment target rather than dying with a KeyError.
|
|
90
|
+
deployment_target = env_or_none(env_or_empty("DEPLOYMENT_TARGET_CLANG_ENV_NAME") or default_deployment_target_clang_env_name) \
|
|
91
|
+
or env("IPHONEOS_DEPLOYMENT_TARGET")
|
|
89
92
|
std = env("GCC_C_LANGUAGE_STANDARD")
|
|
90
93
|
header_search_paths = env_or_empty("HEADER_SEARCH_PATHS")
|
|
91
94
|
header_search_paths_parsed = map_and_list((lambda s: "-I" + s), shlex.split(header_search_paths))
|
|
92
95
|
framework_search_paths = shlex.split(env_or_empty("FRAMEWORK_SEARCH_PATHS"))
|
|
93
96
|
# Add extra framework search path for newer Xcode versions
|
|
94
97
|
framework_search_paths.append(os.path.join(sdk_root, "System/Library/SubFrameworks"))
|
|
98
|
+
if effective_platform_name == "-maccatalyst":
|
|
99
|
+
# UIKit and the rest of the iOS-flavoured frameworks live under iOSSupport in
|
|
100
|
+
# the macOS SDK. Xcode passes these to the real compile via -iframework, which
|
|
101
|
+
# never reaches FRAMEWORK_SEARCH_PATHS, so without them the generated metadata
|
|
102
|
+
# contains no UIKit at all ("ReferenceError: UIDevice is not defined").
|
|
103
|
+
framework_search_paths.append(os.path.join(sdk_root, "System/iOSSupport/System/Library/Frameworks"))
|
|
104
|
+
framework_search_paths.append(os.path.join(sdk_root, "System/iOSSupport/System/Library/SubFrameworks"))
|
|
95
105
|
framework_search_paths_parsed = map_and_list((lambda s: "-F" + s), framework_search_paths)
|
|
96
106
|
other_cflags = env_or_empty("OTHER_CFLAGS")
|
|
97
107
|
other_cflags_parsed = shlex.split(other_cflags)
|
|
Binary file
|
|
@@ -85,13 +85,23 @@ conf_build_dir = env("CONFIGURATION_BUILD_DIR")
|
|
|
85
85
|
sdk_root = env("SDKROOT")
|
|
86
86
|
src_root = env("SRCROOT")
|
|
87
87
|
deployment_target_flag_name = env_or_empty("DEPLOYMENT_TARGET_CLANG_FLAG_NAME") or default_deployment_target_flag_name
|
|
88
|
-
|
|
88
|
+
# Xcode does not export MACCATALYST_DEPLOYMENT_TARGET unless the project sets it,
|
|
89
|
+
# so fall back to the iOS deployment target rather than dying with a KeyError.
|
|
90
|
+
deployment_target = env_or_none(env_or_empty("DEPLOYMENT_TARGET_CLANG_ENV_NAME") or default_deployment_target_clang_env_name) \
|
|
91
|
+
or env("IPHONEOS_DEPLOYMENT_TARGET")
|
|
89
92
|
std = env("GCC_C_LANGUAGE_STANDARD")
|
|
90
93
|
header_search_paths = env_or_empty("HEADER_SEARCH_PATHS")
|
|
91
94
|
header_search_paths_parsed = map_and_list((lambda s: "-I" + s), shlex.split(header_search_paths))
|
|
92
95
|
framework_search_paths = shlex.split(env_or_empty("FRAMEWORK_SEARCH_PATHS"))
|
|
93
96
|
# Add extra framework search path for newer Xcode versions
|
|
94
97
|
framework_search_paths.append(os.path.join(sdk_root, "System/Library/SubFrameworks"))
|
|
98
|
+
if effective_platform_name == "-maccatalyst":
|
|
99
|
+
# UIKit and the rest of the iOS-flavoured frameworks live under iOSSupport in
|
|
100
|
+
# the macOS SDK. Xcode passes these to the real compile via -iframework, which
|
|
101
|
+
# never reaches FRAMEWORK_SEARCH_PATHS, so without them the generated metadata
|
|
102
|
+
# contains no UIKit at all ("ReferenceError: UIDevice is not defined").
|
|
103
|
+
framework_search_paths.append(os.path.join(sdk_root, "System/iOSSupport/System/Library/Frameworks"))
|
|
104
|
+
framework_search_paths.append(os.path.join(sdk_root, "System/iOSSupport/System/Library/SubFrameworks"))
|
|
95
105
|
framework_search_paths_parsed = map_and_list((lambda s: "-F" + s), framework_search_paths)
|
|
96
106
|
other_cflags = env_or_empty("OTHER_CFLAGS")
|
|
97
107
|
other_cflags_parsed = shlex.split(other_cflags)
|
|
Binary file
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// Type declarations for the runtime's public `ns:` builtin modules
|
|
2
|
-
// .d.ts per module, mirroring @types/node's layout and the "one module, one
|
|
3
|
-
// source file" rule in docs/ns-builtin-modules.md
|
|
4
|
-
// stay in sync with that document
|
|
5
|
-
//
|
|
1
|
+
// Type declarations for the runtime's public surfaces — `ns:` builtin modules
|
|
2
|
+
// (one .d.ts per module, mirroring @types/node's layout and the "one module, one
|
|
3
|
+
// source file" rule in docs/ns-builtin-modules.md) and globals such as
|
|
4
|
+
// NativeClass. The `ns:` surfaces must stay in sync with that document
|
|
5
|
+
// (NsRuntimeTests.js / NsUtilTests.js / HttpEsmLoaderTests.js assert the
|
|
6
|
+
// export sets at runtime).
|
|
6
7
|
//
|
|
7
8
|
// `ns:` is not a resolvable package specifier, so these are ambient
|
|
8
9
|
// declarations: they apply program-wide once this file is in the TypeScript
|
|
@@ -25,3 +26,4 @@
|
|
|
25
26
|
/// <reference path="./ns-module.d.ts" />
|
|
26
27
|
/// <reference path="./ns-runtime.d.ts" />
|
|
27
28
|
/// <reference path="./ns-util.d.ts" />
|
|
29
|
+
/// <reference path="./ns-nativeclass.d.ts" />
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorates a class that extends a native type. All properties are optional.
|
|
3
|
+
* This runtime implements the `ios` side; `android` is accepted and ignored.
|
|
4
|
+
*
|
|
5
|
+
* `@NativeClass` and `@NativeClass({ ios: { ... } })` are both valid.
|
|
6
|
+
* Passing the class directly (`NativeClass(MyClass)`) applies empty options.
|
|
7
|
+
* On worker isolates this is a no-op; only the main isolate registers
|
|
8
|
+
* native ES classes.
|
|
9
|
+
*/
|
|
10
|
+
interface NativeClassIOSMethodSignature {
|
|
11
|
+
returns?: any;
|
|
12
|
+
params?: any[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface NativeClassIOSOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Objective-C class name to register eagerly. When omitted, the ES class
|
|
18
|
+
* name is used and registration stays lazy until first native use.
|
|
19
|
+
*/
|
|
20
|
+
name?: string;
|
|
21
|
+
protocols?: any[];
|
|
22
|
+
/**
|
|
23
|
+
* Maps to `static ObjCExposedMethods`. Keys are Objective-C selectors.
|
|
24
|
+
*/
|
|
25
|
+
methods?: { [selector: string]: NativeClassIOSMethodSignature };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface NativeClassAndroidOptions {
|
|
29
|
+
name?: string;
|
|
30
|
+
interfaces?: any[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface NativeClassOptions {
|
|
34
|
+
ios?: NativeClassIOSOptions;
|
|
35
|
+
android?: NativeClassAndroidOptions;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare function NativeClass<T extends { new (...args: any[]): {} }>(
|
|
39
|
+
constructor: T
|
|
40
|
+
): T;
|
|
41
|
+
declare function NativeClass(
|
|
42
|
+
options?: NativeClassOptions
|
|
43
|
+
): <T extends { new (...args: any[]): {} }>(constructor: T) => T;
|
package/types/ns-runtime.d.ts
CHANGED
|
@@ -21,6 +21,18 @@ declare module "ns:runtime" {
|
|
|
21
21
|
*/
|
|
22
22
|
export interface RuntimeConfig {
|
|
23
23
|
releasedObjectPolicy: ReleasedObjectPolicy;
|
|
24
|
+
/**
|
|
25
|
+
* Verbose script/module-loading diagnostics. Boot default is the
|
|
26
|
+
* `logScriptLoading` value from nativescript.config / package.json
|
|
27
|
+
* (`false` when absent). Process-wide; main-isolate writes only.
|
|
28
|
+
*/
|
|
29
|
+
logScriptLoading: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* One log line per HTTP fetch URL (high volume). Boot default is the
|
|
32
|
+
* `httpFetchUrlLog` value from nativescript.config / package.json
|
|
33
|
+
* (`false` when absent). Process-wide; main-isolate writes only.
|
|
34
|
+
*/
|
|
35
|
+
httpFetchUrlLog: boolean;
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
/**
|
|
@@ -28,7 +40,9 @@ declare module "ns:runtime" {
|
|
|
28
40
|
*
|
|
29
41
|
* Throws `TypeError` on an unknown key, an invalid value, or — for
|
|
30
42
|
* process-wide keys such as `releasedObjectPolicy` — when called from a
|
|
31
|
-
* worker isolate.
|
|
43
|
+
* worker isolate. Remote-module security (`security.allowRemoteModules`,
|
|
44
|
+
* `security.remoteModuleAllowlist`) is not a runtime config key: it is
|
|
45
|
+
* read once from nativescript.config at boot and cannot be changed here.
|
|
32
46
|
*/
|
|
33
47
|
export function setConfig<K extends keyof RuntimeConfig | (string & {})>(
|
|
34
48
|
key: K,
|