From f96a5feff719ac4a7e05f43752fcb6a40de27f11 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 23 May 2017 01:31:58 +0000 Subject: [PATCH 1/2] chore(package): update lerna to version 2.0.0-rc.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1862380321f1..71f8cd291d57 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "eslint-plugin-prettier": "^2.0.1", "jest": "^20.0.3", "jest-enzyme": "^3.1.1", - "lerna": "2.0.0-rc.4", + "lerna": "2.0.0-rc.5", "prettier": "^1.3.0", "react": "^15.5.4", "react-test-renderer": "^15.5.4", From a593145cd0670c630dbf35f2c5574b750f7324fa Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 23 May 2017 20:56:54 +0200 Subject: [PATCH 2/2] FIX a few things --- .travis.yml | 2 +- addons/comments/src/stories/index.js | 3 ++- addons/info/example/story.js | 2 +- .../storyshots/stories/directly_required/index.js | 3 ++- jest.config.js | 9 +++++++-- lerna.json | 7 +------ lib/cli/generators/REACT/template/stories/index.js | 4 +++- lib/cli/lib/has_yarn.js | 2 +- lib/cli/lib/helpers.js | 2 +- lib/cli/package.json | 13 +++++++++---- package.json | 7 ++----- 11 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8449163230f..db08dd1deeb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ before_install: ./scripts/travis/before_install.sh after_success: ./scripts/travis/after_success.sh script: - npm run bootstrap - - (cd examples/test-cra && npm install) + - lerna exec --scope test-cra -- npm i - npm run lint - npm run test -- --coverage - npm run coverage diff --git a/addons/comments/src/stories/index.js b/addons/comments/src/stories/index.js index 9ce72cb3ace9..1185adb51dd7 100644 --- a/addons/comments/src/stories/index.js +++ b/addons/comments/src/stories/index.js @@ -1,5 +1,6 @@ import React from 'react'; -import { storiesOf, action } from '@storybook/react'; +import { storiesOf } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; import Button from '../index'; import CommentForm from '../manager/components/CommentForm'; import CommentList from '../manager/components/CommentList'; diff --git a/addons/info/example/story.js b/addons/info/example/story.js index cd8357b2ca83..a89f76b6f17b 100644 --- a/addons/info/example/story.js +++ b/addons/info/example/story.js @@ -1,7 +1,7 @@ import React from 'react'; import Button from './Button'; -import { storiesOf, action } from '@storybook/react'; +import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import backgrounds from 'react-storybook-addon-backgrounds'; diff --git a/addons/storyshots/stories/directly_required/index.js b/addons/storyshots/stories/directly_required/index.js index 660c37b8c24c..d9d51ee4ad44 100644 --- a/addons/storyshots/stories/directly_required/index.js +++ b/addons/storyshots/stories/directly_required/index.js @@ -1,5 +1,6 @@ import React from 'react'; -import { storiesOf, action } from '@storybook/react'; +import { storiesOf } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; import Button from './Button'; storiesOf('Another Button', module) diff --git a/jest.config.js b/jest.config.js index 9c2938d5b1d6..f1e928f2bf72 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,9 +5,14 @@ module.exports = { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/__mocks__/fileMock.js', '\\.(css|scss)$': '/__mocks__/styleMock.js', }, - projects: ['/packages/*', '/examples/*'], + roots: ['/addons', '/app', '/lib', '/examples'], collectCoverage: false, - collectCoverageFrom: ['packages/**/*.{js,jsx}', '!**/generators/**'], + collectCoverageFrom: [ + 'app/**/*.{js,jsx}', + 'lib/**/*.{js,jsx}', + 'addons/**/*.{js,jsx}', + '!**/generators/**', + ], coverageDirectory: 'coverage', testEnvironment: 'jsdom', setupTestFrameworkScriptFile: './node_modules/jest-enzyme/lib/index.js', diff --git a/lerna.json b/lerna.json index 3f6e9c687696..2a06194610ce 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "lerna": "2.0.0-rc.3", + "lerna": "2.0.0-rc.5", "version": "3.0.0-alpha.4", "commands": { "bootstrap": { @@ -7,11 +7,6 @@ "test-cra" ] }, - "exec": { - "ignore": [ - "test-cra" - ] - }, "publish": { "ignore": [ "cra-storybook", diff --git a/lib/cli/generators/REACT/template/stories/index.js b/lib/cli/generators/REACT/template/stories/index.js index 3c061d101dc9..29f8f2417b8e 100644 --- a/lib/cli/generators/REACT/template/stories/index.js +++ b/lib/cli/generators/REACT/template/stories/index.js @@ -1,5 +1,7 @@ import React from 'react'; -import { storiesOf, action, linkTo } from '@storybook/react'; +import { storiesOf } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; +import { linkTo } from '@storybook/addon-links'; import Button from './Button'; import Welcome from './Welcome'; diff --git a/lib/cli/lib/has_yarn.js b/lib/cli/lib/has_yarn.js index 0d30687addb3..cd606f7cb7cc 100644 --- a/lib/cli/lib/has_yarn.js +++ b/lib/cli/lib/has_yarn.js @@ -1,4 +1,4 @@ -const spawnSync = require('spawn-sync'); +const spawnSync = require('cross-spawn').sync; module.exports = function hasYarn() { const result = spawnSync('yarn', ['--version'], { silent: true }); diff --git a/lib/cli/lib/helpers.js b/lib/cli/lib/helpers.js index 38a4f40c8f02..95e2b7e7caf0 100644 --- a/lib/cli/lib/helpers.js +++ b/lib/cli/lib/helpers.js @@ -2,7 +2,7 @@ const path = require('path'); const fs = require('fs'); const chalk = require('chalk'); const logger = console; -const spawnSync = require('spawn-sync'); +const spawnSync = require('cross-spawn').sync; exports.getPackageJson = function getPackageJson() { const packageJsonPath = path.resolve('package.json'); diff --git a/lib/cli/package.json b/lib/cli/package.json index 1ecf9c4dd179..7ae6d2a71ce0 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -1,7 +1,7 @@ { "name": "@storybook/cli", "version": "3.0.0-alpha.4", - "description": "Easiest way to add Storybook support to your project.", + "description": "Storybook's CLI - easiest method of adding storybook to your projects", "bin": { "getstorybook": "./bin/generate.js" }, @@ -11,7 +11,8 @@ }, "keywords": [ "storybook", - "generator" + "generator", + "cli" ], "author": "", "license": "MIT", @@ -22,10 +23,14 @@ "dependencies": { "chalk": "^1.1.3", "commander": "^2.9.0", + "cross-spawn": "^5.0.1", "json5": "^0.5.1", "merge-dirs": "^0.2.1", "shelljs": "^0.7.7", - "spawn-sync": "^1.0.15", - "update-notifier": "^2.1.0" + "update-notifier": "^2.1.0", + "opencollective": "^1.0.3" + }, + "scripts": { + "postinstall": "opencollective postinstall" } } diff --git a/package.json b/package.json index 71f8cd291d57..36206bd230a4 100644 --- a/package.json +++ b/package.json @@ -32,14 +32,11 @@ "scripts": { "publish": "lerna publish", "bootstrap": "lerna bootstrap", + "bootstrap:test-cra": "lerna exec --scope test-cra -- npm i", "lint": "eslint .", "test": "jest", "test:watch": "npm test -- --watch", - "coverage": "codecov", - "postinstall": "opencollective postinstall" - }, - "dependencies": { - "opencollective": "^1.0.3" + "coverage": "codecov" }, "collective": { "type": "opencollective",