expo-manifests 0.8.1 → 0.9.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.
package/.eslintrc.js ADDED
@@ -0,0 +1,2 @@
1
+ // @generated by expo-module-scripts
2
+ module.exports = require('expo-module-scripts/eslintrc.base.js');
package/CHANGELOG.md CHANGED
@@ -10,6 +10,17 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.9.0 — 2023-09-04
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - Remove classic manifest types. ([#24053](https://github.com/expo/expo/pull/24053) by [@wschurman](https://github.com/wschurman))
18
+
19
+ ### 🎉 New features
20
+
21
+ - Added support for React Native 0.73. ([#24018](https://github.com/expo/expo/pull/24018) by [@kudo](https://github.com/kudo))
22
+ - Make expo-manifests source of truth for manifest TS types. ([#24049](https://github.com/expo/expo/pull/24049) by [@wschurman](https://github.com/wschurman))
23
+
13
24
  ## 0.8.1 — 2023-08-02
14
25
 
15
26
  ### 🛠 Breaking changes
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '0.8.1'
6
+ version = '0.9.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -53,13 +53,16 @@ afterEvaluate {
53
53
  android {
54
54
  compileSdkVersion safeExtGet("compileSdkVersion", 33)
55
55
 
56
- compileOptions {
57
- sourceCompatibility JavaVersion.VERSION_11
58
- targetCompatibility JavaVersion.VERSION_11
59
- }
56
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
57
+ if (agpVersion.tokenize('.')[0].toInteger() < 8) {
58
+ compileOptions {
59
+ sourceCompatibility JavaVersion.VERSION_11
60
+ targetCompatibility JavaVersion.VERSION_11
61
+ }
60
62
 
61
- kotlinOptions {
62
- jvmTarget = JavaVersion.VERSION_11.majorVersion
63
+ kotlinOptions {
64
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
65
+ }
63
66
  }
64
67
 
65
68
  namespace "expo.modules.manifests"
@@ -67,7 +70,7 @@ android {
67
70
  minSdkVersion safeExtGet("minSdkVersion", 21)
68
71
  targetSdkVersion safeExtGet("targetSdkVersion", 33)
69
72
  versionCode 31
70
- versionName '0.8.1'
73
+ versionName '0.9.0'
71
74
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
72
75
  }
73
76
  lintOptions {
@@ -0,0 +1,70 @@
1
+ import { ExpoConfig } from '@expo/config-types';
2
+ export interface ManifestAsset {
3
+ url: string;
4
+ }
5
+ export type ManifestExtra = ClientScopingConfig & {
6
+ expoClient?: ExpoConfig & {
7
+ /**
8
+ * Only present during development using @expo/cli.
9
+ */
10
+ hostUri?: string;
11
+ };
12
+ expoGo?: ExpoGoConfig;
13
+ eas?: EASConfig;
14
+ };
15
+ export type EASConfig = {
16
+ /**
17
+ * The ID for this project if it's using EAS. UUID. This value will not change when a project is
18
+ * transferred between accounts or renamed.
19
+ */
20
+ projectId?: string;
21
+ };
22
+ export type ClientScopingConfig = {
23
+ /**
24
+ * An opaque unique string for scoping client-side data to this project. This value
25
+ * will not change when a project is transferred between accounts or renamed.
26
+ */
27
+ scopeKey?: string;
28
+ };
29
+ export type ExpoGoConfig = {
30
+ mainModuleName?: string;
31
+ debuggerHost?: string;
32
+ developer?: {
33
+ tool?: string;
34
+ [key: string]: any;
35
+ };
36
+ packagerOpts?: ExpoGoPackagerOpts;
37
+ };
38
+ export type ExpoGoPackagerOpts = {
39
+ hostType?: string;
40
+ dev?: boolean;
41
+ strict?: boolean;
42
+ minify?: boolean;
43
+ urlType?: string;
44
+ urlRandomness?: string;
45
+ lanType?: string;
46
+ [key: string]: any;
47
+ };
48
+ /**
49
+ * A modern manifest.
50
+ */
51
+ export type NewManifest = {
52
+ id: string;
53
+ createdAt: string;
54
+ runtimeVersion: string;
55
+ launchAsset: ManifestAsset;
56
+ assets: ManifestAsset[];
57
+ metadata: object;
58
+ extra?: ManifestExtra;
59
+ };
60
+ /**
61
+ * An embedded bare manifest.
62
+ *
63
+ * Generated during build in createManifest.js build step script.
64
+ */
65
+ export type BareManifest = {
66
+ id: string;
67
+ commitTime: number;
68
+ assets: any[];
69
+ };
70
+ //# sourceMappingURL=Manifests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Manifests.d.ts","sourceRoot":"","sources":["../src/Manifests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IAChD,UAAU,CAAC,EAAE,UAAU,GAAG;QACxB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAGF,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,GAAG,EAAE,CAAC;CACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Manifests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Manifests.js","sourceRoot":"","sources":["../src/Manifests.ts"],"names":[],"mappings":"","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\n// @docsMissing\nexport interface ManifestAsset {\n url: string;\n}\n// @docsMissing\nexport type ManifestExtra = ClientScopingConfig & {\n expoClient?: ExpoConfig & {\n /**\n * Only present during development using @expo/cli.\n */\n hostUri?: string;\n };\n expoGo?: ExpoGoConfig;\n eas?: EASConfig;\n};\n\n// @needsAudit\nexport type EASConfig = {\n /**\n * The ID for this project if it's using EAS. UUID. This value will not change when a project is\n * transferred between accounts or renamed.\n */\n projectId?: string;\n};\n\n// @needsAudit\nexport type ClientScopingConfig = {\n /**\n * An opaque unique string for scoping client-side data to this project. This value\n * will not change when a project is transferred between accounts or renamed.\n */\n scopeKey?: string;\n};\n\n// @docsMissing\nexport type ExpoGoConfig = {\n mainModuleName?: string;\n debuggerHost?: string;\n developer?: {\n tool?: string;\n [key: string]: any;\n };\n packagerOpts?: ExpoGoPackagerOpts;\n};\n\n// @docsMissing\nexport type ExpoGoPackagerOpts = {\n hostType?: string;\n dev?: boolean;\n strict?: boolean;\n minify?: boolean;\n urlType?: string;\n urlRandomness?: string;\n lanType?: string;\n [key: string]: any;\n};\n\n/**\n * A modern manifest.\n */\nexport type NewManifest = {\n id: string;\n createdAt: string;\n runtimeVersion: string;\n launchAsset: ManifestAsset;\n assets: ManifestAsset[];\n metadata: object;\n extra?: ManifestExtra;\n};\n\n/**\n * An embedded bare manifest.\n *\n * Generated during build in createManifest.js build step script.\n */\nexport type BareManifest = {\n id: string;\n commitTime: number;\n assets: any[]; // intentionally underspecified for now since there are no uses in JS\n};\n"]}
package/package.json CHANGED
@@ -1,8 +1,19 @@
1
1
  {
2
2
  "name": "expo-manifests",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Code to parse and use Expo and Expo Updates manifests.",
5
- "main": "index.js",
5
+ "main": "build/Manifests.js",
6
+ "types": "build/Manifests.d.ts",
7
+ "sideEffects": false,
8
+ "scripts": {
9
+ "build": "expo-module build",
10
+ "clean": "expo-module clean",
11
+ "lint": "expo-module lint",
12
+ "test": "expo-module test",
13
+ "prepare": "expo-module prepare",
14
+ "prepublishOnly": "expo-module prepublishOnly",
15
+ "expo-module": "expo-module"
16
+ },
6
17
  "keywords": [
7
18
  "react-native",
8
19
  "expo",
@@ -19,8 +30,18 @@
19
30
  "author": "650 Industries, Inc.",
20
31
  "license": "MIT",
21
32
  "homepage": "https://docs.expo.dev/versions/latest/sdk/module-template",
33
+ "jest": {
34
+ "preset": "expo-module-scripts"
35
+ },
22
36
  "dependencies": {
23
- "expo-json-utils": "~0.8.0"
37
+ "expo-json-utils": "~0.9.0",
38
+ "@expo/config": "~8.3.0"
39
+ },
40
+ "devDependencies": {
41
+ "expo-module-scripts": "^3.0.0"
42
+ },
43
+ "peerDependencies": {
44
+ "expo": "*"
24
45
  },
25
- "gitHead": "2240630a92eb79a4e4bf73e1439916c394876478"
46
+ "gitHead": "79607a7325f47aa17c36d266100d09a4ff2cc544"
26
47
  }
@@ -0,0 +1,82 @@
1
+ import { ExpoConfig } from '@expo/config-types';
2
+
3
+ // @docsMissing
4
+ export interface ManifestAsset {
5
+ url: string;
6
+ }
7
+ // @docsMissing
8
+ export type ManifestExtra = ClientScopingConfig & {
9
+ expoClient?: ExpoConfig & {
10
+ /**
11
+ * Only present during development using @expo/cli.
12
+ */
13
+ hostUri?: string;
14
+ };
15
+ expoGo?: ExpoGoConfig;
16
+ eas?: EASConfig;
17
+ };
18
+
19
+ // @needsAudit
20
+ export type EASConfig = {
21
+ /**
22
+ * The ID for this project if it's using EAS. UUID. This value will not change when a project is
23
+ * transferred between accounts or renamed.
24
+ */
25
+ projectId?: string;
26
+ };
27
+
28
+ // @needsAudit
29
+ export type ClientScopingConfig = {
30
+ /**
31
+ * An opaque unique string for scoping client-side data to this project. This value
32
+ * will not change when a project is transferred between accounts or renamed.
33
+ */
34
+ scopeKey?: string;
35
+ };
36
+
37
+ // @docsMissing
38
+ export type ExpoGoConfig = {
39
+ mainModuleName?: string;
40
+ debuggerHost?: string;
41
+ developer?: {
42
+ tool?: string;
43
+ [key: string]: any;
44
+ };
45
+ packagerOpts?: ExpoGoPackagerOpts;
46
+ };
47
+
48
+ // @docsMissing
49
+ export type ExpoGoPackagerOpts = {
50
+ hostType?: string;
51
+ dev?: boolean;
52
+ strict?: boolean;
53
+ minify?: boolean;
54
+ urlType?: string;
55
+ urlRandomness?: string;
56
+ lanType?: string;
57
+ [key: string]: any;
58
+ };
59
+
60
+ /**
61
+ * A modern manifest.
62
+ */
63
+ export type NewManifest = {
64
+ id: string;
65
+ createdAt: string;
66
+ runtimeVersion: string;
67
+ launchAsset: ManifestAsset;
68
+ assets: ManifestAsset[];
69
+ metadata: object;
70
+ extra?: ManifestExtra;
71
+ };
72
+
73
+ /**
74
+ * An embedded bare manifest.
75
+ *
76
+ * Generated during build in createManifest.js build step script.
77
+ */
78
+ export type BareManifest = {
79
+ id: string;
80
+ commitTime: number;
81
+ assets: any[]; // intentionally underspecified for now since there are no uses in JS
82
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ // @generated by expo-module-scripts
2
+ {
3
+ "extends": "expo-module-scripts/tsconfig.base",
4
+ "compilerOptions": {
5
+ "outDir": "./build"
6
+ },
7
+ "include": ["./src"],
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9
+ }
@@ -1,64 +0,0 @@
1
- // Copyright 2015-present 650 Industries. All rights reserved.
2
-
3
- package expo.modules.manifests.core
4
-
5
- import com.google.common.truth.Truth
6
- import org.json.JSONObject
7
- import org.junit.Test
8
-
9
- class ManifestTest {
10
- @Test
11
- fun getPluginProperties_emptyManifest_returnsNull() {
12
- val manifestJson = JSONObject("{}")
13
- val manifest = Manifest.fromManifestJson(manifestJson)
14
- Truth.assertThat(manifest.getPluginProperties("test")).isNull()
15
- }
16
-
17
- @Test
18
- fun getPluginProperties_emptyPlugins_returnsNull() {
19
- val manifestJson = JSONObject("{\"plugins\": []}")
20
- val manifest = Manifest.fromManifestJson(manifestJson)
21
- Truth.assertThat(manifest.getPluginProperties("test")).isNull()
22
- }
23
-
24
- @Test
25
- fun getPluginProperties_nonMatchedPlugins_returnsNull() {
26
- val manifestJson = JSONObject("{\"plugins\": [\"hello\"]}")
27
- val manifest = Manifest.fromManifestJson(manifestJson)
28
- Truth.assertThat(manifest.getPluginProperties("test")).isNull()
29
- }
30
-
31
- @Test
32
- fun getPluginProperties_matchedPluginWithoutProps_returnsNull() {
33
- val manifestJson = JSONObject("{\"plugins\": [\"test\"]}")
34
- val manifest = Manifest.fromManifestJson(manifestJson)
35
- Truth.assertThat(manifest.getPluginProperties("test")).isNull()
36
- }
37
-
38
- @Test
39
- fun getPluginProperties_matchedPluginWithoutPropsAsNestedArray_returnsNull() {
40
- val manifestJson = JSONObject("{\"plugins\": [[\"test\"]]}")
41
- val manifest = Manifest.fromManifestJson(manifestJson)
42
- Truth.assertThat(manifest.getPluginProperties("test")).isNull()
43
- }
44
-
45
- @Test
46
- fun getPluginProperties_matchedPluginWithProps_returnsProps() {
47
- val props = mapOf<String, Any>("foo" to "bar")
48
- val manifestJson = JSONObject("{\"plugins\": [ [\"test\", {\"foo\":\"bar\"}] ]}")
49
- val manifest = Manifest.fromManifestJson(manifestJson)
50
- val result = manifest.getPluginProperties("test")
51
- Truth.assertThat(result).isNotNull()
52
- Truth.assertThat(result).containsExactlyEntriesIn(props)
53
- }
54
-
55
- @Test
56
- fun getPluginProperties_matchedPluginWithNestedProps_returnsNestedProps() {
57
- val props = mapOf<String, Any>("nested" to mapOf<String, Any>("insideNested" to true))
58
- val manifestJson = JSONObject("{\"plugins\":[[\"test\",{\"nested\":{\"insideNested\":true}}]]}")
59
- val manifest = Manifest.fromManifestJson(manifestJson)
60
- val result = manifest.getPluginProperties("test")
61
- Truth.assertThat(result).isNotNull()
62
- Truth.assertThat(result).containsExactlyEntriesIn(props)
63
- }
64
- }
@@ -1,46 +0,0 @@
1
- package expo.modules.manifests.core
2
-
3
- import org.json.JSONObject
4
- import org.junit.Assert
5
- import org.junit.Test
6
-
7
- class NewManifestTest {
8
- @Test
9
- @Throws(Exception::class)
10
- fun testGetSDKVersionNullable_ValidCases() {
11
- val runtimeVersion = "exposdk:39.0.0"
12
- val manifestJson =
13
- "{\"runtimeVersion\":\"$runtimeVersion\"}"
14
- val manifest = NewManifest(JSONObject(manifestJson))
15
- Assert.assertEquals(manifest.getExpoGoSDKVersion(), "39.0.0")
16
- }
17
-
18
- @Test
19
- @Throws(Exception::class)
20
- fun testGetSDKVersionNullable_ValidCaseUnversioned() {
21
- val runtimeVersion = "exposdk:UNVERSIONED"
22
- val manifestJson =
23
- "{\"runtimeVersion\":\"$runtimeVersion\"}"
24
- val manifest = NewManifest(JSONObject(manifestJson))
25
- Assert.assertEquals(manifest.getExpoGoSDKVersion(), "UNVERSIONED")
26
- }
27
-
28
- @Test
29
- @Throws(Exception::class)
30
- fun testGetSDKVersionNullable_NotSDKRuntimeVersionCases() {
31
- val runtimeVersions = listOf(
32
- "exposdk:123",
33
- "exposdkd:39.0.0",
34
- "exposdk:hello",
35
- "bexposdk:39.0.0",
36
- "exposdk:39.0.0-beta.0",
37
- "exposdk:39.0.0-alpha.256"
38
- )
39
- runtimeVersions.forEach { runtimeVersion ->
40
- val manifestJson =
41
- "{\"runtimeVersion\":\"$runtimeVersion\"}"
42
- val manifest = NewManifest(JSONObject(manifestJson))
43
- Assert.assertNull(manifest.getExpoGoSDKVersion())
44
- }
45
- }
46
- }
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = null;
File without changes