Skip to content

Commit 87c3ad7

Browse files
authored
Merge branch 'master' into 1036-apify-validate-schema-should-validate-all-schemas-in-actorjson-not-just-input_schema
2 parents 3ce25a1 + ef4d375 commit 87c3ad7

32 files changed

Lines changed: 3491 additions & 565 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _mytests
1212
.idea
1313
.zed
1414
docs/changelog.md
15-
.generated
15+
__generated__
1616

1717
# Yarn files
1818
.yarn/install-state.gz

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
<!-- git-cliff-unreleased-start -->
6+
7+
## 1.5.1 - **not yet released**
8+
9+
### 🚀 Features
10+
11+
- **generate-schema-types:** Change default output path to src&#x2F;**generated**&#x2F;actor&#x2F; ([#1104](https://github.com/apify/apify-cli/pull/1104)) ([9b44152](https://github.com/apify/apify-cli/commit/9b441522eae7c23ff0744e1a903b87664c66f36e)) by [@vladfrangu](https://github.com/vladfrangu)
12+
13+
<!-- git-cliff-unreleased-end -->
14+
515
## [1.5.0](https://github.com/apify/apify-cli/releases/tag/v1.5.0) (2026-04-27)
616

717
### 🚀 Features

docs/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ FLAGS
492492
--all-optional Mark all properties as optional in
493493
generated types.
494494
-o, --output=<value> Directory where the generated files
495-
should be outputted. Defaults to src/.generated/actor/ to
495+
should be outputted. Defaults to src/__generated__/actor/ to
496496
stay within the typical tsconfig rootDir.
497497
--strict Whether generated interfaces should be
498498
strict (no index signature [key: string]: unknown).

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ export default [
5555
// Not ideal, but we still use any for simplicity
5656
'@typescript-eslint/no-explicit-any': 'off',
5757

58+
// Allow underscore-prefixed variables (including `using _name = ...`
59+
// bindings kept alive solely for their Symbol.dispose effect) in
60+
// addition to the base config's underscore-prefixed args exemption.
61+
'@typescript-eslint/no-unused-vars': [
62+
'error',
63+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true },
64+
],
65+
5866
// '@typescript-eslint/array-type': 'error',
5967
// '@typescript-eslint/no-empty-object-type': 'off',
6068
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apify-cli",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Apify command-line interface (CLI) helps you manage the Apify cloud platform and develop, build, and deploy Apify Actors.",
55
"exports": "./dist/index.js",
66
"type": "module",
@@ -18,7 +18,7 @@
1818
"format": "biome format . && prettier --check \"**/*.{md,yml,yaml}\"",
1919
"format:fix": "biome format --write . && prettier --write \"**/*.{md,yml,yaml}\"",
2020
"clean": "rimraf dist",
21-
"build": "yarn clean && tsc && tsup",
21+
"build": "yarn clean && tsc && tsdown",
2222
"build-bundles": "bun run scripts/build-cli-bundles.ts",
2323
"prepack": "yarn insert-cli-metadata && yarn build && yarn update-docs",
2424
"insert-cli-metadata": "tsx scripts/insert-cli-metadata.ts",
@@ -143,7 +143,7 @@
143143
"lint-staged": "^16.0.0",
144144
"mock-stdin": "^1.0.0",
145145
"prettier": "^3.5.3",
146-
"tsup": "^8.5.0",
146+
"tsdown": "^0.21.9",
147147
"tsx": "^4.16.5",
148148
"typescript": "^6.0.0",
149149
"typescript-eslint": "^8.31.0",

src/commands/actor/generate-schema-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ Optionally specify custom schema path to use.`;
7979
output: Flags.string({
8080
char: 'o',
8181
description:
82-
'Directory where the generated files should be outputted. Defaults to src/.generated/actor/ to stay within the typical tsconfig rootDir.',
82+
'Directory where the generated files should be outputted. Defaults to src/__generated__/actor/ to stay within the typical tsconfig rootDir.',
8383
required: false,
84-
default: path.join('src', '.generated', 'actor'),
84+
default: path.join('src', '__generated__', 'actor'),
8585
}),
8686
strict: Flags.boolean({
8787
description: 'Whether generated interfaces should be strict (no index signature [key: string]: unknown).',

src/commands/actors/push.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Args } from '../../lib/command-framework/args.js';
1414
import { Flags } from '../../lib/command-framework/flags.js';
1515
import { CommandExitCodes, DEPRECATED_LOCAL_CONFIG_NAME, LOCAL_CONFIG_PATH } from '../../lib/consts.js';
1616
import { sumFilesSizeInBytes } from '../../lib/files.js';
17+
import { useAbortJobOnSignal } from '../../lib/hooks/useAbortJobOnSignal.js';
1718
import { useActorConfig } from '../../lib/hooks/useActorConfig.js';
1819
import { error, info, link, run, success, warning } from '../../lib/outputs.js';
1920
import { transformEnvToEnvVars } from '../../lib/secrets.js';
@@ -362,6 +363,17 @@ Skipping push. Use --force to override.`,
362363
});
363364

364365
try {
366+
// While the log is streaming, forward interrupt signals to a
367+
// platform-side abort so the build doesn't keep running after the
368+
// user gives up waiting (Ctrl+C, SIGTERM from a parent process,
369+
// SIGHUP from a closing terminal). The `using` binding guarantees
370+
// the listener is removed before we poll for final status.
371+
using _signalHandler = useAbortJobOnSignal({
372+
apifyClient,
373+
kind: 'build',
374+
jobId: build.id,
375+
});
376+
365377
await outputJobLog({ job: build, timeoutMillis: waitForFinishMillis, apifyClient });
366378
} catch (err) {
367379
warning({ message: 'Can not get log:' });

src/commands/builds/create.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ApifyCommand } from '../../lib/command-framework/apify-command.js';
44
import { Args } from '../../lib/command-framework/args.js';
55
import { Flags } from '../../lib/command-framework/flags.js';
66
import { resolveActorContext } from '../../lib/commands/resolve-actor-context.js';
7+
import { useAbortJobOnSignal } from '../../lib/hooks/useAbortJobOnSignal.js';
78
import { error, simpleLog } from '../../lib/outputs.js';
89
import {
910
getLoggedClientOrThrow,
@@ -158,6 +159,17 @@ export class BuildsCreateCommand extends ApifyCommand<typeof BuildsCreateCommand
158159
});
159160

160161
if (log) {
162+
// While the log is streaming, forward interrupt signals to a
163+
// platform-side abort so the build doesn't keep running after the
164+
// user gives up waiting (Ctrl+C, SIGTERM from a parent process,
165+
// SIGHUP from a closing terminal). The `using` binding guarantees
166+
// the listener is removed when the block exits.
167+
using _signalHandler = useAbortJobOnSignal({
168+
apifyClient: client,
169+
kind: 'build',
170+
jobId: build.id,
171+
});
172+
161173
try {
162174
await outputJobLog({ job: build, apifyClient: client });
163175
} catch (err) {

src/commands/run.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { getInputOverride } from '../lib/commands/resolve-input.js';
1616
import {
1717
CommandExitCodes,
1818
DEFAULT_LOCAL_STORAGE_DIR,
19+
INTERRUPT_SIGNALS,
1920
LEGACY_LOCAL_STORAGE_DIR,
2021
MINIMUM_SUPPORTED_PYTHON_VERSION,
2122
SUPPORTED_NODEJS_VERSION,
@@ -338,6 +339,7 @@ export class RunCommand extends ApifyCommand<typeof RunCommand> {
338339
cmd: runtime.executablePath,
339340
args: [entrypoint],
340341
opts: { env, cwd },
342+
forwardSignals: INTERRUPT_SIGNALS,
341343
});
342344
} else {
343345
// Assert the package.json content for scripts
@@ -369,6 +371,7 @@ export class RunCommand extends ApifyCommand<typeof RunCommand> {
369371
args: ['run', entrypoint],
370372
opts: { env, cwd },
371373
overrideCommand: runtime.pmName,
374+
forwardSignals: INTERRUPT_SIGNALS,
372375
});
373376
}
374377

@@ -392,12 +395,14 @@ export class RunCommand extends ApifyCommand<typeof RunCommand> {
392395
cmd: runtime.executablePath,
393396
args: ['-m', entrypoint],
394397
opts: { env, cwd },
398+
forwardSignals: INTERRUPT_SIGNALS,
395399
});
396400
} else {
397401
await execWithLog({
398402
cmd: runtime.executablePath,
399403
args: [entrypoint],
400404
opts: { env, cwd },
405+
forwardSignals: INTERRUPT_SIGNALS,
401406
});
402407
}
403408

src/lib/commands/run-on-cloud.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ACTOR_JOB_STATUSES } from '@apify/consts';
77

88
import { Flags } from '../command-framework/flags.js';
99
import { CommandExitCodes } from '../consts.js';
10+
import { useAbortJobOnSignal } from '../hooks/useAbortJobOnSignal.js';
1011
import { error, run as runLog, success, warning } from '../outputs.js';
1112
import { outputJobLog } from '../utils.js';
1213
import { resolveInput } from './resolve-input.js';
@@ -90,6 +91,20 @@ export async function* runActorOrTaskOnCloud(apifyClient: ApifyClient, options:
9091
throw err;
9192
}
9293

94+
// From this point on the run exists on the platform. Forward interrupt
95+
// signals to a platform-side abort so the run does not keep burning
96+
// compute units after the user gives up waiting locally (Ctrl+C, SIGTERM
97+
// from a parent process, SIGHUP from a closing terminal). The `using`
98+
// binding removes the listener when this generator finishes or is
99+
// terminated by the consumer (e.g. `break` out of `for await`).
100+
using _signalHandler = useAbortJobOnSignal({
101+
apifyClient,
102+
kind: 'run',
103+
jobId: run.id,
104+
runType: type,
105+
silent,
106+
});
107+
93108
// Return the started run right away
94109
yield run;
95110

0 commit comments

Comments
 (0)