-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for app.config.js manifest #191
Comments
Hi @zanona! I have run into the same issue. Have you made any progression with this incompatibility issue? |
Hi, @TomFrames module.exports = {
branches: ['master', {name: 'beta', prerelease: true}, {name: 'alpha', prerelease: true}],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
[
'@google/semantic-release-replace-plugin',
{
replacements: [
{
files: ['app.config.js'],
from: "version: process.env.APP_VERSION \\|\\| '.*'",
to: "version: process.env.APP_VERSION || '${nextRelease.version}'",
},
],
},
],
'@semantic-release/changelog',
['@semantic-release/git', {assets: ['CHANGELOG.md', 'app.config.js']}],
'@semantic-release/gitlab',
],
}; updatealso adding part of my export default {
name: 'App',
description: 'description',
slug: 'app',
platforms: ['ios', 'android'],
version: process.env.APP_VERSION || '1.0.0-alpha.8',
...
} |
Great! Thanks for the reference 👍 |
I've also recently encountered this issue as my However I definitely think this feature is warranted, so I started to take a look at it but it seems a tougher fix that I initially thought. I started by attempting to modify the /**
* Read the Expo manifest content and return the parsed JSON.
*/
export async function readManifest(filename: string): Promise<ManifestMeta> {
try {
const isNewAppConfig = filename.includes('config.js');
const content = isNewAppConfig ? await import(filename) : await readFile(filename, 'utf8');
const manifest = isNewAppConfig ? content : JSON.parse(content).expo;
return { filename, content, manifest };
} catch (error) {
error.expo = filename;
throw error;
}
} Unfortunately this doesn't work without adding An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/conor/Documents/Projects/Personal/semantic-release-playground/node_modules/semantic-release-expo/build/src/index.js
require() of ES modules is not supported. @byCedric Happy to help you out with this if you have any suggestions on how to proceed? |
Are you handling an Android versionCode? We are hitting a wall trying to auto-increment that. |
I took the torch from @zanona and also moved to https://github.com/google/semantic-release-replace-plugin. After a quick PR today, you should be able to update your expo
|
I ran into this problem today, but found that you can use
See https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs for their code examples |
Not related but might be helpful. If anyone is wondering how to migrate [
"@google/semantic-release-replace-plugin",
{
replacements: [
{
files: ["app.json"],
from: '"version": ".*"',
to: '"version": "${nextRelease.version}"',
},
{
files: ["app.json"],
from: '"buildNumber": ".*"',
to: '"buildNumber": "${nextRelease.version}"',
},
{
files: ["app.json"],
from: `"versionCode": .*$`,
to: (match) => {
const hadComma = match.includes(",");
const currVersion = parseInt(match.split(":")[1].trim()) || 0;
const nextVersion = currVersion + 1;
return `"versionCode": ${nextVersion}${hadComma ? "," : ""}`;
},
},
],
},
], |
Apparently this plugin only caters for
app.json
manifest format?I am using
app.config.js
in order to use theextra
manifest field. So it would be nice to have this supported.A workaround is to inherit the version from package.json if using so and under
app.config.js
have:However, I'm not completely clear on whether this semantic-version plugin runs other actions which are useful, besides updating the version on the manifest?
The text was updated successfully, but these errors were encountered: