guidesmiths / gs-hygen Goto Github PK
View Code? Open in Web Editor NEWRemote hygen templates generator
License: MIT License
Remote hygen templates generator
License: MIT License
We have to change the GLP Licence to MIT. We have to use that license to be compliant with the license checker.
Afte I installed the command using
npm install -g gs-hygen
I executed this command
gs-hygen template --url [email protected]:guidesmiths/infinitas-hygen-template-generators.git --generator service-systemic-basics,nvm,commitlint,jest-systemic,jest-systemic-mock-bus --output . git --private-key ~/.ssh/my_key --public-key ~/.ssh/my_key.pub
I receive one of the questions, and I answer YES.
✔ Are you sure you whant to remove .? (y/N) · true
If I select N nothing happens. I am not sure if that's okay 🤔
After that I receive this error:
(node:79623) UnhandledPromiseRejectionWarning: Error: failed to make directory './_templates': No such file or directory
Apart from that error, once I got that error the command does not work anymore and I cannot re-install again. I have to remove that package from my Laptop and then I can re-install it again.
Describe the bug
Error in package installation or building
gs-hygen-1.2.1
npm install
> [email protected] install /Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install
[nodegit] Running pre-install script
[nodegit] Running install script
node-pre-gyp
WARN Using request for node-pre-gyp https download
node-pre-gyp
WARN Tried to download(404): https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.27.0-node-v83-darwin-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
Traceback (most recent call last):
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
sys.exit(gyp.script_main())
^^^^^^^^^^^^^^^^^
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
return main(sys.argv[1:])
^^^^^^^^^^^^^^^^^^
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
return gyp_main(args)
^^^^^^^^^^^^^^
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
[generator, flat_list, targets, data] = Load(
^^^^^
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
result = gyp.input.Load(build_files, default_variables, includes[:],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load
LoadTargetBuildFile(build_file, data, aux_data,
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile
build_file_contents = open(build_file_path, 'rU').read()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU' while trying to load binding.gyp
gyp
ERR! configure error
gyp
ERR! stack Error: `gyp` failed with exit code: 1
gyp
ERR! stack at ChildProcess.onCpExit (/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp
ERR! System Darwin 23.3.0
gyp ERR! command "/Users/edoardo/.nvm/versions/node/v14.21.3/bin/node" "/Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit/build/Release/nodegit.node" "--module_name=nodegit" "--module_path=/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR!
cwd /Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit
gyp ERR! node -v v14.21.3
gyp ERR!
node-gyp -v v5.1.1
gyp ERR! not ok
node-pre-gyp
ERR! build error
node-pre-gyp
ERR! stack Error: Failed to execute '/Users/edoardo/.nvm/versions/node/v14.21.3/bin/node /Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp
ERR! stack at ChildProcess.emit (events.js:400:28)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1088:16)
node-pre-gyp ERR!
stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
node-pre-gyp ERR!
System Darwin 23.3.0
node-pre-gyp ERR! command "/Users/edoardo/.nvm/versions/node/v14.21.3/bin/node" "/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp
ERR! cwd /Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit
node-pre-gyp ERR! node -v v14.21.3
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR!
not ok
Failed to execute '/Users/edoardo/.nvm/versions/node/v14.21.3/bin/node /Users/edoardo/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/edoardo/Downloads/gs-hygen-1.2.1/node_modules/nodegit/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
[nodegit] ERROR - Could not finish install
[nodegit] ERROR - finished with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node lifecycleScripts/preinstall && node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/edoardo/.npm/_logs/2024-02-06T11_29_17_314Z-debug.log
I receive this error after I run these commands:
Error
Commands
gs-hygen template --url [email protected]:guidesmiths/infinitas-hygen-template-generators.git --generator service-systemic-basics,nvm,commitlint,jest-systemic,jest-systemic-mock-bus --output /Users/kevinccbsg/guidesmiths/pocs/gs-hygen-tests git --private-key ~/.ssh/id_gs_rsa --public-key ~/.ssh/id_gs_rsa.pub // SUCESS
// This one I selected the remove option
gs-hygen template --url [email protected]:guidesmiths/infinitas-hygen-template-generators.git --generator license-gpl-3 --output /Users/kevinccbsg/guidesmiths/pocs/gs-hygen-tests git --private-key ~/.ssh/id_gs_rsa --public-key ~/.ssh/id_gs_rsa.pub // SUCESS
// After selecting the remove option and receive the error
gs-hygen template --url [email protected]:guidesmiths/infinitas-hygen-template-generators.git --generator jest-systemic-mock-bus --output /Users/kevinccbsg/guidesmiths/pocs/gs-hygen-tests git --private-key ~/.ssh/id_gs_rsa --public-key ~/.ssh/id_gs_rsa.pub // ERROR
gs-hygen // ERROR
When we run the command there are some names that are related to some of our projects.
What's the name of your package? Ex: (service he hst results api)
We must remove that and add a more open-source example. This it should work for non Guidesmiths projects 👍
What's the name of your package? Ex: (My service api)
We have jest.config.js
but we don't have any test. Maybe it is a good idea to have some test for some of these conditions:
if (existsSync(templatesPath)) {
del.sync(templatesPath, { force: true });
}
if (!existsSync(tmpOutput)) {
console.error('This generator did no generated any output files');
process.exit(1);
}
if (existsSync(templateArgvs.output)) {
del.sync(templateArgvs.output, { force: true })
}
Or maybe we could create a fake template to test that everything works as expected.
I think this one is an important one because the way I see this package as an interesting solution is this one.
Users will have the option to create a repo from a scaffolding template. This one is working with this command:
gs-hygen template --url [email protected]:guidesmiths/infinitas-hygen-template-generators.git --generator service-systemic-basics,nvm,commitlint,jest-systemic,jest-systemic-mock-bus --output /Users/kevinccbsg/guidesmiths/pocs/gs-hygen-tests git --private-key ~/.ssh/id_gs_rsa --public-key ~/.ssh/id_gs_rsa.pub
But we have the use case that a project has a few refactors in its initial development but after some sprints will need to use another one or multiple ones. This will be a problem as the current command does not allow you to do that. It will remove or not update the folder.
We have to complete the Community checklist
We have to improve readme docs. We must keep clear this is not the generator unless it is the cli we use with other hygen templates.
I don't think it is necessary but we could use Docsify to have better documentation.
We have to create some Github actions.
After this, we could add Readme badges. Like the shield ones
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.