@leverege/build-tools 2.33.0 → 2.33.2-bruno.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ {
2
+ "eslint.alwaysShowStatus": true,
3
+ "[javascript]": {
4
+ "editor.codeActionsOnSave": {
5
+ "source.fixAll.eslint": true,
6
+ "source.organizeImports": false
7
+ }
8
+ },
9
+ "[javascriptreact]": {
10
+ "editor.codeActionsOnSave": {
11
+ "source.fixAll.eslint": true,
12
+ "source.organizeImports": false
13
+ }
14
+ },
15
+ }
@@ -302,6 +302,19 @@ const getGitTagSuffix = async () => {
302
302
  });
303
303
  return tagSuffix;
304
304
  };
305
+ const getGitAnnotationMessage = async ({
306
+ tagName
307
+ }) => {
308
+ const {
309
+ annotationMessage
310
+ } = await prompt({
311
+ type: 'input',
312
+ name: 'annotationMessage',
313
+ message: 'What annotation message would you like to add to git tag?',
314
+ initial: tagName
315
+ });
316
+ return annotationMessage;
317
+ };
305
318
  const confirmPushCommit = async buildMessage => {
306
319
  const {
307
320
  confirm
@@ -425,19 +438,19 @@ const commitAndPushNewBuild = async config => {
425
438
  await createNewBuildCommit(config);
426
439
  await pushToGitRemote();
427
440
  };
428
- const confirmPushTag = async tagName => {
441
+ const confirmPushTag = async (tagName, annotationMessage) => {
429
442
  const {
430
443
  confirm
431
444
  } = await prompt([{
432
445
  type: 'confirm',
433
446
  name: 'confirm',
434
- message: `${_ansiColors.default.bold.red('[Warning]')} Push new tag ${_ansiColors.default.bold.yellow(tagName)} to git remote?`
447
+ message: `${_ansiColors.default.bold.red('[Warning]')} Push new tag ${_ansiColors.default.bold.yellow(tagName)} with annotation message "${_ansiColors.default.bold.yellow(annotationMessage)}" to git remote?`
435
448
  }]);
436
449
  return confirm;
437
450
  };
438
- const createGitTag = async tagName => {
451
+ const createGitTag = async (tagName, annotationMessage) => {
439
452
  try {
440
- await (0, _zx.$)`git tag ${tagName}`;
453
+ await (0, _zx.$)`git tag -a ${tagName} -m "${annotationMessage}"`;
441
454
  } catch (err) {
442
455
  console.log(err.stderr || err);
443
456
  process.exit(1);
@@ -453,11 +466,12 @@ const pushGitTag = async tagName => {
453
466
  };
454
467
  const createAndPushGitTag = async ({
455
468
  tagName,
469
+ annotationMessage,
456
470
  noConfirm
457
471
  }) => {
458
- const confirmAnswer = noConfirm || (await confirmPushTag(tagName));
472
+ const confirmAnswer = noConfirm || (await confirmPushTag(tagName, annotationMessage));
459
473
  if (confirmAnswer) {
460
- await createGitTag(tagName);
474
+ await createGitTag(tagName, annotationMessage);
461
475
  await pushGitTag(tagName);
462
476
  }
463
477
  };
@@ -497,9 +511,11 @@ const displayReleaseInfo = config => {
497
511
  packagePath,
498
512
  buildMessage,
499
513
  tagName,
514
+ annotationMessage,
500
515
  publishable,
501
516
  npmjsTag,
502
- isBetaRelease
517
+ isBetaRelease,
518
+ noGitTag
503
519
  } = config;
504
520
  console.log(`
505
521
 
@@ -509,8 +525,9 @@ ${_ansiColors.default.blue('Version:')} ${version}
509
525
  ${_ansiColors.default.blue('Root directory:')} ${repositoryRoot}
510
526
  ${_ansiColors.default.blue('Package name:')} ${packageName}
511
527
  ${_ansiColors.default.blue('package.json path:')} ${_path.default.join(packagePath, 'package.json')}${buildMessage ? `
512
- ${_ansiColors.default.blue('Commit message:')} ${buildMessage}` : ''}${isBetaRelease ? '' : `
513
- ${_ansiColors.default.blue('Git tag:')} ${tagName}`}${publishable ? `
528
+ ${_ansiColors.default.blue('Commit message:')} ${buildMessage}` : ''}${isBetaRelease || noGitTag ? '' : `
529
+ ${_ansiColors.default.blue('Git tag:')} ${tagName}`}${isBetaRelease || noGitTag ? '' : `
530
+ ${_ansiColors.default.blue('Git tag annotation:')} ${annotationMessage}`}${publishable ? `
514
531
  ${_ansiColors.default.blue('Npmjs tag:')} ${npmjsTag}` : ''}
515
532
  ${_ansiColors.default.bold.green('=============================================')}
516
533
  `);
@@ -551,6 +568,11 @@ const optionList = [{
551
568
  type: String,
552
569
  alias: 't',
553
570
  description: 'tag suffix to be appended to the version when pushing to git'
571
+ }, {
572
+ name: 'annotation-message',
573
+ type: String,
574
+ alias: 'm',
575
+ description: 'annotation message that will annotate the git tag'
554
576
  }, {
555
577
  name: 'branch-filter',
556
578
  type: String,
@@ -560,6 +582,10 @@ const optionList = [{
560
582
  name: 'no-commit',
561
583
  type: Boolean,
562
584
  description: 'do not create a new commit on git (in case the goal is just tagging it)'
585
+ }, {
586
+ name: 'no-git-tag',
587
+ type: Boolean,
588
+ description: 'do not create a new tag on git'
563
589
  }, {
564
590
  name: 'no-confirm',
565
591
  type: Boolean,
@@ -589,6 +615,7 @@ validateArgs(args);
589
615
  const config = {};
590
616
  config.noConfirm = !!args['no-confirm'];
591
617
  config.noCommit = !!args['no-commit'];
618
+ config.noGitTag = !!args['no-git-tag'];
592
619
  config.repositoryRoot = await getGitRootDirectory();
593
620
  config.branch = args.branch || (await getBranch({
594
621
  branchFilter: args['branch-filter']
@@ -601,10 +628,12 @@ config.version = args.version || (await getVersion(config));
601
628
  config.packageName = await getPackageName(config);
602
629
  config.buildMessage = config.noCommit ? '' : getBuildMessage(config);
603
630
  config.isBetaRelease = config.version.includes('-beta.');
604
- if (!config.isBetaRelease) {
631
+ if (!config.isBetaRelease && !config.noGitTag) {
605
632
  const tagSuffix = args['tag-suffix'] ?? (await getGitTagSuffix());
606
633
  const tagPrefix = config.isPackageInRepositoryRoot ? '' : `${config.packageName}/`;
607
634
  config.tagName = `${tagPrefix}v${config.version}${tagSuffix}`;
635
+ const annotationMessage = args['annotation-message'] ?? (await getGitAnnotationMessage(config));
636
+ config.annotationMessage = annotationMessage;
608
637
  }
609
638
  config.publishable = !!args.publishable;
610
639
  if (config.publishable) {
@@ -624,7 +653,7 @@ if (!config.noConfirm) {
624
653
  if (!config.noCommit) {
625
654
  await commitAndPushNewBuild(config);
626
655
  }
627
- if (!config.isBetaRelease) {
656
+ if (!config.isBetaRelease && !config.noGitTag) {
628
657
  await createAndPushGitTag(config);
629
658
  }
630
659
  if (config.publishable) {
@@ -302,6 +302,19 @@ const getGitTagSuffix = async () => {
302
302
  });
303
303
  return tagSuffix;
304
304
  };
305
+ const getGitAnnotationMessage = async ({
306
+ tagName
307
+ }) => {
308
+ const {
309
+ annotationMessage
310
+ } = await prompt({
311
+ type: 'input',
312
+ name: 'annotationMessage',
313
+ message: 'What annotation message would you like to add to git tag?',
314
+ initial: tagName
315
+ });
316
+ return annotationMessage;
317
+ };
305
318
  const confirmPushCommit = async buildMessage => {
306
319
  const {
307
320
  confirm
@@ -425,19 +438,19 @@ const commitAndPushNewBuild = async config => {
425
438
  await createNewBuildCommit(config);
426
439
  await pushToGitRemote();
427
440
  };
428
- const confirmPushTag = async tagName => {
441
+ const confirmPushTag = async (tagName, annotationMessage) => {
429
442
  const {
430
443
  confirm
431
444
  } = await prompt([{
432
445
  type: 'confirm',
433
446
  name: 'confirm',
434
- message: `${_ansiColors.default.bold.red('[Warning]')} Push new tag ${_ansiColors.default.bold.yellow(tagName)} to git remote?`
447
+ message: `${_ansiColors.default.bold.red('[Warning]')} Push new tag ${_ansiColors.default.bold.yellow(tagName)} with annotation message "${_ansiColors.default.bold.yellow(annotationMessage)}" to git remote?`
435
448
  }]);
436
449
  return confirm;
437
450
  };
438
- const createGitTag = async tagName => {
451
+ const createGitTag = async (tagName, annotationMessage) => {
439
452
  try {
440
- await (0, _zx.$)`git tag ${tagName}`;
453
+ await (0, _zx.$)`git tag -a ${tagName} -m "${annotationMessage}"`;
441
454
  } catch (err) {
442
455
  console.log(err.stderr || err);
443
456
  process.exit(1);
@@ -453,11 +466,12 @@ const pushGitTag = async tagName => {
453
466
  };
454
467
  const createAndPushGitTag = async ({
455
468
  tagName,
469
+ annotationMessage,
456
470
  noConfirm
457
471
  }) => {
458
- const confirmAnswer = noConfirm || (await confirmPushTag(tagName));
472
+ const confirmAnswer = noConfirm || (await confirmPushTag(tagName, annotationMessage));
459
473
  if (confirmAnswer) {
460
- await createGitTag(tagName);
474
+ await createGitTag(tagName, annotationMessage);
461
475
  await pushGitTag(tagName);
462
476
  }
463
477
  };
@@ -497,9 +511,11 @@ const displayReleaseInfo = config => {
497
511
  packagePath,
498
512
  buildMessage,
499
513
  tagName,
514
+ annotationMessage,
500
515
  publishable,
501
516
  npmjsTag,
502
- isBetaRelease
517
+ isBetaRelease,
518
+ noGitTag
503
519
  } = config;
504
520
  console.log(`
505
521
 
@@ -509,8 +525,9 @@ ${_ansiColors.default.blue('Version:')} ${version}
509
525
  ${_ansiColors.default.blue('Root directory:')} ${repositoryRoot}
510
526
  ${_ansiColors.default.blue('Package name:')} ${packageName}
511
527
  ${_ansiColors.default.blue('package.json path:')} ${_path.default.join(packagePath, 'package.json')}${buildMessage ? `
512
- ${_ansiColors.default.blue('Commit message:')} ${buildMessage}` : ''}${isBetaRelease ? '' : `
513
- ${_ansiColors.default.blue('Git tag:')} ${tagName}`}${publishable ? `
528
+ ${_ansiColors.default.blue('Commit message:')} ${buildMessage}` : ''}${isBetaRelease || noGitTag ? '' : `
529
+ ${_ansiColors.default.blue('Git tag:')} ${tagName}`}${isBetaRelease || noGitTag ? '' : `
530
+ ${_ansiColors.default.blue('Git tag annotation:')} ${annotationMessage}`}${publishable ? `
514
531
  ${_ansiColors.default.blue('Npmjs tag:')} ${npmjsTag}` : ''}
515
532
  ${_ansiColors.default.bold.green('=============================================')}
516
533
  `);
@@ -551,6 +568,11 @@ const optionList = [{
551
568
  type: String,
552
569
  alias: 't',
553
570
  description: 'tag suffix to be appended to the version when pushing to git'
571
+ }, {
572
+ name: 'annotation-message',
573
+ type: String,
574
+ alias: 'm',
575
+ description: 'annotation message that will annotate the git tag'
554
576
  }, {
555
577
  name: 'branch-filter',
556
578
  type: String,
@@ -560,6 +582,10 @@ const optionList = [{
560
582
  name: 'no-commit',
561
583
  type: Boolean,
562
584
  description: 'do not create a new commit on git (in case the goal is just tagging it)'
585
+ }, {
586
+ name: 'no-git-tag',
587
+ type: Boolean,
588
+ description: 'do not create a new tag on git'
563
589
  }, {
564
590
  name: 'no-confirm',
565
591
  type: Boolean,
@@ -589,6 +615,7 @@ validateArgs(args);
589
615
  const config = {};
590
616
  config.noConfirm = !!args['no-confirm'];
591
617
  config.noCommit = !!args['no-commit'];
618
+ config.noGitTag = !!args['no-git-tag'];
592
619
  config.repositoryRoot = await getGitRootDirectory();
593
620
  config.branch = args.branch || (await getBranch({
594
621
  branchFilter: args['branch-filter']
@@ -601,10 +628,12 @@ config.version = args.version || (await getVersion(config));
601
628
  config.packageName = await getPackageName(config);
602
629
  config.buildMessage = config.noCommit ? '' : getBuildMessage(config);
603
630
  config.isBetaRelease = config.version.includes('-beta.');
604
- if (!config.isBetaRelease) {
631
+ if (!config.isBetaRelease && !config.noGitTag) {
605
632
  const tagSuffix = args['tag-suffix'] ?? (await getGitTagSuffix());
606
633
  const tagPrefix = config.isPackageInRepositoryRoot ? '' : `${config.packageName}/`;
607
634
  config.tagName = `${tagPrefix}v${config.version}${tagSuffix}`;
635
+ const annotationMessage = args['annotation-message'] ?? (await getGitAnnotationMessage(config));
636
+ config.annotationMessage = annotationMessage;
608
637
  }
609
638
  config.publishable = !!args.publishable;
610
639
  if (config.publishable) {
@@ -624,7 +653,7 @@ if (!config.noConfirm) {
624
653
  if (!config.noCommit) {
625
654
  await commitAndPushNewBuild(config);
626
655
  }
627
- if (!config.isBetaRelease) {
656
+ if (!config.isBetaRelease && !config.noGitTag) {
628
657
  await createAndPushGitTag(config);
629
658
  }
630
659
  if (config.publishable) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.33.0",
3
+ "version": "2.33.2-bruno.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/dockreate CHANGED
@@ -4,7 +4,7 @@ if [ -z "$1" ]; then
4
4
  exit 1
5
5
  fi
6
6
 
7
- printf "\n****LOCAL DOCKREATE****\n\n" && sleep 1
7
+ # printf "\n****LOCAL DOCKREATE****\n\n" && sleep 1
8
8
 
9
9
  # Load common bash functions
10
10
  . `build-tools --bashfun`
@@ -118,7 +118,7 @@ COPY ./.npmrc /usr/src/app/.npmrc
118
118
  RUN apk --no-cache add openssh-client && \
119
119
  apk --update add --no-cache --virtual build-dep g++ gcc libgcc \\
120
120
  libstdc++ linux-headers make ${apkadds} && \
121
- npm install -g npm@8 && \
121
+ npm install -g npm@9 && \
122
122
  npm ci --only=production --ignore-scripts --no-optional ${npmlogging} && \
123
123
  rm -f /usr/src/app/.npmrc /root/.ssh/*
124
124
 
@@ -131,7 +131,7 @@ FROM node:${nodeimg}
131
131
  # Install tini for PID 1 and replace shell with bash so we can source files
132
132
  RUN apk update && \
133
133
  apk add --no-cache bash curl tini vim ${apkadds} && \
134
- npm install -g npm@8 && \
134
+ npm install -g npm@9 && \
135
135
  rm /bin/sh && ln -s /bin/bash /bin/sh && \
136
136
  mkdir -p /usr/src/app /tmp/levlog && \
137
137
  chown node:node /usr/src/app
@@ -288,6 +288,16 @@ const getGitTagSuffix = async () => {
288
288
  return tagSuffix
289
289
  }
290
290
 
291
+ const getGitAnnotationMessage = async ( { tagName } ) => {
292
+ const { annotationMessage } = await prompt( {
293
+ type : 'input',
294
+ name : 'annotationMessage',
295
+ message : 'What annotation message would you like to add to git tag?',
296
+ initial : tagName
297
+ } )
298
+ return annotationMessage
299
+ }
300
+
291
301
  const confirmPushCommit = async ( buildMessage ) => {
292
302
  const { confirm } = await prompt( [ {
293
303
  type : 'confirm',
@@ -406,18 +416,18 @@ const commitAndPushNewBuild = async ( config ) => {
406
416
  await pushToGitRemote()
407
417
  }
408
418
 
409
- const confirmPushTag = async ( tagName ) => {
419
+ const confirmPushTag = async ( tagName, annotationMessage ) => {
410
420
  const { confirm } = await prompt( [ {
411
421
  type : 'confirm',
412
422
  name : 'confirm',
413
- message : `${colors.bold.red( '[Warning]' )} Push new tag ${colors.bold.yellow( tagName )} to git remote?`
423
+ message : `${colors.bold.red( '[Warning]' )} Push new tag ${colors.bold.yellow( tagName )} with annotation message "${colors.bold.yellow( annotationMessage )}" to git remote?`
414
424
  } ] )
415
425
  return confirm
416
426
  }
417
427
 
418
- const createGitTag = async ( tagName ) => {
428
+ const createGitTag = async ( tagName, annotationMessage ) => {
419
429
  try {
420
- await $`git tag ${tagName}`
430
+ await $`git tag -a ${tagName} -m "${annotationMessage}"`
421
431
  } catch ( err ) {
422
432
  console.log( err.stderr || err )
423
433
  process.exit( 1 )
@@ -433,10 +443,10 @@ const pushGitTag = async ( tagName ) => {
433
443
  }
434
444
  }
435
445
 
436
- const createAndPushGitTag = async ( { tagName, noConfirm } ) => {
437
- const confirmAnswer = noConfirm || await confirmPushTag( tagName )
446
+ const createAndPushGitTag = async ( { tagName, annotationMessage, noConfirm } ) => {
447
+ const confirmAnswer = noConfirm || await confirmPushTag( tagName, annotationMessage )
438
448
  if ( confirmAnswer ) {
439
- await createGitTag( tagName )
449
+ await createGitTag( tagName, annotationMessage )
440
450
  await pushGitTag( tagName )
441
451
  }
442
452
  }
@@ -474,9 +484,11 @@ const displayReleaseInfo = ( config ) => {
474
484
  packagePath,
475
485
  buildMessage,
476
486
  tagName,
487
+ annotationMessage,
477
488
  publishable,
478
489
  npmjsTag,
479
- isBetaRelease
490
+ isBetaRelease,
491
+ noGitTag,
480
492
  } = config
481
493
 
482
494
  console.log( `
@@ -487,8 +499,9 @@ ${colors.blue( 'Version:' )} ${version}
487
499
  ${colors.blue( 'Root directory:' )} ${repositoryRoot}
488
500
  ${colors.blue( 'Package name:' )} ${packageName}
489
501
  ${colors.blue( 'package.json path:' )} ${path.join( packagePath, 'package.json' )}${buildMessage ? `
490
- ${colors.blue( 'Commit message:' )} ${buildMessage}` : ''}${isBetaRelease ? '' : `
491
- ${colors.blue( 'Git tag:' )} ${tagName}`}${publishable ? `
502
+ ${colors.blue( 'Commit message:' )} ${buildMessage}` : ''}${isBetaRelease || noGitTag ? '' : `
503
+ ${colors.blue( 'Git tag:' )} ${tagName}`}${isBetaRelease || noGitTag ? '' : `
504
+ ${colors.blue( 'Git tag annotation:' )} ${annotationMessage}`}${publishable ? `
492
505
  ${colors.blue( 'Npmjs tag:' )} ${npmjsTag}` : ''}
493
506
  ${colors.bold.green( '=============================================' )}
494
507
  ` )
@@ -536,6 +549,12 @@ const optionList = [
536
549
  alias : 't',
537
550
  description : 'tag suffix to be appended to the version when pushing to git',
538
551
  },
552
+ {
553
+ name : 'annotation-message',
554
+ type : String,
555
+ alias : 'm',
556
+ description : 'annotation message that will annotate the git tag',
557
+ },
539
558
  {
540
559
  name : 'branch-filter',
541
560
  type : String,
@@ -547,6 +566,11 @@ const optionList = [
547
566
  type : Boolean,
548
567
  description : 'do not create a new commit on git (in case the goal is just tagging it)',
549
568
  },
569
+ {
570
+ name : 'no-git-tag',
571
+ type : Boolean,
572
+ description : 'do not create a new tag on git',
573
+ },
550
574
  {
551
575
  name : 'no-confirm',
552
576
  type : Boolean,
@@ -586,6 +610,8 @@ config.noConfirm = !!args['no-confirm']
586
610
 
587
611
  config.noCommit = !!args['no-commit']
588
612
 
613
+ config.noGitTag = !!args['no-git-tag']
614
+
589
615
  config.repositoryRoot = await getGitRootDirectory()
590
616
 
591
617
  config.branch = args.branch || await getBranch( { branchFilter : args['branch-filter'] } )
@@ -605,10 +631,13 @@ config.buildMessage = config.noCommit ? '' : getBuildMessage( config )
605
631
 
606
632
  config.isBetaRelease = config.version.includes( '-beta.' )
607
633
 
608
- if ( !config.isBetaRelease ) {
634
+ if ( !config.isBetaRelease && !config.noGitTag ) {
609
635
  const tagSuffix = args['tag-suffix'] ?? await getGitTagSuffix()
610
636
  const tagPrefix = config.isPackageInRepositoryRoot ? '' : `${config.packageName}/`
611
637
  config.tagName = `${tagPrefix}v${config.version}${tagSuffix}`
638
+
639
+ const annotationMessage = args['annotation-message'] ?? await getGitAnnotationMessage( config )
640
+ config.annotationMessage = annotationMessage
612
641
  }
613
642
 
614
643
  config.publishable = !!args.publishable
@@ -627,7 +656,7 @@ if ( !config.noConfirm ) {
627
656
  }
628
657
 
629
658
  if ( !config.noCommit ) { await commitAndPushNewBuild( config ) }
630
- if ( !config.isBetaRelease ) { await createAndPushGitTag( config ) }
659
+ if ( !config.isBetaRelease && !config.noGitTag ) { await createAndPushGitTag( config ) }
631
660
  if ( config.publishable ) { await publishToNpmjs( config ) }
632
661
 
633
662
  process.exit()