Skip to content

Commit 2bb7995

Browse files
committed
Merge branch 'master' into feat/handle-sub-schema-validation
# Conflicts: # yarn.lock
2 parents 9976113 + fe856ac commit 2bb7995

File tree

10 files changed

+1744
-1145
lines changed

10 files changed

+1744
-1145
lines changed

features/builds-namespace.feature.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@
5454

5555
- Given the local Actor is pushed to the Apify platform
5656
- When I run:
57+
5758
```
5859
$ apify builds create --json
5960
```
61+
6062
- Then I can read valid JSON on stdout
6163

6264
## Rule: Printing information about builds works

features/test-implementations/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,28 @@ Currently, the following phrases are implemented:
4545
- `given the actor implementation doesn't throw itself`
4646
- `given the following input provided via standard input`
4747
- Example:
48+
4849
```
4950
Given the following input provided via standard input
5051
"""
5152
{"foo":"bar"}
5253
"""
5354
```
55+
5456
- This step supports providing input to the CLI via stdin. This is useful for testing CLI commands that can optionally accept standard input.
57+
5558
- `given the following input provided via file \`<filename>\``
5659
- Example:
60+
5761
```
5862
Given the following input provided via file `input.json`
5963
"""
6064
{"foo":"bar"}
6165
"""
6266
```
67+
6368
- This step supports providing input to the CLI via a file.
69+
6470
- `given a logged in apify console user`
6571
- This step ensures the test is ran assuming a logged in user on the Apify console.
6672
- `given the local actor is pushed to the apify platform`
@@ -76,22 +82,28 @@ Currently, the following phrases are implemented:
7682

7783
- `when I run:` followed by a code block consisting of a CLI command (optionally prefixed with `$`)
7884
- Example:
85+
7986
```
8087
When I run:
8188
`​`​`
8289
$ apify actor run --input='{"foo":"bar"}'
8390
`​`​`
8491
```
92+
8593
- This step supports running only CLI commands. It also expects only **one** command to be ran. Any more than one command will result in an error (this is done for simplicity sake)
8694
- When referring to the CLI, you should mention the `apify` binary (as if you'd write this in a terminal). For testing sake, when we actually run the command, it will instead call the `tsx ./bin/dev.js` script, meaning changes that you do to the CLI will be reflected in the tests without needing a rebuild.
95+
8796
- `when i capture the <type> id`
8897
- Example:
98+
8999
```
90100
When I capture the build ID
91101
```
102+
92103
- This step captures the ID of the specified type and stores it in the world. This is useful for checking the output of the CLI, as some variables may be needed to check the output of the actor run.
93104
- Currently, the following types are implemented:
94105
- `build`: captures the ID of the build that was created
106+
95107
- `when i run with captured data`
96108
- Identical to `when I run`, with the only difference being that you can use it in conjunction with `when i capture the <type> id` to run the CLI with the captured data.
97109

@@ -103,40 +115,52 @@ Currently, the following phrases are implemented:
103115

104116
- `then the local run has an input JSON:` followed by a code block consisting of a JSON object
105117
- Example:
118+
106119
```
107120
Then the local run has an input JSON:
108121
`​`​`
109122
{"foo":"bar"}
110123
`​`​`
111124
```
125+
112126
- This step checks the input of the actor run. It expects the input to be a JSON object. If the input is not a JSON object, an error will be thrown. This will ensure the overridden input is correctly passed to the actor run.
127+
113128
- `then the local actor run has started`
114129
- This step checks if the actor run has actually started.
115130
- `then the local actor run hasn't even started`
116131
- This step checks if the actor run hasn't started. If the actor run has started, an error will be thrown.
117132
- ``then the exit status code is `<number>`​``
118133
- Example:
134+
119135
```
120136
Then the exit status code is `0`
121137
```
138+
122139
- This step checks the exit status code of the CLI. If the exit status code is not the same as the one provided, an error will be thrown.
140+
123141
- ``then the exit status code is not `<number>`​``
124142
- Example:
143+
125144
```
126145
Then the exit status code is not `0`
127146
```
147+
128148
- This step checks the exit status code of the CLI. If the exit status code is the same as the one provided, an error will be thrown.
149+
129150
- `then I don't see any Node.js exception`
130151
- This step checks if there are any Node.js exceptions in the output. If there are any, an error will be thrown.
131152
- `then I can read text on stderr:` followed by a code block consisting of a string
132153
- Example:
154+
133155
```
134156
Then I can read text on stderr:
135157
`​`​`
136158
use "--input-file=" flag instead
137159
`​`​`
138160
```
161+
139162
- This step checks if the text provided is in the stderr output. If the text is not in the stderr output, an error will be thrown.
163+
140164
- `then i can read text on stdout:` followed by a code block consisting of a string
141165
- Example:
142166
```

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"lodash.clonedeep": "^4.5.0",
100100
"mime": "~4.0.4",
101101
"mixpanel": "~0.18.0",
102-
"open": "~10.1.0",
102+
"open": "~10.2.0",
103103
"ow": "~2.0.0",
104104
"rimraf": "~6.0.1",
105105
"semver": "~7.7.0",
@@ -116,7 +116,7 @@
116116
"@apify/tsconfig": "^0.1.1",
117117
"@biomejs/biome": "^2.0.0",
118118
"@crawlee/types": "^3.11.1",
119-
"@cucumber/cucumber": "^11.0.0",
119+
"@cucumber/cucumber": "^12.0.0",
120120
"@types/adm-zip": "^0.5.5",
121121
"@types/archiver": "^6.0.2",
122122
"@types/bun": "^1.2.5",

src/commands/login.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Server } from 'node:http';
22
import type { AddressInfo } from 'node:net';
33

4+
import chalk from 'chalk';
45
import computerName from 'computer-name';
56
import cors from 'cors';
67
import express from 'express';
@@ -11,6 +12,7 @@ import { cryptoRandomObjectId } from '@apify/utilities';
1112

1213
import { ApifyCommand } from '../lib/command-framework/apify-command.js';
1314
import { Flags } from '../lib/command-framework/flags.js';
15+
import { AUTH_FILE_PATH } from '../lib/consts.js';
1416
import { error, info, success } from '../lib/outputs.js';
1517
import { useApifyIdentity } from '../lib/telemetry.js';
1618
import { getLocalUserInfo, getLoggedClient } from '../lib/utils.js';
@@ -30,7 +32,7 @@ const tryToLogin = async (token: string) => {
3032
if (isUserLogged) {
3133
await useApifyIdentity(userInfo.id!);
3234
success({
33-
message: `You are logged in to Apify as ${userInfo.username || userInfo.id}!`,
35+
message: `You are logged in to Apify as ${userInfo.username || userInfo.id}. ${chalk.gray(`Your token is stored at ${AUTH_FILE_PATH()}.`)}`,
3436
});
3537
} else {
3638
error({
@@ -44,7 +46,7 @@ export class LoginCommand extends ApifyCommand<typeof LoginCommand> {
4446
static override name = 'login' as const;
4547

4648
static override description =
47-
`Authenticates your Apify account and saves credentials to '~/.apify'.\n` +
49+
`Authenticates your Apify account and saves credentials to '${AUTH_FILE_PATH()}'.\n` +
4850
`All other commands use these stored credentials.\n\n` +
4951
`Run 'apify logout' to remove authentication.`;
5052

src/commands/logout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class LogoutCommand extends ApifyCommand<typeof LogoutCommand> {
88
static override name = 'logout' as const;
99

1010
static override description =
11-
`Removes authentication by deleting your API token and account information from '~/.apify'.\n` +
11+
`Removes authentication by deleting your API token and account information from '${AUTH_FILE_PATH()}'.\n` +
1212
`Run 'apify login' to authenticate again.`;
1313

1414
async run() {

src/lib/outputs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function error(options: SimpleLogOptions) {
3434

3535
export function warning(options: SimpleLogOptions) {
3636
internalLog({
37-
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.rgb(254, 90, 29).bold('Warning:'), options.message],
37+
[options.stdout ? 'stdoutOutput' : 'stderrOutput']: [chalk.yellow.bold('Warning:'), options.message],
3838
});
3939
}
4040

website/docusaurus.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ const versions = require('./versions.json');
66
const { absoluteUrl } = config;
77
/** @type {Partial<import('@docusaurus/types').DocusaurusConfig>} */
88
module.exports = {
9+
future: {
10+
experimental_faster: {
11+
swcJsLoader: true,
12+
swcJsMinimizer: true,
13+
swcHtmlMinimizer: true,
14+
lightningCssMinimizer: true,
15+
rspackBundler: true,
16+
mdxCrossCompilerCache: true,
17+
rspackPersistentCache: true,
18+
},
19+
v4: {
20+
removeLegacyPostBuildHeadAttribute: true,
21+
useCssCascadeLayers: false,
22+
},
23+
},
924
title: 'CLI | Apify Documentation',
1025
url: absoluteUrl,
1126
baseUrl: '/cli',

website/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
"rimraf": "^6.0.0"
2727
},
2828
"dependencies": {
29-
"@apify/docs-theme": "^1.0.182",
30-
"@docusaurus/core": "^3.5.2",
31-
"@docusaurus/plugin-client-redirects": "^3.5.2",
32-
"@docusaurus/preset-classic": "^3.5.2",
29+
"@apify/docs-theme": "^1.0.185",
30+
"@docusaurus/core": "^3.8.1",
31+
"@docusaurus/faster": "^3.8.1",
32+
"@docusaurus/plugin-client-redirects": "^3.8.1",
33+
"@docusaurus/preset-classic": "^3.8.1",
3334
"clsx": "^1.2.1",
3435
"docusaurus-gtm-plugin": "^0.0.2",
3536
"prop-types": "^15.8.1",

0 commit comments

Comments
 (0)