argent 0.1.0 → 0.26.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/README.md +42 -14
- package/cli.cjs +6 -0
- package/package.json +24 -17
- package/preinstall.cjs +19 -0
- package/.npmignore +0 -15
- package/LICENSE +0 -20
- package/index.js +0 -143
- package/test/test.js +0 -25
package/README.md
CHANGED
|
@@ -1,18 +1,46 @@
|
|
|
1
|
-
argent
|
|
2
|
-
|
|
1
|
+
> **Note:** `argent` is an alias for [`@swmansion/argent`](https://www.npmjs.com/package/@swmansion/argent), for use with `npx`: `npx argent@latest init` runs `@swmansion/argent` of the same version.
|
|
2
|
+
> To install argent globally, run `npm install -g @swmansion/argent`. The alias refuses global installs.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
<br/>
|
|
5
|
+
<p align="center"><a href="https://argent.swmansion.com"><img width="1100" height="382" alt="argent-header" src="https://github.com/user-attachments/assets/6cec01d5-da3c-4b6c-97c3-0374a63c213c" /></a></p>
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
[](https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-argent-1&n=1)
|
|
8
|
+
[](https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-argent-2&n=1)
|
|
9
|
+
[](https://swm-delivery.com/www/delivery/ck-slug.php?zoneid=zone-gh-argent-3&n=1)
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
var argent = require('argent');
|
|
11
|
+
**[Argent](https://argent.swmansion.com)** gives your AI assistant direct control of iOS simulators, Android emulators and devices, TVs (Apple TV, Android TV, Fire TV) and Electron/Chromium apps. Tap a button, profile a screen, reproduce a bug - without leaving the CLI.
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
```bash
|
|
14
|
+
npx @swmansion/argent@latest init # pnpm: pnpm dlx @swmansion/argent@latest init
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
<p align="center"><img src="https://github.com/software-mansion/argent/blob/main/assets/showcase.gif" alt="argent showcase video gif" width="100%" /></p>
|
|
18
|
+
|
|
19
|
+
## What it does
|
|
20
|
+
|
|
21
|
+
- **Interact** - tap, swipe, gesture, type, hardware buttons; D-pad on TV; mouse and keyboard on desktop.
|
|
22
|
+
- **Flows** - record a path once, replay it deterministically as a repro or smoke test.
|
|
23
|
+
- **Visual regression** - diff a baseline against a live capture, OCR- and font-aware.
|
|
24
|
+
- **Profiling** - Hermes, React DevTools, Xcode Instruments, Perfetto: renders, CPU hotspots, hangs.
|
|
25
|
+
- **Debugging** - logs, network (`fetch` and native), JS evaluation, native and React trees.
|
|
26
|
+
- **React Native** - build, launch and iterate, no extra setup.
|
|
27
|
+
|
|
28
|
+
Ask your assistant _"What can Argent do?"_ to list every tool.
|
|
29
|
+
|
|
30
|
+
## Documentation
|
|
31
|
+
|
|
32
|
+
[Installation](https://docs.swmansion.com/argent/docs/fundamentals/installation) · [Platforms](https://docs.swmansion.com/argent/docs/fundamentals/supported-platforms) · [CLI](https://docs.swmansion.com/argent/docs/reference/cli) · [Editors](https://docs.swmansion.com/argent/docs/reference/editors)
|
|
33
|
+
|
|
34
|
+
## Privacy
|
|
35
|
+
|
|
36
|
+
Telemetry is opt-out: `argent telemetry disable`. See the [Privacy Notice](https://github.com/software-mansion/argent/blob/main/Telemetry.md).
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
Argent uses a mixed licensing model. **Source code** is released under the [Apache License 2.0](LICENSE.txt). **Proprietary binaries** (the per-platform `bin/<platform>/simulator-server` and `bin/darwin/ax-service` executables and the `.dylib` files in `native-devtools-ios`) are the intellectual property of Software Mansion S.A. and are licensed solely for use within this project. Decompiling, reverse-engineering, or redistributing them without explicit written permission is prohibited. By using Argent, you acknowledge and agree to this structure. See [LICENSE](https://github.com/software-mansion/argent/blob/main/LICENSE.txt) for full details.
|
|
41
|
+
|
|
42
|
+
## Argent is created by Software Mansion
|
|
43
|
+
|
|
44
|
+
Since 2012 [Software Mansion](https://swmansion.com) is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – [Hire us](https://swmansion.com/contact/projects?utm_source=argent&utm_medium=readme).
|
|
45
|
+
|
|
46
|
+
[](https://swmansion.com)
|
package/cli.cjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `argent` on npm is an alias for @swmansion/argent, so that `npx argent <command>`
|
|
3
|
+
// works. It runs the CLI of the @swmansion/argent version it pins, in this process.
|
|
4
|
+
const { pathToFileURL } = require("node:url");
|
|
5
|
+
|
|
6
|
+
import(pathToFileURL(require.resolve("@swmansion/argent/dist/cli.js")).href);
|
package/package.json
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "argent",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "node test/test.js"
|
|
8
|
-
},
|
|
3
|
+
"version": "0.26.0",
|
|
4
|
+
"description": "Alias for @swmansion/argent: `npx argent <command>` runs the @swmansion/argent CLI",
|
|
5
|
+
"license": "Apache-2.0",
|
|
9
6
|
"repository": {
|
|
10
7
|
"type": "git",
|
|
11
|
-
"url": "git://github.com/
|
|
8
|
+
"url": "git+https://github.com/software-mansion/argent.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://docs.swmansion.com/argent",
|
|
11
|
+
"bin": {
|
|
12
|
+
"argent": "cli.cjs"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"prepack": "node sync-readme.cjs",
|
|
16
|
+
"preinstall": "node preinstall.cjs"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=20.12.0"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"registry": "https://registry.npmjs.org",
|
|
23
|
+
"access": "public"
|
|
12
24
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"function"
|
|
25
|
+
"files": [
|
|
26
|
+
"cli.cjs",
|
|
27
|
+
"preinstall.cjs"
|
|
17
28
|
],
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"readmeFilename": "README.md",
|
|
21
|
-
"gitHead": "39159030af810ddb9cbfdc18eb9e7ffa15f04231",
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/scrollback/argent/issues"
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@swmansion/argent": "0.26.0"
|
|
24
31
|
}
|
|
25
32
|
}
|
package/preinstall.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// A global install of this alias would put a second `argent` binary on PATH, which
|
|
2
|
+
// clashes with @swmansion/argent (the package `argent init` installs globally) and
|
|
3
|
+
// hides it from `argent update`. Global installs go to @swmansion/argent instead.
|
|
4
|
+
if (process.env.npm_config_global === "true") {
|
|
5
|
+
console.error(
|
|
6
|
+
[
|
|
7
|
+
"",
|
|
8
|
+
"The `argent` package is only an alias for running argent with npx:",
|
|
9
|
+
"",
|
|
10
|
+
" npx argent init",
|
|
11
|
+
"",
|
|
12
|
+
"To install argent globally, install @swmansion/argent:",
|
|
13
|
+
"",
|
|
14
|
+
" npm install -g @swmansion/argent",
|
|
15
|
+
"",
|
|
16
|
+
].join("\n")
|
|
17
|
+
);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
package/.npmignore
DELETED
package/LICENSE
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2013 scrollback
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/index.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
var argent = function(fn, spec) {
|
|
2
|
-
return function() {
|
|
3
|
-
var i=0, j=0, args=[];
|
|
4
|
-
while(j<spec.length) {
|
|
5
|
-
if(i<arguments.length && spec[j].test(arguments[i])) {
|
|
6
|
-
args[j] = arguments[i];
|
|
7
|
-
i++; j++;
|
|
8
|
-
} else {
|
|
9
|
-
args[j] = spec[j]._def;
|
|
10
|
-
j++;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return fn.apply(this, args);
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
function helper(name, fn, modfn, opt) {
|
|
18
|
-
var i;
|
|
19
|
-
opt = opt || {};
|
|
20
|
-
opt.def = opt.def || function(d) { this._def = d; };
|
|
21
|
-
|
|
22
|
-
argent[name] = function() {
|
|
23
|
-
var mod = [].splice.call(arguments, 0),
|
|
24
|
-
constraint = Object.create(opt);
|
|
25
|
-
|
|
26
|
-
if(!fn) fn = function() { return true; };
|
|
27
|
-
|
|
28
|
-
constraint.test = (mod && modfn? function(v) {
|
|
29
|
-
return fn(v) && modfn.apply(null, [v].concat(mod));
|
|
30
|
-
}: fn);
|
|
31
|
-
|
|
32
|
-
return constraint;
|
|
33
|
-
}
|
|
34
|
-
for(i in opt) argent[name][i] = opt[i];
|
|
35
|
-
argent[name].test = fn;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/*
|
|
39
|
-
How this works
|
|
40
|
-
--------------
|
|
41
|
-
|
|
42
|
-
helper() is called with the name and two functions. The first is
|
|
43
|
-
used when the spec uses the basic helper [argent.myHelper] while
|
|
44
|
-
both functions are used when the helper has been customized
|
|
45
|
-
[argent.myHelper(default, additionalConstraints)]
|
|
46
|
-
|
|
47
|
-
When the helper is called as a function (customization mode),
|
|
48
|
-
the first parameter is treated as a default value (if it passes
|
|
49
|
-
the basic constraint for that helper) and all remaining params
|
|
50
|
-
are passed to the modfn.
|
|
51
|
-
|
|
52
|
-
Example: Consider the 'string' constraint:
|
|
53
|
-
|
|
54
|
-
In the basic mode [argent.string], it just verifies that typeof
|
|
55
|
-
argument is string. This helper can be further customized by
|
|
56
|
-
requiring that arguments must also match a supplied regex
|
|
57
|
-
[argent.string(myRegex)], providing a default value
|
|
58
|
-
[argent.string(def)], or both [argent.string(def, myRegex)].
|
|
59
|
-
|
|
60
|
-
When argent.string sees only one parameter, we check if that
|
|
61
|
-
parameter satisfies the basic constraint typeof == string to
|
|
62
|
-
decide between treating that parameter as a regex or a default
|
|
63
|
-
value.
|
|
64
|
-
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
helper('string',
|
|
68
|
-
function(v) { return typeof v === 'string'; },
|
|
69
|
-
function(v, regex) { return regex.test? regex.test(v): true; }
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
helper('number', function(v) { return typeof v === 'number'; });
|
|
73
|
-
helper('boolean', function(v) { return typeof v === 'boolean'; });
|
|
74
|
-
|
|
75
|
-
/*
|
|
76
|
-
The 'function' helper can be further constrained with the number
|
|
77
|
-
of arguments in the callback function's specification
|
|
78
|
-
*/
|
|
79
|
-
helper('function',
|
|
80
|
-
function(v) { return typeof v === 'function'; },
|
|
81
|
-
function(v, length) { return v.length === length; }
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
helper('array',
|
|
85
|
-
function(v) { return Object.prototype.toString.call(v) === "[object Array]" }
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
helper('object', function(v) { return typeof v === 'object' && v !== null; });
|
|
90
|
-
|
|
91
|
-
/*
|
|
92
|
-
The 'all' and 'any' helpers check property names on objects; use an
|
|
93
|
-
an 'and' helper to combine them with an 'object' helper.
|
|
94
|
-
*/
|
|
95
|
-
helper(
|
|
96
|
-
'all', null,
|
|
97
|
-
function(v, props) {
|
|
98
|
-
var i, l;
|
|
99
|
-
for(i=0, l=props.length; i<l; i++) {
|
|
100
|
-
if(typeof v[props[i]] === 'undefined') return false;
|
|
101
|
-
}
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
helper(
|
|
107
|
-
'one', null,
|
|
108
|
-
function(v, props) {
|
|
109
|
-
var i, l;
|
|
110
|
-
for(i=0, l=props.length; i<l; i++) {
|
|
111
|
-
if(typeof v[props[i]] !== 'undefined') return true;
|
|
112
|
-
}
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
helper('anything', null);
|
|
118
|
-
helper('defined', function(v) { return typeof v !== 'undefined'; });
|
|
119
|
-
helper('nonnull', function(v) { return typeof v !== 'undefined' && v !== null; });
|
|
120
|
-
helper('truthy', function(v) { return !!v; });
|
|
121
|
-
|
|
122
|
-
helper('or', null,
|
|
123
|
-
function(v) {
|
|
124
|
-
var i, l;
|
|
125
|
-
for(i=1, l=arguments.length; i<l; i++) {
|
|
126
|
-
if(arguments[i].test(v)) return true;
|
|
127
|
-
}
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
helper('and', null,
|
|
133
|
-
function(v) {
|
|
134
|
-
var i, l;
|
|
135
|
-
for(i=1, l=arguments.length; i<l; i++) {
|
|
136
|
-
if(!arguments[i].test(v)) return false;
|
|
137
|
-
}
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
module.exports = argent;
|
package/test/test.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var argent = require('../index.js'),
|
|
2
|
-
assert = require('assert');
|
|
3
|
-
|
|
4
|
-
var test = argent(function(str, phone, num, user, cb) {
|
|
5
|
-
console.log(arguments);
|
|
6
|
-
}, [
|
|
7
|
-
argent.string,
|
|
8
|
-
argent.string(/\d+/),
|
|
9
|
-
argent.number,
|
|
10
|
-
argent.and(argent.object, argent.all(['name', 'email'])),
|
|
11
|
-
argent.function
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
console.log(1);
|
|
16
|
-
test(function() {});
|
|
17
|
-
|
|
18
|
-
console.log(2);
|
|
19
|
-
test('asdf', 34, function() {});
|
|
20
|
-
|
|
21
|
-
console.log(3);
|
|
22
|
-
test('asdf', {}, function() {});
|
|
23
|
-
|
|
24
|
-
console.log(4);
|
|
25
|
-
test({name: 'hah', email: 'rew'});
|