-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contributor-workflow): add command to copy vendored PUI packages…
… to projects - See contributing guidelines for details [Finishes #95551932]
- Loading branch information
1 parent
26352e2
commit 8538ef3
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {exec} from 'child_process'; | ||
import gulp from 'gulp'; | ||
import path from 'path'; | ||
import {argv} from 'yargs'; | ||
|
||
gulp.task('vendor-package', ['css-build', 'react-build'], (callback) => { | ||
const {type: componentType, component: componentName, dest} = argv; | ||
|
||
function useVendoredPackageInProject() { | ||
console.log('hi'); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
const originalDirectory = process.cwd(); | ||
process.chdir(dest); | ||
|
||
exec(`npm install --save ${path.join('pui-vendor', componentType, componentName)}`, (error) => { | ||
if (error) { | ||
new gutil.PluginError('vendor-package', {message: error}); | ||
} | ||
process.chdir(originalDirectory); | ||
callback(); | ||
}); | ||
} | ||
|
||
gulp.src(`dist/${componentType}/${componentName}/*`) | ||
.pipe(gulp.dest(`${dest}/pui-vendor/${componentType}/${componentName}`)) | ||
.on('end', useVendoredPackageInProject); | ||
}); |
hmm... :)