"
+# img.version="0.1.7" \
+
+# Workdir in build stage should be equal with release stage, razzle uses this path
+WORKDIR /app
# install and cache node packages
COPY package.json yarn.lock ./
-RUN yarn install
+RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
+
#
# ---- Release ----
-FROM nginx:alpine
-# copy production node_modules
-COPY --from=base /root/build/build /var/www
-COPY nginx.conf /etc/nginx/nginx.conf
+FROM node:12.16.1-alpine3.9
+
+WORKDIR /app
+
+COPY --from=build /app/package.json /app/yarn.lock ./
+RUN yarn install --production
+COPY --from=build /app/build ./build
EXPOSE 80
+# EXPOSE 3000
+
+ENV PORT=80
+
+CMD ["yarn", "start:prod"]
diff --git a/README.md b/README.md
index bb0f440..ebaff67 100755
--- a/README.md
+++ b/README.md
@@ -1,47 +1,12 @@
# @howtocards/frontend
-[![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/howtocards/howtocards) [![](https://img.shields.io/badge/feature/slices-0.1-orange)](https://featureslices.dev/v0.1)
+> This is new version of Howtocards. If you want previous, see `master` branch
+[![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/howtocards/howtocards) [![](https://img.shields.io/badge/feature/slices-1.0-blue)](https://featureslices.dev/v1.0)
-[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg)](#contributors)
+[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg)](#contributors) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](http://prettier.io)
-## Aliases
-
-- `@features` resolves to `./src/features/`
-- `@howtocards/ui` resolves to `./src/ui/`
-- `@lib` resolves to `./src/lib/`
-
-## Available Scripts
-
-In the project directory, you can run:
-
-### `npm start`
-
-Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
-
-The page will reload if you make edits.
-You will also see any lint errors in the console.
-
-### `npm test`
-
-Lints the code an launches the test runner in the interactive watch mode.
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
-
-Use `npm run test:code` to run only `jest`
-And `npm run test:lint` to run only `eslint`
-
-### `npm run build`
-
-Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance.
-
-The build is minified and the filenames include the hashes.
-Your app is ready to be deployed!
-
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
-
-### `npm run commit`
+### `yarn commit`
**Please, always commit with this tool!**
Prompts commit type, scope and message.
diff --git a/babel.config.js b/babel.config.js
deleted file mode 100644
index 27ca3d5..0000000
--- a/babel.config.js
+++ /dev/null
@@ -1,20 +0,0 @@
-module.exports = {
- presets: ["react-app"],
- plugins: [
- "react-hot-loader/babel",
- "styled-components",
- "@babel/proposal-optional-chaining",
- ],
- env: {
- development: {
- plugins: [
- [
- "styled-components",
- {
- displayName: true,
- },
- ],
- ],
- },
- },
-}
diff --git a/commitlint.config.js b/commitlint.config.js
index aa9dd89..8e3b5fc 100644
--- a/commitlint.config.js
+++ b/commitlint.config.js
@@ -1,23 +1,23 @@
/* eslint-disable no-magic-numbers */
module.exports = {
- extends: ["@commitlint/config-conventional"],
+ extends: ['@commitlint/config-conventional'],
rules: {
- "type-enum": [
+ 'type-enum': [
2,
- "always",
+ 'always',
[
- "chore",
- "config",
- "docs",
- "feat",
- "fix",
- "perf",
- "refactor",
- "revert",
- "style",
- "test",
- "wip",
+ 'chore',
+ 'config',
+ 'docs',
+ 'feat',
+ 'fix',
+ 'perf',
+ 'refactor',
+ 'revert',
+ 'style',
+ 'test',
+ 'wip',
],
],
},
-}
+};
diff --git a/config/env.js b/config/env.js
deleted file mode 100644
index 4a53695..0000000
--- a/config/env.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* eslint-disable no-magic-numbers, unicorn/no-process-exit, no-console, prefer-template */
-const fs = require("fs")
-const path = require("path")
-const dotenv = require("dotenv")
-const dotenvExpand = require("dotenv-expand")
-
-const paths = require("./paths")
-
-// Make sure that including paths.js after env.js will read .env variables.
-delete require.cache[require.resolve("./paths")]
-
-const { NODE_ENV } = process.env
-if (!NODE_ENV) {
- throw new Error(
- "The NODE_ENV environment variable is required but was not specified.",
- )
-}
-
-// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
-const dotenvFiles = [
- `${paths.dotenv}.${NODE_ENV}.local`,
- `${paths.dotenv}.${NODE_ENV}`,
- // Don't include `.env.local` for `test` environment
- // since normally you expect tests to produce the same
- // results for everyone
- NODE_ENV !== "test" && `${paths.dotenv}.local`,
- paths.dotenv,
-].filter(Boolean)
-
-// Load environment variables from .env* files. Suppress warnings using silent
-// if this file is missing. dotenv will never modify any environment variables
-// that have already been set. Variable expansion is supported in .env files.
-// https://github.com/motdotla/dotenv
-// https://github.com/motdotla/dotenv-expand
-dotenvFiles.forEach((dotenvFile) => {
- if (fs.existsSync(dotenvFile)) {
- dotenvExpand(
- dotenv.config({
- path: dotenvFile,
- }),
- )
- }
-})
-
-// We support resolving modules according to `NODE_PATH`.
-// This lets you use absolute paths in imports inside large monorepos:
-// https://github.com/facebook/create-react-app/issues/253.
-// It works similar to `NODE_PATH` in Node itself:
-// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
-// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
-// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
-// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
-// We also resolve them to make sure all tools using them work consistently.
-const appDirectory = fs.realpathSync(process.cwd())
-process.env.NODE_PATH = (process.env.NODE_PATH || "")
- .split(path.delimiter)
- .filter((folder) => folder && !path.isAbsolute(folder))
- .map((folder) => path.resolve(appDirectory, folder))
- .join(path.delimiter)
-
-// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
-// injected into the application via DefinePlugin in Webpack configuration.
-const REACT_APP = /^REACT_APP_/i
-
-function getClientEnvironment(publicUrl) {
- const raw = Object.keys(process.env)
- .filter((key) => REACT_APP.test(key))
- .reduce(
- (env, key) => {
- // eslint-disable-next-line no-param-reassign
- env[key] = process.env[key]
- return env
- },
- {
- // Useful for determining whether weโre running in production mode.
- // Most importantly, it switches React into the correct mode.
- NODE_ENV: process.env.NODE_ENV || "development",
- // Useful for resolving the correct path to static assets in `public`.
- // For example, .
- // This should only be used as an escape hatch. Normally you would put
- // images into the `src` and `import` them in code to get their paths.
- PUBLIC_URL: publicUrl,
- },
- )
- // Stringify all values so we can feed into Webpack DefinePlugin
- const stringified = {
- "process.env": Object.keys(raw).reduce((env, key) => {
- // eslint-disable-next-line no-param-reassign
- env[key] = JSON.stringify(raw[key])
- return env
- }, {}),
- }
-
- return { raw, stringified }
-}
-
-module.exports = getClientEnvironment
diff --git a/config/jest/css-transform.js b/config/jest/css-transform.js
deleted file mode 100644
index a97276c..0000000
--- a/config/jest/css-transform.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// This is a custom Jest transformer turning style imports into empty objects.
-// http://facebook.github.io/jest/docs/en/webpack.html
-
-module.exports = {
- process() {
- return "module.exports = {};"
- },
- getCacheKey() {
- // The output is always the same.
- return "cssTransform"
- },
-}
diff --git a/config/jest/file-transform.js b/config/jest/file-transform.js
deleted file mode 100644
index f883f4f..0000000
--- a/config/jest/file-transform.js
+++ /dev/null
@@ -1,28 +0,0 @@
-const path = require("path")
-
-// This is a custom Jest transformer turning file imports into filenames.
-// http://facebook.github.io/jest/docs/en/webpack.html
-
-module.exports = {
- process(_src, filename) {
- const assetFilename = JSON.stringify(path.basename(filename))
-
- if (filename.match(/\.svg$/)) {
- return `module.exports = {
- __esModule: true,
- default: ${assetFilename},
- ReactComponent: (props) => ({
- $$typeof: Symbol.for('react.element'),
- type: 'svg',
- ref: null,
- key: null,
- props: Object.assign({}, props, {
- children: ${assetFilename}
- })
- }),
- };`
- }
-
- return `module.exports = ${assetFilename};`
- },
-}
diff --git a/config/paths.js b/config/paths.js
deleted file mode 100644
index c4f6217..0000000
--- a/config/paths.js
+++ /dev/null
@@ -1,86 +0,0 @@
-const path = require("path")
-const fs = require("fs")
-const url = require("url")
-
-// Make sure any symlinks in the project folder are resolved:
-// https://github.com/facebook/create-react-app/issues/637
-const appDirectory = fs.realpathSync(process.cwd())
-const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath)
-
-const envPublicUrl = process.env.PUBLIC_URL
-
-function ensureSlash(inputPath, needsSlash) {
- const hasSlash = inputPath.endsWith("/")
- if (hasSlash && !needsSlash) {
- return inputPath.substr(0, inputPath.length - 1)
- }
- if (!hasSlash && needsSlash) {
- return `${inputPath}/`
- }
- return inputPath
-}
-
-const getPublicUrl = (appPackageJson) =>
- // eslint-disable-next-line global-require, import/no-dynamic-require
- envPublicUrl || require(appPackageJson).homepage
-
-// We use `PUBLIC_URL` environment variable or "homepage" field to infer
-// "public path" at which the app is served.
-// Webpack needs to know it to put the right `
+ : ``
+ }
+
+
+ `;
+}
+
+function htmlEnd(storesValues: {}): string {
+ return `
+
+
+