Giter Club home page Giter Club logo

standard-version-expo's People

Contributors

awinograd avatar bycedric avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

standard-version-expo's Issues

Android converted to semver despite configs & iOS removes leading zeros in semver

Description of the bug

Android version is bumped to semver instead of default android method.
iOS version does not respect leading zeros.

To Reproduce

installed and configured per documentation using 1.0.3

configure

// .versionrc.js

module.exports = {
  bumpFiles: [
    {
      filename: 'package.json',
    },
    {
      filename: 'app.json',
      updater: require.resolve('standard-version-expo'),
    },
    {
      filename: 'app.json',
      updater: require.resolve('standard-version-expo/android'),
    },
    {
      filename: 'app.json',
      updater: require.resolve('standard-version-expo/ios'),
    }
  ]
};

run

% npx standard-version --dry-run 
✔ bumping version in package.json from 2.2.4 to 2.2.5
✔ bumping version in app.json from 2.2.4 to 2.2.5
✔ bumping version in app.json from 380020204 to 2.2.5
✔ bumping version in app.json from 2.2.04 to 2.2.5
✔ outputting changes to CHANGELOG.md

---
### 2.2.5 (2020-09-21)
---

✔ committing app.json and package.json and CHANGELOG.md
✔ tagging release v2.2.5
ℹ Run `git push --follow-tags origin CU-buh9bc-trunk-based-ci-cd` to publish

Expected behavior

android would bump to 380020204
iOS would bump to 2.2.05

Actual behavior

android bumpe to 2.2.5
iOS bumped to 2.2.5

[Discussion] How handle test versions and releases

There are a couple of issues regarding prereleases (like #11) and I think it would be great to discuss how handle prerelease or versions that will get to TestFlight but NO to published to the store.

I would love to create a PR, I just want to be sure what would be the standard.

Problem

Example:

  1. I wrote a couple of fixes and features for my app that are ready to be tested.
  2. We run expo build:ios --release-channel stage
  3. Distribute the testing build via TestFlight IMPORTANT -> We need to increment the build number (Problem 1)
  4. All the tests passes, so we run expo build:ios --release-channel prod
  5. We try to upload the production build and BOM, error, the build numbers should be different (Problem 2)

So we try to use standard-version-expo.

  1. I wrote a couple of fixed and features that are ready to be tested.
  2. We run standard-version to increment the build number of both platforms and the versions (We can't use pre-releases because of #11 and is not working for iOS either)
  3. . Distribute the testing build via TestFlight IMPORTANT -> The build was already increased (Problem solved! 👍 )
  4. All the tests passes, so we run expo build:ios --release-channel prod
  5. We try to upload the production build and BOM, error, the build numbers should be different to the one that was used on the testing phase, so a solution? run standard-version as a patch? Change only the builds manually? What is the best option here?

Posible solutions

  1. Update the release channel of the existing testing build to production, but that is not possible.
  2. Format the pre-release correctly, and then when creating the production release just bump the versionCode (android) and versionBuild (iOS) NOT the version on app.json and package.json (Since package.json.version is the source of truth, this can be a problem)

A solution that I found online was create a second app with a second bundle id (have an app that would never get to the stores) but I think this is a overkill.

What approach to you use? I would love to hear what can be improved or what is the flow the you use!

Thanks!

PD: standard-version-expo/ios/code is not possible to use because is not allowed by AppStore.

Supporting the `expo prebuild` workflow

Topic and scope of discussion

How would you summarise and scope the issue?

I've upgraded to Expo SDK 44 and have converted all of my changes inside the /ios and /android folders of my Expo Bare project over to using config plugins. I do commit my /ios and /android folders to source, but I only make changes to them using the new expo prebuild command.

My release workflow is:

// Increment a patch version
% npx standard-version

// Undo standard version's commit and delete the GIT tag 
% git reset --soft HEAD^
% git tag -d $TAG

// Re-run rebuild, carrying the versions in app.json into native code
% expo prebuild

// Re-stage latest GIT changes
% git add ...
% git commit

% git tag $TAG
% git push --follow-tags origin master

Motivation

Why should we have this discussion?

  1. Thoughts on adding a flag to standard-version that skips the commit step, so I don't have to undo it?
  2. How do we want to take expo prebuild into account? Should I use native bumpers, or continue using prebuild?

Additional context

Can you further explain the purpose of this discussion? E.g., screenshots or real-world examples.

See release workflow example above

Bumping version in app.json to package.json version

Description of the bug

When dry running standard-version for native application, it tries to bump app.json version, android and ios version to the version in package.json

To Reproduce

What steps did you perform which led to this issue?
npm i -D standard-version@next standard-version-expo

.versionrc.js
module.exports = { bumpFiles: [ { filename: 'package.json', }, { filename: 'app.json', updater: require.resolve('standard-version-expo'), }, { filename: 'app.json', updater: require.resolve('standard-version-expo/android'), }, { filename: 'app.json', updater: require.resolve('standard-version-expo/ios'), } ], releaseCommitMessageFormat: "chore(release): Release {{currentTag}}\n\n[ci skip]" };

I also tried
... updater: require.resolve('standard-version-expo/android/increment'), ... updater: require.resolve('standard-version-expo/ios/ios-increment'), ...
Documentation was wrong for ios resolver. Is /increment, but should be /ios-increment for v1.0.0

app.json
{ ... "version": "2.2.1", ... "ios": { ... "buildNumber": "1", ... }, ... "android": { ... "versionCode": 20033, ... }, ... }

Expected behavior

  • app.json version to be equal to package.json version
  • ios buildNumber to be a single integer
  • android versionCode to be in the format of 20033, but incremented

Actual behavior

Output of npx standard-version --dry-run
✔ bumping version in package.json from 1.24.0 to 1.25.0
✔ bumping version in app.json from 2.2.1 to 1.25.0
✔ bumping version in app.json from 20033 to 1.25.0
✔ bumping version in app.json from 1 to 1.25.0
✔ outputting changes to CHANGELOG.md

Supporting `beta`?

Firstly, just want to say love the package! Really pleased to get it in my Expo workflow :)

Description of the feature

Would like to be able to tag beta versions in expo. Currently you can run standard-version -p beta -n to tag a release a beta, and you'll get this output:

✔ bumping version in package.json from 0.8.6 to 0.8.6-beta.0
✔ bumping version in app.json from 0.8.6 to 0.8.6-beta.0
✔ bumping version in app.json from 370000806 to 0.8.6-beta.0
✔ bumping version in app.json from 0.8.6 to 0.8.6-beta.0

However inside app.json, the android version code does not updated, and the ios build number gets updated to "0.8.7-beta.0" which is an invalid build code for ios:

• Field: ios.buildNumber - 'ios.buildNumber' should match pattern "^[A-Za-z0-9.]+$".

Motivation

Would be helpful to release beta versions of my app onto internal release tracks in the play store.

Additional context

Also happy to revisit my workflow. This is my first RN app so maybe there is a better way to release betas?

"Manifest must include a JSON object."

Topic and scope of discussion

Unable to get version bumping for app.config.js files - getting the subject's message to the console.

Motivation

To understand if a flexible, dynamic configuration is currently possible.

Additional context

In my .versionrc.js I have the following:

/*
 * From https://gist.github.com/gregfenton/b81ec014e8488dc5576f8444cbf7bcd4
 */
let fs = require('fs');

let bumps = [
  {filename: 'package.json'},
];

let CONFIGS_DIR = './customer-configs';

try {
  let entries = fs.readdirSync(CONFIGS_DIR, {withFileTypes: true});
  for (let i = 0; i < entries.length; i++) {
    let entry = entries[i];
    let confFile = `${CONFIGS_DIR}/${entry.name}/app.config.js`;
    if (entry?.isDirectory()) {ame: 
      if (fs.existsSync(confFile)) {
        // updates `expo.version`
        bumps.push({
          filename: confFile,
          updater: require.resolve('standard-version-expo'),
        });
        // updates `expo.android.versionCode`
        bumps.push({
          filename: confFile,
          updater: require.resolve('standard-version-expo/android'),
        });
        // updates `expo.ios.buildNumber`
        bumps.push({
          filename: confFile,
          updater: require.resolve('standard-version-expo/ios'),
        });
      }
    }
  }
} catch (ex) {
  console.log(`EXCEPTION with readdir: ${ex.message}`);
  throw ex;
}

module.exports = {
  bumpFiles: [...bumps],
};

When I run npx standard-version --dry-run I get the following output:

$ npx standard-version --dry-run
✔ bumping version in package.json from 0.2.17 to 0.2.18
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
Manifest must include a JSON object.
✔ outputting changes to CHANGELOG.md

---
### [0.2.18](https://github.com/gregfenton/rn_tick8s/compare/v0.2.17...v0.2.18) (2020-10-17)
---

✔ committing package.json and CHANGELOG.md
✔ tagging release v0.2.18
ℹ Run `git push --follow-tags origin main` to publish

and my app.config.js files do not update. I have 2 app.config.js files (I have 2 customer-configs), and I'm quite certain that the 6 instances of "Manifest must include a JSON object." are coming from (2 customer-configs * 3 updaters).

Looking at the code in standard-version-expo/build/expo.js, it seems that the code to parseJsonString() is failing with the exception message ending with:

└─ Cause: SyntaxError: JSON5: invalid character 'i' at 1:1
> 1 | import fs from 'fs';
    | ^
  2 | 
  3 | const APP_NAME = 'tick8s';
  4 | const FB_PROJECT_NAME = 't8s-CUSTOMER-DETAILS-HERE';

So it is blowing up simply trying to read in the app.config.js.

Any thoughts on what I could try next? It clearly finds the config files, but fails to parse them

Android increments are wrong when using prereleases

Description of the bug

See #10

To Reproduce

  1. npx standard-version --release-as prerelease

Expected behavior

Android increments to be +1

Actual behavior

Something like 1.1.0-0.

Additional context

It's probably related to the semver parsing, but I'll have to investigate.

Add support for `app.config.js`

Description of the feature

Next to app.json and app.config.json, this library should support having a dynamic config.

Motivation

It's new and paves the path to a new set of tools to use for managing expo manifests.

Additional context

An example could be something like:

import * as versions from 'standard-version-expo';
import pkg from './package.json';

export default {
  name: 'awesomeapp',
  version: pkg.version,
  ios: {
    bundleIdentifier: 'com.acme.awesomeapp',
    buildNumber: versions.ios(pkg.version),
  },
  android: {
    package: 'com.acme.awesomeapp',
    versionCode: versions.android(pkg.version),
  }
}

This only works with deterministic methods, for incremental updates this would not work (which is kind of the reason why increments are not that great 😅)

Get sdkVersion from expo package.json

Description of the bug

Expo has deprecated putting sdkVersion in app.json in favor of using the version defined by node_modules/expo/package.json's version field. Would be great if this plugin started using that as the source as well.

To Reproduce

  1. Remove sdkVersion from app.json (automatically done by expo upgrade)
  2. run standard-releasse

Expected behavior

properly detects sdkVersion

Actual behavior

doesnt bump android version because of missing sdkVersion in app.json

Additional context

Please merge the dependabot PRs :)

@byCedric would you be able to merge some or all of the dependabot PRs? There are a lot of critical security bugs that would be fixed by accepting these updates. Then release a new version.

It would be a huge help to everyone that is using this module

Missing getenv dependency after upgrading to Expo 38.0.8

Description of the bug

After upgrading to Expo 38.0.8, errors where thrown when leveling up.

Additional context

The errors mention not being able to find getenv module.

Installing that module fixes the issue, but I thought I'd let you know in case you needed/wanted to update this package.

Add version bumpers for bare projects

Description of the feature

Add version bumpers for bare projects to update e.g. versionCode in Gradle.

Motivation

It would be awesome if bare users can use this tool too!

Additional context

See this

Android versionCode bumped to semver?

Description of the bug

standard-version --dry-run

✔ bumping version in package.json from 1.0.0 to 1.1.0
✔ bumping version in app.json from 1.0.0 to 1.1.0
✔ bumping version in app.json from 1.0.2 to 1.1.0
✔ bumping version in app.json from 3 to 1.1.0
✔ created CHANGELOG.md
✔ outputting changes to CHANGELOG.md

Shouldn't this go from 3 to 4?

To Reproduce

https://dev.to/bycedric/simplify-expo-releases-with-standard-version-2f4o

Expected behavior

For it to go from 3 to 4

Actual behavior

It went from 3 to 1.1.0

Additional context

I know issue is quite empty but... I tried 😅

Not matched value between console and execute result.

Description of the bug

Not matched value between console and execute result.

To Reproduce

What steps did you perform which led to this issue?

  1. run command standard-version
  2. Bumped. It showed this on console.
✔ bumping version in package.json from 0.0.0 to 0.0.1
✔ bumping version in app.json from 1 to 0.0.1
✔ bumping version in app.json from 1.0.0 to 0.0.1
  1. But! buildNumber in app.json is incremented like below.

Before

{
~~~~~~
    "ios": {
      "supportsTablet": true,
      "buildNumber": "1"
    },
~~~~~~
}

After

{
~~~~~~
    "ios": {
      "supportsTablet": true,
      "buildNumber": "2"
    },
~~~~~~
}

Expected behavior

✔ bumping version in package.json from 0.0.0 to 0.0.1
✔ bumping version in app.json from 1 to 2
✔ bumping version in app.json from 1.0.0 to 1.0.1

Actual behavior

✔ bumping version in package.json from 0.0.0 to 0.0.1
✔ bumping version in app.json from 1 to 0.0.1
✔ bumping version in app.json from 1.0.0 to 1.0.1

Additional context

.versionrc.js

module.exports = {
  bumpFiles: [
    {
      filename: 'package.json',
    },
    {
      filename: 'app.json',
      updater: require.resolve('standard-version-expo/ios/increment'),
    },
    {
      filename: 'app.json',
      updater: require.resolve('standard-version-expo'),
    }
  ]
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.