@salesforce/cli 2.0.1 → 2.0.2

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.
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@salesforce/cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/cli",
9
- "version": "2.0.1",
9
+ "version": "2.0.2",
10
+ "hasInstallScript": true,
10
11
  "license": "BSD-3-Clause",
11
12
  "dependencies": {
12
13
  "@oclif/core": "2.8.11",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.1",
2
+ "version": "2.0.2",
3
3
  "commands": {
4
4
  "cmdt:generate:field": {
5
5
  "id": "cmdt:generate:field",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/cli",
3
3
  "description": "The Salesforce CLI",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "sf": "./bin/run",
@@ -17,7 +17,9 @@
17
17
  "/bin",
18
18
  "/dist/**/*.js",
19
19
  "/oclif.manifest.json",
20
- "/npm-shrinkwrap.json"
20
+ "/npm-shrinkwrap.json",
21
+ "/scripts/preinstall.js",
22
+ "/scripts/post-install-release-notes.js"
21
23
  ],
22
24
  "keywords": [
23
25
  "oclif",
@@ -28,6 +30,10 @@
28
30
  "main": "dist/index.js",
29
31
  "oclif": {
30
32
  "bin": "sf",
33
+ "binAliases": [
34
+ "sfdx"
35
+ ],
36
+ "nsisCustomization": "scripts/nsis.nsi",
31
37
  "scope": "salesforce",
32
38
  "dirname": "sf",
33
39
  "topicSeparator": " ",
@@ -79,7 +85,8 @@
79
85
  ],
80
86
  "hooks": {
81
87
  "command_incomplete": "./dist/hooks/incomplete",
82
- "plugins:preinstall": "./dist/hooks/pluginsPreinstall.js"
88
+ "plugins:preinstall": "./dist/hooks/pluginsPreinstall.js",
89
+ "update": "./dist/hooks/display-release-notes.js"
83
90
  },
84
91
  "update": {
85
92
  "s3": {
@@ -93,7 +100,7 @@
93
100
  "info": {
94
101
  "releasenotes": {
95
102
  "distTagUrl": "https://registry.npmjs.org/-/package/@salesforce/cli/dist-tags",
96
- "releaseNotesPath": "https://github.com/forcedotcom/cli/tree/main/releasenotes/sf",
103
+ "releaseNotesPath": "https://github.com/forcedotcom/cli/tree/main/releasenotes",
97
104
  "releaseNotesFilename": "README.md"
98
105
  }
99
106
  },
@@ -199,6 +206,8 @@
199
206
  "pack:verify": "sf-release cli:tarballs:verify --cli sf --windows-username-buffer 34",
200
207
  "pack:win": "oclif pack:win",
201
208
  "postpack": "rm -f oclif.manifest.json npm-shrinkwrap.json",
209
+ "preinstall": "node ./scripts/preinstall.js",
210
+ "postinstall": "node ./scripts/post-install-release-notes.js",
202
211
  "prepack": "sf-prepack",
203
212
  "prepare": "sf-install && yarn compile && yarn lint",
204
213
  "prepublishOnly": "npm shrinkwrap",
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require('child_process');
4
+ const { join } = require('path');
5
+
6
+ if (process.env.SF_HIDE_RELEASE_NOTES === 'true') process.exit(0);
7
+
8
+ const logAndExit = (msg) => {
9
+ console.log('NOTE: This error can be ignored in CI and may be silenced in the future');
10
+ console.log('- Set the SF_HIDE_RELEASE_NOTES env var to "true" to skip this script\n');
11
+ console.log(msg.toString());
12
+
13
+ process.exit(0);
14
+ };
15
+
16
+ /*
17
+ * NOTE: Please read "Notes about the hook scripts" in this PR before making changes:
18
+ * https://github.com/salesforcecli/sfdx-cli/pull/407
19
+ */
20
+
21
+ var executable = process.platform === 'win32' ? 'run.cmd' : 'run';
22
+
23
+ var cmd = spawn(join(__dirname, '..', 'bin', executable), ['whatsnew', '--hook'], {
24
+ stdio: ['ignore', 'inherit', 'pipe'],
25
+ timeout: 10000,
26
+ });
27
+
28
+ cmd.stderr.on('data', (error) => {
29
+ logAndExit(error);
30
+ });
31
+
32
+ cmd.on('error', (error) => {
33
+ logAndExit(error);
34
+ });
35
+
36
+ // 'exit' fires whether or not the stream are finished
37
+ cmd.on('exit', (code) => {
38
+ process.exit(0);
39
+ });
@@ -0,0 +1,16 @@
1
+ const { execSync } = require('child_process');
2
+
3
+ (() => {
4
+ const testCliNotVersion = (cli, version) => {
5
+ try {
6
+ return execSync(`${cli} --version`).toString('utf-8').includes(version);
7
+ } catch (e) {
8
+ // if cli isn't installed it'll throw, but that's ok for us
9
+ return false;
10
+ }
11
+ };
12
+ // test sfdx is installed
13
+ if (testCliNotVersion('sfdx', 'sfdx-cli/7.')) {
14
+ throw Error('"sf@2.x" has a bin alias for "sfdx", please uninstall sfdx-cli first. See https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_move_to_sf_v2.htm for more information');
15
+ }
16
+ })();