Giter VIP home page Giter VIP logo

react-workspaces / create-react-app Goto Github PK

View Code? Open in Web Editor NEW
94.0 94.0 39.0 11.02 MB

Yarn Workspaces Monorepo support for Create-React-App / React-Scripts.

Home Page: https://github.com/react-workspaces/react-workspaces-playground

License: MIT License

JavaScript 98.10% CSS 0.15% AppleScript 0.09% HTML 0.12% TypeScript 0.22% Shell 1.33%
create-react-app monorepo react react-scripts workspaces yarn

create-react-app's People

Contributors

amyrlam avatar andriijas avatar arcanis avatar bondz avatar bradfordlemley avatar brunolemos avatar enoahnetzach avatar existentialism avatar f1lt3r avatar fson avatar gaearon avatar greengremlin avatar heyimalex avatar iamandrewluca avatar ianschmitz avatar iansu avatar jeffposnick avatar mrmckeb avatar mxstbr avatar pmoleri avatar ro-savage avatar ryansully avatar selbekk avatar sidoshi avatar tharakawj avatar timer avatar tuchk4 avatar viankakrisna avatar vjeux avatar xiaoxiangmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-react-app's Issues

Issue with babel-jest version mismatch.

These is an issue whenever I do "yarn install" or "yarn" as it overrides the yarn.lock file and with this whenever I run "yarn start" into my libraries or apps it fails with the following errors:

The @react-workspaces/react-scripts package provided by Create React App requires a dependency:

  "babel-jest": "24.7.1"

Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-jest was detected higher up in the tree:

  /ROOT/sample-app/node_modules/babel-jest (version: 24.8.0) 

Manually installing incompatible versions is known to cause hard-to-debug issues.
.
....
......

Is this issue because of base CRA and "@react-workspaces/react-scripts" using different version.? Not sure.

Don't want to use SKIP_PREFLIGHT_CHECK=true for all the modules.

Again tried with --frozen-lockfile true in yarnrc but this also does not solve it.

Any Idea, what I am doing wrong there.?

Deleting 'yarn.lock' before yarn install, things work fine, but I need to do it all the time whenever yarn install needed.

Used versions:
Node: v12.6.0,
Yarn: 1.17.3,
babel-eslint: v10.0.1

Parsing error: Unexpected token, expected "]" (eslint-loader)

Here's an error I get if I use any relatively new (in the last 3 or so years) features of typescript:

ERROR in ../linear/src/elements.tsx
Module Error (from /mnt/c/Users/thoma/OneDrive/Documents/devel/linear/node_modules/@react-workspaces/react-scripts/node_modules/eslint-loader/dist/cjs.js):

  Line 5:41:  Parsing error: Unexpected token, expected "]"

  3 | import classes from './classes';
  4 | 
> 5 | type PropsOf<T> = JSX.IntrinsicElements[T];
    |                                         ^
  6 | 
  7 | 
  8 | export const A:

It looks to me like the issue is that eslint-loader is pegged to exactly 3.0.3 here: https://github.com/react-workspaces/create-react-app/blob/master/packages/react-scripts/package.json#L47

Security issue: Need to upgrade jest

Hi,

High security issue have been reported to handlebars package used in the tree below :

@react-workspaces/react-scripts > jest-cli > @jest/core > @jest/reporters > istanbul-reports > handlebars

Link of the report

Your jest is under the 24.7.1 version.
I think upgrade to the latest version (24.9.0) will solve this security issue.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string

I'm having this error when executing yarn:app start:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at validateString (internal/validators.js:118:11) at Object.join (path.js:1039:7) at noopServiceWorkerMiddleware (/var/www/html/react-workspaces-playground/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26) at Layer.handle [as handle_request] (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:317:13) at /var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:335:12) at next (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:275:10) at launchEditorMiddleware (/var/www/html/react-workspaces-playground/node_modules/react-dev-utils/errorOverlayMiddleware.js:20:7) at Layer.handle [as handle_request] (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:317:13) at /var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:335:12) at next (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/index.js:275:10) at handleWebpackInternalMiddleware (/var/www/html/react-workspaces-playground/node_modules/react-dev-utils/evalSourceMapMiddleware.js:42:7) at Layer.handle [as handle_request] (/var/www/html/react-workspaces-playground/node_modules/express/lib/router/layer.js:95:5)

Tools and versions:

  • Windows 10 Enterprise
  • Yarn: v1.19.0 (cannot use v1.22.0, due to this error).
  • Lerna: 3.20.2
  • @react-workspaces/react-scripts: 3.3.0-alpha-08

According to this stackoverflow topic, this error should be resolved by upgrading the react-scripts version to 3.4.0.

SecurityError: The operation is insecure.

script display an error on run start

SecurityError: The operation is insecure.
../../../node_modules/@react-workspaces/react-scripts/node_modules/react-dev-utils/webpackHotDevClient.js
node_modules/@react-workspaces/react-scripts/node_modules/react-dev-utils/webpackHotDevClient.js:60

version "@react-workspaces/react-scripts": "3.3.0-alpha-08"

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

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

Bug: Can't import PubNub package

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Environment

Environment Info:

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
Binaries:
Node: 12.9.1 - E:\nodejs\node.EXE
Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.10.2 - E:\nodejs\npm.CMD
Browsers:
Edge: 41.16299.248.0
Internet Explorer: 11.0.16299.15
npmPackages:
react: ^16.9.0 => 16.9.0
react-dom: ^16.9.0 => 16.9.0
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found

Steps to Reproduce

  1. yarn create react-app --scripts-version @react-workspaces/react-scripts test
  2. cd test && yarn add pubnub
  3. vi src/App.js
  4. Add import pubnub from "pubnub"; at the top
  5. yarn start

Expected Behavior

Start with only a unused warning

Compiled with warnings.

./src/App.js
  Line 4:  'pubnub' is defined but never used  no-unused-vars

Actual Behavior

Compiles but give a runtime error in the browser.
Screenshot_7

Uncaught TypeError: Cannot read property 'fd' of undefined
at Function.useColors (node.js:60)
at createDebug (debug.js:112)
at Object. (index.js:14)
at Object../node_modules/http-proxy-agent/index.js (index.js:110)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/pac-proxy-agent/index.js (index.js:36)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/proxy-agent/index.js (index.js:22)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/superagent-proxy/index.js (index.js:4)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/pubnub/lib/networking/modules/node.js (node.js:11)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object../node_modules/pubnub/lib/node/index.js (index.js:16)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Module../src/App.js (App.css?4433:45)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Module../src/index.js (index.css?f3f6:45)
at webpack_require (bootstrap:781)
at fn (bootstrap:149)
at Object.0 (serviceWorker.js:135)
at webpack_require (bootstrap:781)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1

Reproducible Demo

Can't recreate the issue in codesandbox. Creating the issue in a new project as described above is fast and straightforward.

Some tests I did

  1. Tried with nodejs 10.16.3/12.9.1 with same issue.
  2. Tried with official react-scripts 3.0.1 and 3.1.1 and I do not face the issue.

Thanks

Using jsdom in test environment

My test script in package.json looks like this:

"test": "react-scripts test"

It works fine and Jest takes over. But if I supply "env" argument to the script, it stops working:

"test": "react-scripts test --env=jsdom"

Output:

yarn workspace v1.22.4
yarn run v1.22.4
$ react-scripts test --env=jsdom
✨  Done in 0.14s.
✨  Done in 0.41s.

Jest never starts and no tests are executed.

cc @F1LT3R

Please release the reactscript in npm

If you have a general question about Create React App or about building an app with Create React App we encourage you to post on our Spectrum community instead of this issue tracker. The maintainers and other community members can provide help and answer your questions there: https://spectrum.chat/create-react-app

If you're looking for general information on using React, the React docs have a list of resources: https://reactjs.org/community/support.html

If you've discovered a bug or would like to propose a change please use one of the other issue templates.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.