Skip to content
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

🔧 lerna #82

Merged
merged 12 commits into from
Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"lerna": "2.5.1",
"packages": [
"packages/*"
],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}
113 changes: 12 additions & 101 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,103 +1,14 @@
{
"name": "hoc-react-loader",
"version": "6.1.1",
"description": "Higher order component to call a load function from props at mount.",
"main": "build/index.js",
"peerDependencies": {
"prop-types": "^15.x",
"react": "^15.x || ^16.x",
"tinycolor2": "^1.x"
},
"scripts": {
"lint": "find src -iname \"*.jsx\" -exec eslint {} +; find src -iname \"*.js\" -exec eslint {} +;",
"build": "cross-env BABEL_ENV=cjs babel --ignore \"*.spec.js\" ./src/ --out-dir build",
"test": "jest --collectCoverageFrom=src/**/*.js --collectCoverageFrom=src/**/*.jsx",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls",
"ci": "npm-run-all --parallel lint coveralls"

},
"devDependencies": {
"babel-cli": "^6.24.0",
"babel-core": "^6.24.0",
"babel-eslint": "^7.2.1",
"babel-jest": "^21.2.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-es2017": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"blanket": "^1.2.3",
"chai": "^3.5.0",
"chai-spies": "^0.7.1",
"coveralls": "^2.12.0",
"cross-env": "^3.2.4",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.2",
"eslint": "^3.18.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.3",
"jest": "^21.2.1",
"jsdom": "^9.12.0",
"lodash": "^4.17.4",
"mocha": "^3.2.0",
"npm-run-all": "^4.1.1",
"nyc": "^10.2.0",
"prop-types": "^15.6.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"tinycolor2": "^1.4.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Zenika/hoc-react-loader.git"
},
"author": "Fabien JUIF <[email protected]>",
"contributors": [
"Yvonnick FRIN <[email protected]>",
"Yoann Prot <[email protected]>",
"Benjamin CAVY <[email protected]>"
],
"license": "MIT",
"keywords": [
"react",
"loader",
"hoc",
"placeholder"
],
"bugs": {
"url": "https://github.com/Zenika/hoc-react-loader/issues"
},
"homepage": "https://github.com/Zenika/hoc-react-loader#readme",
"babel": {
"presets": [
"es2017",
"es2015",
"react",
"stage-0"
]
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": [
"airbnb"
],
"rules": {
"semi": [
2,
"never"
],
"arrow-body-style": 0,
"import/no-named-as-default": 0,
"import/prefer-default-export": 0,
"import/no-unresolved": 0,
"react/forbid-prop-types": 0
}
},
"jest": {
"setupFiles": [
"./misc/testSetup.js"
]
}
"private": true,
Copy link
Member

@fabienjuif fabienjuif Nov 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use tab in this one ?
Maybe you should run a yarn add some-dep && yarn remove some-dep to reindent it better. :p

"workspaces": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We both need it in package.json AND in lerna.json ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't for the same thing. workspaces is a config for yarn not lerna.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I can see that, but I think this is sad that lerna doesn't look for workspaces field when it set to "useWorkspaces": true for instance.

Is there a way to set lerna config into the package.json ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't mention it in documentation

"packages/*"
],
"scripts": {
"bootstrap": "lerna bootstrap --no-hoist",
"lint": "lerna run lint --stream --parallel",
"build": "lerna run build --stream --parallel"
},
"devDependencies": {
"lerna": "^2.5.1"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"webpack-dev-server": "~1.12.1"
},
"dependencies": {
"hoc-react-loader": "file:../",
"hoc-react-loader": "~6.1.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, will lerna detect that hoc-react-loader is in a relative package and do the link on its own ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what if I upgrade the hoc-react-loader package to 7.0.0 without publishing it ?
What will do lerna ? Still doing a link, or download hoc-react-loader from NPM registry ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an option to force local linking regardless of package version. I guess without this option it will download it from NPM registry.

"lodash": "^4.15.0",
"normalize.css": "~4.2.0",
"prop-types": "^15.5.8",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
104 changes: 104 additions & 0 deletions packages/hoc-react-loader/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"name": "hoc-react-loader",
"version": "6.1.1",
"description": "Higher order component to call a load function from props at mount.",
"main": "build/index.js",
"peerDependencies": {
"prop-types": "^15.x",
"react": "^15.x || ^16.x",
"tinycolor2": "^1.x"
},
"scripts": {
"lint": "find src -iname \"*.jsx\" -exec eslint {} +; find src -iname \"*.js\" -exec eslint {} +;",
"build": "cross-env BABEL_ENV=cjs babel --ignore \"*.spec.js\" ./src/ --out-dir build",
"test": "jest --collectCoverageFrom=src/**/*.js --collectCoverageFrom=src/**/*.jsx",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls",
"ci": "npm-run-all --parallel lint coveralls"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line :p

},
"devDependencies": {
"babel-cli": "^6.24.0",
"babel-core": "^6.24.0",
"babel-eslint": "^7.2.1",
"babel-jest": "^21.2.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-es2017": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"blanket": "^1.2.3",
"chai": "^3.5.0",
"chai-spies": "^0.7.1",
"coveralls": "^2.12.0",
"cross-env": "^3.2.4",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.2",
"eslint": "^3.18.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.3",
"jest": "^21.2.1",
"jsdom": "^9.12.0",
"lodash": "^4.17.4",
"mocha": "^3.2.0",
"npm-run-all": "^4.1.1",
"nyc": "^10.2.0",
"prop-types": "^15.6.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"tinycolor2": "^1.4.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Zenika/hoc-react-loader.git"
},
"author": "Fabien JUIF <[email protected]>",
"contributors": [
"Yvonnick FRIN <[email protected]>",
"Yoann Prot <[email protected]>",
"Benjamin CAVY <[email protected]>"
],
"license": "MIT",
"keywords": [
"react",
"loader",
"hoc",
"placeholder"
],
"bugs": {
"url": "https://github.com/Zenika/hoc-react-loader/issues"
},
"homepage": "https://github.com/Zenika/hoc-react-loader#readme",
"babel": {
"presets": [
"es2017",
"es2015",
"react",
"stage-0"
]
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": [
"airbnb"
],
"rules": {
"semi": [
2,
"never"
],
"arrow-body-style": 0,
"import/no-named-as-default": 0,
"import/prefer-default-export": 0,
"import/no-unresolved": 0,
"react/forbid-prop-types": 0,
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.spec.js"]}]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice I didn't know about the exclusion :)

}
},
"jest": {
"setupFiles": [
"./misc/testSetup.js"
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading