-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: #1920 reapit elements next init packages #2065
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
159c373
feat: elements next initial commit
willmcvay 0352139
feat: adds more constants, styles to docs
willmcvay 2057573
chore: remove copy clipboard function
duong-se edd2b16
fix: build prod script
duong-se 3182ae9
fix: name of reapit element next package
duong-se File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment