Giter VIP home page Giter VIP logo

Comments (5)

Szandor72 avatar Szandor72 commented on July 2, 2024 2

I think we miss some polishing for development on windows. Especially powershell - I wish somebody told me to use cmd instead. Would have spared me an hour.

As you did, I grabbed the newest version of the plugin generator, left everything untouched and the plugin does not compile either. If I workaround the issues (missing node_modules folder, failing npm install) I am ending up with the same behaviour: plugin looks for command in 'lib' and there's no lib folder to be found.

from sfdx-plugin-generate.

jayree avatar jayree commented on July 2, 2024 2

I have the same problem when I try to install a new plugin from a tarball on Mac or Windows. The prepare script seems to be the cause of this issue.

It deletes the lib directory and then calls the compiler. Since the src directory does not exist in the tarball, nothing is compiled and the plugin is not working.

But the behavior is different depending on the platform the plugin was created on.

On a Mac this script is created:

"prepare": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap"

On Windows the rm command is not recognized (even PowerShell doesn't know the parameter -rf). This means on Windows the plugins works. But you will always get some yarn errors during the installation.
On MacOS rm -rf is executed with the result described above.

On Windows this script looks different:

"prepare": "rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap"

As rimraf is the UNIX command rm -rf for Node.js the lib directory will be removed on Windows as well as MacOS and the plugin is not working.

As a workaround you need to remove rimraf/rm-rf and tsc -b from the prepare script and build everything upfront.

from sfdx-plugin-generate.

jayree avatar jayree commented on July 2, 2024 1

My current solution to delete the lib folder and call the compiler within the prepare script during development and not if the plugin is published or packed:

install path-exists-cli

npm install --save-dev path-exists-cli

add a prepack script:

"prepack": "rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap ",

and modify the prepare script:

"prepare": "path-exists src && rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap || path-exists lib",

from sfdx-plugin-generate.

Szandor72 avatar Szandor72 commented on July 2, 2024

Ill give this a try, @jayree . Thx

@amphro could you still have look on getting started on Win as easily as on Mac? Thank you.

from sfdx-plugin-generate.

amphro avatar amphro commented on July 2, 2024

Can you try this with the latest CLI and build?

from sfdx-plugin-generate.

Related Issues (20)

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.