mdx-live-editor icon indicating copy to clipboard operation
mdx-live-editor copied to clipboard

update package.json to successfully resolve forked packages

Open 100ideas opened this issue 6 years ago • 1 comments

problem: mdx-live-editor requires forks of npm packages that are not published on npm or yarn registries. Perhaps you have them yarn linked on your dev box?

# master was at f3da3ff
$ git clone mdx-live-editor
$ cd mdx-live-editor
$ yarn
yarn install v1.15.2
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@axe312/babel-plugin-inline-import/-/babel-plugin-inline-import-4.0.0.tgz: Request failed \"404 Not Found\"".
# same thing happens w/ '@axe312/easymde'

The two commits show alternative approaches to fixing the error:

  • use forked package github url in package.json: this fetches the up-to-date fork source code from your repos
  • use yarn alias to to rename original packages to name of forked packages: this fetches the original packages from npm/yarn registry, but allows the mdx-live-editor source code to refer to them in imports as if they were the forked version. Not good approach if you plan on modifying your forks.

either way, both solutions allow git cloneing then yarn installing to work successfully while retaining the alternate names of the forked packages (i.e. import EasyMDE from '@axe312/easymde'). If you ever publish your forks, you would just need to change the package.jsons in this repo.

I really like this project - thanks for publishing it! I am working on something kinda similar (and also saw the [blocks/blocks](https://github.com/blocks/blocks) project announcement, so I will see you around and perhaps even have some contributions someday.

100ideas avatar Apr 19 '19 20:04 100ideas

please merge 🙏

retani avatar Jan 27 '20 22:01 retani