Skip to content

Commit 8d44b4f

Browse files
committed
Merge branch 'master' into feat/sign-tarball-kv-record-url
2 parents 02c8db6 + ecd4eb5 commit 8d44b4f

35 files changed

+822
-821
lines changed

.bun-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.19
1+
1.2.20

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file.
2525
### Chore
2626

2727
- [**breaking**] Move from yargs to node:util ([#871](https://github.com/apify/apify-cli/pull/871)) ([482d0b2](https://github.com/apify/apify-cli/commit/482d0b29f285c020320f1f2e3f0fd08a362d57cc)) by [@vladfrangu](https://github.com/vladfrangu), closes [#833](https://github.com/apify/apify-cli/issues/833)
28+
- [**breaking**] Make opening the actor build results in push opt-in ([#881](https://github.com/apify/apify-cli/pull/881)) ([d842424](https://github.com/apify/apify-cli/commit/d84242421387a9487eef5c07183dd0b8ac7ae67b)) by [@vladfrangu](https://github.com/vladfrangu)
2829

2930
<!-- git-cliff-unreleased-end -->
3031

features/test-implementations/1.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Given<TestWorld>(/the local actor is pushed to the Apify platform/i, { timeout:
234234
}
235235

236236
const result = await executeCommand({
237-
rawCommand: 'apify push --no-prompt',
237+
rawCommand: 'apify push',
238238
cwd: this.testActor.pwd,
239239
env: extraEnv,
240240
});

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
},
6161
"homepage": "https://github.com/apify/apify-cli#readme",
6262
"engines": {
63-
"node": ">=18"
63+
"node": ">=20"
6464
},
6565
"dependencies": {
6666
"@apify/actor-templates": "^0.1.5",
@@ -100,9 +100,7 @@
100100
"js-levenshtein": "^1.1.6",
101101
"lodash.clonedeep": "^4.5.0",
102102
"mime": "~4.0.4",
103-
"mixpanel": "~0.18.0",
104103
"open": "~10.2.0",
105-
"ow": "~2.0.0",
106104
"rimraf": "~6.0.1",
107105
"semver": "~7.7.0",
108106
"string-width": "^7.2.0",

scripts/generate-cli-docs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ const categories: Record<string, CommandsInCategory[]> = {
6767
//
6868
{ command: Commands.help },
6969
{ command: Commands.upgrade },
70+
{ command: Commands.telemetry },
71+
{ command: Commands.telemetryEnable },
72+
{ command: Commands.telemetryDisable },
7073
],
7174
'dataset': [
7275
//

src/commands/_register.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { RunCommand } from './run.js';
2828
import { RunsIndexCommand } from './runs/_index.js';
2929
import { SecretsIndexCommand } from './secrets/_index.js';
3030
import { TasksIndexCommand } from './task/_index.js';
31+
import { TelemetryIndexCommand } from './telemetry/_index.js';
3132
import { ValidateInputSchemaCommand } from './validate-schema.js';
3233

3334
export const apifyCommands = [
@@ -41,6 +42,8 @@ export const apifyCommands = [
4142
RunsIndexCommand,
4243
SecretsIndexCommand,
4344
TasksIndexCommand,
45+
TelemetryIndexCommand,
46+
4447
// top-level
4548
TopLevelCallCommand,
4649
UpgradeCommand,
@@ -70,8 +73,12 @@ export const actorCommands = [
7073
ActorGetPublicUrlCommand,
7174
ActorGetInputCommand,
7275
ActorChargeCommand,
76+
7377
// top-level
7478
HelpCommand,
7579
UpgradeCommand,
7680
InstallCommand,
81+
82+
// namespaces
83+
TelemetryIndexCommand,
7784
] as const satisfies (typeof BuiltApifyCommand)[];

src/commands/actors/push.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { join, resolve } from 'node:path';
33
import process from 'node:process';
44

55
import type { Actor, ActorCollectionCreateOptions, ActorDefaultRunOptions } from 'apify-client';
6-
import isCI from 'is-ci';
76
import open from 'open';
87

98
import { fetchManifest } from '@apify/actor-templates';
@@ -16,7 +15,6 @@ import { Flags } from '../../lib/command-framework/flags.js';
1615
import { CommandExitCodes, DEPRECATED_LOCAL_CONFIG_NAME, LOCAL_CONFIG_PATH } from '../../lib/consts.js';
1716
import { sumFilesSizeInBytes } from '../../lib/files.js';
1817
import { useActorConfig } from '../../lib/hooks/useActorConfig.js';
19-
import { useYesNoConfirm } from '../../lib/hooks/user-confirmations/useYesNoConfirm.js';
2018
import { error, info, link, run, success, warning } from '../../lib/outputs.js';
2119
import { transformEnvToEnvVars } from '../../lib/secrets.js';
2220
import {
@@ -67,9 +65,8 @@ export class ActorsPushCommand extends ApifyCommand<typeof ActorsPushCommand> {
6765
description: 'Seconds for waiting to build to finish, if no value passed, it waits forever.',
6866
required: false,
6967
}),
70-
'no-prompt': Flags.boolean({
71-
description:
72-
'Do not prompt for opening the Actor details in a browser. This will also not open the browser automatically.',
68+
'open': Flags.boolean({
69+
description: 'Whether to open the browser automatically to the Actor details page.',
7370
default: false,
7471
required: false,
7572
}),
@@ -329,15 +326,13 @@ Skipping push. Use --force to override.`,
329326
url: `https://console.apify.com${redirectUrlPart}/actors/${build.actId}#/builds/${build.buildNumber}`,
330327
});
331328

332-
// Disable open browser on CI, or if user passed --no-prompt flag
333-
if (!isCI && !this.flags.noPrompt) {
334-
const shouldOpenBrowser = await useYesNoConfirm({
335-
message: 'Do you want to open the Actor detail in your browser?',
336-
});
329+
link({
330+
message: 'Actor detail',
331+
url: `https://console.apify.com${redirectUrlPart}/actors/${build.actId}`,
332+
});
337333

338-
if (shouldOpenBrowser) {
339-
await open(`https://console.apify.com${redirectUrlPart}/actors/${build.actId}`);
340-
}
334+
if (this.flags.open) {
335+
await open(`https://console.apify.com${redirectUrlPart}/actors/${build.actId}`);
341336
}
342337

343338
if (build.status === ACTOR_JOB_STATUSES.SUCCEEDED) {

src/commands/cli-management/install.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ export class InstallCommand extends ApifyCommand<typeof InstallCommand> {
9292

9393
const symlinkPath = join(localBinDirectory, file);
9494

95-
await unlink(symlinkPath);
95+
await unlink(symlinkPath).catch(() => {
96+
// Ignore errors
97+
});
98+
9699
await symlink(originalPath, symlinkPath);
97100

98101
cliDebugPrint('[install] symlink created for item', file, symlinkPath);

src/commands/init.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import process from 'node:process';
44
import { ApifyCommand } from '../lib/command-framework/apify-command.js';
55
import { Args } from '../lib/command-framework/args.js';
66
import { Flags } from '../lib/command-framework/flags.js';
7-
import {
8-
CommandExitCodes,
9-
DEFAULT_LOCAL_STORAGE_DIR,
10-
EMPTY_LOCAL_CONFIG,
11-
LOCAL_CONFIG_PATH,
12-
PROJECT_TYPES,
13-
} from '../lib/consts.js';
7+
import { CommandExitCodes, DEFAULT_LOCAL_STORAGE_DIR, EMPTY_LOCAL_CONFIG, LOCAL_CONFIG_PATH } from '../lib/consts.js';
148
import { useActorConfig } from '../lib/hooks/useActorConfig.js';
159
import { ProjectLanguage, useCwdProject } from '../lib/hooks/useCwdProject.js';
1610
import { useUserInput } from '../lib/hooks/user-confirmations/useUserInput.js';
@@ -61,7 +55,7 @@ export class InitCommand extends ApifyCommand<typeof InitCommand> {
6155

6256
if (project.type === ProjectLanguage.Scrapy) {
6357
info({ message: 'The current directory looks like a Scrapy project. Using automatic project wrapping.' });
64-
this.telemetryData.actorWrapper = PROJECT_TYPES.SCRAPY;
58+
this.telemetryData.actorWrapper = 'scrapy';
6559

6660
return wrapScrapyProject({ projectPath: cwd });
6761
}

src/commands/login.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import { cryptoRandomObjectId } from '@apify/utilities';
1212
import { ApifyCommand } from '../lib/command-framework/apify-command.js';
1313
import { Flags } from '../lib/command-framework/flags.js';
1414
import { AUTH_FILE_PATH } from '../lib/consts.js';
15+
import { updateUserId } from '../lib/hooks/telemetry/useTelemetryState.js';
1516
import { useMaskedInput } from '../lib/hooks/user-confirmations/useMaskedInput.js';
1617
import { useSelectFromList } from '../lib/hooks/user-confirmations/useSelectFromList.js';
1718
import { error, info, success } from '../lib/outputs.js';
18-
import { useApifyIdentity } from '../lib/telemetry.js';
1919
import { getLocalUserInfo, getLoggedClient } from '../lib/utils.js';
2020

2121
const CONSOLE_BASE_URL = 'https://console.apify.com/settings/integrations';
@@ -30,8 +30,10 @@ const API_VERSION = 'v1';
3030
const tryToLogin = async (token: string) => {
3131
const isUserLogged = await getLoggedClient(token, API_BASE_URL);
3232
const userInfo = await getLocalUserInfo();
33+
3334
if (isUserLogged) {
34-
await useApifyIdentity(userInfo.id!);
35+
await updateUserId(userInfo.id!);
36+
3537
success({
3638
message: `You are logged in to Apify as ${userInfo.username || userInfo.id}. ${chalk.gray(`Your token is stored at ${AUTH_FILE_PATH()}.`)}`,
3739
});
@@ -67,6 +69,7 @@ export class LoginCommand extends ApifyCommand<typeof LoginCommand> {
6769

6870
async run() {
6971
const { token, method } = this.flags;
72+
7073
if (token) {
7174
await tryToLogin(token);
7275
return;

0 commit comments

Comments
 (0)