Skip to content

Commit

Permalink
Merge pull request #2 from vojty/ts-build
Browse files Browse the repository at this point in the history
Typescript build
  • Loading branch information
michalxfanta authored May 29, 2021
2 parents c89fdfe + a7daeeb commit 0c91fc7
Show file tree
Hide file tree
Showing 9 changed files with 11,990 additions and 16,558 deletions.
16,516 changes: 0 additions & 16,516 deletions package-lock.json

This file was deleted.

24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"name": "react-original-prusa-icons",
"homepage": "https://michalxfanta.github.io/React-Original-Prusa-Icons",
"version": "0.2.2",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"main": "dist/cjs/index.cjs.js",
"module": "dist/es/index.es.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"files": [
"dist/*"
],
Expand All @@ -18,10 +19,11 @@
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@babel/preset-typescript": "^7.10.1",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-image": "^2.0.5",
"@rollup/plugin-node-resolve": "^8.4.0",
"@rollup/plugin-typescript": "^4.1.2",
"@rollup/plugin-typescript": "^8.2.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
Expand All @@ -38,29 +40,31 @@
"jszip": "^3.5.0",
"n-readlines": "^1.0.0",
"optipng-js": "^0.1.2",
"react": "^17.0.2",
"react-bootstrap": "^1.0.0-beta.16",
"react-dom": "^17.0.2",
"react-pace-progress": "^2.0.0",
"react-router": "^5.2.0",
"react-router-bootstrap": "^0.25.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"rollup": "^2.17.1",
"rollup-plugin-babel": "^4.4.0",
"rimraf": "^3.0.2",
"rollup": "^2.50.3",
"rollup-plugin-dts": "^3.0.2",
"rollup-plugin-peer-deps-external": "^2.2.2",
"rollup-plugin-postcss": "^3.1.2",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-visualizer": "^4.0.4",
"styled-components": "^5.1.1",
"tslib": "^2.0.0",
"typescript": "^3.7.5"
"typescript": "^4.3.2"
},
"scripts": {
"start": "react-scripts start",
"build": "git rev-list --count master > tmp && set /p REACT_APP_BUILD_NUMBER=<tmp && del tmp && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"deploy:types": "tsc --emitDeclarationOnly --declaration true --declarationDir dist --declarationMap true",
"deploy:js": "rollup -c",
"deploy": "npm run deploy:types && npm run deploy:js",
"deploy": "rimraf dist && rollup -c",
"svg": "npm run svg:favicons && npm run svg:icons && npm run svg:logos",
"svg:favicons": "svgo --folder=./src/svg/favicons --precision=8 --indent=4 --pretty --enable=sortAttrs --disable=convertPathData,cleanupNumericValues",
"svg:icons": "svgo --folder=./src/svg/icons --precision=8 --indent=4 --pretty --enable=sortAttrs --disable=convertPathData,cleanupNumericValues",
Expand Down
73 changes: 45 additions & 28 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,53 @@
import babel from 'rollup-plugin-babel'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import image from '@rollup/plugin-image'
import pkg from './package.json'
import postcss from 'rollup-plugin-postcss'
import dts from 'rollup-plugin-dts'
import resolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import typescript from 'rollup-plugin-typescript2'

export default {
input: './src/lib/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true
const bundle = config => ({
...config,
input: 'src/lib/index.ts'
})

export default [
bundle({
plugins: [
typescript({
tsconfigOverride: {
target: 'esnext'
}
}),
external(),
postcss(),
babel({
babelHelpers: 'runtime'
}),
resolve(),
commonjs(),
image()
],
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true
},
{
file: pkg.module,
format: 'es',
sourcemap: true
},
]
}),
bundle({
plugins: [dts()],
output: {
file: pkg.types,
format: 'es'
},
{
file: pkg.module,
format: 'esm',
sourcemap: true
}
],
plugins: [
typescript(),
external(),
postcss(),
babel({
exclude: 'node_modules/**',
extensions: ['.js', '.jsx', '.ts', '.tsx']
}),
resolve(),
commonjs(),
image()
]
}
})
]
2 changes: 1 addition & 1 deletion src/lib/icons/DisplayReplacement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const DisplayReplacementIcon = (props: IProps) => {
<Svg viewBox={viewBox} width={props.width} height={props.height} withPadding={props.withPadding}>
<Scale viewBox={viewBox} backgroundColor={backgroundColor} withPadding={props.withPadding} withBackground={props.withBackground} backgroundRounded={props.backgroundRounded} backgroundRadius={props.backgroundRadius} width={props.width} height={props.height}>
<path fill={secondaryColor?.toString()} d="M0 89.38L363.64 89.38 363.64 60.28 0 60.28z" />
<path fill={primaryColor?.toString()} fill-rule="nonzero" d="M115.15 243.55c1.57,4.56 -0.9,9.54 -5.46,11.11 -4.56,1.57 -9.54,-0.9 -11.11,-5.46l-44.14 -129.06c-1.57,-4.56 0.9,-9.54 5.46,-11.11 4.56,-1.57 9.54,0.9 11.11,5.46l44.15 129.06zm-17.99 54.77l169.31 0 0 -29.1 -169.31 0 0 29.1zm167.89 -49.18c-1.57,4.56 -6.51,7.03 -11.11,5.46 -4.56,-1.57 -7.03,-6.51 -5.46,-11.11l44.15 -129.06c1.57,-4.56 6.5,-7.03 11.11,-5.46 4.56,1.57 7.03,6.51 5.46,11.11l-44.14 129.06zm-35.69 -133.09c0.66,-4.79 5.12,-8.12 9.92,-7.45 4.79,0.66 8.12,5.13 7.45,9.92l-18.8 129.06c-0.66,4.79 -5.13,8.12 -9.92,7.45 -4.79,-0.66 -8.12,-5.12 -7.45,-9.92l18.8 -129.06zm-38.78 130.29c0,4.84 -3.94,8.78 -8.78,8.78 -4.84,0 -8.78,-3.94 -8.78,-8.78l0 -129.06c0,-4.84 3.94,-8.78 8.78,-8.78 4.84,0 8.78,3.94 8.78,8.78l0 129.06zm-37.5 -1.23c0.66,4.79 -2.66,9.21 -7.45,9.92 -4.79,0.66 -9.21,-2.66 -9.92,-7.45l-18.8 -129.06c-0.66,-4.79 2.66,-9.21 7.45,-9.92 4.79,-0.66 9.21,2.66 9.92,7.45l18.8 129.06z" />
<path fill={primaryColor?.toString()} fillRule="nonzero" d="M115.15 243.55c1.57,4.56 -0.9,9.54 -5.46,11.11 -4.56,1.57 -9.54,-0.9 -11.11,-5.46l-44.14 -129.06c-1.57,-4.56 0.9,-9.54 5.46,-11.11 4.56,-1.57 9.54,0.9 11.11,5.46l44.15 129.06zm-17.99 54.77l169.31 0 0 -29.1 -169.31 0 0 29.1zm167.89 -49.18c-1.57,4.56 -6.51,7.03 -11.11,5.46 -4.56,-1.57 -7.03,-6.51 -5.46,-11.11l44.15 -129.06c1.57,-4.56 6.5,-7.03 11.11,-5.46 4.56,1.57 7.03,6.51 5.46,11.11l-44.14 129.06zm-35.69 -133.09c0.66,-4.79 5.12,-8.12 9.92,-7.45 4.79,0.66 8.12,5.13 7.45,9.92l-18.8 129.06c-0.66,4.79 -5.13,8.12 -9.92,7.45 -4.79,-0.66 -8.12,-5.12 -7.45,-9.92l18.8 -129.06zm-38.78 130.29c0,4.84 -3.94,8.78 -8.78,8.78 -4.84,0 -8.78,-3.94 -8.78,-8.78l0 -129.06c0,-4.84 3.94,-8.78 8.78,-8.78 4.84,0 8.78,3.94 8.78,8.78l0 129.06zm-37.5 -1.23c0.66,4.79 -2.66,9.21 -7.45,9.92 -4.79,0.66 -9.21,-2.66 -9.92,-7.45l-18.8 -129.06c-0.66,-4.79 2.66,-9.21 7.45,-9.92 4.79,-0.66 9.21,2.66 9.92,7.45l18.8 129.06z" />
</Scale>
</Svg>
)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/NextIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NextIcon = (props: IProps) => {
return (
<Svg viewBox={viewBox} width={props.width} height={props.height} withPadding={props.withPadding}>
<Scale viewBox={viewBox} backgroundColor={backgroundColor} withPadding={props.withPadding} withBackground={props.withBackground} backgroundRounded={props.backgroundRounded} backgroundRadius={props.backgroundRadius} width={props.width} height={props.height}>
<path fill={primaryColor?.toString()} fill-rule="nonzero" d="M117.61 33.09c75.07,0 112.9,91.19 59.77,144.3 -53.13,53.13 -144.29,15.29 -144.29,-59.77 0,-46.69 37.86,-84.52 84.52,-84.52zm47.81 36.72c-42.49,-42.48 -115.45,-12.23 -115.45,47.81 0,60.06 72.96,90.29 115.45,47.81 26.41,-26.41 26.41,-69.23 0,-95.64l0 0.02z" />
<path fill={primaryColor?.toString()} fillRule="nonzero" d="M117.61 33.09c75.07,0 112.9,91.19 59.77,144.3 -53.13,53.13 -144.29,15.29 -144.29,-59.77 0,-46.69 37.86,-84.52 84.52,-84.52zm47.81 36.72c-42.49,-42.48 -115.45,-12.23 -115.45,47.81 0,60.06 72.96,90.29 115.45,47.81 26.41,-26.41 26.41,-69.23 0,-95.64l0 0.02z" />
<path fill={secondaryColor?.toString()} d="M104.64 168.33L92.68 156.39 132.15 117.59 92.68 78.86 104.64 66.9 156.07 117.59z" />
</Scale>
</Svg>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/PreviousIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const PreviousIcon = (props: IProps) => {
return (
<Svg viewBox={viewBox} width={props.width} height={props.height} withPadding={props.withPadding}>
<Scale viewBox={viewBox} backgroundColor={backgroundColor} withPadding={props.withPadding} withBackground={props.withBackground} backgroundRounded={props.backgroundRounded} backgroundRadius={props.backgroundRadius} width={props.width} height={props.height}>
<path fill={primaryColor?.toString()} fill-rule="nonzero" d="M181.87 51.14c-116.01,0 -174.48,140.93 -92.37,223 82.11,82.11 223,23.64 223,-92.37 0,-72.16 -58.51,-130.63 -130.63,-130.63zm-73.88 56.74c65.66,-65.66 178.42,-18.9 178.42,73.89 0,92.82 -112.76,139.54 -178.42,73.88 -40.81,-40.81 -40.81,-106.99 0,-147.8l0 0.03z" />
<path fill={primaryColor?.toString()} fillRule="nonzero" d="M181.87 51.14c-116.01,0 -174.48,140.93 -92.37,223 82.11,82.11 223,23.64 223,-92.37 0,-72.16 -58.51,-130.63 -130.63,-130.63zm-73.88 56.74c65.66,-65.66 178.42,-18.9 178.42,73.89 0,92.82 -112.76,139.54 -178.42,73.88 -40.81,-40.81 -40.81,-106.99 0,-147.8l0 0.03z" />
<path fill={secondaryColor?.toString()} d="M201.91 260.14L220.4 241.69 159.41 181.73 220.4 121.87 201.91 103.39 122.43 181.73z" />
</Scale>
</Svg>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/icons/RemoteControlIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const RemoteControlIcon = (props: IProps) => {
return (
<Svg viewBox={viewBox} width={props.width} height={props.height} withPadding={props.withPadding}>
<Scale viewBox={viewBox} backgroundColor={backgroundColor} withPadding={props.withPadding} withBackground={props.withBackground} backgroundRounded={props.backgroundRounded} backgroundRadius={props.backgroundRadius} width={props.width} height={props.height}>
<path fill={primaryColor?.toString()} fill-rule="nonzero" d="M237.4 104.8c-10.54,0 -19.05,-8.55 -19.05,-19.05 0,-10.54 8.55,-19.05 19.05,-19.05l96.75 0c10.54,0 19.05,8.55 19.05,19.05 0,10.54 -8.55,19.05 -19.05,19.05l-96.75 0zm-91.7 -104.72l280.03 0c14.22,0 27.19,5.87 36.57,15.25l0.09 0.08c9.38,9.42 15.25,22.4 15.25,36.57l0 467.53c0,14.22 -5.87,27.19 -15.29,36.62l0.04 0.04c-9.38,9.38 -22.36,15.25 -36.7,15.25l-280.03 0c-14.3,0 -27.28,-5.87 -36.7,-15.25 -9.38,-9.38 -15.25,-22.36 -15.25,-36.7l0 -467.53c0,-14.3 5.87,-27.28 15.25,-36.7l0.04 0.04c9.42,-9.42 22.4,-15.29 36.62,-15.29l0.09 0.09 -0.01 -0.01zm280.03 47.61l-280.03 0c-1.24,0 -2.32,0.45 -3.01,1.2l0 0.09c-0.79,0.79 -1.28,1.9 -1.28,3.01l0 467.53c0,1.2 0.54,2.23 1.28,3.01 0.79,0.79 1.9,1.28 3.01,1.28l280.03 0c1.2,0 2.23,-0.54 3.01,-1.28l0.08 0c0.7,-0.7 1.2,-1.78 1.2,-3.01l0 -467.53c0,-1.24 -0.46,-2.32 -1.2,-3.01l-0.08 -0.09c-0.7,-0.7 -1.78,-1.2 -3.01,-1.2z" />
<path fill={primaryColor?.toString()} fillRule="nonzero" d="M237.4 104.8c-10.54,0 -19.05,-8.55 -19.05,-19.05 0,-10.54 8.55,-19.05 19.05,-19.05l96.75 0c10.54,0 19.05,8.55 19.05,19.05 0,10.54 -8.55,19.05 -19.05,19.05l-96.75 0zm-91.7 -104.72l280.03 0c14.22,0 27.19,5.87 36.57,15.25l0.09 0.08c9.38,9.42 15.25,22.4 15.25,36.57l0 467.53c0,14.22 -5.87,27.19 -15.29,36.62l0.04 0.04c-9.38,9.38 -22.36,15.25 -36.7,15.25l-280.03 0c-14.3,0 -27.28,-5.87 -36.7,-15.25 -9.38,-9.38 -15.25,-22.36 -15.25,-36.7l0 -467.53c0,-14.3 5.87,-27.28 15.25,-36.7l0.04 0.04c9.42,-9.42 22.4,-15.29 36.62,-15.29l0.09 0.09 -0.01 -0.01zm280.03 47.61l-280.03 0c-1.24,0 -2.32,0.45 -3.01,1.2l0 0.09c-0.79,0.79 -1.28,1.9 -1.28,3.01l0 467.53c0,1.2 0.54,2.23 1.28,3.01 0.79,0.79 1.9,1.28 3.01,1.28l280.03 0c1.2,0 2.23,-0.54 3.01,-1.28l0.08 0c0.7,-0.7 1.2,-1.78 1.2,-3.01l0 -467.53c0,-1.24 -0.46,-2.32 -1.2,-3.01l-0.08 -0.09c-0.7,-0.7 -1.78,-1.2 -3.01,-1.2z" />
<path fill={secondaryColor?.toString()} d="M313.86 480.17c0,-15.52 -12.58,-28.1 -28.1,-28.1 -15.52,0 -28.1,12.58 -28.1,28.1 0,15.52 12.58,28.1 28.1,28.1 15.52,0 28.1,-12.58 28.1,-28.1z" />
</Scale>
</Svg>
Expand Down
2 changes: 2 additions & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ export { default as WifiIcon } from './icons/WifiIcon'
export { default as ZaxisIcon } from './icons/ZaxisIcon'
export { default as OriginalPrusaIconsFavicon } from './favicons/OriginalPrusaIconsFavicon'
export { default as PrusaConnectFavicon } from './favicons/PrusaConnectFavicon'

export * from './config'
Loading

0 comments on commit 0c91fc7

Please sign in to comment.