generator icon indicating copy to clipboard operation
generator copied to clipboard

feat: template pulling with npm config

Open pierrick-boule opened this issue 1 year ago • 8 comments

test_output.tar.gz

Description Use npm config values in arborist in order to inherit form the global config when pulling a template. This allow to pass config like private registry and proxy-auth.

Related issue(s) https://github.com/asyncapi/generator/issues/538

pierrick-boule avatar Nov 17 '23 22:11 pierrick-boule

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Nov 17 '23 23:11 sonarqubecloud[bot]

Hello, The indent was not to make a dupplicate of https://github.com/asyncapi/generator/pull/1061 , I was scripting the generator at work this week and been trying to work around the limits of the generator (our ci has no direct acces to the web and to ways : private repository, http proxy with auth). Both are ok with npm because we can config it but not with the generator. Maybe this PR can help to find a convenient way of using the generator as easily that npm by reusing the same source of configuration.

pierrick-boule avatar Nov 18 '23 10:11 pierrick-boule

@asyncapi/bounty_team

aeworxet avatar Dec 19 '23 21:12 aeworxet

@pierrick-boule as I wrote before. This https://github.com/asyncapi/generator/pull/1061 is already merged, so please update your PR with latest private npm support

derberg avatar Jan 18 '24 11:01 derberg

Hello @derberg, i updated this PR, was able to test localy : I put "127.0.0.1 registry.npmjs.org" in /etc/hosts to make it unavailable (to remove later) set a private registry : npm config set registry https://private.registry.org/ Run few test OK used a docker proxy https://hub.docker.com/r/thelebster/docker-squid-simple-proxy/ npm config set proxy http://username:password@localhost:3128 Run few test OK

pierrick-boule avatar Feb 06 '24 10:02 pierrick-boule

Hello, i fixed the code style. The backwards compatibility with nodeJS 12 is not that easy to get, i will need more time to check the old npm code :-( .

pierrick-boule avatar Feb 14 '24 17:02 pierrick-boule

Hello, Yes, I tried few implementation of npm config of npm 12 and it's very different of this PR, it will be verbose to implement a retrocompatible version and not very clear/maintainable, i was also thinking about depreciating it, and maybe introduce the new LTS of node (20) if possible.

I will now focus on this way (taking your proposals).

pierrick-boule avatar Mar 11 '24 15:03 pierrick-boule

@pierrick-boule we should support what Node community supports, so minimum is Node 18 that is in maintenance until April next year -> https://nodejs.org/en/about/previous-releases

since we agreed we will run a major release with this PR:

  • please update title to feat!
  • lets refresh node support so make sure package.json and docs talk about Node 18 as minimum
  • make sure testing is also done Node 18 and 20
  • make sure package-lock is using lockfileVersion set to 3

derberg avatar Mar 19 '24 08:03 derberg

@pierrick-boule whenever you're ready for another review round please rerequest review as I do not get notifications that you pushed all required changes.

also please solve conflicts with package-lock.json

derberg avatar Mar 25 '24 13:03 derberg

Hello, @derberg it should be ok now.

pierrick-boule avatar Apr 08 '24 09:04 pierrick-boule

/rtm

derberg avatar Apr 24 '24 09:04 derberg

:tada: This PR is included in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Apr 24 '24 09:04 asyncapi-bot

@all-contributors please add @pierrick-boule for code,test,doc

derberg avatar Apr 24 '24 09:04 derberg

@derberg

I've put up a pull request to add @pierrick-boule! :tada:

allcontributors[bot] avatar Apr 24 '24 09:04 allcontributors[bot]