We are having difficulties to get our npm pipeline running. If we got your docs right you’re providing two methods for npm apps:
rtNpm.install / ci
rtNpm.publish
What we are missing right now is something like rtNpm.build to trigger the actual build script for the app.
We would like to have a method that takes a parameter and paste that parameter into "npm run".
For example a method could be implemented in your plugin like this:
function runCustomScript(scriptName) { npm run scriptname; }
The caller of that method would call:
rtNpm.runCustomScript('build')
So normally you would build our app with the following commands:
npm install && npm run build && npm pack
Sadly your provided methods are just covering install and pack. You gave us the hint to define the build script in the postinstall-script space. Unfortunately this does not work for us. This is because we want to build a library. When we define the postinstall script it gets triggered everytime a new application integrates the library. This results in a bunch of errors cause the source that would be needed to execute the build commands is not present (because the sources are already compiled / build).
To give you a better insight of what we are trying to archive:
We want to build a pattern-library (stencil.js).
This is how our package.json (script part) file looks like:
"scripts": {
"build": "npm run clean && npm run generate-svg-sprite && stencil build --ci --docs-readme",
"test": "stencil test --spec --e2e --coverage && jest --coverage",
"clean": "rimraf dist",
"generate-svg-sprite": "gulp"
},
To get everything running we would need to run the command chain as mentioned earlier (npm install && npm run build && npm pack).
In most npm apps that I’ve stumbled upon you’re always have a separate command (build-script) for building the app. The install command is always only used to install all needed dependencies and to prepare the environment.
For example in an Angular app you’re running the ng build command, like shown above in stencil you need to run stencil build, for storybook.js it is build-storybook, and so on.
We are having difficulties to get our npm pipeline running. If we got your docs right you’re providing two methods for npm apps:
What we are missing right now is something like rtNpm.build to trigger the actual build script for the app.
We would like to have a method that takes a parameter and paste that parameter into "npm run".
For example a method could be implemented in your plugin like this:
function runCustomScript(scriptName) { npm run scriptname; }
The caller of that method would call:
rtNpm.runCustomScript('build')
So normally you would build our app with the following commands:
npm install && npm run build && npm pack
Sadly your provided methods are just covering install and pack. You gave us the hint to define the build script in the postinstall-script space. Unfortunately this does not work for us. This is because we want to build a library. When we define the postinstall script it gets triggered everytime a new application integrates the library. This results in a bunch of errors cause the source that would be needed to execute the build commands is not present (because the sources are already compiled / build).
To give you a better insight of what we are trying to archive:
We want to build a pattern-library (stencil.js). This is how our package.json (script part) file looks like:
To get everything running we would need to run the command chain as mentioned earlier (npm install && npm run build && npm pack).
In most npm apps that I’ve stumbled upon you’re always have a separate command (build-script) for building the app. The install command is always only used to install all needed dependencies and to prepare the environment. For example in an Angular app you’re running the ng build command, like shown above in stencil you need to run stencil build, for storybook.js it is build-storybook, and so on.
See also Jfrog-Artifactory-Ticket #178663 https://support.jfrog.com/s/tickets/5006900003MnzuD