Skip to content

Commit

Permalink
Fix auto publishing npm
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Oct 6, 2022
1 parent de2d7fc commit abfbbb9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 29 deletions.
53 changes: 27 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,41 @@
},
"dependencies": {
"better-console": "*",
"del": "^3.0.0",
"extend": "^3.0.2",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^6.1.0",
"gulp-chmod": "^2.0.0",
"gulp-clean-css": "^3.10.0",
"gulp-clone": "^2.0.1",
"gulp-concat": "^2.6.1",
"gulp-concat-css": "^3.1.0",
"gulp-copy": "4.0.1",
"gulp-dedupe": "0.0.2",
"gulp-flatten": "^0.4.0",
"gulp-header": "^2.0.9",
"gulp-if": "^2.0.2",
"del": "*",
"extend": "*",
"gulp": "*",
"gulp-autoprefixer": "*",
"gulp-chmod": "*",
"gulp-clean-css": "*",
"gulp-clone": "*",
"gulp-concat": "*",
"gulp-concat-css": "*",
"gulp-copy": "*",
"gulp-dedupe": "*",
"gulp-flatten": "*",
"gulp-header": "*",
"gulp-if": "*",
"gulp-json-editor": "^2.5.4",
"gulp-less": "^4.0.1",
"gulp-notify": "^3.2.0",
"gulp-plumber": "^1.2.1",
"gulp-print": "^5.0.2",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-rtlcss": "^1.4.1",
"gulp-uglify": "^3.0.2",
"gulp-less": "*",
"gulp-notify": "*",
"gulp-plumber": "*",
"gulp-print": "*",
"gulp-rename": "*",
"gulp-replace": "*",
"gulp-rtlcss": "*",
"gulp-uglify": "*",
"jquery": "^3.5.1",
"map-stream": "^0.1.0",
"map-stream": "*",
"merge-stream": "^1.0.0",
"mkdirp": "^1.0.4",
"prompt-sui": "^3.2.1",
"replace-ext": "^1.0.1",
"require-dot-file": "^0.4.0",
"replace-ext": "*",
"require-dot-file": "*",
"wrench-sui": "^0.0.3",
"yamljs": "^0.3.0"
"yamljs": "*"
},
"devDependencies": {
"@jsdevtools/npm-publish": "^1.4.3",
"@octokit/rest": "^19.0.4",
"gulp-concat-filenames": "*",
"gulp-debug": "^4.0.0",
Expand Down
29 changes: 26 additions & 3 deletions tasks/admin/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ let
// node dependencies
process = require('child_process'),

npmPublish = require('@jsdevtools/npm-publish'),

// config
release = require('../config/admin/release'),

Expand All @@ -29,21 +31,42 @@ module.exports = function(callback) {
console.log('Registering repos with package managers');

// Do Git commands synchronously per component, to avoid issues
stepRepo = function() {
stepRepo = async function() {

index = index + 1;
if(index >= total) {
callback();
return;
}

let
fs = require('fs'),
config = fs.existsSync(__dirname + '/../config/admin/oauth.js')
? require('../config/admin/oauth')
: false,
repo = repos[index].toLowerCase(),
outputDirectory = release.outputRoot + repo + '/',
outputDirectory = `${release.outputRoot}${repo}/`,
exec = process.exec,
execSettings = {cwd: outputDirectory},
updateNPM = 'npm publish;meteor publish;'
updateNPM = 'meteor publish;'
;

/* Register with NPM */
console.info(`NPM Token "${config.npmToken}"`);
console.info(`NPM Publish "${repo}"`);
console.info(outputDirectory);
await npmPublish({
package: `${outputDirectory}/package.json`,
token: config.npmToken,
greaterVersionOnly: true,
debug: function(log) {
console.log(log);
}
});

/* Register with NPM */
console.info(`Meteor publish "${repo}"`);
console.info(outputDirectory);
exec(updateNPM, execSettings, function(err, stdout, stderr) {
console.log(err, stdout, stderr);
stepRepo();
Expand Down

0 comments on commit abfbbb9

Please sign in to comment.