-
-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix jest noop, upgrade to Babel 7, use Yarn Workspaces, add create-razzle-app tests #519
Conversation
Instead of inline options.
It wasn't running tests. `jest.config.json` was not being used. I have not been able to figure out why, but it works without `--config`.
babel-preset-razzle was adjusted to CRA and extended to accept options for both `@babel/preset-env` and `@babel/preset-react`, to exclude generator and async transforms accordingly. `@babel/preset-env` options are divided in `envTest` and `envRest` to allow more control over the Node environment when testing.
To match CRA.
Removes manual linking and direct bootstrapping with Lerna in favor of Yarn Workspaces. See facebook/create-react-app#3755. Before using Yarn Workspaces, tests were not passing because of an error similar to babel/babel#7110; it seems it was related to conflicting babel-core (see babel/babel#7110 (comment)) since we are using Jest which depends on babel-core 6 and needs babel-core 7-bridge to work. Issues disappear with Yarn Workspaces and tests are passing.
Some packages may require compilers. Some, like BuckleScript's, are compiled locally. When added directly to `devDependencies`, internal `yarn install` performs an unnecessary, expensive operation. Therefore,`npm/yarn run init` bootstraps these requirements in userland. Moreover, Yarn Workspaces reinstalls all packages on `add` (yarnpkg/yarn#4980) and having these dependencies within `devDependencies` meant that binaries where redownloaded and recompiled every time.
Other than testing some of create-razzle-app's surface, we ensure that `yarn init:bin` is working correctly.
Due to `yarn format` failing on `yarn add razzle`.
Waiting to razzle v2.1.0 😄 |
Most of this is in 2.x The |
Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal. |
ProBot automatically closed this due to inactivity. Holler if this is a mistake, and we'll re-open it. |
Changes
babel-preset-razzle
instead of usingbabel-preset-react-app
.preset-env
andpreset-react
instead of having them opaque and incurring in a full-blown manual configuration for minor tweaks (e.g., disabling async transforms or usingtarget.browsers
) (not tested yet)..babelrc.js
(994cf40)yarn link
(8280275)yarn bootstrap
andyarn clean
yarn.lock
Module build error
similar to Module build failed: TypeError: Cannot read property 'loose' of undefined babel/babel#7110. It seems it was related to conflicting babel-core (see Module build failed: TypeError: Cannot read property 'loose' of undefined babel/babel#7110 (comment)) due to Jest: babel-jest depends on babel-core 6 and requiresbabel-core v7.0.0-bridge.0
to work with Babel 7.yarn install
takes care of removing unused packages and bootstrappinglerna clean --yes
is apreinstall
script.yarn init:bin
requirement for examples that depend on locally-compiled binaries (e8bd5f1)bs-platform
devDependency
within with-reason-react)devDependencies
,yarn install
performs an unnecessary, expensive operation.npm/yarn run init:bin
bootstraps these requirements in userland viacreate-razzle-app
, which was updated to handle the change."pkg.init:bin"
create-razzle-app
to allow testing with local examples (e8bd5f1)origin
; this made it impossible to test it with local changes without merging.create-razzle-app
tests (to also coveryarn init:bin
) (0b1c71e)config/polyfills
increateJestConfig
(as per Start migrating to babel 7.x #462 (comment)) (a45375d, c5e90c4)Fixes
yarn e2e
was not actually running tests because of a faulty--config
. See CircleCIyarn e2e —runInBand
output. (185b0d4)jest --verbose --no-cache
on master)..json
,.css
, and.md
(4b7ee26)Yarn Workspaces Caveats
devDependencies
package to a workspace,yarn add package —dev
must be executed within a workspace folder rather anywhere else withyarn workspace workspace-name add package —dev
(pendingyarn workspaces <workspace> add <package> -D
adds to <workspace>dependencies
yarnpkg/yarn#5396; related to Yarn workspace fails to add local package as dependency yarnpkg/yarn#4878 and Cannotyarn add
in workspace package if depending on a local package yarnpkg/yarn#3973)cd
toworkspace-name
(e.g.,cd packages/create-razzle-app
)yarn add package --dev
(e.g.,yarn add @babel/runtime --dev
)dependencies
package to the root workspace (i.e., ./package.json), useyarn add package --ignore-workspace-root-check
(see Cannot add a regular dependency to a workspace root yarnpkg/yarn#4558). To add adevDependencies
package to the root workspaceyarn add package --dev
.yarn install
reinstalls all packages every time (pending Adding package to workspace reinstalls all packages yarnpkg/yarn#4980)Caveats
critical dependency
(Warning: Critical dependencies. webpack/webpack#196) when compiling basic (and possibly all others?) due to Express (not a significant issue given it’s server-side).Could not kill process
when running tests due to conservativekill(process.pid)
use inexports.run
in test/utils/common due to occasionalEADDRINUSE :::3001
issues (i.e., processes not being terminated).EADDRINUSE :::3001
thensudo lsof -ti:3001 | xargs kill -9
(on>= El Capitan
) (related to yarn run fails due to port 3001 already in use #454 and Check for port in use when running npm run start to avoid EADDRINUSE #397)babel-preset-razzle
preset-env
andpreset-react
options.yarn bootstrap
andyarn clean
mentions.