apify-cli 0.14.2-beta.0 → 0.14.2-beta.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.
@@ -23,10 +23,10 @@
23
23
  "ajv": "^8.10.0",
24
24
  "apify-client": "^2.2.0",
25
25
  "archiver-promise": "^1.0.0",
26
+ "axios": "^0.21.1",
26
27
  "chalk": "^4.1.2",
27
28
  "computer-name": "^0.1.0",
28
29
  "cors": "^2.8.5",
29
- "cross-spawn": "^7.0.3",
30
30
  "detect-indent": "^6.1.0",
31
31
  "express": "^4.18.2",
32
32
  "globby": "^11.1.0",
@@ -2153,6 +2153,7 @@
2153
2153
  "version": "7.0.3",
2154
2154
  "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
2155
2155
  "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
2156
+ "dev": true,
2156
2157
  "dependencies": {
2157
2158
  "path-key": "^3.1.0",
2158
2159
  "shebang-command": "^2.0.0",
@@ -6176,6 +6177,7 @@
6176
6177
  "version": "3.1.1",
6177
6178
  "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
6178
6179
  "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
6180
+ "dev": true,
6179
6181
  "engines": {
6180
6182
  "node": ">=8"
6181
6183
  }
@@ -7037,6 +7039,7 @@
7037
7039
  "version": "2.0.0",
7038
7040
  "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
7039
7041
  "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
7042
+ "dev": true,
7040
7043
  "dependencies": {
7041
7044
  "shebang-regex": "^3.0.0"
7042
7045
  },
@@ -7048,6 +7051,7 @@
7048
7051
  "version": "3.0.0",
7049
7052
  "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
7050
7053
  "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
7054
+ "dev": true,
7051
7055
  "engines": {
7052
7056
  "node": ">=8"
7053
7057
  }
@@ -7775,6 +7779,7 @@
7775
7779
  "version": "2.0.2",
7776
7780
  "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
7777
7781
  "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
7782
+ "dev": true,
7778
7783
  "dependencies": {
7779
7784
  "isexe": "^2.0.0"
7780
7785
  },
@@ -9644,6 +9649,7 @@
9644
9649
  "version": "7.0.3",
9645
9650
  "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
9646
9651
  "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
9652
+ "dev": true,
9647
9653
  "requires": {
9648
9654
  "path-key": "^3.1.0",
9649
9655
  "shebang-command": "^2.0.0",
@@ -12602,7 +12608,8 @@
12602
12608
  "path-key": {
12603
12609
  "version": "3.1.1",
12604
12610
  "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
12605
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
12611
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
12612
+ "dev": true
12606
12613
  },
12607
12614
  "path-parse": {
12608
12615
  "version": "1.0.7",
@@ -13249,6 +13256,7 @@
13249
13256
  "version": "2.0.0",
13250
13257
  "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
13251
13258
  "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
13259
+ "dev": true,
13252
13260
  "requires": {
13253
13261
  "shebang-regex": "^3.0.0"
13254
13262
  }
@@ -13256,7 +13264,8 @@
13256
13264
  "shebang-regex": {
13257
13265
  "version": "3.0.0",
13258
13266
  "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
13259
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
13267
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
13268
+ "dev": true
13260
13269
  },
13261
13270
  "side-channel": {
13262
13271
  "version": "1.0.4",
@@ -13823,6 +13832,7 @@
13823
13832
  "version": "2.0.2",
13824
13833
  "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
13825
13834
  "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
13835
+ "dev": true,
13826
13836
  "requires": {
13827
13837
  "isexe": "^2.0.0"
13828
13838
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify-cli",
3
- "version": "0.14.2-beta.0",
3
+ "version": "0.14.2-beta.1",
4
4
  "description": "Apify command-line interface helps you create, develop, build and run Apify actors, and manage the Apify cloud platform.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -65,10 +65,10 @@
65
65
  "ajv": "^8.10.0",
66
66
  "apify-client": "^2.2.0",
67
67
  "archiver-promise": "^1.0.0",
68
+ "axios": "^0.21.1",
68
69
  "chalk": "^4.1.2",
69
70
  "computer-name": "^0.1.0",
70
71
  "cors": "^2.8.5",
71
- "cross-spawn": "^7.0.3",
72
72
  "detect-indent": "^6.1.0",
73
73
  "express": "^4.18.2",
74
74
  "globby": "^11.1.0",
@@ -100,7 +100,7 @@ class CreateCommand extends ApifyCommand {
100
100
  }
101
101
  await execWithLog(
102
102
  pythonCommand,
103
- ['-m', 'pip', 'install', '--no-cache-dir', '--no-warn-script-location', '--upgrade', 'pip'],
103
+ ['-m', 'pip', 'install', '--no-cache-dir', '--no-warn-script-location', '--upgrade', 'pip', 'setuptools', 'wheel'],
104
104
  { cwd: actFolderDir },
105
105
  );
106
106
  await execWithLog(
@@ -1,5 +1,5 @@
1
+ const axios = require('axios');
1
2
  const chalk = require('chalk');
2
- const { spawn } = require('cross-spawn');
3
3
  const semver = require('semver');
4
4
  const {
5
5
  CHECK_VERSION_EVERY_MILLIS,
@@ -13,16 +13,28 @@ const {
13
13
  extendLocalState,
14
14
  } = require('./local_state');
15
15
 
16
- const getLatestNpmVersion = () => spawn.sync('npm', ['view', 'apify-cli', 'version']).stdout.toString().trim();
16
+ const getLatestNpmVersion = async () => {
17
+ const response = await axios({
18
+ url: 'https://registry.npmjs.org/apify-cli/',
19
+ headers: {
20
+ // This is necessary so that NPM returns the abbreviated version of the metadata
21
+ // See https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
22
+ accept: 'application/vnd.npm.install-v1+json',
23
+ },
24
+ });
25
+ const packageMetadata = response.data;
26
+ const latestVersion = packageMetadata['dist-tags'].latest;
27
+ return latestVersion;
28
+ };
17
29
 
18
30
  /**
19
31
  * Fetches the latest NPM version of Apify CLI and caches it locally.
20
32
  */
21
- const getAndCacheLatestNpmVersion = () => {
33
+ const getAndCacheLatestNpmVersion = async () => {
22
34
  try {
23
35
  info('Making sure that Apify CLI is up to date...');
24
36
 
25
- const latestNpmVersion = getLatestNpmVersion();
37
+ const latestNpmVersion = await getLatestNpmVersion();
26
38
 
27
39
  extendLocalState({
28
40
  latestNpmVersion,
@@ -54,7 +66,7 @@ const checkLatestVersion = async (enforeUpdate = false) => {
54
66
  // If check is outdated and we are online then update the current NPM version.
55
67
  const shouldGetCurrentVersion = enforeUpdate || (isCheckOutdated && await isOnline.default({ timeout: 500 }));
56
68
  const latestNpmVersion = shouldGetCurrentVersion
57
- ? getAndCacheLatestNpmVersion()
69
+ ? await getAndCacheLatestNpmVersion()
58
70
  : cachedLatestNpmVersion;
59
71
 
60
72
  const currentNpmVersion = require('../../package.json').version; // eslint-disable-line