|
1 |
| -import path from 'path'; |
2 | 1 | import fs from 'fs-extra';
|
3 | 2 | import kleur from 'kleur';
|
4 |
| -import yargs from 'yargs'; |
5 | 3 | import ora from 'ora';
|
6 |
| -import { prompt } from './utils/prompt'; |
7 |
| -import generateExampleApp from './exampleApp/generateExampleApp'; |
| 4 | +import path from 'path'; |
| 5 | +import yargs from 'yargs'; |
8 | 6 | import { addCodegenBuildScript } from './exampleApp/addCodegenBuildScript';
|
9 |
| -import { createInitialGitCommit } from './utils/initialCommit'; |
10 |
| -import { assertUserInput, assertNpxExists } from './utils/assert'; |
11 |
| -import { resolveNpmPackageVersion } from './utils/resolveNpmPackageVersion'; |
12 |
| -import { applyTemplates, generateTemplateConfiguration } from './template'; |
| 7 | +import { getDependencyVersionsFromExampleApp } from './exampleApp/dependencies'; |
| 8 | +import generateExampleApp from './exampleApp/generateExampleApp'; |
| 9 | +import { printErrorHelp, printNextSteps, printUsedRNVersion } from './inform'; |
13 | 10 | import {
|
14 |
| - createQuestions, |
| 11 | + acceptedArgs, |
15 | 12 | createMetadata,
|
| 13 | + createQuestions, |
16 | 14 | type Answers,
|
17 |
| - acceptedArgs, |
18 | 15 | type Args,
|
19 | 16 | } from './input';
|
20 |
| -import { getDependencyVersionsFromExampleApp } from './exampleApp/dependencies'; |
21 |
| -import { printErrorHelp, printNextSteps, printUsedRNVersion } from './inform'; |
| 17 | +import { applyTemplates, generateTemplateConfiguration } from './template'; |
| 18 | +import { assertNpxExists, assertUserInput } from './utils/assert'; |
| 19 | +import { createInitialGitCommit } from './utils/initialCommit'; |
| 20 | +import { prompt } from './utils/prompt'; |
| 21 | +import { resolveNpmPackageVersion } from './utils/resolveNpmPackageVersion'; |
| 22 | +import sortObjectKeys from './utils/sortObjectKeys'; |
22 | 23 |
|
23 | 24 | const FALLBACK_BOB_VERSION = '0.38.3';
|
24 | 25 | const FALLBACK_NITRO_MODULES_VERSION = '0.22.1';
|
@@ -116,17 +117,18 @@ async function create(_argv: yargs.Arguments<Args>) {
|
116 | 117 | const rootPackageJson = await fs.readJson(path.join(folder, 'package.json'));
|
117 | 118 |
|
118 | 119 | if (config.example !== 'none') {
|
119 |
| - const { devDependencies } = await getDependencyVersionsFromExampleApp( |
120 |
| - folder, |
121 |
| - config |
122 |
| - ); |
| 120 | + const { dependencies, devDependencies } = |
| 121 | + await getDependencyVersionsFromExampleApp(folder, config); |
123 | 122 |
|
124 |
| - rootPackageJson.devDependencies = rootPackageJson.devDependencies |
125 |
| - ? { |
126 |
| - ...rootPackageJson.devDependencies, |
127 |
| - ...devDependencies, |
128 |
| - } |
129 |
| - : devDependencies; |
| 123 | + rootPackageJson.dependencies = sortObjectKeys({ |
| 124 | + ...rootPackageJson.dependencies, |
| 125 | + ...dependencies, |
| 126 | + }); |
| 127 | + |
| 128 | + rootPackageJson.devDependencies = sortObjectKeys({ |
| 129 | + ...rootPackageJson.devDependencies, |
| 130 | + ...devDependencies, |
| 131 | + }); |
130 | 132 | }
|
131 | 133 |
|
132 | 134 | if (
|
|
0 commit comments