1
0
Fork 0

🔧 Removed ES modules exports for components because react-scripts

This commit is contained in:
Joost De Cock 2019-05-03 13:23:40 +02:00
parent 3dbaed0411
commit f123d9fea3
6 changed files with 24 additions and 20 deletions

View file

@ -6,6 +6,9 @@ customRollup:
- components - components
- core - core
packageJson: packageJson:
components:
# react-scripts doesn't handle .mjs files correctly
module: '!'
create-freesewing-pattern: create-freesewing-pattern:
bin: bin:
create-freesewing-pattern: index.js create-freesewing-pattern: index.js

View file

@ -21,6 +21,9 @@ css-theme:
components: components:
test: "echo \"{{name}}: No tests configured. Perhaps you'd like to do this?\" && exit 0" test: "echo \"{{name}}: No tests configured. Perhaps you'd like to do this?\" && exit 0"
storybook: "start-storybook -p 6663" storybook: "start-storybook -p 6663"
# react-scripts doesn't handle .mjs files correctly
modulebuild: '!'
build: "npm run clean && npm run nodebuild"
core: core:
test: "BABEL_ENV=production nyc mocha tests/*.test.js" test: "BABEL_ENV=production nyc mocha tests/*.test.js"
report: "BABEL_ENV=production nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js" report: "BABEL_ENV=production nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js"

View file

@ -14,12 +14,10 @@
"react" "react"
], ],
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"nodebuild": "BABEL_ENV=production rollup -c -o dist/index.js -f cjs", "nodebuild": "BABEL_ENV=production rollup -c -o dist/index.js -f cjs",
"modulebuild": "BABEL_ENV=production rollup -c -o dist/index.mjs -f es", "build": "npm run clean && npm run nodebuild",
"build": "npm run clean && npm run nodebuild && npm run modulebuild",
"test": "echo \"components: No tests configured. Perhaps you'd like to do this?\" && exit 0", "test": "echo \"components: No tests configured. Perhaps you'd like to do this?\" && exit 0",
"pubtest": "npm publish --registry http://localhost:6662", "pubtest": "npm publish --registry http://localhost:6662",
"pubforce": "npm publish", "pubforce": "npm publish",
@ -27,18 +25,18 @@
"storybook": "start-storybook -p 6663" "storybook": "start-storybook -p 6663"
}, },
"peerDependencies": { "peerDependencies": {
"@freesewing/css-theme": "^2.0.0-alpha.13", "react": "^16.4.1",
"@freesewing/i18n": "^2.0.0-alpha.13", "prop-types": "15.7.2",
"@freesewing/mui-theme": "^2.0.0-alpha.13", "@freesewing/pattern-info": "^2.0.0-alpha.14",
"@freesewing/pattern-info": "^2.0.0-alpha.13", "@freesewing/mui-theme": "^2.0.0-alpha.14",
"@freesewing/utils": "^2.0.0-alpha.13", "@freesewing/css-theme": "^2.0.0-alpha.14",
"typeface-roboto-condensed": "latest",
"@freesewing/i18n": "^2.0.0-alpha.14",
"@freesewing/utils": "^2.0.0-alpha.14",
"react-intl": "^2.8.0",
"@material-ui/core": "^3.9.3", "@material-ui/core": "^3.9.3",
"@material-ui/icons": "^3.0.2", "@material-ui/icons": "^3.0.2",
"@material-ui/lab": "^3.0.0-alpha.30", "@material-ui/lab": "^3.0.0-alpha.30"
"prop-types": "15.7.2",
"react": "^16.4.1",
"react-intl": "^2.8.0",
"typeface-roboto-condensed": "latest"
}, },
"files": [ "files": [
"dist/*", "dist/*",

View file

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
const Logo = props => { const Ogol = props => {
return ( return (
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@ -19,15 +19,15 @@ const Logo = props => {
); );
}; };
Logo.propTypes = { Ogol.propTypes = {
size: PropTypes.number, size: PropTypes.number,
embed: PropTypes.bool embed: PropTypes.bool
}; };
Logo.defaultProps = { Ogol.defaultProps = {
size: 24, size: 24,
embed: false, embed: false,
color: "#fff" color: "#fff"
}; };
export default Logo; export default Ogol;

View file

@ -4,9 +4,9 @@ import withGist from "../withGist";
import { FormattedMessage, IntlProvider } from "react-intl"; import { FormattedMessage, IntlProvider } from "react-intl";
import Button from "@material-ui/core/Button"; import Button from "@material-ui/core/Button";
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles"; import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";
import { i18n, strings } from "@freesewing/i18n"; import { strings } from "@freesewing/i18n";
import Navbar from "../Navbar"; import Navbar from "../Navbar";
import { defaultGist, storage, partList } from "@freesewing/utils"; import { defaultGist, storage } from "@freesewing/utils";
import { dark, light } from "@freesewing/mui-theme"; import { dark, light } from "@freesewing/mui-theme";
import Logo from "../Logo"; import Logo from "../Logo";
import withLanguage from "../withLanguage"; import withLanguage from "../withLanguage";

View file

@ -1,4 +1,4 @@
export { default as draftConfigurator } from "./DraftConfigurator"; export { default as DraftConfigurator } from "./DraftConfigurator";
export { default as Emblem } from "./Emblem"; export { default as Emblem } from "./Emblem";
export { default as Logo } from "./Logo"; export { default as Logo } from "./Logo";
export { default as Navbar } from "./Navbar"; export { default as Navbar } from "./Navbar";