@uirouter/publish-scripts 2.6.7 → 2.6.8

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 2.6.8 (2026-01-02)
2
+ [Compare `@uirouter/publish-scripts` versions 2.6.7 and 2.6.8](https://github.com/ui-router/publish-scripts/compare/2.6.7...2.6.8)
3
+
4
+ ### Features
5
+
6
+ * add npm 2FA support and manual publish option ([ef720ff](https://github.com/ui-router/publish-scripts/commit/ef720ff))
7
+
8
+
9
+
10
+
1
11
  ## 2.6.7 (2026-01-02)
2
12
  [Compare `@uirouter/publish-scripts` versions 2.6.6 and 2.6.7](https://github.com/ui-router/publish-scripts/compare/2.6.6...2.6.7)
3
13
 
@@ -8,6 +8,7 @@ const readlineSync = require('readline-sync');
8
8
  const fs = require('fs');
9
9
  const path = require('path');
10
10
  let _exec = util._exec;
11
+ let _execInteractive = util._execInteractive;
11
12
 
12
13
  const CONFIG = JSON.parse(fs.readFileSync('./artifacts.json'));
13
14
  const COMMIT_ARTIFACTS = CONFIG.ARTIFACTS;
@@ -89,8 +90,9 @@ if (npm) {
89
90
  if (!latest) {
90
91
  throw new Error(`Could not determine value of "latest" dist-tag for ${pkg.name}`);
91
92
  }
92
-
93
- _exec(`npm publish`);
93
+
94
+ console.log('\nPublishing to npm (you may be prompted for 2FA)...\n');
95
+ _execInteractive(`npm publish`);
94
96
  _exec(`npm dist-tag add ${pkg.name}@${latest[1]} latest`);
95
97
  }
96
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uirouter/publish-scripts",
3
- "version": "2.6.7",
3
+ "version": "2.6.8",
4
4
  "description": "Helper scripts for publishing UI-Router projects",
5
5
  "main": "x",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "util": "./util.js"
30
30
  },
31
31
  "dependencies": {
32
- "check-peer-dependencies": "^4.3.3",
32
+ "check-peer-dependencies": "^4.3.4",
33
33
  "conventional-changelog": "^3.1.24",
34
34
  "conventional-changelog-ui-router-core": "^1.4.2",
35
35
  "find-parent-dir": "^0.3.1",
package/release.js CHANGED
@@ -21,10 +21,17 @@ const yargs = require('yargs')
21
21
  .option('deps', {
22
22
  description: 'Deps to include in changelog',
23
23
  array: true,
24
+ })
25
+ .option('manual-publish', {
26
+ alias: ['m'],
27
+ description: 'Skip npm publish and print instructions for manual publishing',
28
+ boolean: true,
29
+ default: false,
24
30
  });
25
31
 
26
32
  const util = require('./util');
27
33
  const _exec = util._exec;
34
+ const _execInteractive = util._execInteractive;
28
35
 
29
36
  if (yargs.argv.dryrun) {
30
37
  console.log('Dry run mode...')
@@ -110,18 +117,38 @@ if (!yargs.argv.dryrun) {
110
117
  }
111
118
 
112
119
 
113
- // Publish to NPM and push to github
120
+ // Build, tag, push to github, and publish to NPM
114
121
  if (!yargs.argv.dryrun) {
115
122
  const distDir = packageJson.distDir || '.';
123
+ const publishDir = path.resolve(distDir);
124
+
125
+ // Build if needed
116
126
  if (distDir !== '.' && packageJson.scripts && packageJson.scripts.build) {
117
127
  _exec('npm run build')
118
128
  }
119
- shelljs.pushd(distDir);
120
- _exec(`npm publish`);
121
- shelljs.popd();
129
+
130
+ // Git tag and push first (before npm publish, so if npm publish fails, you can retry)
122
131
  _exec(`git tag ${version}`);
123
132
  _exec(`git push origin master`);
124
133
  _exec(`git push origin ${version}`);
134
+
135
+ // Publish to NPM
136
+ if (yargs.argv['manual-publish']) {
137
+ console.log('\n\n=======================================================');
138
+ console.log('MANUAL NPM PUBLISH REQUIRED');
139
+ console.log('=======================================================');
140
+ console.log('\nGit tag and push completed successfully.');
141
+ console.log('\nTo publish to npm, run the following commands:\n');
142
+ console.log(` cd ${publishDir}`);
143
+ console.log(` npm publish`);
144
+ console.log('\nAfter publishing, you can continue with the release process below.');
145
+ console.log('=======================================================\n');
146
+ } else {
147
+ console.log('\nPublishing to npm (you may be prompted for 2FA)...\n');
148
+ shelljs.pushd(distDir);
149
+ _execInteractive(`npm publish`);
150
+ shelljs.popd();
151
+ }
125
152
  }
126
153
 
127
154
 
package/util.js CHANGED
@@ -30,6 +30,21 @@ function _exec(command, silent) {
30
30
  exit(result.code)
31
31
  }
32
32
 
33
+ function _execInteractive(command) {
34
+ echo(command);
35
+ echo();
36
+ const { spawnSync } = require('child_process');
37
+ const result = spawnSync(command, {
38
+ stdio: 'inherit',
39
+ shell: true,
40
+ cwd: process.cwd()
41
+ });
42
+ if (result.status === 0) return result;
43
+ echo(`cwd: ${process.cwd()}`);
44
+ echo(`Aborting; non-zero return value (${result.status}) from: ${command}`);
45
+ exit(result.status)
46
+ }
47
+
33
48
  function asJson (obj) { return JSON.stringify(obj, null, 2); }
34
49
 
35
50
  let ensure = (type) => (path) => {
@@ -43,6 +58,7 @@ let assertFile = ensure('File');
43
58
  module.exports = {
44
59
  ensureCleanMaster: ensureCleanMaster,
45
60
  _exec: _exec,
61
+ _execInteractive: _execInteractive,
46
62
  asJson: asJson,
47
63
  assertDir: assertDir,
48
64
  assertFile: assertFile,