blackboxvision / react-admin-extensions Goto Github PK
View Code? Open in Web Editor NEWPackages for improving your development workflow with react admin
License: MIT License
Packages for improving your development workflow with react admin
License: MIT License
On react ^17.0.2:
Could not resolve dependency: peer react@"^16.11.0" from @blackbox-vision/[email protected]
Hi,
Thanks for sharing Spanish translations for react-admin!
I've updated from 3.12 to 3.16 and found this issue. I've tried installing this library on a new React Admin project but didn't work.
yarn create react-app test-admin
cd test-admin/
yarn add react-admin ra-data-json-server prop-types
yarn build
That works until I installed this library:
yarn add v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "connected-react-router@^6.5.2".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "final-form@^4.20.2".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-final-form@^6.5.2".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-redux@^7.1.0".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-router@^5.1.0".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "react-router-dom@^5.1.0".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "redux@^3.7.2 || ^4.0.3".
warning "ra-data-json-server > [email protected]" has unmet peer dependency "redux-saga@^1.0.0".
warning "react-admin > [email protected]" has unmet peer dependency "history@^4.7.2".
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".
warning " > @blackbox-vision/[email protected]" has unmet peer dependency "ra-core@^3.14.0".
warning " > @blackbox-vision/[email protected]" has incorrect peer dependency "react@^16.11.0".
[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ @blackbox-vision/[email protected]
info All dependencies
└─ @blackbox-vision/[email protected]
Done in 6.34s.
yarn run v1.22.10
$ react-scripts build
Creating an optimized production build...
Failed to compile.
./src/App.js
Cannot find module: '@blackbox-vision/ra-language-spanish'. Make sure this package is installed.
You can install this package by running: yarn add @blackbox-vision/ra-language-spanish.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Is there something I wrong I'm doing or maybe installing wrong library version?
Installed react-admin repository.
Installed @blackbox-vision/ra-language-spanish on repository root.
When trying to import it to App get cannot find module '@blackbox-vision/ra-language-spanish'
Version 4.4.0 added the Customize
component, which includes some new i18n keys. More info here.
This is how the translation works in react-admin 3.17.1
`import polyglotI18nProvider from "ra-i18n-polyglot";
import spanishMessages from "@blackbox-vision/ra-language-spanish";
export const i18nProvider = polyglotI18nProvider(() => spanishMessages, 'es', {
allowMissing: true,
});
`
Hi
I am going to push a translation change to the project. I would like it to count for my hactkoberfest PRs. Can you add that label to the project so it gets accepted?
Thanks
We've used to work with pika pkg as the method for building, bundling and releasing the libraries under the monorepo. The latest year pika pkg has been archived and no more work has been done around.
Analizing where to move, I think we need to move the packages to tsdx since its well mantained and it has a lot of features that can make our work more easier.
It works perfect from the App build (create react app), but it cannot find the module when running jest tests.
I think it has something to do with
Jest looking for a file called index.js in the module root folder.
If i create and empty index.js file in the root folder Jest pass sucessfully.
This is the node_modules subfolder for the installed module:
└── ra-language-spanish
├── dist-src
│ └── index.js
├── dist-types
│ └── index.d.ts
├── dist-web
│ ├── index.js
│ └── index.js.map
├── package.json
└── README.md
This is the Jest run failing ouput:
FAIL src/App.test.js
● Test suite failed to run
Cannot find module '@blackbox-vision/ra-language-spanish' from 'src/providers/i18nProvider.js'
Require stack:
src/providers/i18nProvider.js
src/App.js
src/App.test.js
2 | import polyglotI18nProvider from 'ra-i18n-polyglot'
3 | import englishMessages from 'ra-language-english'
> 4 | import spanishMessages from '@blackbox-vision/ra-language-spanish'
| ^
5 | import frenchMessages from 'ra-language-french'
6 | import italianMessages from 'ra-language-italian'
7 | import merge from 'lodash/merge'
at Resolver.resolveModule (node_modules/jest-runtime/node_modules/jest-resolve/build/index.js:306:11)
at Object.<anonymous> (src/providers/i18nProvider.js:4:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 7.515 s, estimated 10 s
Ran all test suites.
If I import the library as:
import spanishMessages from "@blackbox-vision/ra-language-spanish/";
It works, but get the following ESLint errors:
Unable to resolve path to module "@blackbox-vision/ra-language-spanish/"
Missing file extension for "@blackbox-vision/ra-language-spanish/"
And my tests fail:
Cannot find module '@blackbox-vision/ra-language-spanish/' from 'src/providers/translation/locales/es.js'
I can fix the ESLint errors if I import as @blackbox-vision/ra-language-spanish/dist-src
or /dist-web
but my tests still fail with:
export default spanishMessages;
^^^^^^
SyntaxError: Unexpected token 'export'
I only managed to make everything work by updating the jest config in my package.json
:
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!@blackbox-vision)"
]
}
I don't understand why I have to do this, I am missing something?
Versions:
@blackbox-vision/ra-language-spanish
- 3.16.2react-admin
- 3.19.1yarn
- 1.22.10node
- 14.18.1A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.