create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

tsconfig.json is not created after running npx create-react-app --scripts-version @react-workspaces/react-scripts --template typescript

Open ivankoleda opened this issue 4 years ago β€’ 0 comments

Which terms did you search for in User Guide?

According to CRA doc: https://create-react-app.dev/docs/adding-typescript/#getting-started-with-typescript-and-react tsconfig.json will be created automatically

Running script form this section https://github.com/react-workspaces/react-workspaces-playground#creating-a-new-cra-app does not create it

Expected behavior

running npx create-react-app --scripts-version @react-workspaces/react-scripts --template typescript shared should create tsconfig.json file in root folder

Actual behavior

npx create-react-app --scripts-version @react-workspaces/react-scripts --template typescript shared

tsconfig.json has not beed created

Screen Shot 2020-03-06 at 20 05 21

This message is absent in following output, however it is present while using default react-scripts

We detected TypeScript in your project (src/App.test.tsx) and created a tsconfig.json file for you. Your tsconfig.json has been populated with default values.

output

npx: installed 99 in 7.186s

Creating a new React app in /Users/ivan/projects/monorepo/workspace-no-es5/packages/shared.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and @react-workspaces/react-scripts with cra-template-typescript...

yarn add v1.15.2 [1/4] πŸ” Resolving packages... [2/4] 🚚 Fetching packages... warning Pattern ["[email protected]"] is trying to unpack in the same destination "/Users/ivan/Library/Caches/Yarn/v4/npm-react-16.13.0-d046eabcdf64e457bbeed1e792e235e1b9934cf7/node_modules/react" as pattern ["react@^16.13.0"]. This could result in non-deterministic behavior, skipping. warning Pattern ["[email protected]"] is trying to unpack in the same destination "/Users/ivan/Library/Caches/Yarn/v4/npm-react-dom-16.13.0-cdde54b48eb9e8a0ca1b3dc9943d9bb409b81866/node_modules/react-dom" as pattern ["react-dom@^16.13.0"]. This could result in non-deterministic behavior, skipping. [3/4] πŸ”— Linking dependencies... warning "workspace-aggregator-0bcca8c9-25ac-45a2-b068-d4557dfa6570 > web > @react-workspaces/react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". [4/4] πŸ”¨ Building fresh packages... success Saved lockfile. warning Your current version of Yarn is out of date. The latest version is "1.22.1", while you're on "1.15.2". info To upgrade, run the following command: $ brew upgrade yarn success Saved 4 new dependencies. info Direct dependencies info All dependencies β”œβ”€ @react-workspaces/[email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] └─ [email protected] ✨ Done in 21.48s. Removing template package using yarnpkg...

yarn remove v1.15.2 [1/2] πŸ—‘ Removing module cra-template-typescript... [2/2] πŸ”¨ Regenerating lockfile and installing missing dependencies... warning "workspace-aggregator-fd2495c5-560c-41a6-aec9-54235e0c6177 > shared > @react-workspaces/react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". success Uninstalled packages. ✨ Done in 9.47s.

Initialized a git repository.

Success! Created shared at /Users/ivan/projects/monorepo/workspace-no-es5/packages/shared Inside that directory, you can run several commands:

yarn start Starts the development server.

yarn build Bundles the app into static files for production.

yarn test Starts the test runner.

yarn eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

cd shared yarn start

Happy hacking!

npx create-react-app --template typescript shared-copy

tsconfig.json has been fcreated

Screen Shot 2020-03-06 at 20 05 16
output

npx: installed 99 in 8.969s

Creating a new React app in /Users/ivan/projects/monorepo/workspace-no-es5/shared-copy.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template-typescript...

yarn add v1.15.2 [1/4] πŸ” Resolving packages... [2/4] 🚚 Fetching packages... [3/4] πŸ”— Linking dependencies... warning "react-scripts > [email protected]" has incorrect peer dependency "[email protected]". warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". [4/4] πŸ”¨ Building fresh packages... success Saved lockfile. success Saved 9 new dependencies. info Direct dependencies β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] └─ [email protected] info All dependencies β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] └─ [email protected] ✨ Done in 17.98s.

Initialized a git repository.

Installing template dependencies using yarnpkg... yarn add v1.15.2 [1/4] πŸ” Resolving packages... [2/4] 🚚 Fetching packages... [3/4] πŸ”— Linking dependencies... warning "react-scripts > [email protected]" has incorrect peer dependency "[email protected]". warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=5". [4/4] πŸ”¨ Building fresh packages... success Saved lockfile. success Saved 25 new dependencies. info Direct dependencies β”œβ”€ @testing-library/[email protected] β”œβ”€ @testing-library/[email protected] β”œβ”€ @testing-library/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] └─ [email protected] info All dependencies β”œβ”€ @babel/[email protected] β”œβ”€ @sheerun/[email protected] β”œβ”€ @testing-library/[email protected] β”œβ”€ @testing-library/[email protected] β”œβ”€ @testing-library/[email protected] β”œβ”€ @testing-library/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ @types/[email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] β”œβ”€ [email protected] └─ [email protected] ✨ Done in 11.80s.

We detected TypeScript in your project (src/App.test.tsx) and created a tsconfig.json file for you.

Your tsconfig.json has been populated with default values.

Removing template package using yarnpkg...

yarn remove v1.15.2 [1/2] πŸ—‘ Removing module cra-template-typescript... [2/2] πŸ”¨ Regenerating lockfile and installing missing dependencies... warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=5". warning "react-scripts > [email protected]" has incorrect peer dependency "[email protected]". success Uninstalled packages. ✨ Done in 16.67s.

Created git commit.

Success! Created shared-copy at /Users/ivan/projects/monorepo/workspace-no-es5/shared-copy Inside that directory, you can run several commands:

yarn start Starts the development server.

yarn build Bundles the app into static files for production.

yarn test Starts the test runner.

yarn eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

cd shared-copy yarn start

Happy hacking!

Seem like checking happens in this function https://github.com/react-workspaces/create-react-app/blob/a4d9ee5a9e1ba099aee5ac40e82975dd0c180b67/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js#L27

ivankoleda avatar Mar 08 '20 08:03 ivankoleda