Coder Social home page Coder Social logo

gs-hygen's People

Contributors

bounteous avatar bounteous17 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bounteous17

gs-hygen's Issues

[Bug] Error when running the command

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.

upgrade to latest node version

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
  • OS: macos Sonoma 14.3
  • Node: 14.21.3 (via NVM), same on v.21.6.1 (via NVM)

[Bug] Cannot use command after error

I receive this error after I run these commands:

Error

Screenshot 2021-05-08 at 19 38 29

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

[Enhancement] Remove project naming and examples

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)

[tests] Add tests to this package

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.

[Enhancement] Allow override generators

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.

[docs] Improve readme docs

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.

[Chore] Add Github actions

We have to create some Github actions.

  • Run tests and linter on each PR
  • npm publish after each release

After this, we could add Readme badges. Like the shield ones

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.