Skip to content

Commit

Permalink
fix(expo): show support app.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Jun 27, 2024
1 parent c2c6a13 commit e37e918
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 e37e918

Please sign in to comment.