Skip to content

Commit

Permalink
fix(expo): should support app.config.ts (#26713)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26467
  • Loading branch information
xiongemi authored Jun 27, 2024
1 parent 2a80315 commit 412a450
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions e2e/expo/src/expo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
runCLIAsync,
runE2ETests,
killPorts,
createFile,
removeFile,
} from 'e2e/utils';
import { join } from 'path';

Expand Down Expand Up @@ -159,4 +161,18 @@ describe('@nx/expo', () => {
`${appName}/src/app/App.stories.tsx`
);
});

it('should work with app.config.ts', () => {
const appJson = join(appName, `app.json`);
const appJsonContent = readJson(appJson);
removeFile(appJson);
createFile(
join(appName, 'app.config.ts'),
`export default { expo: { name: 'my-app', slug: 'my-app' } };`
);
const result = runCLI(`show project ${appName} --json false`);
expect(result).toContain('start:');
expect(result).toContain('serve:');
createFile(appJson, JSON.stringify(appJsonContent));
});
});
2 changes: 1 addition & 1 deletion packages/expo/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const createDependencies: CreateDependencies = () => {
};

export const createNodes: CreateNodes<ExpoPluginOptions> = [
'**/app.{json,config.js}',
'**/app.{json,config.js,config.ts}',
async (configFilePath, options, context) => {
options = normalizeOptions(options);
const projectRoot = dirname(configFilePath);
Expand Down

0 comments on commit 412a450

Please sign in to comment.