@nativescript/core 9.1.1 → 9.1.2-rc.0

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.
@@ -1,9 +1,7 @@
1
- import semver from 'semver';
2
-
3
1
  const webpackPackageName = "@nativescript/webpack";
4
2
 
5
3
  export default function ($staticConfig, hookArgs) {
6
- const cliVersion = semver.parse($staticConfig.version);
4
+ const cliVersion = parseMajorMinor($staticConfig.version);
7
5
  const platform = hookArgs.prepareData.platform;
8
6
  const projectData = hookArgs.projectData;
9
7
 
@@ -24,7 +22,20 @@ export default function ($staticConfig, hookArgs) {
24
22
  };
25
23
 
26
24
  /**
27
- * Checks if semver object satisifies a major/minor requirement. Pre-release versions are OK too!
25
+ * First `major.minor` in a version or range ("7.1.2", "~7.1.0", "^7.1", ">=7.1.0 <8"),
26
+ * which for the ranges package.json uses is the lower bound. Returns null when there is
27
+ * none (tags such as "next" or "rc"); the checks treat that as satisfied.
28
+ *
29
+ * This file runs from the app's node_modules, where only @nativescript/core's own
30
+ * dependencies are guaranteed to exist, so it must not import any package.
31
+ */
32
+ function parseMajorMinor(version) {
33
+ const match = /(\d+)\.(\d+)/.exec(String(version || ""));
34
+ return match ? { major: Number(match[1]), minor: Number(match[2]) } : null;
35
+ }
36
+
37
+ /**
38
+ * Checks if a parsed version satisifies a major/minor requirement. Pre-release versions are OK too!
28
39
  */
29
40
  function satisfiesRequiredVersion(actualVersion, requiredMajor, requiredMinor) {
30
41
  // Return true for null version to handle tags (ex. "next", "rc")
@@ -46,15 +57,5 @@ function satisfiesRequiredVersion(actualVersion, requiredMajor, requiredMinor) {
46
57
  function getMinWebpackVersion(projectData) {
47
58
  const devDependencies = projectData.devDependencies || {};
48
59
  const dependencies = projectData.dependencies || {};
49
- const webpackVer = dependencies[webpackPackageName] || devDependencies[webpackPackageName];
50
-
51
- let webpackMinVer = null;
52
-
53
- if (semver.valid(webpackVer)) {
54
- webpackMinVer = semver.parse(webpackVer);
55
- } else if (semver.validRange(webpackVer)) {
56
- webpackMinVer = semver.minVersion(webpackVer);
57
- }
58
-
59
- return webpackMinVer;
60
- }
60
+ return parseMajorMinor(dependencies[webpackPackageName] || devDependencies[webpackPackageName]);
61
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/core",
3
- "version": "9.1.1",
3
+ "version": "9.1.2-rc.0",
4
4
  "description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
5
5
  "type": "module",
6
6
  "main": "index",
package/references.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!CFNetwork.d.ts" />
3
3
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!CoreText.d.ts" />
4
4
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!Darwin.d.ts" />
5
+ /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!Security.d.ts" />
5
6
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!_DarwinFoundation1.d.ts" />
6
7
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!_DarwinFoundation2.d.ts" />
7
8
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!_DarwinFoundation3.d.ts" />
@@ -21,10 +21,14 @@ export class Crypto {
21
21
  org.nativescript.winter_tc.Crypto.getRandomValues(bytes);
22
22
  }
23
23
  if (__IOS__) {
24
- // The pointer is V8-owned: freeWhenDone must stay NO, or Foundation and V8's
25
- // ArrayBufferSweeper both free the same allocation.
26
- const data = NSMutableData.dataWithBytesNoCopyLengthFreeWhenDone(bytes, bytes.byteLength, false);
27
- NSCCrypto.getRandomValues(data);
24
+ // The view goes to Security directly: the runtime hands over V8's backing store at
25
+ // the view's byte offset, so the bytes land in the caller's array. No NSData may
26
+ // sit in between — NSMutableData copies bytes it does not own, so a no-copy wrapper
27
+ // fills a private copy, and one that owns them frees V8's allocation.
28
+ const status = SecRandomCopyBytes(kSecRandomDefault, bytes.byteLength, bytes);
29
+ if (status !== errSecSuccess) {
30
+ throw new Error(`getRandomValues: SecRandomCopyBytes failed (${status})`);
31
+ }
28
32
  }
29
33
  return typedArray;
30
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/wgc/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;AAClC,MAAM,OAAO,MAAM;IAClB,IAAI,MAAM;QACT,OAAO,MAAM,CAAC;IACf,CAAC;IACD,UAAU;QACT,IAAI,WAAW,EAAE,CAAC;YACjB,OAAa,GAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC9D,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC,UAAU,EAAE,CAAC;QAC/B,CAAC;IACF,CAAC;IAED,eAAe,CAA6D,UAAa;QACxF,uFAAuF;QACvF,qFAAqF;QACrF,oCAAoC;QACpC,MAAM,KAAK,GAAG,UAAU,CAAC,iBAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QAEhJ,IAAI,WAAW,EAAE,CAAC;YACX,GAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACb,6EAA6E;YAC7E,oDAAoD;YACpD,MAAM,IAAI,GAAG,aAAa,CAAC,qCAAqC,CAAC,KAAc,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAE1G,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAA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