-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Pham Hai Duong
authored
Jul 15, 2020
1 parent
a6b2262
commit 67ae948
Showing
39 changed files
with
153,413 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
yarn-path ".yarn/releases/yarn-1.18.0.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// TODO - a start on theming - needs some work - ideally, should look like Elements itself | ||
export default { | ||
typescript: true, | ||
showDarkModeSwitch: false, | ||
themeConfig: { | ||
colors: { | ||
text: '#3b454e', | ||
background: '#fff', | ||
primary: '#0061a8', | ||
}, | ||
prism: { | ||
plain: { | ||
fontFamily: '"Source Code Pro", monospace', | ||
color: '#393A34', | ||
backgroundColor: '#f5f7f9', | ||
}, | ||
}, | ||
fonts: { | ||
body: '"Roboto", sans-serif', | ||
heading: '"Roboto", sans-serif', | ||
monospace: '"Source Code Pro", monospace', | ||
}, | ||
radii: { | ||
square: 0, | ||
radius: 0, | ||
rounded: 0, | ||
}, | ||
styles: { | ||
h1: { | ||
fontSize: '2rem', | ||
fontFamily: 'heading', | ||
fontWeight: 'heading', | ||
color: 'text', | ||
mt: 0, | ||
mb: 4, | ||
}, | ||
code: { | ||
fontFamily: '"Source Code Pro", monospace', | ||
}, | ||
inlineCode: { | ||
fontFamily: '"Source Code Pro", monospace', | ||
}, | ||
pre: { | ||
my: 4, | ||
p: 3, | ||
variant: 'prism', | ||
textAlign: 'left', | ||
fontFamily: '"Source Code Pro", monospace', | ||
borderRadius: 'radius', | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import '@/styles/global' | ||
import '@/styles/docs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
resolve: 'gatsby-plugin-typescript', | ||
options: { | ||
isTSX: true, | ||
allExtensions: true, | ||
}, | ||
}, | ||
'gatsby-plugin-linaria', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const path = require('path') | ||
|
||
exports.onCreateWebpackConfig = args => { | ||
args.actions.setWebpackConfig({ | ||
resolve: { | ||
modules: [path.resolve(__dirname, '../src'), 'node_modules'], | ||
alias: { | ||
'@': path.resolve(__dirname, '../src/'), | ||
}, | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const baseConfig = require('../../scripts/jest/jest.config') | ||
|
||
module.exports = { | ||
...baseConfig, | ||
testPathIgnorePatterns: ['<rootDir>/src/tests/'], | ||
collectCoverageFrom: ['<rootDir>/src/**/*.ts', '<rootDir>/src/**/*.tsx'], | ||
coveragePathIgnorePatterns: [ | ||
'<rootDir>[/\\\\](node_modules|src/types|src/tests|src/scripts|src/helpers|src/styles|src/utils)[/\\\\]', | ||
'__styles__', | ||
'src/index.tsx', | ||
'index.ts' | ||
], | ||
modulePathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|public|dist)[/\\\\]'], | ||
transform: { | ||
'^.+\\.svg$': '<rootDir>/src/scripts/svg-transform.js' | ||
}, | ||
moduleNameMapper: { | ||
'\\.(css|less|scss|sass)$': '<rootDir>/src/scripts/style-mock.js' | ||
}, | ||
coverageThreshold: { | ||
global: { | ||
branches: 90, | ||
functions: 90, | ||
lines: 90, | ||
statements: 90 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const dashify = require('dashify') | ||
|
||
module.exports = { | ||
evaluate: true, | ||
displayName: false, | ||
// converts camelCase classNames to kebab-case-for-friendly-css | ||
classNameSlug: (_hash, title) => dashify(title), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "@reapit/elements-next", | ||
"version": "0.0.1", | ||
"description": "Next generation of elements", | ||
"scripts": { | ||
"test": "", | ||
"build:prod": "rollup -c && docz build", | ||
"start:dev": "docz dev", | ||
"start:prod": "docz build && docz serve" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"main": "dist/elements.cjs.js", | ||
"module": "dist/elements.esm.js", | ||
"author": "", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"react-router": "^5.2.0", | ||
"react-router-dom": "^5.2.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.10.4", | ||
"@babel/plugin-transform-runtime": "^7.10.4", | ||
"@babel/runtime": "^7.10.4", | ||
"@rollup/plugin-babel": "^5.0.4", | ||
"@rollup/plugin-commonjs": "^13.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^8.1.0", | ||
"@types/react-copy-to-clipboard": "^4.3.0", | ||
"babel-preset-gatsby": "^0.5.1", | ||
"babel-plugin-module-resolver": "^4.0.0", | ||
"dashify": "^2.0.0", | ||
"docz": "^2.3.1", | ||
"gatsby-plugin-linaria": "^2.0.0", | ||
"linaria": "1.4.0-beta.10", | ||
"prism-react-renderer": "^1.1.1", | ||
"react-copy-to-clipboard": "^5.0.2", | ||
"react-icons": "^3.10.0", | ||
"rollup": "^2.18.2", | ||
"rollup-plugin-scss": "^2.5.0", | ||
"rollup-plugin-terser": "^6.1.0", | ||
"rollup-plugin-typescript2": "^0.27.1", | ||
"typescript": "^3.9.6" | ||
}, | ||
"dependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import json from '@rollup/plugin-json' | ||
import { terser } from 'rollup-plugin-terser' | ||
import babel from '@rollup/plugin-babel' | ||
import scss from 'rollup-plugin-scss' | ||
import linaria from 'linaria/rollup' | ||
import typescript from 'rollup-plugin-typescript2' | ||
|
||
const globals = { | ||
react: 'react', | ||
'react-dom': 'react-dom', | ||
'react-router-dom': 'react-router-dom', | ||
} | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
format: 'cjs', | ||
name: 'elements-cjs', | ||
file: './dist/elements.cjs.js', | ||
globals, | ||
}, | ||
{ | ||
format: 'es', | ||
name: 'elements-esm', | ||
file: './dist/elements.esm.js', | ||
globals, | ||
}, | ||
], | ||
plugins: [ | ||
resolve({ | ||
browser: true, | ||
}), | ||
commonjs(), | ||
json(), | ||
typescript(), | ||
// use Babel here to transpile @ alias from the styles and components which linaria cannot understanding the alias | ||
babel({ | ||
exclude: /node_modules/, | ||
extensions: ['.ts', '.tsx'], | ||
babelHelpers: 'bundled', | ||
plugins: [ | ||
['module-resolver', | ||
{ | ||
alias: { | ||
'@': './src', | ||
} | ||
} | ||
] | ||
], | ||
}), | ||
linaria(), | ||
scss({ | ||
output: 'dist/index.css', | ||
}), | ||
babel({ | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
ie: '11', | ||
}, | ||
useBuiltIns: 'usage', | ||
corejs: 3, | ||
}, | ||
], | ||
'@babel/preset-react', | ||
'linaria/babel' | ||
], | ||
exclude: /node_modules/, | ||
include: /node_modules\/(linaria)/, | ||
extensions: ['.js', '.jsx'], | ||
babelHelpers: 'runtime', | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
terser(), | ||
], | ||
} |
Oops, something went wrong.