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

Rework extensions folder to use paranext-multi-extension-template #693

Merged
merged 48 commits into from
Jan 5, 2024

Conversation

tjcouch-sil
Copy link
Member

@tjcouch-sil tjcouch-sil commented Jan 3, 2024

Reworked extensions folder to use the multi-extension template. Primary changes:

  • Each extension that uses TypeScript is now templated from the extension template. The files were restructured so the main file is now src/main.ts and all code is now in src under the extension. The types are now in src/types/<extension_name>.d.ts. There are a bunch more files in each extension folder now, which pretty much only means the folder now supports opening it directly in VSCode and editing just the one extension (the files are there mainly because each extension is from the template now)
  • Webpack now generates the main and types files in the same place in the dist folder to avoid great confusion
  • There are a couple new npm scripts in extensions that help with making new extensions and updating from the template
  • Moved usxeditor devDependency from inside resource-viewer up to extensions to make life easier since it doesn't really seem to provide much benefit to put it lower

More information on the templates can be found at paranext/paranext-multi-extension-template#1 and paranext/paranext-extension-template#55


This change is Reviewable

git-subtree-dir: extensions
git-subtree-split: 56b2862f3e33fb5a8bb01c8f8eecf5cbb00ac3ce
git-subtree-dir: extensions/src/resource-viewer
git-subtree-split: 239accaa3f44a15d2f37d8329a0f775297cadf0b
git-subtree-dir: extensions/src/quick-verse
git-subtree-split: 239accaa3f44a15d2f37d8329a0f775297cadf0b
git-subtree-dir: extensions/src/hello-world
git-subtree-split: 239accaa3f44a15d2f37d8329a0f775297cadf0b
git-subtree-dir: extensions/src/hello-someone
git-subtree-split: 239accaa3f44a15d2f37d8329a0f775297cadf0b
Copy link
Contributor

@rolfheij-sil rolfheij-sil left a comment

Choose a reason for hiding this comment

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

Great work! With so many files I couldn't do an in depth review, but I figure a lot of it was just moving files to a different location. I disabled auto-merge because I have some non-blocking questions, but I thought it would be wise to not merge immediately

Reviewed 153 of 153 files at r1, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @tjcouch-sil)


LICENSE line 3 at r1 (raw file):

MIT License

Copyright (c) 2022-2023 SIL International

2024 now? Or is this no longer relevant today?


extensions/.stylelintrc.cjs line 2 at r1 (raw file):

module.exports = {
  extends: ['stylelint-config-recommended', 'stylelint-config-sass-guidelines'],

Since we're no longer using a central stylelintrc, should we add a comment that we want to keep the various stylelint.rcs in sync? Or is that not a necessity?


extensions/LICENSE line 3 at r1 (raw file):

MIT License

Copyright (c) 2022-2023 SIL International

2024?


extensions/README.md line 11 at r1 (raw file):

- `src/` contains the source code for all extensions
  - Each sub-folder in `src/` with a `manifest.json` in it is an extension
    - `package.json` contains information about this extension's npm package. It is required for Platform.Bible to use the extension properly. It is copied into the build folder

I see we're starting to mix paranext and platform.bible now. For example, it still says Paranext at line 3. Do we already have a task to change all occurences of paranext to platform.bible? And update repo names etc?


extensions/README.md line 81 at r1 (raw file):

Then follow the instructions for customizing the new extension.

Just an idea: Can't we build some interactive script that prompts the user to provide a name for their extension, and maybe some additional info, and updates all files and filenames accordingly? Instead of our users having to go through these instructions and doing it by hand?


lib/papi-dts/LICENSE line 3 at r1 (raw file):

MIT License

Copyright (c) 2022-2023 SIL International

Also, why is present not acceptable anymore?

rolfheij-sil
rolfheij-sil previously approved these changes Jan 5, 2024
Copy link
Contributor

@rolfheij-sil rolfheij-sil left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lyonsil and @tjcouch-sil)


extensions/README.md line 81 at r1 (raw file):

Previously, lyonsil (Matt Lyons) wrote…

If we're going to go down that route, we'd probably want to consider doing something like what VSCode does with yeoman.

Created 695

Copy link
Member Author

@tjcouch-sil tjcouch-sil left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


extensions/README.md line 81 at r1 (raw file):

Previously, rolfheij-sil wrote…

Created 695

Thank you, Rolf!

6fd7212c Added 'shared with' statements to various style files and brought them in sync (#3)
26aea8b6 Added 'shared with' statements to various style files and brought them in sync
aeca48d4 Fixed a couple things related to packaging extensions (#2)
655ae0e2 Fixed a couple things related to packaging extensions

git-subtree-dir: extensions
git-subtree-split: 6fd7212c359f8d1e7539127608352734eeb92a54
80e78c86 Added 'shared with' statements to various style files and brought them in sync (#56)
e8cfc335 Added 'shared with' statements to various style files and brought them in sync

git-subtree-dir: extensions/src/hello-someone
git-subtree-split: 80e78c864dcc1a4ecf937c1aea92f03c73319780
80e78c86 Added 'shared with' statements to various style files and brought them in sync (#56)
e8cfc335 Added 'shared with' statements to various style files and brought them in sync

git-subtree-dir: extensions/src/hello-world
git-subtree-split: 80e78c864dcc1a4ecf937c1aea92f03c73319780
80e78c86 Added 'shared with' statements to various style files and brought them in sync (#56)
e8cfc335 Added 'shared with' statements to various style files and brought them in sync

git-subtree-dir: extensions/src/quick-verse
git-subtree-split: 80e78c864dcc1a4ecf937c1aea92f03c73319780
…78c86

80e78c86 Added 'shared with' statements to various style files and brought them in sync (#56)
e8cfc335 Added 'shared with' statements to various style files and brought them in sync

git-subtree-dir: extensions/src/resource-viewer
git-subtree-split: 80e78c864dcc1a4ecf937c1aea92f03c73319780
@tjcouch-sil tjcouch-sil dismissed stale reviews from rolfheij-sil and lyonsil via 4ec2003 January 5, 2024 14:26
79123d5c Removed no-non-null-assertion as it is covered by no-type-assertion (#4)
d5fcc8d0 Removed no-non-null-assertion as it is covered by no-type-assertion

git-subtree-dir: extensions
git-subtree-split: 79123d5c0ec3523090f3f6eb4ae02895a7e637f0
2bfae618 Removed no-non-null-assertion as it is covered by no-type-assertion (#57)
9daa8694 Removed no-non-null-assertion as it is covered by no-type-assertion

git-subtree-dir: extensions/src/hello-someone
git-subtree-split: 2bfae618f63a28ba9420a992837ccfdae37393b0
2bfae618 Removed no-non-null-assertion as it is covered by no-type-assertion (#57)
9daa8694 Removed no-non-null-assertion as it is covered by no-type-assertion

git-subtree-dir: extensions/src/hello-world
git-subtree-split: 2bfae618f63a28ba9420a992837ccfdae37393b0
2bfae618 Removed no-non-null-assertion as it is covered by no-type-assertion (#57)
9daa8694 Removed no-non-null-assertion as it is covered by no-type-assertion

git-subtree-dir: extensions/src/quick-verse
git-subtree-split: 2bfae618f63a28ba9420a992837ccfdae37393b0
…ae618

2bfae618 Removed no-non-null-assertion as it is covered by no-type-assertion (#57)
9daa8694 Removed no-non-null-assertion as it is covered by no-type-assertion

git-subtree-dir: extensions/src/resource-viewer
git-subtree-split: 2bfae618f63a28ba9420a992837ccfdae37393b0
Copy link
Contributor

@rolfheij-sil rolfheij-sil left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 52 of 57 files at r2, 6 of 6 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @tjcouch-sil)


extensions/src/hello-someone/LICENSE line 3 at r3 (raw file):

MIT License

Copyright (c) 2023-2024 SIL International

At a previous job we configured beautifier (which is an alternative to prettier) to automatically update these things when you'd apply your styling settings (i.e. on saving the file). Can we do something similar? Doing all these things by hand is very error prone and honestly I don't feel like searching for and manully updating numbers like these when I'm coding.

Copy link
Member Author

@tjcouch-sil tjcouch-sil left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


extensions/src/hello-someone/LICENSE line 3 at r3 (raw file):

Previously, rolfheij-sil wrote…

At a previous job we configured beautifier (which is an alternative to prettier) to automatically update these things when you'd apply your styling settings (i.e. on saving the file). Can we do something similar? Doing all these things by hand is very error prone and honestly I don't feel like searching for and manully updating numbers like these when I'm coding.

Sounds pretty nice - might be worth filing an issue ;) I'm going to resolve this for the sake of getting the PR in, but feel free to continue the conversation

@tjcouch-sil tjcouch-sil merged commit 75ca025 into main Jan 5, 2024
7 checks passed
@tjcouch-sil tjcouch-sil deleted the 486-multi-extension-template branch January 5, 2024 18:11
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.

3 participants