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

feat: support for 序.wy and 藏書樓 in cli #512

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

antfu
Copy link
Member

@antfu antfu commented Jan 10, 2020

This PR aims to provide a more flexible import mechanism for 3-rd party libraries and package management. #510 #100 #154


The reader now will search for a module '四庫全書' for a given path '/tmp/examples'

  • /tmp/examples/四庫全書.wy
  • /tmp/examples/四庫全書/序.wy

The first match will be imported.


Heretical import is NOT implemented yet. For example

When 四庫全書/序.wy imports 本草綱目 will search for

  • /tmp/examples/四庫全書/本草綱目.wy
  • /tmp/examples/四庫全書/本草綱目/序.wy

To archive this, we need to the current file path to manipulate the importPaths and this may require some refactoring to current codebase. So I will make another PR for that later.


藏書樓 as node_modules will be included as importPaths by CLI automatically. It will do an up searching for 藏書樓 from the cwd (just as node did)

@LingDong- LingDong- merged commit e1fd1f7 into wenyan-lang:master Jan 10, 2020
@LingDong-
Copy link
Member

👍, thanks!

@antfu
Copy link
Member Author

antfu commented Jan 10, 2020

@LingDong- Can I make a release for this? 😏

@LingDong-
Copy link
Member

Sure!

LingDong- added a commit that referenced this pull request Jan 20, 2020
feat: support for 序.wy and 藏書樓 in cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants