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

DO NOT MERGE: Adds a command for files in an npm package #1195

Closed
wants to merge 1 commit into from
Closed

DO NOT MERGE: Adds a command for files in an npm package #1195

wants to merge 1 commit into from

Conversation

futuremint
Copy link
Contributor

Fixes issue #1146

Additional description

Please review the output of running "npm run dist" in this PR. It adds an additional temp directory called .tmp-npm. I intend to publish the npm package from that folder. In its current state this PR uses Babel to down-compile what is in .tmp-es to general ES6. The idea is that we don't want to force any particular babel presets onto our users, but that we can be fairly sure they're using some kind of JS compiler in their toolchain downstream from this package to target different JS versions (such as ES5 or whatever they want).


Reviewer checklist

  • While the contributor's branch is checked out, run npm run dist and compare the generated JS files to the source JSX files.

@interactivellama
Copy link
Contributor

I think this is looking good. We can always go more transpiled. We can't go less though in the future. The "@salesforce" namespace needs to be added to the package, so devs don't have to change that in the future. I'm going to test with create-react-app today.

@interactivellama
Copy link
Contributor

interactivellama commented Dec 11, 2017

The update on this is that we are hoping to do multiple versions in one tag:

  • a lightly transpiled ES6 that maintains modules in /components/
  • a CJS version that means if you use import { Button } from 'design-system-react', you won't need Babel transpiling of files in node_modules which will make this format compatible with a non-ejected create-react-app. CJS can be swapped out for "modular ES5" in this instance, I think.

@interactivellama
Copy link
Contributor

Closing in favor of #1210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants