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

components-typescript package.json main field is confusing #43

Open
abrkn opened this issue Apr 3, 2020 · 1 comment
Open

components-typescript package.json main field is confusing #43

abrkn opened this issue Apr 3, 2020 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@abrkn
Copy link

abrkn commented Apr 3, 2020

In packages/components-typescript/package.json the fields main and main:src: refer to files that do not exist:

  "main": "src/index.tsx",
  "main:src": "src/index.tsx",

The index.tsx file is located in packages/components-typescript/index.tsx

Are these two fields redundant?

@F1LT3R
Copy link
Collaborator

F1LT3R commented Apr 23, 2020

Have you tried removing them? What happens?

I see an index.tsx in the same dir as package.json.

It may be in the wrong place. As far as collecting the babel-paths is concerned, my guess is that it should make no difference. Because the code is located in src/ babel should still be able to load the code in the child path.

It's an oversight for sure. The same issue is found in the JavaScript components dir: https://github.com/react-workspaces/react-workspaces-playground/tree/master/packages/components

It has been many months since I used React or React-Workspaces, so I'm a little rusty, but I think those index files should be moved into the src/ directory - and the index code should be:

export { default as CompOne } from './CompOne';
export { default as CompTwo } from './CompTwo';

Do you want to submit a PR?

@F1LT3R F1LT3R added help wanted Extra attention is needed good first issue Good for newcomers labels Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants