Coder Social home page Coder Social logo

minesweeper's Introduction

Minesweeper

A simple minesweeper game made in React

Getting started

Install yarn. Then in this project directory run:

yarn

This will install all the project dependencies. When adding new dependencies, be sure to also commit the yarn.lock file. Read more about Managing Dependencies.

Developing

Keep this running in the background:

yarn start

Now navigate to http://localhost:8080 to view the app.

Workflow

Auto-generating files

The following pinkprint commands are available:

yarn g component folder/NewComponent
yarn g store foo
yarn g style fancy
yarn g helper maths

Best Practices

JavaScript

Prefer absolute imports instead of relative, upwards navigation. Relative downwards imports are also fine.

// Good
import Button from '@/components/Button';

// Bad
import Button from '../../components/Button';

// OK but not preferred
import Button from './stuff/Button';

CSS

Any global styles should go directly in the style directory. From an scss file you can import any file in the style/globals directory. For example:

@import 'colors';

Code Formatting

To format your code run:

yarn format

Thanks to Husky, this will be run automatically when you commit. To disable this temporarily, run git commit -n which will skip all git hooks for that commit. Try not to make a habit of it, though.

The commit hooks are defined in the scripts section of the package.json.

Building

Create a production build of the app:

yarn dist

Features

Project Structure

├── bin/                    # Webpack builds the static site into this directory
└── public/                 # Public files that get shipped
    ├── fonts/              # Font files
    └── img/                # Images and SVGs
└── src/                    # All source code
    └── components/         # React components
        ├── Component.jsx   # React component file
        └── Component.scss  # Style sheet for react component
    └── helpers/            # Helper files
        ├── history.js      # Browser history singleton
        └── functions.js    # General-purpose helper functions
    └── store/              # Base redux files and reducers
        ├── index.js        # Redux store singleton
        └── reducer.js      # Root reducer
    └── style/              # Common stylesheets
        ├── globals/        # Global variables and mixins
        └── lib/            # 3rd party vendor code
    ├── index.html          # App HTML page using lodash template
    ├── index.jsx           # App entry point
    └── index.scss          # SCSS entry point
├── package.json            # Defines dependencies and build scripts
├── webpack.config.js       # Main build file
└── README.md               # This file

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.