fix(expo): should support app.config.ts (#26713)
<!-- 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 https://github.com/nrwl/nx/issues/26467
This commit is contained in:
parent
2a803158ef
commit
412a450dae
@ -12,6 +12,8 @@ import {
|
|||||||
runCLIAsync,
|
runCLIAsync,
|
||||||
runE2ETests,
|
runE2ETests,
|
||||||
killPorts,
|
killPorts,
|
||||||
|
createFile,
|
||||||
|
removeFile,
|
||||||
} from 'e2e/utils';
|
} from 'e2e/utils';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
@ -159,4 +161,18 @@ describe('@nx/expo', () => {
|
|||||||
`${appName}/src/app/App.stories.tsx`
|
`${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));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -53,7 +53,7 @@ export const createDependencies: CreateDependencies = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const createNodes: CreateNodes<ExpoPluginOptions> = [
|
export const createNodes: CreateNodes<ExpoPluginOptions> = [
|
||||||
'**/app.{json,config.js}',
|
'**/app.{json,config.js,config.ts}',
|
||||||
async (configFilePath, options, context) => {
|
async (configFilePath, options, context) => {
|
||||||
options = normalizeOptions(options);
|
options = normalizeOptions(options);
|
||||||
const projectRoot = dirname(configFilePath);
|
const projectRoot = dirname(configFilePath);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user