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

Fixed date/color knobs by forcing a single version of react #1345

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
20 changes: 12 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
node_modules
*.log
.idea

package-lock.json
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should be ignoring these files (also yarn.lock)

Copy link
Member

Choose a reason for hiding this comment

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

@tmeasday see my PR here: #1338

We tried merging in the package lock, but it broke everything, and I pulled it out. I think until somebody figures out what to do here, we are better off not checking them in and ignoring them so that they don't accidentally get checked in.

Copy link
Member

Choose a reason for hiding this comment

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

I guess that makes sense but it certainly feels weird to be ignoring a file that npm tells you to check in. We should open an issue about this I guess

Copy link
Member

Choose a reason for hiding this comment

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

npm-shrinkwrap.json
yarn.lock
*.lerna_backup
packs/*.tgz

dist
build
coverage/
docs/public

.cache

.tern-port
*.DS_Store
.cache
junit.xml
coverage/
*.lerna_backup
build
packages/examples/automated-*
yarn.lock
/**/LICENSE
docs/public
packs/*.tgz
package-lock.json
3 changes: 3 additions & 0 deletions app/react/src/server/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export default function() {
// Add support to NODE_PATH. With this we could avoid relative path imports.
// Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules'].concat(nodePaths),
alias: {
react: path.resolve('./node_modules/react'),
},
},
performance: {
hints: false,
Expand Down
4 changes: 4 additions & 0 deletions app/react/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export default function() {
// Add support to NODE_PATH. With this we could avoid relative path imports.
// Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules'].concat(nodePaths),
alias: {
react: path.resolve('./node_modules/react'),
'react-dom': path.resolve('./node_modules/react-dom'),
},
},
};

Expand Down
1 change: 1 addition & 0 deletions examples/cra-kitchen-sink/src/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ storiesOf('Button', module)

// NOTE: color picker is currently broken
Copy link
Member

@shilman shilman Jun 22, 2017

Choose a reason for hiding this comment

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

@ndelangen if it's fixed, please remove this 😄

const backgroundColor = color('background', '#ffff00');
// const backgroundColor = '#ffff00';
const items = array('Items', ['Laptop', 'Book', 'Whiskey']);
const otherStyles = object('Styles', {
border: '3px solid #ff00ff',
Expand Down
3 changes: 0 additions & 3 deletions lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
"type": "git",
"url": "https://github.com/storybooks/storybook.git"
},
"scripts": {
Copy link
Member

Choose a reason for hiding this comment

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

@ndelangen remove opencollective deps?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah the postinstall was messing with hoisting which I experimented with, When refactoring the cli I will add a opencollective notice during first run or something like it.

"postinstall": "opencollective postinstall --collective=storybook"
},
"dependencies": {
"@storybook/codemod": "^3.1.5",
"chalk": "^1.1.3",
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.5.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2016": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-runtime": "^6.23.0",
"chalk": "^1.1.3",
"codecov": "^2.2.0",
"danger": "^0.21.0",
Expand Down
6 changes: 5 additions & 1 deletion scripts/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ shell.echo(chalk.bold(`${packageJson.name}@${packageJson.version}`));
shell.echo(chalk.gray('\n=> Clean dist.'));
shell.rm('-rf', 'dist');

const pwd = shell.pwd();
shell.echo(`pwd = ${pwd}`);
shell.cd(path.join(__dirname, '..'));
Copy link
Member

Choose a reason for hiding this comment

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

@ndelangen what's this for?

Copy link
Member Author

Choose a reason for hiding this comment

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

Babel WAS run inside each folder, using the babel binary from root, but presets from package folders.

This changes so the directory where babel is run from IS root, so presets are taken from there. This will allow us to clean up the babel presets dependencies in packages a bit.

Copy link
Member

Choose a reason for hiding this comment

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

Can you explain this a bit more? Doesn't babel end up looking for the preset in root if it doesn't find it in the package anyway (w/ standard node_modules resolution algorithm).


const babel = path.join(__dirname, '..', 'node_modules', '.bin', 'babel');
const args = [
'--ignore tests,__tests__,test.js,stories/,story.jsx',
'--plugins "transform-runtime"',
'./src --out-dir ./dist',
`${pwd}/src --out-dir ${pwd}/dist`,
'--copy-files',
].join(' ');

Expand Down