Skip to content

Commit

Permalink
Merge pull request #3161 from storybooks/polymer-loader-peer
Browse files Browse the repository at this point in the history
Move polymer loader to peerDependencies
  • Loading branch information
Hypnosphi authored Mar 8, 2018
2 parents 3140df3 + 88d2fe2 commit 85d6aed
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
7 changes: 4 additions & 3 deletions app/polymer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"global": "^4.3.2",
"html-webpack-plugin": "^2.30.1",
"json5": "^0.5.1",
"polymer-webpack-loader": "2.0.1",
"react": "^16.0.0",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.0.0",
Expand All @@ -59,10 +58,12 @@
"webpack-hot-middleware": "^2.21.2"
},
"devDependencies": {
"nodemon": "^1.17.1"
"nodemon": "^1.17.1",
"polymer-webpack-loader": "^2.0.1"
},
"peerDependencies": {
"babel-core": "^6.26.0 || ^7.0.0-0",
"babel-runtime": ">=6.0.0"
"babel-runtime": ">=6.0.0",
"polymer-webpack-loader": ">=2.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/polymer-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@storybook/polymer": "^3.4.0-rc.0",
"@webcomponents/webcomponentsjs": "^1.1.0",
"global": "^4.3.2",
"polymer-webpack-loader": "^2.0.0",
"polymer-webpack-loader": "^2.0.1",
"webpack": "^3.11.0"
},
"devDependencies": {
Expand Down
16 changes: 14 additions & 2 deletions lib/cli/generators/POLYMER/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ import path from 'path';
import { getVersions, getPackageJson, writePackageJson } from '../../lib/helpers';

export default async () => {
const [storybookVersion, babelCoreVersion, babelRuntimeVersion] = await getVersions(
const [
storybookVersion,
babelCoreVersion,
babelRuntimeVersion,
polymerLoaderVarion,
] = await getVersions(
'@storybook/polymer',
'babel-core',
'babel-runtime'
'babel-runtime',
'polymer-webpack-loader'
);
mergeDirs(path.resolve(__dirname, 'template'), '.', 'overwrite');

Expand All @@ -22,6 +28,12 @@ export default async () => {
if (!packageJson.dependencies['babel-runtime'] && !packageJson.devDependencies['babel-runtime']) {
packageJson.devDependencies['babel-runtime'] = babelRuntimeVersion;
}
if (
!packageJson.dependencies['polymer-webpack-loader'] &&
!packageJson.devDependencies['polymer-webpack-loader']
) {
packageJson.devDependencies['polymer-webpack-loader'] = polymerLoaderVarion;
}

packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.storybook = 'start-storybook -p 6006';
Expand Down
3 changes: 2 additions & 1 deletion lib/cli/test/snapshots/polymer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"devDependencies": {
"@storybook/polymer": "^3.4.0-rc.0",
"babel-core": "^6.26.0",
"babel-runtime": "^6.26.0"
"babel-runtime": "^6.26.0",
"polymer-webpack-loader": "^2.0.1"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"lint-staged": "^7.0.0",
"lodash": "^4.17.5",
"npmlog": "^4.1.2",
"polymer-webpack-loader": "^2.0.1",
"prettier": "^1.11.1",
"raf": "^3.4.0",
"react": "^16.2.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11703,7 +11703,7 @@ pngjs@^3.0.0, pngjs@^3.3.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.3.1.tgz#8e14e6679ee7424b544334c3b2d21cea6d8c209a"

polymer-webpack-loader@2.0.1, polymer-webpack-loader@^2.0.0:
polymer-webpack-loader@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/polymer-webpack-loader/-/polymer-webpack-loader-2.0.1.tgz#d15d45328f6a6700366dfaee83fc606f39cdcee0"
dependencies:
Expand Down

0 comments on commit 85d6aed

Please sign in to comment.