Browse Source

chore: add gulp script to publish.ps1

pull/2017/head
mehmet-erim 7 years ago
parent
commit
fedff95375
  1. 27
      npm/abp-run-gulp-script.js
  2. 2
      npm/ng-packs/scripts/build.js
  3. 2
      npm/ng-packs/scripts/sync.js
  4. 7
      npm/package.json
  5. 9
      npm/publish.ps1

27
npm/abp-run-gulp-script.js

@ -0,0 +1,27 @@
const glob = require('glob');
var path = require('path');
const childProcess = require('child_process');
const gulp = pkgJsonPath => {
try {
console.log('Running the yarn command... Cwd: ' + pkgJsonPath);
childProcess.execSync(`yarn`, { cwd: pkgJsonPath });
console.log('Running the gulp command...');
return childProcess.execSync(`gulp`, { cwd: pkgJsonPath, stdio: 'inherit' });
} catch (error) {
console.log('exec error: ' + error.message);
process.exit(error.status);
}
};
const folder = process.argv[2] || '.';
glob(folder + '/**/package.json', {}, (er, files) => {
files.forEach(file => {
if (file.includes('node_modules')) {
return;
}
gulp(file.replace('/package.json', ''));
});
});

2
npm/ng-packs/scripts/build.js

@ -37,7 +37,7 @@ import fse from 'fs-extra';
}); });
await execa('git', ['add', '../dist/*', '../package.json'], { stdout: 'inherit' }); await execa('git', ['add', '../dist/*', '../package.json'], { stdout: 'inherit' });
await execa('git', ['commit', '--no-verify', '-m', 'Build ng packages'], { stdout: 'inherit' }); await execa('git', ['commit', '-m', 'Build ng packages', '--no-verify'], { stdout: 'inherit' });
process.exit(0); process.exit(0);
})(); })();

2
npm/ng-packs/scripts/sync.js

@ -25,7 +25,7 @@ import execa from 'execa';
try { try {
await execa('git', ['add', '../packages/*', '../package.json'], { stdout: 'inherit' }); await execa('git', ['add', '../packages/*', '../package.json'], { stdout: 'inherit' });
await execa('git', ['commit', '-m', '--no-verify', 'Update source packages versions'], { stdout: 'inherit' }); await execa('git', ['commit', '-m', 'Update source packages versions', '--no-verify'], { stdout: 'inherit' });
} catch (error) { } catch (error) {
console.error(error.stderr); console.error(error.stderr);
} }

7
npm/package.json

@ -1,9 +1,10 @@
{ {
"scripts": { "scripts": {
"lerna": "lerna", "lerna": "lerna",
"update": "node abp-package-update-script.js .", "gulp:app": "node abp-run-gulp-script.js ../templates/app/aspnet-core",
"update:templates": "node abp-package-update-script.js ../templates", "gulp:module": "node abp-run-gulp-script.js ../templates/module/aspnet-core",
"ncu": "ncu" "ncu": "ncu",
"update:templates": "node abp-package-update-script.js ../templates"
}, },
"devDependencies": { "devDependencies": {
"lerna": "^2.11.0", "lerna": "^2.11.0",

9
npm/publish.ps1

@ -1,10 +1,13 @@
& cd ng-packs\scripts & cd ng-packs\scripts
& npm install & npm install
& yarn build & npm run build
& cd ../../ & cd ../../
& yarn & yarn
& yarn lerna publish --no-push & yarn lerna publish --no-push
& cd ng-packs\scripts & cd ng-packs\scripts
& yarn sync & npm run sync
& cd ../../ & cd ../../
& yarn update:templates & yarn update:templates
& yarn global add gulp
& yarn gulp:app
& yarn gulp:module
Loading…
Cancel
Save