@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.
@@ -505,7 +505,7 @@
505
505
  repositoryURL = "https://github.com/NativeScript/ios-spm.git";
506
506
  requirement = {
507
507
  kind = exactVersion;
508
- version = "9.1.0-alpha.19";
508
+ version = "9.1.0-alpha.20";
509
509
  };
510
510
  };
511
511
  /* End XCRemoteSwiftPackageReference section */
@@ -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
- deployment_target = env(env_or_empty("DEPLOYMENT_TARGET_CLANG_ENV_NAME") or default_deployment_target_clang_env_name)
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)
@@ -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
- deployment_target = env(env_or_empty("DEPLOYMENT_TARGET_CLANG_ENV_NAME") or default_deployment_target_clang_env_name)
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)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nativescript/ios",
3
3
  "description": "NativeScript Runtime for iOS",
4
- "version": "9.1.0-alpha.19",
4
+ "version": "9.1.0-alpha.20",
5
5
  "keywords": [
6
6
  "NativeScript",
7
7
  "iOS",
package/types/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- // Type declarations for the runtime's public `ns:` builtin modules — one
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. The declared surfaces must
4
- // stay in sync with that document (NsRuntimeTests.js / NsUtilTests.js /
5
- // HttpEsmLoaderTests.js assert the export sets at runtime).
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;
@@ -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,