@argos-ci/cli 0.1.0
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.
- package/LICENSE +7 -0
- package/README.md +19 -0
- package/bin/argos-cli.js +1 -0
- package/dist/index.mjs +31 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2022 Smooth Code
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/logo-github-readme.png" alt="Argos" width="300" height="61">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
_Argos is a visual testing solution that fits in your workflow to avoid visual regression. Takes screenshots on each commit and be notified if something changes._
|
|
8
|
+
|
|
9
|
+
# Argos Command Line Interface
|
|
10
|
+
|
|
11
|
+
Argos CLI is used to interact with and upload screenshots to [argos-ci.com](https://argos-ci.com) via command line.
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/@argos-ci/cli)
|
|
14
|
+
[](https://www.npmjs.com/package/@argos-ci/cli)
|
|
15
|
+
[](https://www.npmjs.com/package/@argos-ci/cli)
|
|
16
|
+
|
|
17
|
+
## Links
|
|
18
|
+
|
|
19
|
+
- [Official CLI Docs](https://docs.argos-ci.com)
|
package/bin/argos-cli.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../dist/index.mjs";
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { program } from 'commander';
|
|
3
|
+
import { upload } from '@argos-ci/core';
|
|
4
|
+
import ora from 'ora';
|
|
5
|
+
|
|
6
|
+
const rawPkg = await readFile(new URL("../package.json", import.meta.url).pathname, "utf8");
|
|
7
|
+
const pkg = JSON.parse(rawPkg);
|
|
8
|
+
program.name(pkg.name).description("Interact with and upload screenshots to argos-ci.com via command line.").version(pkg.version);
|
|
9
|
+
program.command("upload").argument("<directory>", "Directory to upload").description("Upload screenshots to argos-ci.com").option("-f, --files <patterns...>", "One or more globs matching image file paths to upload", "**/*.{png,jpg,jpeg}").option("-i, --ignore <patterns...>", 'One or more globs matching image file paths to ignore (ex: "**/*.png **/diff.jpg")').option("--token <token>", "Repository token").option("--build-name <string>", "Name of the build, in case you want to run multiple Argos builds in a single CI job").option("--parallel", "Enable parallel mode. Run multiple Argos builds and combine them at the end").option("--parallel-total <number>", "The number of parallel nodes being ran").option("--parallel-nonce <string>", "A unique ID for this parallel build").action(async (directory, options)=>{
|
|
10
|
+
const spinner = ora("Uploading screenshots").start();
|
|
11
|
+
try {
|
|
12
|
+
const result = await upload({
|
|
13
|
+
root: directory,
|
|
14
|
+
buildName: options.buildName,
|
|
15
|
+
files: options.files,
|
|
16
|
+
ignore: options.ignore,
|
|
17
|
+
parallel: options.parallel ? {
|
|
18
|
+
nonce: options.parallelNonce,
|
|
19
|
+
total: options.parallelTotal
|
|
20
|
+
} : false
|
|
21
|
+
});
|
|
22
|
+
spinner.succeed(`Build created: ${result.build.url}`);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
spinner.fail(`Build failed: ${error.message}`);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
if (!process.argv.slice(2).length) {
|
|
28
|
+
program.outputHelp();
|
|
29
|
+
} else {
|
|
30
|
+
program.parse(process.argv);
|
|
31
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@argos-ci/cli",
|
|
3
|
+
"description": "Visual testing solution to avoid visual regression. Argos CLI is used to interact with and upload screenshots to argos-ci.com via command line.",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"bin": {
|
|
6
|
+
"argos": "./bin/argos-cli.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prebuild": "rm -rf dist",
|
|
10
|
+
"build": "rollup -c",
|
|
11
|
+
"e2e": "node ./bin/argos-cli.js upload ../../__fixtures__ --build-name argos-cli-e2e"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/argos-ci/argos-javascript.git",
|
|
20
|
+
"directory": "packages/core"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/argos-ci/argos-javascript/tree/main/packages/core#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/argos-ci/argos-javascript/issues"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=16.14.0"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"argos",
|
|
32
|
+
"automation",
|
|
33
|
+
"test automation",
|
|
34
|
+
"testing",
|
|
35
|
+
"visual testing",
|
|
36
|
+
"regression",
|
|
37
|
+
"visual regression"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@argos-ci/core": "^0.1.0",
|
|
44
|
+
"commander": "^9.4.0",
|
|
45
|
+
"ora": "^6.1.2",
|
|
46
|
+
"update-notifier": "^6.0.2"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"rollup": "^2.78.0",
|
|
50
|
+
"rollup-plugin-swc3": "^0.3.0"
|
|
51
|
+
},
|
|
52
|
+
"gitHead": "ff22c7f1ecf8cbbd1468440b3247d10b3b7b7310"
|
|
53
|
+
}
|