expo-document-picker 10.0.2 → 10.1.2

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/CHANGELOG.md CHANGED
@@ -10,9 +10,23 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 10.0.2 — 2021-10-15
13
+ ## 10.1.2 — 2022-02-01
14
14
 
15
- _This version does not introduce any user-facing changes._
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 10.1.1 — 2022-01-26
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - Pass iCloudContainerEnvironment to plugin. ([#15774](https://github.com/expo/expo/pull/15774) by [@wkozyra95](https://github.com/wkozyra95))
24
+
25
+ ## 10.1.0 — 2021-12-03
26
+
27
+ ### 🎉 New features
28
+
29
+ - [plugin] Added `iCloudContainerEnvironment` prop for setting the `com.apple.developer.icloud-container-environment` entitlement ([#14885](https://github.com/expo/expo/pull/14885) by [@EvanBacon](https://github.com/EvanBacon))
16
30
 
17
31
  ## 10.0.1 — 2021-10-01
18
32
 
package/README.md CHANGED
@@ -13,7 +13,7 @@ For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
16
- For bare React Native projects, you must ensure that you have [installed and configured the `react-native-unimodules` package](https://github.com/expo/expo/tree/master/packages/react-native-unimodules) before continuing.
16
+ For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
17
17
 
18
18
  ### Add the package to your npm dependencies
19
19
 
@@ -1,9 +1,9 @@
1
1
  apply plugin: 'com.android.library'
2
2
  apply plugin: 'kotlin-android'
3
- apply plugin: 'maven'
3
+ apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '10.0.2'
6
+ version = '10.1.2'
7
7
 
8
8
  buildscript {
9
9
  // Simple helper that allows the root project to override versions declared by this library.
@@ -20,27 +20,25 @@ buildscript {
20
20
  }
21
21
  }
22
22
 
23
- // Upload android library to maven with javadoc and android sources
24
- configurations {
25
- deployerJars
26
- }
27
-
28
23
  // Creating sources with comments
29
24
  task androidSourcesJar(type: Jar) {
30
25
  classifier = 'sources'
31
26
  from android.sourceSets.main.java.srcDirs
32
27
  }
33
28
 
34
- // Put the androidSources and javadoc to the artifacts
35
- artifacts {
36
- archives androidSourcesJar
37
- }
38
-
39
- uploadArchives {
40
- repositories {
41
- mavenDeployer {
42
- configuration = configurations.deployerJars
43
- repository(url: mavenLocal().url)
29
+ afterEvaluate {
30
+ publishing {
31
+ publications {
32
+ release(MavenPublication) {
33
+ from components.release
34
+ // Add additional sourcesJar to artifacts
35
+ artifact(androidSourcesJar)
36
+ }
37
+ }
38
+ repositories {
39
+ maven {
40
+ url = mavenLocal().url
41
+ }
44
42
  }
45
43
  }
46
44
  }
@@ -61,7 +59,7 @@ android {
61
59
  minSdkVersion safeExtGet("minSdkVersion", 21)
62
60
  targetSdkVersion safeExtGet("targetSdkVersion", 30)
63
61
  versionCode 17
64
- versionName '10.0.2'
62
+ versionName '10.1.2'
65
63
  }
66
64
  lintOptions {
67
65
  abortOnError false
package/build/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare type DocumentPickerOptions = {
6
6
  * The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available
7
7
  * to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type
8
8
  * of document you can use `'*/*'`.
9
- * @default `'*/*'`
9
+ * @default '*/*'
10
10
  */
11
11
  type?: string | string[];
12
12
  /**
@@ -14,12 +14,13 @@ export declare type DocumentPickerOptions = {
14
14
  * which allows other Expo APIs to read the file immediately. This may impact performance for
15
15
  * large files, so you should consider setting this to `false` if you expect users to pick
16
16
  * particularly large files and your app does not need immediate read access.
17
- * @default `true`
17
+ * @default true
18
18
  */
19
19
  copyToCacheDirectory?: boolean;
20
20
  /**
21
- * __Web Only.__ Allows multiple files to be selected from the system UI.
22
- * @default `false`
21
+ * Allows multiple files to be selected from the system UI.
22
+ * @default false
23
+ * @platform web
23
24
  */
24
25
  multiple?: boolean;
25
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\n/**\n *\n */\nexport type DocumentPickerOptions = {\n /**\n * The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available\n * to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type\n * of document you can use `'*/*'`.\n * @default `'*/*'`\n */\n type?: string | string[];\n /**\n * If `true`, the picked file is copied to [`FileSystem.CacheDirectory`](filesystem.md#filesystemcachedirectory),\n * which allows other Expo APIs to read the file immediately. This may impact performance for\n * large files, so you should consider setting this to `false` if you expect users to pick\n * particularly large files and your app does not need immediate read access.\n * @default `true`\n */\n copyToCacheDirectory?: boolean;\n /**\n * __Web Only.__ Allows multiple files to be selected from the system UI.\n * @default `false`\n */\n multiple?: boolean;\n};\n\n// @needsAudit @docsMissing\nexport type DocumentResult =\n | { type: 'cancel' }\n | {\n type: 'success';\n /**\n * Document original name.\n */\n name: string;\n /**\n * Document size in bytes.\n */\n size?: number;\n /**\n * An URI to the local document file.\n */\n uri: string;\n /**\n * Document MIME type.\n */\n mimeType?: string;\n lastModified?: number;\n file?: File;\n output?: FileList | null;\n };\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\n/**\n *\n */\nexport type DocumentPickerOptions = {\n /**\n * The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available\n * to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type\n * of document you can use `'*/*'`.\n * @default '*/*'\n */\n type?: string | string[];\n /**\n * If `true`, the picked file is copied to [`FileSystem.CacheDirectory`](filesystem.md#filesystemcachedirectory),\n * which allows other Expo APIs to read the file immediately. This may impact performance for\n * large files, so you should consider setting this to `false` if you expect users to pick\n * particularly large files and your app does not need immediate read access.\n * @default true\n */\n copyToCacheDirectory?: boolean;\n /**\n * Allows multiple files to be selected from the system UI.\n * @default false\n * @platform web\n */\n multiple?: boolean;\n};\n\n// @needsAudit @docsMissing\nexport type DocumentResult =\n | { type: 'cancel' }\n | {\n type: 'success';\n /**\n * Document original name.\n */\n name: string;\n /**\n * Document size in bytes.\n */\n size?: number;\n /**\n * An URI to the local document file.\n */\n uri: string;\n /**\n * Document MIME type.\n */\n mimeType?: string;\n lastModified?: number;\n file?: File;\n output?: FileList | null;\n };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-document-picker",
3
- "version": "10.0.2",
3
+ "version": "10.1.2",
4
4
  "description": "Provides access to the system's UI for selecting documents from the available providers on the user's device.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -32,15 +32,17 @@
32
32
  "license": "MIT",
33
33
  "homepage": "https://docs.expo.dev/versions/latest/sdk/document-picker/",
34
34
  "jest": {
35
- "preset": "expo-module-scripts/ios"
35
+ "preset": "expo-module-scripts"
36
36
  },
37
37
  "dependencies": {
38
- "@expo/config-plugins": "^3.1.0",
39
- "expo-modules-core": "~0.4.3",
38
+ "@expo/config-plugins": "^4.0.2",
40
39
  "uuid": "^3.3.2"
41
40
  },
42
41
  "devDependencies": {
43
42
  "expo-module-scripts": "^2.0.0"
44
43
  },
45
- "gitHead": "d23e1ac491da96b51c25eb2533efcd56499ee287"
44
+ "peerDependencies": {
45
+ "expo": "*"
46
+ },
47
+ "gitHead": "ba24eba18bf4f4d4b0d54828992d81a2bb18246a"
46
48
  }
@@ -1,5 +1,4 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
- declare const _default: ConfigPlugin<void | {
3
- appleTeamId?: string | undefined;
4
- }>;
2
+ import { IosProps } from './withDocumentPickerIOS';
3
+ declare const _default: ConfigPlugin<void | IosProps>;
5
4
  export default _default;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_plugins_1 = require("@expo/config-plugins");
4
4
  const withDocumentPickerIOS_1 = require("./withDocumentPickerIOS");
5
5
  const pkg = require('expo-document-picker/package.json');
6
- const withDocumentPicker = (config, { appleTeamId = process.env.EXPO_APPLE_TEAM_ID } = {}) => {
7
- config = withDocumentPickerIOS_1.withDocumentPickerIOS(config, { appleTeamId });
6
+ const withDocumentPicker = (config, { appleTeamId = process.env.EXPO_APPLE_TEAM_ID, iCloudContainerEnvironment } = {}) => {
7
+ config = (0, withDocumentPickerIOS_1.withDocumentPickerIOS)(config, { appleTeamId, iCloudContainerEnvironment });
8
8
  return config;
9
9
  };
10
- exports.default = config_plugins_1.createRunOncePlugin(withDocumentPicker, pkg.name, pkg.version);
10
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withDocumentPicker, pkg.name, pkg.version);
@@ -1,6 +1,14 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
- export declare const withDocumentPickerIOS: ConfigPlugin<{
3
+ export declare type IosProps = {
4
4
  appleTeamId?: string;
5
- }>;
6
- export declare function setICloudEntitlments(config: Pick<ExpoConfig, 'ios'>, appleTeamId: string, entitlements: Record<string, any>): Record<string, any>;
5
+ /**
6
+ * Sets the `com.apple.developer.icloud-container-environment` entitlement which is read by EAS CLI to set
7
+ * the `iCloudContainerEnvironment` in the `xcodebuild` `exportOptionsPlist`.
8
+ *
9
+ * Available options: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
10
+ */
11
+ iCloudContainerEnvironment?: 'Development' | 'Production';
12
+ };
13
+ export declare const withDocumentPickerIOS: ConfigPlugin<IosProps>;
14
+ export declare function setICloudEntitlements(config: Pick<ExpoConfig, 'ios'>, { appleTeamId, iCloudContainerEnvironment }: IosProps, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }: Record<string, any>): Record<string, any>;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setICloudEntitlments = exports.withDocumentPickerIOS = void 0;
3
+ exports.setICloudEntitlements = exports.withDocumentPickerIOS = void 0;
4
4
  const config_plugins_1 = require("@expo/config-plugins");
5
- const withDocumentPickerIOS = (config, { appleTeamId }) => {
6
- return config_plugins_1.withEntitlementsPlist(config, (config) => {
5
+ const withDocumentPickerIOS = (config, { appleTeamId, iCloudContainerEnvironment }) => {
6
+ return (0, config_plugins_1.withEntitlementsPlist)(config, (config) => {
7
7
  if (appleTeamId) {
8
- config.modResults = setICloudEntitlments(config, appleTeamId, config.modResults);
8
+ config.modResults = setICloudEntitlements(config, { appleTeamId, iCloudContainerEnvironment }, config.modResults);
9
9
  }
10
10
  else {
11
11
  config_plugins_1.WarningAggregator.addWarningIOS('expo-document-picker', 'Cannot configure iOS entitlements because neither the appleTeamId property, nor the environment variable EXPO_APPLE_TEAM_ID were defined.');
@@ -14,9 +14,12 @@ const withDocumentPickerIOS = (config, { appleTeamId }) => {
14
14
  });
15
15
  };
16
16
  exports.withDocumentPickerIOS = withDocumentPickerIOS;
17
- function setICloudEntitlments(config, appleTeamId, entitlements) {
17
+ function setICloudEntitlements(config, { appleTeamId, iCloudContainerEnvironment }, { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }) {
18
18
  var _a;
19
19
  if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.usesIcloudStorage) {
20
+ // Used for AdHoc iOS builds: https://github.com/expo/eas-cli/issues/693
21
+ // https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
22
+ entitlements['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
20
23
  entitlements['com.apple.developer.icloud-container-identifiers'] = [
21
24
  'iCloud.' + config.ios.bundleIdentifier,
22
25
  ];
@@ -29,4 +32,4 @@ function setICloudEntitlments(config, appleTeamId, entitlements) {
29
32
  }
30
33
  return entitlements;
31
34
  }
32
- exports.setICloudEntitlments = setICloudEntitlments;
35
+ exports.setICloudEntitlements = setICloudEntitlements;
@@ -1,14 +1,14 @@
1
1
  import { ConfigPlugin, createRunOncePlugin } from '@expo/config-plugins';
2
2
 
3
- import { withDocumentPickerIOS } from './withDocumentPickerIOS';
3
+ import { withDocumentPickerIOS, IosProps } from './withDocumentPickerIOS';
4
4
 
5
5
  const pkg = require('expo-document-picker/package.json');
6
6
 
7
- const withDocumentPicker: ConfigPlugin<{ appleTeamId?: string } | void> = (
7
+ const withDocumentPicker: ConfigPlugin<IosProps | void> = (
8
8
  config,
9
- { appleTeamId = process.env.EXPO_APPLE_TEAM_ID } = {}
9
+ { appleTeamId = process.env.EXPO_APPLE_TEAM_ID, iCloudContainerEnvironment } = {}
10
10
  ) => {
11
- config = withDocumentPickerIOS(config, { appleTeamId });
11
+ config = withDocumentPickerIOS(config, { appleTeamId, iCloudContainerEnvironment });
12
12
  return config;
13
13
  };
14
14
 
@@ -1,13 +1,28 @@
1
1
  import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
3
 
4
- export const withDocumentPickerIOS: ConfigPlugin<{ appleTeamId?: string }> = (
4
+ export type IosProps = {
5
+ appleTeamId?: string;
6
+ /**
7
+ * Sets the `com.apple.developer.icloud-container-environment` entitlement which is read by EAS CLI to set
8
+ * the `iCloudContainerEnvironment` in the `xcodebuild` `exportOptionsPlist`.
9
+ *
10
+ * Available options: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
11
+ */
12
+ iCloudContainerEnvironment?: 'Development' | 'Production';
13
+ };
14
+
15
+ export const withDocumentPickerIOS: ConfigPlugin<IosProps> = (
5
16
  config,
6
- { appleTeamId }
17
+ { appleTeamId, iCloudContainerEnvironment }
7
18
  ) => {
8
19
  return withEntitlementsPlist(config, (config) => {
9
20
  if (appleTeamId) {
10
- config.modResults = setICloudEntitlments(config, appleTeamId, config.modResults);
21
+ config.modResults = setICloudEntitlements(
22
+ config,
23
+ { appleTeamId, iCloudContainerEnvironment },
24
+ config.modResults
25
+ );
11
26
  } else {
12
27
  WarningAggregator.addWarningIOS(
13
28
  'expo-document-picker',
@@ -18,12 +33,16 @@ export const withDocumentPickerIOS: ConfigPlugin<{ appleTeamId?: string }> = (
18
33
  });
19
34
  };
20
35
 
21
- export function setICloudEntitlments(
36
+ export function setICloudEntitlements(
22
37
  config: Pick<ExpoConfig, 'ios'>,
23
- appleTeamId: string,
24
- entitlements: Record<string, any>
38
+ { appleTeamId, iCloudContainerEnvironment }: IosProps,
39
+ { 'com.apple.developer.icloud-container-environment': _env, ...entitlements }: Record<string, any>
25
40
  ): Record<string, any> {
26
41
  if (config.ios?.usesIcloudStorage) {
42
+ // Used for AdHoc iOS builds: https://github.com/expo/eas-cli/issues/693
43
+ // https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment
44
+ entitlements['com.apple.developer.icloud-container-environment'] = iCloudContainerEnvironment;
45
+
27
46
  entitlements['com.apple.developer.icloud-container-identifiers'] = [
28
47
  'iCloud.' + config.ios.bundleIdentifier,
29
48
  ];
package/src/types.ts CHANGED
@@ -7,7 +7,7 @@ export type DocumentPickerOptions = {
7
7
  * The [MIME type(s)](https://en.wikipedia.org/wiki/Media_type) of the documents that are available
8
8
  * to be picked. Is also supports wildcards like `'image/*'` to choose any image. To allow any type
9
9
  * of document you can use `'&ast;/*'`.
10
- * @default `'&ast;/*'`
10
+ * @default '&ast;/*'
11
11
  */
12
12
  type?: string | string[];
13
13
  /**
@@ -15,12 +15,13 @@ export type DocumentPickerOptions = {
15
15
  * which allows other Expo APIs to read the file immediately. This may impact performance for
16
16
  * large files, so you should consider setting this to `false` if you expect users to pick
17
17
  * particularly large files and your app does not need immediate read access.
18
- * @default `true`
18
+ * @default true
19
19
  */
20
20
  copyToCacheDirectory?: boolean;
21
21
  /**
22
- * __Web Only.__ Allows multiple files to be selected from the system UI.
23
- * @default `false`
22
+ * Allows multiple files to be selected from the system UI.
23
+ * @default false
24
+ * @platform web
24
25
  */
25
26
  multiple?: boolean;
26
27
  };