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

fix(package.json): edit main, exports and publishConfig to improve DX #228

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

manudeli
Copy link
Contributor

Edit main, exports and publishConfig to improve DX

Cannot find module directly, if contributors didn't build packages.

image

Though there is built packages, Contributor want to access source itself, not built package.

Solution I thought

How about making vscode access to workspaces source code directly, not built package. if package.json using publishConfig, making built package and developing package in workspaces for DX separately is available.

{
  "main": "src/index.ts",
  "exports": {
    ".": {
      "require": "./src/index.ts",
      "import": "./src/index.ts"
    },
    "./package.json": "./package.json"
  },
  "publishConfig": {
    "access": "public",
    "exports": {
      ".": {
        "require": "./dist/index.js",
        "import": "./esm/index.mjs",
        "types": "./dist/index.d.ts"
      },
      "./package.json": "./package.json"
    },
    "import": "./esm/index.mjs",
    "main": "./dist/index.js",
    "types": "dist/index.d.ts",
    "module": "esm/index.mjs"
  },
}

@height
Copy link

height bot commented Dec 11, 2022

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@netlify
Copy link

netlify bot commented Dec 11, 2022

Deploy Preview for storybook-h6s ready!

Name Link
🔨 Latest commit 5d99463
🔍 Latest deploy log https://app.netlify.com/sites/storybook-h6s/deploys/63a288cab9ae0200092bae2f
😎 Deploy Preview https://deploy-preview-228--storybook-h6s.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Dec 11, 2022

Deploy Preview for h6s-react-examples canceled.

Name Link
🔨 Latest commit 5d99463
🔍 Latest deploy log https://app.netlify.com/sites/h6s-react-examples/deploys/63a288caab5e16000897191b

@netlify
Copy link

netlify bot commented Dec 11, 2022

Deploy Preview for h6s-dev canceled.

Name Link
🔨 Latest commit 5d99463
🔍 Latest deploy log https://app.netlify.com/sites/h6s-dev/deploys/63a288ca7d15890008bc5587

@SoYoung210 SoYoung210 self-requested a review December 12, 2022 13:26
Copy link
Member

@SoYoung210 SoYoung210 left a comment

Choose a reason for hiding this comment

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

Thanks for Contribute.

I would appreciate it if you could change the order of the exports fields(types first) by referring to below information. 👇
microsoft/TypeScript#46334

cc @JaeYeopHan

@manudeli
Copy link
Contributor Author

manudeli commented Dec 12, 2022

Thanks for Contribute.

I would appreciate it if you could change the order of the exports fields(types first) by referring to below information. 👇 microsoft/TypeScript#46334

cc @JaeYeopHan

@SoYoung210

I changed order of exports as your link reference's advice.

I tried to reproduce problem situation. but actually, I couldn't reproduce it what you worried. so I couldn't get confidence at this implementation. If my change is wrong, could you make some suggestion code for me? I just want to know what you want exactly.

@manudeli manudeli requested review from SoYoung210 and removed request for JaeYeopHan December 12, 2022 15:40
@SoYoung210
Copy link
Member

I don't know how you tried it, but as written in the issue above, in an environment using (ts)module: next and wrong order of the exports map - types are not described first, the type evaluation can match the wrong file.

btw, i'll investigate broken netlify issues... I don't think it's because of this change 🤔, but can you wait a moment? 🙏 🙏

@SoYoung210
Copy link
Member

@manudeli netlify issue is solved in #231. I'll rebase this PR and publish beta release for testing.

@JaeYeopHan
Copy link
Collaborator

rebase please

@SoYoung210
Copy link
Member

@manudeli sorry i cant rebase this pr (this pr is created through a forked repo 😅)
can u do it?

@manudeli
Copy link
Contributor Author

@JaeYeopHan @SoYoung210 Rebasing done

@SoYoung210 SoYoung210 changed the base branch from main to alpha December 21, 2022 04:50
@SoYoung210 SoYoung210 merged commit d5271de into h6s-dev:alpha Dec 21, 2022
github-actions bot pushed a commit that referenced this pull request Dec 21, 2022
# [@h6s/calendar-v1.0.8-alpha.1](https://github.com/h6s-dev/h6s/compare/@h6s/calendar-v1.0.7...@h6s/calendar-v1.0.8-alpha.1) (2022-12-21)

### Bug Fixes

* **package.json:** edit main, exports and publishConfig to improve DX ([#228](#228)) ([d5271de](d5271de))
@github-actions
Copy link
Contributor

🎉 This PR is included in version @h6s/calendar-v1.0.8-alpha.1 🎉

github-actions bot pushed a commit that referenced this pull request Dec 21, 2022
# [@h6s/table-v1.0.5-alpha.1](https://github.com/h6s-dev/h6s/compare/@h6s/table-v1.0.4...@h6s/table-v1.0.5-alpha.1) (2022-12-21)

### Bug Fixes

* **package.json:** edit main, exports and publishConfig to improve DX ([#228](#228)) ([d5271de](d5271de))
@github-actions
Copy link
Contributor

🎉 This PR is included in version @h6s/table-v1.0.5-alpha.1 🎉

@SoYoung210 SoYoung210 mentioned this pull request Jan 2, 2023
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.

None yet

3 participants