craft-native 0.0.203 → 0.0.204

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.
@@ -52,6 +52,7 @@ export interface CraftAndroidConfig {
52
52
  enableLocalNetwork?: boolean;
53
53
  urlSchemes?: string[];
54
54
  /** HTTPS hosts owned by the app; path rules are ordered, with `*` matching any path text. */
55
+ /** Ordered path rules: * matches zero or more characters, ? one, and ?* one or more. */
55
56
  appLinks?: Array<{
56
57
  host: string;
57
58
  paths?: Array<{
@@ -7,6 +7,14 @@ import androidx.browser.customtabs.CustomTabsClient
7
7
  import androidx.browser.customtabs.CustomTabsIntent
8
8
  import org.json.JSONObject
9
9
 
10
+ /** Match the path wildcards supported by website association files. */
11
+ internal fun craftAppLinkPathMatches(pattern: String, path: String): Boolean {
12
+ val regex = pattern.split('*').joinToString(".*") { part ->
13
+ part.split('?').joinToString(".") { Regex.escape(it) }
14
+ }
15
+ return Regex("^$regex$").matches(path)
16
+ }
17
+
10
18
  /** Ordered website path rules, also publishable as Android 15 dynamic App Links. */
11
19
  internal object CraftAppLinks {
12
20
  fun opensInBrowser(config: JSONObject?, uri: Uri): Boolean {
@@ -20,8 +28,7 @@ internal object CraftAppLinks {
20
28
  for (ruleIndex in 0 until rules.length()) {
21
29
  val rule = rules.optJSONObject(ruleIndex) ?: continue
22
30
  val pattern = rule.optString("pattern")
23
- val regex = pattern.split('*').joinToString(".*") { Regex.escape(it) }
24
- if (Regex("^$regex$").matches(path)) return rule.optBoolean("exclude", false)
31
+ if (craftAppLinkPathMatches(pattern, path)) return rule.optBoolean("exclude", false)
25
32
  }
26
33
  return true
27
34
  }
package/dist/cli.js CHANGED
@@ -3424,7 +3424,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3424
3424
  `);
3425
3425
  }
3426
3426
  // package.json
3427
- var version = "0.0.203";
3427
+ var version = "0.0.204";
3428
3428
 
3429
3429
  // bin/cli.ts
3430
3430
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -309,7 +309,7 @@ function craftBinaryNotFoundMessage(triedPath) {
309
309
  `);
310
310
  }
311
311
  // package.json
312
- var version = "0.0.203";
312
+ var version = "0.0.204";
313
313
 
314
314
  // src/sdk-version.ts
315
315
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ function craftBinaryNotFoundMessage(triedPath) {
57
57
  `);
58
58
  }
59
59
  // package.json
60
- var version = "0.0.203";
60
+ var version = "0.0.204";
61
61
 
62
62
  // src/sdk-version.ts
63
63
  var SDK_VERSION = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.203",
3
+ "version": "0.0.204",
4
4
  "type": "module",
5
5
  "description": "Build desktop apps with web languages - TypeScript SDK for Craft",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",