GithubHelp home page GithubHelp logo

bem / bem-react-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
31.0 17.0 8.0 345 KB

DEPRECATED! A bare minimum frontend boilerplate based on create-react-app and bem-react-core.

JavaScript 34.84% HTML 20.37% CSS 5.61% TypeScript 39.17%
bem react bem-react create-react-app declarative

bem-react-boilerplate's People

Contributors

awinogradov avatar kompolom avatar tadatuta avatar yeti-or 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

Watchers

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

bem-react-boilerplate's Issues

specs falls

first case:

 [email protected] test D:\learning\bem-in-react
> jest

 FAIL  src/blocks/App/App.test.tsx
  ● Test suite failed to run

    SecurityError: localStorage is not available for opaque origins

      at Window.get localStorage [as localStorage] (node_modules/jest-runner/node_modules/jsdom/lib/jsdom/browser/Window.js:257:15)
          at Array.forEach (<anonymous>)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.658s, estimated 3s
Ran all test suites.

second case:

> [email protected] test D:\learning\bem-in-react
> jest

 FAIL  src/blocks/App/App.test.tsx
  ● Test suite failed to run

    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    D:\learning\bem-in-react\src\blocks\App\Logo\App-Logo.svg:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
                                                                                             ^

    SyntaxError: Unexpected token <

       6 | import './App-Header.css';
       7 | 
    >  8 | const logoSvg = require('../Logo/App-Logo.svg');
         |                 ^
       9 | 
      10 | export interface IElemProps {
      11 |   title: string;

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runner/node_modules/jest-runtime/build/script_transformer.js:403:17)
      at Object.<anonymous> (src/blocks/App/Header/App-Header.tsx:8:17)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        3.648s
Ran all test suites.

Jest вылетает с ошибкой

bem-react-boilerplate v 0.1.0, при запуске yarn test

Вылетает с ошибкой
TypeError: environment.teardown is not a function at node_modules/jest-runner/build/run_test.js:230:25

Fix specs

npm test

> [email protected] test /Users/tadatuta/projects/shri/bem-react-boilerplate
> jest

 FAIL  src/blocks/App/App.test.js
  ● Test suite failed to run

    Cannot find module 'b:App' from 'App.test.js'

      2 | import ReactDOM from 'react-dom';
      3 |
    > 4 | import App from 'b:App';
      5 |
      6 | it('renders without crashing', () => {
      7 |   const div = document.createElement('div');

      at Resolver.resolveModule (node_modules/jest-cli/node_modules/jest-resolve/build/index.js:169:17)
      at Object.<anonymous> (src/blocks/App/App.test.js:4:13)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        2.181s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

Add readme about bundle creation for different platforms.

To create bundle for some override level you need to set level name in .env file.
Example:

PLATFORM= desktop

After run npm start to work with desktop override level and npm run build to create bundle of desktop-override level.

How to use sourcemaps?

I see that some maps are present, but what I see during debugging is not my source code. How I can to enable them properly?

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.