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

Allow installation via git #574

Open
wants to merge 7 commits into
base: v4.8.0
Choose a base branch
from

Conversation

ShadiestGoat
Copy link
Contributor

This PR enables users to install replugged using the git syntax that npm allows. There 2 parts to the PR - the type changes & the script changes. Neither change the replugged API.

The type changes are a bit odd. These are required to make the package 'portable'. This is an issue thats tracked on the ts repo. The workaround implemented here is a based on this comment, but instead of creating an intermediate interface, we re-export the React namespace as _. The exported _ isn't intended for actual use, the idea is that it can be an unlinted unused type import, but be there enough so that typescript still correctly identifies the react types. Also yeah - i did check if its possible to just not import the _ but I couldn't find a way to not. It shouldn't affect anything at all since its exported as a type and its a namespace anyways.

TLDR is that typescript is weird & this is a non-intrusive way to make it just work.

The second part of this is the script changes. I aliased the current prepublishOnly script to be build:types as it makes a bit more sense it terms of naming and clarity, especially since its reused. I then removed the prepublishOnly script in favor of the prepare script, as its a ran post install & pre publish. For compatibility with npm it first does a check to see if src present. If it ain't present, its an npm pkg & therefore doesn't need any to have it's types built.

As for why this is needed - primarily its for testing & preparing for new releases. Secondary, it makes the code more 'correct' since its able to compile in more contexts.

ShadiestGoat and others added 7 commits October 14, 2023 12:43
* Install Commands - Draft 1

* Prettier choices

* Better store display name handler

* Use install flow + don't send a message response

* Woops forgot lint

* Add util for generating install urls

* add a share command

* Lint

* Use a shared injector instance for commands

* Use executor & getValue

* Bloody lint

* Single source display name map

* Lint <3

* Remove share cmd

* Remove unused imports

* Remove install URL util

* Type assertion no longer required

* Add i18n

* Move parseInstallLink to utils

* Allow addon to be the install link

* Replace toast responses with command ones

* Lint

* Remove try/catch & null check parseInstallLink

* format

---------

Co-authored-by: Albert Portnoy <albert@albertp.dev>
@asportnoy asportnoy changed the base branch from v4.7.0 to v4.8.0 October 19, 2023 02:07
@12944qwerty 12944qwerty added this to the v4.8.0 milestone Oct 24, 2023
@FedeIlLeone FedeIlLeone added enhancement New feature or request semver: minor Requires a minor semver version bump labels Jun 22, 2024
@FedeIlLeone FedeIlLeone removed this from the v4.8.0 milestone Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver: minor Requires a minor semver version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants