Skip to content

Migrate to a pnpm monorepo #1281

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

Merged
merged 6 commits into from
Mar 21, 2023
Merged

Migrate to a pnpm monorepo #1281

merged 6 commits into from
Mar 21, 2023

Conversation

pokey
Copy link
Member

@pokey pokey commented Feb 27, 2023

Checklist

Desiderata

Correctly flagging errors

  • D1: It is a compile error to import external packages that are not listed in package.json
    • D1.1: vscode (for some reason this one behaves strangely)
    • D1.2: Other packages
  • D2: It is not a compile error to import from local packages that you depend on, using our preferred syntax (eg @cursorless/foo)
  • D3: It is a compile error to import from local packages that you depend on, not using our preferred syntax (eg ../foo)
  • D4: It is a compile error to import from local packages that you do not depend on, either
    • D4.1: using our non-preferred syntax (eg ../packages/foo), or
    • D4.2: using preferred syntax (eg @cursorless/foo)
  • D5: It is a compile error to import from anything other than index.ts in another module
    • D5.1: no @cursorless/foo/bar
    • D5.2: no ../foo/bar
    • a: Even if you depend on the module
    • b: Even if bar was re-exported in foo/index.ts. In that case it should be required to import @cursorless/foo. Untested, but probably works, and I ran out of steam 😅
  • D6: It is not a compile error to import external packages listed in package.json
    • D6.1: vscode (for some reason this one behaves strangely)
    • D6.2: Other packages

Auto-import

  • D7: Auto-import doesn't import from external packages not listed in package.json
    • D7.1: vscode (for some reason this one behaves strangely)
    • D7.2: Other packages
  • D8: Auto-import imports from external packages listed in package.json
    • D8.1: vscode (for some reason this one behaves strangely)
    • D8.2: Other packages
  • D9: Auto-import imports from local packages that you depend on, using our preferred syntax (eg @cursorless/foo)
  • D10: Auto-import doesn't import from local packages that you don't depend on
  • D11: Auto-import doesn't import from anything other than index.ts in another package (eg no @cursorless/foo/bar)
    • D11.1: When you depend on the package
    • D11.2: When you don't depend on the package

Other DX

  • D12: Find references across projects when no file from the referencing project is open
  • D13: Rename across projects when no file from the referencing project is open
  • D14: Jump to definition across projects
  • D15: It is easy to move a file from one package to another
  • D16: It is easy to create a new package
  • D17: Breakpoints work in Cursorless extension
  • D18: Breakpoints work on Cursorless root website
  • D19: Breakpoints work on Cursorless docs website

@pokey pokey force-pushed the pokey/pnpm-workspace branch from 3f552a7 to faacb15 Compare February 27, 2023 18:39
Base automatically changed from pokey/disallow-type-import-exceptions to main February 28, 2023 12:52
@pokey pokey mentioned this pull request Mar 1, 2023
11 tasks
@pokey pokey force-pushed the pokey/pnpm-workspace branch 12 times, most recently from abec685 to efd5c50 Compare March 6, 2023 19:29
@pokey pokey force-pushed the pokey/pnpm-workspace branch 2 times, most recently from 60e86b1 to e44b9a2 Compare March 9, 2023 20:26
@pokey pokey changed the title pnpm workspace Migrate to a pnpm monorepo Mar 10, 2023
@pokey pokey force-pushed the pokey/pnpm-workspace branch from b0fdf7e to cdef473 Compare March 12, 2023 14:11
@pokey pokey force-pushed the pokey/pnpm-workspace branch 2 times, most recently from 14694c7 to 0405fb5 Compare March 16, 2023 10:19
# Cursorless first and using a special extension id to break update chain

# 1. Uninstall production cursorless
code --uninstall-extension pokey.cursorless || echo "Cursorless not currently installed"
Copy link
Member Author

Choose a reason for hiding this comment

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

--disable-extension

Copy link
Member Author

Choose a reason for hiding this comment

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

Turns out this flag doesn't do what we thought it did; it just tries to launch vscode with the extension disabled; it doesn't disable the extension everywhere. Leaving it as uninstall cc/ @AndreasArvidsson

@pokey
Copy link
Member Author

pokey commented Mar 20, 2023

ok @auscompgeek I split out requested pieces into #1327, and pulled out the missing pieces you needed for #1322 and added them there

@pokey
Copy link
Member Author

pokey commented Mar 20, 2023

Ok everything from review session addressed except for comment re removing deps from docs package; see response there. Captured changes in 563b872. We need to merge #1322 and #1327 then I think this one is ready to go.

lmk what you think cc/ @AndreasArvidsson @auscompgeek

@pokey pokey changed the base branch from main to pokey/base/pnpm-workspace March 20, 2023 15:45
@pokey pokey force-pushed the pokey/base/pnpm-workspace branch from 3b49d86 to eb794e9 Compare March 20, 2023 15:48
@pokey pokey force-pushed the pokey/pnpm-workspace branch from e4e3281 to 563b872 Compare March 20, 2023 15:48
pokey added a commit that referenced this pull request Mar 20, 2023
@AndreasArvidsson
Copy link
Member

Looks good!

pokey added a commit that referenced this pull request Mar 21, 2023
Extracted from #1281 with fixes

- [x] fix `takeSnapshot` taking `vscode.Clipboard`

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: Pokey Rule <[email protected]>
@pokey pokey force-pushed the pokey/pnpm-workspace branch from 563b872 to 1e1090f Compare March 21, 2023 11:49
@pokey pokey changed the base branch from pokey/base/pnpm-workspace to main March 21, 2023 11:49
@pokey pokey force-pushed the pokey/pnpm-workspace branch from 1e1090f to d26d5ae Compare March 21, 2023 11:50
@pokey pokey marked this pull request as ready for review March 21, 2023 11:50
@AndreasArvidsson
Copy link
Member

I'm not going to reread over three thousand files. Based on the walkthrough we have had and the latest changes I have reviewed I'm happy.

@pokey pokey merged commit f90f496 into main Mar 21, 2023
@pokey pokey deleted the pokey/pnpm-workspace branch March 21, 2023 13:28
@pokey pokey mentioned this pull request Mar 22, 2023
3 tasks
pokey added a commit that referenced this pull request Mar 23, 2023
The test case recorder broke in #1281 due to the fact we're now
launching extension in subdirectory called `dist` rather than top-level
repo. This PR fixes it

## Checklist

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet
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.

Upgrade typedoc Migrate to a pnpm monorepo
3 participants