Skip to content

Commit

Permalink
chore: migrate and make it public
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Aug 31, 2018
1 parent e0345d4 commit 0a0722a
Show file tree
Hide file tree
Showing 548 changed files with 13,744 additions and 137 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
!.storybook/config.js
dist/
node_modules/*
**/node_modules/*
2 changes: 2 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
extends: "@commercetools-frontend/eslint-config-mc-app"
84 changes: 84 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Storybook build output
.public

# Serverless directories
.serverless

# Editor/IDE
.idea
.vscode
!.vscode/settings.json

# Netlify
netlify.toml
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package.json
packages-shared/i18n/*.json
.babelrc
**/dist/
**/public/
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"trailingComma": "es5",
"singleQuote": true,
"parser": "babylon"
}
7 changes: 7 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"config:base",
":pinOnlyDevDependencies",
"schedule:weekly"
]
}
6 changes: 3 additions & 3 deletions .storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import IntlDecorator from './decorators/intl';

// setAddon(infoAddon);

import '../materials/reset.mod.css';
import '../src/components/materials/reset.mod.css';
import './main.mod.css';

setOptions({
name: 'MC Styleguide',
url: 'https://mc.escemo.com/styleguide',
url: 'https://uikit.commercetools.com',
goFullScreen: false,
showStoriesPanel: true,
showAddonPanel: true,
Expand All @@ -23,7 +23,7 @@ setOptions({
resolveStoryHierarchy: storyName => storyName.split('/'),
});

const req = require.context('../', true, /\.story\.js$/);
const req = require.context('../src', true, /\.story\.js$/);

function loadStories() {
req.keys().forEach(filename => req(filename));
Expand Down
4 changes: 2 additions & 2 deletions .storybook/decorators/formik-box/formik-box.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Spacings from '../../../materials/spacings';
import Text from '../../../typography/text';
import Spacings from '../../../src/components/materials/spacings';
import Text from '../../../src/components/typography/text';

export default class FormikBox extends React.Component {
static displayName = 'FormikBox';
Expand Down
5 changes: 3 additions & 2 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ const createWebpackConfigForDevelopment = require('@commercetools-frontend/mc-sc
const createWebpackConfigForProduction = require('@commercetools-frontend/mc-scripts/config/create-webpack-config-for-production');

const sourceFolders = [
// This points to `packages-shared`
path.resolve(__dirname, '../..'),
path.resolve(__dirname),
path.resolve(__dirname, '../examples'),
path.resolve(__dirname, '../src'),
];

const mcWebpackConfigDev = createWebpackConfigForDevelopment({
Expand Down
33 changes: 33 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-order"
],
"rules": {
"font-family-name-quotes": ["always-unless-keyword"],
"function-url-quotes": "always",
"selector-attribute-quotes": "always",
"string-quotes": "single",
"selector-pseudo-class-no-unknown": [
true,
{ "ignorePseudoClasses": ["global"] }
],
"order/properties-order": [
["composes"],
{ "unspecified": "bottom" }
],
"declaration-block-no-duplicate-properties": [
true,
{ "ignoreProperties": ["composes"] }
],
"property-no-unknown": [
true,
{ "ignoreProperties": ["composes"] }
],
"declaration-colon-newline-after": null,
"rule-empty-line-before": null,
"value-list-comma-newline-after": null,
"indentation": null,
"selector-descendant-combinator-no-non-space": null
}
}
14 changes: 14 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable */
module.exports = {
extends: ['@commitlint/config-conventional'],
parserPreset: {
parserOpts: {
// Allow to write a "scope" with slashes
// E.g. `refactor(app/my-component): something`
headerPattern: /^(\w*)(?:\(([\w\$\.\/\-\* ]*)\))?\: (.*)$/,
},
},
rules: {
'header-max-length': [0, 'always', 100],
},
};
20 changes: 10 additions & 10 deletions examples/forms.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import { withKnobs, select } from '@storybook/addon-knobs';
import mapValues from 'lodash.mapvalues';
import Section from '../.storybook/decorators/section';
import FormikBox from '../.storybook/decorators/formik-box';
import Spacings from '../materials/spacings';
import Text from '../typography/text';
import ErrorMessage from '../messages/error-message';
import TextInput from '../inputs/text-input';
import NumberInput from '../inputs/number-input';
import MoneyInput from '../inputs/money-input';
import MultilineTextInput from '../inputs/multiline-text-input';
import LocalizedTextInput from '../inputs/localized-text-input';
import PrimaryButton from '../buttons/primary-button';
import SecondaryButton from '../buttons/secondary-button';
import Spacings from '../src/components/materials/spacings';
import Text from '../src/components/typography/text';
import ErrorMessage from '../src/components/messages/error-message';
import TextInput from '../src/components/inputs/text-input';
import NumberInput from '../src/components/inputs/number-input';
import MoneyInput from '../src/components/inputs/money-input';
import MultilineTextInput from '../src/components/inputs/multiline-text-input';
import LocalizedTextInput from '../src/components/inputs/localized-text-input';
import PrimaryButton from '../src/components/buttons/primary-button';
import SecondaryButton from '../src/components/buttons/secondary-button';
import Forms from './forms.md';

// utilities for story
Expand Down
12 changes: 12 additions & 0 deletions jest-runner-eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
cliOptions: {
format: 'node_modules/eslint-formatter-pretty',
rules: {
'import/no-unresolved': 2,
'prettier/prettier': [
'error',
{ trailingComma: 'es5', singleQuote: true },
],
},
},
};
11 changes: 11 additions & 0 deletions jest.eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
runner: 'jest-runner-eslint',
displayName: 'eslint',
testMatch: [
'<rootDir>/.storybook/**/*.js',
'<rootDir>/examples/**/*.js',
'<rootDir>/scripts/**/*.js',
'<rootDir>/src/**/*.js',
],
watchPlugins: ['jest-plugin-filename'],
};
7 changes: 7 additions & 0 deletions jest.stylelint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
runner: 'jest-runner-stylelint',
displayName: 'stylelint',
moduleFileExtensions: ['css'],
testMatch: ['<rootDir>/src/**/*.css'],
watchPlugins: ['jest-plugin-filename'],
};
4 changes: 4 additions & 0 deletions jest.test.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: '@commercetools-frontend/jest-preset-mc-app',
moduleDirectories: ['src'],
};
25 changes: 25 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
'{src,examples}/**/*.md': ['npm run format:md', 'git add'],
'{src,scripts,examples,.storybook}/**/*.js': [
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
// flag, jest does not seem correctly parse the arguments.
//
// No tests found related to files changed since last commit.
// Run Jest without `-o` or with `--all` to run all tests.
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
//
// For that reason, we move the `--onlyChanged` flag next to it.
'npm run lint:js -- --reporters=jest-silent-reporter --onlyChanged',
],
'src/**/*.css': [
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
// flag, jest does not seem correctly parse the arguments.
//
// No tests found related to files changed since last commit.
// Run Jest without `-o` or with `--all` to run all tests.
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
//
// For that reason, we move the `--onlyChanged` flag next to it.
'npm run lint:css -- --reporters=jest-silent-reporter --onlyChanged',
],
};
Loading

0 comments on commit 0a0722a

Please sign in to comment.