expo-updates 0.13.0 → 0.13.3

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,6 +10,25 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.13.3 — 2022-07-07
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix proguard support in Android builds. ([#18035](https://github.com/expo/expo/pull/18035) by [@esamelson](https://github.com/esamelson))
18
+
19
+ ## 0.13.2 — 2022-06-03
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - Android: Allow null asset hash in new manifests. ([#17466](https://github.com/expo/expo/pull/17466) by [@wschurman](https://github.com/wschurman))
24
+ - Android: Fix asset hash storage. ([#17732](https://github.com/expo/expo/pull/17732) by [@wschurman](https://github.com/wschurman))
25
+
26
+ ## 0.13.1 — 2022-05-05
27
+
28
+ ### 🐛 Bug fixes
29
+
30
+ - Improved support of nvm sourcing in iOS shell scripts. ([#17109](https://github.com/expo/expo/pull/17109) by [@liamronancb](https://github.com/liamronancb))
31
+
13
32
  ## 0.13.0 — 2022-04-21
14
33
 
15
34
  ### 🐛 Bug fixes
@@ -4,7 +4,7 @@ apply plugin: 'kotlin-kapt'
4
4
  apply plugin: 'maven-publish'
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '0.13.0'
7
+ version = '0.13.3'
8
8
 
9
9
  apply from: "../scripts/create-manifest-android.gradle"
10
10
 
@@ -77,7 +77,7 @@ android {
77
77
  minSdkVersion safeExtGet("minSdkVersion", 21)
78
78
  targetSdkVersion safeExtGet("targetSdkVersion", 31)
79
79
  versionCode 31
80
- versionName '0.13.0'
80
+ versionName '0.13.3'
81
81
  consumerProguardFiles("proguard-rules.pro")
82
82
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
83
83
  // uncomment below to export the database schema when making changes
@@ -1,3 +1,7 @@
1
1
  -keepclassmembers class com.facebook.react.ReactInstanceManager {
2
2
  private final com.facebook.react.bridge.JSBundleLoader mBundleLoader;
3
3
  }
4
+
5
+ -keepclassmembers class com.facebook.react.devsupport.DisabledDevSupportManager {
6
+ private final com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler mDefaultNativeModuleCallExceptionHandler;
7
+ }
@@ -19,7 +19,7 @@ import java.util.*
19
19
  @Database(
20
20
  entities = [UpdateEntity::class, UpdateAssetEntity::class, AssetEntity::class, JSONDataEntity::class],
21
21
  exportSchema = false,
22
- version = 10
22
+ version = 11
23
23
  )
24
24
  @TypeConverters(Converters::class)
25
25
  abstract class UpdatesDatabase : RoomDatabase() {
@@ -43,6 +43,7 @@ abstract class UpdatesDatabase : RoomDatabase() {
43
43
  .addMigrations(MIGRATION_7_8)
44
44
  .addMigrations(MIGRATION_8_9)
45
45
  .addMigrations(MIGRATION_9_10)
46
+ .addMigrations(MIGRATION_10_11)
46
47
  .fallbackToDestructiveMigration()
47
48
  .allowMainThreadQueries()
48
49
  .build()
@@ -50,6 +51,16 @@ abstract class UpdatesDatabase : RoomDatabase() {
50
51
  return instance!!
51
52
  }
52
53
 
54
+ private fun SupportSQLiteDatabase.runInTransaction(block: SupportSQLiteDatabase.() -> Unit) {
55
+ beginTransaction()
56
+ try {
57
+ block()
58
+ setTransactionSuccessful()
59
+ } finally {
60
+ endTransaction()
61
+ }
62
+ }
63
+
53
64
  private fun SupportSQLiteDatabase.runInTransactionWithForeignKeysOff(block: SupportSQLiteDatabase.() -> Unit) {
54
65
  // https://www.sqlite.org/lang_altertable.html#otheralter
55
66
  try {
@@ -150,18 +161,16 @@ abstract class UpdatesDatabase : RoomDatabase() {
150
161
 
151
162
  val MIGRATION_9_10: Migration = object : Migration(9, 10) {
152
163
  override fun migrate(database: SupportSQLiteDatabase) {
153
- // https://www.sqlite.org/lang_altertable.html#otheralter
154
- try {
155
- database.execSQL("PRAGMA foreign_keys=OFF")
156
- database.beginTransaction()
157
- try {
158
- database.execSQL("ALTER TABLE `assets` ADD COLUMN `expected_hash` TEXT")
159
- database.setTransactionSuccessful()
160
- } finally {
161
- database.endTransaction()
162
- }
163
- } finally {
164
- database.execSQL("PRAGMA foreign_keys=ON")
164
+ database.runInTransactionWithForeignKeysOff {
165
+ execSQL("ALTER TABLE `assets` ADD COLUMN `expected_hash` TEXT")
166
+ }
167
+ }
168
+ }
169
+
170
+ val MIGRATION_10_11: Migration = object : Migration(10, 11) {
171
+ override fun migrate(database: SupportSQLiteDatabase) {
172
+ database.runInTransaction {
173
+ execSQL("UPDATE `assets` SET `expected_hash` = NULL")
165
174
  }
166
175
  }
167
176
  }
@@ -68,7 +68,7 @@ class NewUpdateManifest private constructor(
68
68
  extraRequestHeaders = assetHeaders[mLaunchAsset.getString("key")]
69
69
  isLaunchAsset = true
70
70
  embeddedAssetFilename = EmbeddedLoader.BUNDLE_FILENAME
71
- expectedHash = mLaunchAsset.getString("hash")
71
+ expectedHash = mLaunchAsset.getNullable("hash")
72
72
  }
73
73
  )
74
74
  } catch (e: JSONException) {
@@ -86,7 +86,7 @@ class NewUpdateManifest private constructor(
86
86
  url = Uri.parse(assetObject.getString("url"))
87
87
  extraRequestHeaders = assetHeaders[assetObject.getString("key")]
88
88
  embeddedAssetFilename = assetObject.getNullable("embeddedAssetFilename")
89
- expectedHash = mLaunchAsset.getString("hash")
89
+ expectedHash = assetObject.getNullable("hash")
90
90
  }
91
91
  )
92
92
  } catch (e: JSONException) {
package/build-cli/cli.js CHANGED
@@ -9,7 +9,7 @@ const commands = {
9
9
  'codesigning:generate': () => Promise.resolve().then(() => tslib_1.__importStar(require('./generateCodeSigning'))).then((i) => i.generateCodeSigning),
10
10
  'codesigning:configure': () => Promise.resolve().then(() => tslib_1.__importStar(require('./configureCodeSigning'))).then((i) => i.configureCodeSigning),
11
11
  };
12
- const args = arg_1.default({
12
+ const args = (0, arg_1.default)({
13
13
  // Types
14
14
  '--help': Boolean,
15
15
  // Aliases
@@ -21,7 +21,7 @@ const command = args._[0];
21
21
  const commandArgs = args._.slice(1);
22
22
  // Handle `--help` flag
23
23
  if (args['--help'] || !command) {
24
- console.log(chalk_1.default `
24
+ console.log((0, chalk_1.default) `
25
25
  {bold Usage}
26
26
  {bold $} expo-updates <command>
27
27
 
@@ -7,7 +7,7 @@ const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const args_1 = require("./utils/args");
8
8
  const Log = tslib_1.__importStar(require("./utils/log"));
9
9
  const configureCodeSigning = async (argv) => {
10
- const args = args_1.assertArgs({
10
+ const args = (0, args_1.assertArgs)({
11
11
  // Types
12
12
  '--help': Boolean,
13
13
  '--certificate-input-directory': String,
@@ -16,7 +16,7 @@ const configureCodeSigning = async (argv) => {
16
16
  '-h': '--help',
17
17
  }, argv !== null && argv !== void 0 ? argv : []);
18
18
  if (args['--help']) {
19
- Log.exit(chalk_1.default `
19
+ Log.exit((0, chalk_1.default) `
20
20
  {bold Description}
21
21
  Configure and validate expo-updates code signing for this project
22
22
 
@@ -30,9 +30,9 @@ const configureCodeSigning = async (argv) => {
30
30
  `, 0);
31
31
  }
32
32
  const { configureCodeSigningAsync } = await Promise.resolve().then(() => tslib_1.__importStar(require('./configureCodeSigningAsync')));
33
- const certificateInput = args_1.requireArg(args, '--certificate-input-directory');
34
- const keyInput = args_1.requireArg(args, '--key-input-directory');
35
- return await configureCodeSigningAsync(args_1.getProjectRoot(args), {
33
+ const certificateInput = (0, args_1.requireArg)(args, '--certificate-input-directory');
34
+ const keyInput = (0, args_1.requireArg)(args, '--key-input-directory');
35
+ return await configureCodeSigningAsync((0, args_1.getProjectRoot)(args), {
36
36
  certificateInput,
37
37
  keyInput,
38
38
  });
@@ -16,10 +16,10 @@ async function configureCodeSigningAsync(projectRoot, { certificateInput, keyInp
16
16
  fs_1.promises.readFile(path_1.default.join(keyInputDir, 'private-key.pem'), 'utf8'),
17
17
  fs_1.promises.readFile(path_1.default.join(keyInputDir, 'public-key.pem'), 'utf8'),
18
18
  ]);
19
- const certificate = code_signing_certificates_1.convertCertificatePEMToCertificate(certificatePEM);
20
- const keyPair = code_signing_certificates_1.convertKeyPairPEMToKeyPair({ privateKeyPEM, publicKeyPEM });
21
- code_signing_certificates_1.validateSelfSignedCertificate(certificate, keyPair);
22
- const { exp } = config_1.getConfig(projectRoot, { skipSDKVersionRequirement: true });
19
+ const certificate = (0, code_signing_certificates_1.convertCertificatePEMToCertificate)(certificatePEM);
20
+ const keyPair = (0, code_signing_certificates_1.convertKeyPairPEMToKeyPair)({ privateKeyPEM, publicKeyPEM });
21
+ (0, code_signing_certificates_1.validateSelfSignedCertificate)(certificate, keyPair);
22
+ const { exp } = (0, config_1.getConfig)(projectRoot, { skipSDKVersionRequirement: true });
23
23
  const fields = {
24
24
  codeSigningCertificate: `./${path_1.default.relative(projectRoot, certificateInputDir)}/certificate.pem`,
25
25
  codeSigningMetadata: {
@@ -27,7 +27,7 @@ async function configureCodeSigningAsync(projectRoot, { certificateInput, keyInp
27
27
  alg: 'rsa-v1_5-sha256',
28
28
  },
29
29
  };
30
- await modifyConfigAsync_1.attemptModification(projectRoot, {
30
+ await (0, modifyConfigAsync_1.attemptModification)(projectRoot, {
31
31
  updates: {
32
32
  ...exp.updates,
33
33
  ...fields,
@@ -37,6 +37,6 @@ async function configureCodeSigningAsync(projectRoot, { certificateInput, keyInp
37
37
  ...fields,
38
38
  },
39
39
  });
40
- log_1.log(`Code signing configuration written to app.json.`);
40
+ (0, log_1.log)(`Code signing configuration written to app.json.`);
41
41
  }
42
42
  exports.configureCodeSigningAsync = configureCodeSigningAsync;
@@ -7,7 +7,7 @@ const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const args_1 = require("./utils/args");
8
8
  const Log = tslib_1.__importStar(require("./utils/log"));
9
9
  const generateCodeSigning = async (argv) => {
10
- const args = args_1.assertArgs({
10
+ const args = (0, args_1.assertArgs)({
11
11
  // Types
12
12
  '--help': Boolean,
13
13
  '--key-output-directory': String,
@@ -18,7 +18,7 @@ const generateCodeSigning = async (argv) => {
18
18
  '-h': '--help',
19
19
  }, argv !== null && argv !== void 0 ? argv : []);
20
20
  if (args['--help']) {
21
- Log.exit(chalk_1.default `
21
+ Log.exit((0, chalk_1.default) `
22
22
  {bold Description}
23
23
  Generate expo-updates private key, public key, and code signing certificate using that public key (self-signed by the private key)
24
24
 
@@ -34,11 +34,11 @@ const generateCodeSigning = async (argv) => {
34
34
  `, 0);
35
35
  }
36
36
  const { generateCodeSigningAsync } = await Promise.resolve().then(() => tslib_1.__importStar(require('./generateCodeSigningAsync')));
37
- const keyOutput = args_1.requireArg(args, '--key-output-directory');
38
- const certificateOutput = args_1.requireArg(args, '--certificate-output-directory');
39
- const certificateValidityDurationYears = args_1.requireArg(args, '--certificate-validity-duration-years');
40
- const certificateCommonName = args_1.requireArg(args, '--certificate-common-name');
41
- return await generateCodeSigningAsync(args_1.getProjectRoot(args), {
37
+ const keyOutput = (0, args_1.requireArg)(args, '--key-output-directory');
38
+ const certificateOutput = (0, args_1.requireArg)(args, '--certificate-output-directory');
39
+ const certificateValidityDurationYears = (0, args_1.requireArg)(args, '--certificate-validity-duration-years');
40
+ const certificateCommonName = (0, args_1.requireArg)(args, '--certificate-common-name');
41
+ return await generateCodeSigningAsync((0, args_1.getProjectRoot)(args), {
42
42
  certificateValidityDurationYears,
43
43
  keyOutput,
44
44
  certificateOutput,
@@ -12,32 +12,32 @@ async function generateCodeSigningAsync(projectRoot, { certificateValidityDurati
12
12
  const validityDurationYears = Math.floor(certificateValidityDurationYears);
13
13
  const certificateOutputDir = path_1.default.resolve(projectRoot, certificateOutput);
14
14
  const keyOutputDir = path_1.default.resolve(projectRoot, keyOutput);
15
- await Promise.all([fs_extra_1.ensureDir(certificateOutputDir), fs_extra_1.ensureDir(keyOutputDir)]);
15
+ await Promise.all([(0, fs_extra_1.ensureDir)(certificateOutputDir), (0, fs_extra_1.ensureDir)(keyOutputDir)]);
16
16
  const [certificateOutputDirContents, keyOutputDirContents] = await Promise.all([
17
17
  fs_1.promises.readdir(certificateOutputDir),
18
18
  fs_1.promises.readdir(keyOutputDir),
19
19
  ]);
20
- assert_1.default(certificateOutputDirContents.length === 0, 'Certificate output directory must be empty');
21
- assert_1.default(keyOutputDirContents.length === 0, 'Key output directory must be empty');
22
- const keyPair = code_signing_certificates_1.generateKeyPair();
20
+ (0, assert_1.default)(certificateOutputDirContents.length === 0, 'Certificate output directory must be empty');
21
+ (0, assert_1.default)(keyOutputDirContents.length === 0, 'Key output directory must be empty');
22
+ const keyPair = (0, code_signing_certificates_1.generateKeyPair)();
23
23
  const validityNotBefore = new Date();
24
24
  const validityNotAfter = new Date();
25
25
  validityNotAfter.setFullYear(validityNotAfter.getFullYear() + validityDurationYears);
26
- const certificate = code_signing_certificates_1.generateSelfSignedCodeSigningCertificate({
26
+ const certificate = (0, code_signing_certificates_1.generateSelfSignedCodeSigningCertificate)({
27
27
  keyPair,
28
28
  validityNotBefore,
29
29
  validityNotAfter,
30
30
  commonName: certificateCommonName,
31
31
  });
32
- const keyPairPEM = code_signing_certificates_1.convertKeyPairToPEM(keyPair);
33
- const certificatePEM = code_signing_certificates_1.convertCertificateToCertificatePEM(certificate);
32
+ const keyPairPEM = (0, code_signing_certificates_1.convertKeyPairToPEM)(keyPair);
33
+ const certificatePEM = (0, code_signing_certificates_1.convertCertificateToCertificatePEM)(certificate);
34
34
  await Promise.all([
35
35
  fs_1.promises.writeFile(path_1.default.join(keyOutputDir, 'public-key.pem'), keyPairPEM.publicKeyPEM),
36
36
  fs_1.promises.writeFile(path_1.default.join(keyOutputDir, 'private-key.pem'), keyPairPEM.privateKeyPEM),
37
37
  fs_1.promises.writeFile(path_1.default.join(certificateOutputDir, 'certificate.pem'), certificatePEM),
38
38
  ]);
39
- log_1.log(`Generated public and private keys output in ${keyOutputDir}. Remember to add them to .gitignore or to encrypt them. (e.g. with git-crypt)`);
40
- log_1.log(`Generated code signing certificate output in ${certificateOutputDir}.`);
41
- log_1.log(`To automatically configure this project for code signing, run \`yarn expo-updates codesigning:configure --certificate-input-directory=${certificateOutput} --key-input-directory=${keyOutput}\`.`);
39
+ (0, log_1.log)(`Generated public and private keys output in ${keyOutputDir}. Remember to add them to .gitignore or to encrypt them. (e.g. with git-crypt)`);
40
+ (0, log_1.log)(`Generated code signing certificate output in ${certificateOutputDir}.`);
41
+ (0, log_1.log)(`To automatically configure this project for code signing, run \`yarn expo-updates codesigning:configure --certificate-input-directory=${certificateOutput} --key-input-directory=${keyOutput}\`.`);
42
42
  }
43
43
  exports.generateCodeSigningAsync = generateCodeSigningAsync;
@@ -14,8 +14,8 @@ const Log = tslib_1.__importStar(require("./log"));
14
14
  * @returns valid project directory.
15
15
  */
16
16
  function getProjectRoot(args) {
17
- const projectRoot = path_1.resolve(args._[0] || '.');
18
- if (!fs_1.existsSync(projectRoot)) {
17
+ const projectRoot = (0, path_1.resolve)(args._[0] || '.');
18
+ if (!(0, fs_1.existsSync)(projectRoot)) {
19
19
  Log.exit(`Invalid project root: ${projectRoot}`);
20
20
  }
21
21
  return projectRoot;
@@ -30,7 +30,7 @@ exports.getProjectRoot = getProjectRoot;
30
30
  */
31
31
  function assertArgs(schema, argv) {
32
32
  try {
33
- return arg_1.default(schema, { argv });
33
+ return (0, arg_1.default)(schema, { argv });
34
34
  }
35
35
  catch (error) {
36
36
  // Ensure unknown options are handled the same way.
@@ -7,7 +7,7 @@ const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const Log = tslib_1.__importStar(require("./log"));
8
8
  /** Wraps `[@expo/config] modifyConfigAsync()` and adds additional logging. */
9
9
  async function attemptModification(projectRoot, edits, exactEdits) {
10
- const modification = await config_1.modifyConfigAsync(projectRoot, edits, {
10
+ const modification = await (0, config_1.modifyConfigAsync)(projectRoot, edits, {
11
11
  skipSDKVersionRequirement: true,
12
12
  });
13
13
  if (modification.type === 'success') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-updates",
3
- "version": "0.13.0",
3
+ "version": "0.13.3",
4
4
  "description": "Fetches and manages remotely-hosted assets and updates to your app's JS bundle.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -64,5 +64,5 @@
64
64
  "peerDependencies": {
65
65
  "expo": "*"
66
66
  },
67
- "gitHead": "0f796e10a2b2f258c40f9d56aa141c372cd63fc1"
67
+ "gitHead": "6c7bf5038ccdfbe3e881f86d63ab92b8314ec2c1"
68
68
  }
@@ -9,6 +9,11 @@
9
9
 
10
10
  current_shell=$(ps -cp "$$" -o comm='' | sed 's/^-//')
11
11
 
12
+ # attempt to source via nvm
13
+ if [ -f "$HOME/.nvm/nvm.sh" ]; then
14
+ . "$HOME/.nvm/nvm.sh"
15
+ fi
16
+
12
17
  if [[ "$current_shell" == zsh ]]; then
13
18
  # Zsh's setup script order is:
14
19
  # /etc/zshenv