-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Framework: Add lerna to publish @automattic/simple-components (Take Two) #24788
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cjs | ||
node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** @format */ | ||
|
||
// Keep in sync with the `files` field in package.json! | ||
// TODO: Can we auto-generate at build time? | ||
|
||
export { Badge } from './badge'; | ||
export { Button } from './button'; | ||
export { Main } from './main'; | ||
export { Notice } from './notice'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "@automattic/simple-components", | ||
"version": "0.1.0-alpha.7", | ||
"description": "React components, as used on WordPress.com", | ||
"scripts": { | ||
"build": "npx babel --only ./index.js,./badge/,./button/,./main/,./notice/ --out-dir cjs .", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/automattic/wp-calypso.git" | ||
}, | ||
"keywords": [ | ||
"wordpress", | ||
"react", | ||
"components" | ||
], | ||
"author": "Automattic", | ||
"license": "GPL-2.0+", | ||
"bugs": { | ||
"url": "https://github.com/automattic/wp-calypso/issues" | ||
}, | ||
"homepage": "https://github.com/Automattic/wp-calypso/blob/master/docs/components.md", | ||
"main": "./cjs/index.js", | ||
"esnext": "./index.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we mirror the Gutenberg lerna config (build scripts etc...)? We do publish two versions per module as well:
Is it a common usage to use an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on using the latest i've seen on publishing es6+ is https://babeljs.io/blog/2018/06/26/on-consuming-and-publishing-es2015+-packages There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I didn't want to necessarily introduce build scripts yet since that seemed overblown for the little amount of transpilation we're doing at this point (YAGNI -- might add them later as needed tho).
I picked up
Granted, this is far from standardized, so I'm happy to reconsider. |
||
"files": [ | ||
"index.js", | ||
"cjs/", | ||
"badge/", | ||
"button/", | ||
"main/", | ||
"notice" | ||
], | ||
"dependencies": { | ||
"classnames": "^2.2.6", | ||
"gridicons": "^3.0.1", | ||
"i18n-calypso": "^1.9.1", | ||
"lodash": "^4.17.10", | ||
"prop-types": "^15.6.2", | ||
"react": "^16.4.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"packages": [ | ||
"client/components" | ||
], | ||
"version": "independent" | ||
} |
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.
I believe
node_modules
is redundant here: https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package